pimoroni_keybow2040.h
1/*
2 * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7// -----------------------------------------------------
8// NOTE: THIS HEADER IS ALSO INCLUDED BY ASSEMBLER SO
9// SHOULD ONLY CONSIST OF PREPROCESSOR DIRECTIVES
10// -----------------------------------------------------
11
12#ifndef _BOARDS_PIMORONI_KEYBOW2040_H
13#define _BOARDS_PIMORONI_KEYBOW2040_H
14
15// For board detection
16#define PIMORONI_KEYBOW2040
17
18// --- BOARD SPECIFIC ---
19#ifndef KEYBOW2040_I2C_SDA_PIN
20#define KEYBOW2040_I2C_SDA_PIN 4
21#endif
22
23#ifndef KEYBOW2040_I2C_SCL_PIN
24#define KEYBOW2040_I2C_SCL_PIN 5
25#endif
26
27#ifndef KEYBOW2040_I2C_INT_PIN
28#define KEYBOW2040_I2C_INT_PIN 3
29#endif
30
31#ifndef KEYBOW2040_USER_SW_PIN
32#define KEYBOW2040_USER_SW_PIN 23
33#endif
34
35#ifndef KEYBOW2040_SW0_PIN
36#define KEYBOW2040_SW0_PIN 21
37#endif
38
39#ifndef KEYBOW2040_SW1_PIN
40#define KEYBOW2040_SW1_PIN 20
41#endif
42
43#ifndef KEYBOW2040_SW2_PIN
44#define KEYBOW2040_SW2_PIN 19
45#endif
46
47#ifndef KEYBOW2040_SW3_PIN
48#define KEYBOW2040_SW3_PIN 18
49#endif
50
51#ifndef KEYBOW2040_SW4_PIN
52#define KEYBOW2040_SW4_PIN 17
53#endif
54
55#ifndef KEYBOW2040_SW5_PIN
56#define KEYBOW2040_SW5_PIN 16
57#endif
58
59#ifndef KEYBOW2040_SW6_PIN
60#define KEYBOW2040_SW6_PIN 15
61#endif
62
63#ifndef KEYBOW2040_SW7_PIN
64#define KEYBOW2040_SW7_PIN 14
65#endif
66
67#ifndef KEYBOW2040_SW8_PIN
68#define KEYBOW2040_SW8_PIN 13
69#endif
70
71#ifndef KEYBOW2040_SW9_PIN
72#define KEYBOW2040_SW9_PIN 12
73#endif
74
75#ifndef KEYBOW2040_SW10_PIN
76#define KEYBOW2040_SW10_PIN 11
77#endif
78
79#ifndef KEYBOW2040_SW11_PIN
80#define KEYBOW2040_SW11_PIN 10
81#endif
82
83#ifndef KEYBOW2040_SW12_PIN
84#define KEYBOW2040_SW12_PIN 9
85#endif
86
87#ifndef KEYBOW2040_SW13_PIN
88#define KEYBOW2040_SW13_PIN 8
89#endif
90
91#ifndef KEYBOW2040_SW14_PIN
92#define KEYBOW2040_SW14_PIN 7
93#endif
94
95#ifndef KEYBOW2040_SW15_PIN
96#define KEYBOW2040_SW15_PIN 6
97#endif
98
99#ifndef KEYBOW2040_NUM_SWITCHES_PINS
100#define KEYBOW2040_NUM_SWITCHES_PINS 16
101#endif
102
103// --- UART ---
104#ifndef PICO_DEFAULT_UART
105#define PICO_DEFAULT_UART 0
106#endif
107
108#ifndef PICO_DEFAULT_UART_TX_PIN
109#define PICO_DEFAULT_UART_TX_PIN 0
110#endif
111
112#ifndef PICO_DEFAULT_UART_RX_PIN
113#define PICO_DEFAULT_UART_RX_PIN 1
114#endif
115
116// --- LED ---
117// no PICO_DEFAULT_LED_PIN
118// no PICO_DEFAULT_WS2812_PIN
119
120// --- I2C ---
121#ifndef PICO_DEFAULT_I2C
122#define PICO_DEFAULT_I2C 0
123#endif
124#ifndef PICO_DEFAULT_I2C_SDA_PIN
125#define PICO_DEFAULT_I2C_SDA_PIN KEYBOW2040_I2C_SDA_PIN
126#endif
127#ifndef PICO_DEFAULT_I2C_SCL_PIN
128#define PICO_DEFAULT_I2C_SCL_PIN KEYBOW2040_I2C_SCL_PIN
129#endif
130
131// --- SPI ---
132// no PICO_DEFAULT_SPI
133// no PICO_DEFAULT_SPI_SCK_PIN
134// no PICO_DEFAULT_SPI_TX_PIN
135// no PICO_DEFAULT_SPI_RX_PIN
136// no PICO_DEFAULT_SPI_CSN_PIN
137
138// --- FLASH ---
139#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
140
141#ifndef PICO_FLASH_SPI_CLKDIV
142#define PICO_FLASH_SPI_CLKDIV 2
143#endif
144
145#ifndef PICO_FLASH_SIZE_BYTES
146#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
147#endif
148
149// All boards have B1 RP2040
150#ifndef PICO_RP2040_B0_SUPPORTED
151#define PICO_RP2040_B0_SUPPORTED 0
152#endif
153
154#endif