Skip to content

Commit bb5a2a3

Browse files
Added definition for Badger RP2040 board (earlephilhower#735)
1 parent 8291f10 commit bb5a2a3

File tree

1 file changed

+191
-0
lines changed

1 file changed

+191
-0
lines changed
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
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_BADGER2040_H
13+
#define _BOARDS_PIMORONI_BADGER2040_H
14+
15+
// For board detection
16+
#define PIMORONI_BADGER2040
17+
18+
// --- BOARD SPECIFIC ---
19+
20+
#ifndef BADGER2040_UART
21+
#define BADGER2040_UART 0
22+
#endif
23+
24+
#ifndef BADGER2040_TX_PIN
25+
#define BADGER2040_TX_PIN 0
26+
#endif
27+
28+
#ifndef BADGER2040_RX_PIN
29+
#define BADGER2040_RX_PIN 1
30+
#endif
31+
32+
#ifndef BADGER2040_I2C
33+
#define BADGER2040_I2C 0
34+
#endif
35+
36+
#ifndef BADGER2040_INT_PIN
37+
#define BADGER2040_INT_PIN 3
38+
#endif
39+
40+
#ifndef BADGER2040_SDA_PIN
41+
#define BADGER2040_SDA_PIN 4
42+
#endif
43+
44+
#ifndef BADGER2040_SCL_PIN
45+
#define BADGER2040_SCL_PIN 5
46+
#endif
47+
48+
#ifndef BADGER2040_3V3_EN_PIN
49+
#define BADGER2040_3V3_EN_PIN 10
50+
#endif
51+
52+
#ifndef BADGER2040_SW_DOWN_PIN
53+
#define BADGER2040_SW_DOWN_PIN 11
54+
#endif
55+
56+
#ifndef BADGER2040_SW_A_PIN
57+
#define BADGER2040_SW_A_PIN 12
58+
#endif
59+
60+
#ifndef BADGER2040_SW_B_PIN
61+
#define BADGER2040_SW_B_PIN 13
62+
#endif
63+
64+
#ifndef BADGER2040_SW_C_PIN
65+
#define BADGER2040_SW_C_PIN 14
66+
#endif
67+
68+
#ifndef BADGER2040_SW_UP_PIN
69+
#define BADGER2040_SW_UP_PIN 15
70+
#endif
71+
72+
#ifndef BADGER2040_INKY_SPI
73+
#define BADGER2040_INKY_SPI 0
74+
#endif
75+
76+
#ifndef BADGER2040_INKY_MISO_PIN
77+
#define BADGER2040_INKY_MISO_PIN 16
78+
#endif
79+
80+
#ifndef BADGER2040_INKY_CSN_PIN
81+
#define BADGER2040_INKY_CSN_PIN 17
82+
#endif
83+
84+
#ifndef BADGER2040_INKY_SCK_PIN
85+
#define BADGER2040_INKY_SCK_PIN 18
86+
#endif
87+
88+
#ifndef BADGER2040_INKY_MOSI_PIN
89+
#define BADGER2040_INKY_MOSI_PIN 19
90+
#endif
91+
92+
#ifndef BADGER2040_INKY_DC_PIN
93+
#define BADGER2040_INKY_DC_PIN 20
94+
#endif
95+
96+
#ifndef BADGER2040_INKY_RESET_PIN
97+
#define BADGER2040_INKY_RESET_PIN 21
98+
#endif
99+
100+
#ifndef BADGER2040_USER_SW_PIN
101+
#define BADGER2040_USER_SW_PIN 23
102+
#endif
103+
104+
#ifndef BADGER2040_VBUS_DETECT_PIN
105+
#define BADGER2040_VBUS_DETECT_PIN 24
106+
#endif
107+
108+
#ifndef BADGER2040_USER_LED_PIN
109+
#define BADGER2040_USER_LED_PIN 25
110+
#endif
111+
112+
#ifndef BADGER2040_INKY_BUSY_PIN
113+
#define BADGER2040_INKY_BUSY_PIN 26
114+
#endif
115+
116+
#ifndef BADGER2040_VREF_POWER_PIN
117+
#define BADGER2040_VREF_POWER_PIN 27
118+
#endif
119+
120+
#ifndef BADGER2040_1V2_REF_PIN
121+
#define BADGER2040_1V2_REF_PIN 28
122+
#endif
123+
124+
#ifndef BADGER2040_BAT_SENSE_PIN
125+
#define BADGER2040_BAT_SENSE_PIN 29
126+
#endif
127+
128+
// --- UART ---
129+
#ifndef PICO_DEFAULT_UART
130+
#define PICO_DEFAULT_UART BADGER2040_UART
131+
#endif
132+
133+
#ifndef PICO_DEFAULT_UART_TX_PIN
134+
#define PICO_DEFAULT_UART_TX_PIN BADGER2040_TX_PIN
135+
#endif
136+
137+
#ifndef PICO_DEFAULT_UART_RX_PIN
138+
#define PICO_DEFAULT_UART_RX_PIN BADGER2040_RX_PIN
139+
#endif
140+
141+
// --- LED ---
142+
#ifndef PICO_DEFAULT_LED_PIN
143+
#define PICO_DEFAULT_LED_PIN BADGER2040_USER_LED_PIN
144+
#endif
145+
// no PICO_DEFAULT_WS2812_PIN
146+
147+
// --- I2C ---
148+
#ifndef PICO_DEFAULT_I2C
149+
#define PICO_DEFAULT_I2C BADGER2040_I2C
150+
#endif
151+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
152+
#define PICO_DEFAULT_I2C_SDA_PIN BADGER2040_SDA_PIN
153+
#endif
154+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
155+
#define PICO_DEFAULT_I2C_SCL_PIN BADGER2040_SCL_PIN
156+
#endif
157+
158+
// --- SPI ---
159+
#ifndef PICO_DEFAULT_SPI
160+
#define PICO_DEFAULT_SPI BADGER2040_INKY_SPI
161+
#endif
162+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
163+
#define PICO_DEFAULT_SPI_SCK_PIN BADGER2040_INKY_SCK_PIN
164+
#endif
165+
#ifndef PICO_DEFAULT_SPI_TX_PIN
166+
#define PICO_DEFAULT_SPI_TX_PIN BADGER2040_INKY_MOSI_PIN
167+
#endif
168+
#ifndef PICO_DEFAULT_SPI_RX_PIN
169+
#define PICO_DEFAULT_SPI_RX_PIN BADGER2040_INKY_MISO_PIN
170+
#endif
171+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
172+
#define PICO_DEFAULT_SPI_CSN_PIN BADGER2040_INKY_CSN_PIN
173+
#endif
174+
175+
// --- FLASH ---
176+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
177+
178+
#ifndef PICO_FLASH_SPI_CLKDIV
179+
#define PICO_FLASH_SPI_CLKDIV 2
180+
#endif
181+
182+
#ifndef PICO_FLASH_SIZE_BYTES
183+
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
184+
#endif
185+
186+
// All boards have B1 RP2040
187+
#ifndef PICO_RP2040_B0_SUPPORTED
188+
#define PICO_RP2040_B0_SUPPORTED 0
189+
#endif
190+
191+
#endif

0 commit comments

Comments
 (0)