Skip to content

Commit 93d3cf4

Browse files
Updated existing Pimoroni board headers to match latest style, and added a new board (#343)
* Updated existing pimoroni board headers to newer style from pico.h * Added new pimoroni board headers * Fixed incorrect MB and missing _pin * Removed SPI defaults from Picosystem
1 parent c6d70d5 commit 93d3cf4

File tree

5 files changed

+297
-28
lines changed

5 files changed

+297
-28
lines changed

src/boards/include/boards/pimoroni_keybow2040.h

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,7 @@
1515
// For board detection
1616
#define PIMORONI_KEYBOW2040
1717

18-
#ifndef PICO_DEFAULT_UART
19-
#define PICO_DEFAULT_UART 0
20-
#endif
21-
22-
#ifndef PICO_DEFAULT_UART_TX_PIN
23-
#define PICO_DEFAULT_UART_TX_PIN 0
24-
#endif
25-
26-
#ifndef PICO_DEFAULT_UART_RX_PIN
27-
#define PICO_DEFAULT_UART_RX_PIN 1
28-
#endif
29-
18+
// --- BOARD SPECIFIC ---
3019
#ifndef KEYBOW2040_I2C_SDA_PIN
3120
#define KEYBOW2040_I2C_SDA_PIN 4
3221
#endif
@@ -111,6 +100,42 @@
111100
#define KEYBOW2040_NUM_SWITCHES_PINS 16
112101
#endif
113102

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 ---
114139
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
115140

116141
#ifndef PICO_FLASH_SPI_CLKDIV
@@ -122,7 +147,6 @@
122147
#endif
123148

124149
// All boards have B1 RP2040
125-
126150
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
127151
#define PICO_FLOAT_SUPPORT_ROM_V1 0
128152
#endif
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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_PICOLIPO_16MB_H
13+
#define _BOARDS_PIMORONI_PICOLIPO_16MB_H
14+
15+
// For board detection
16+
#define PIMORONI_PICOLIPO_16MB
17+
18+
// --- BOARD SPECIFIC ---
19+
#ifndef PICOLIPO_USER_SW_PIN
20+
#define PICOLIPO_USER_SW_PIN 23
21+
#endif
22+
23+
#ifndef PICOLIPO_VBUS_DETECT_PIN
24+
#define PICOLIPO_VBUS_DETECT_PIN 24
25+
#endif
26+
27+
#ifndef PICOLIPO_BAT_SENSE_PIN
28+
#define PICOLIPO_BAT_SENSE_PIN 29
29+
#endif
30+
31+
// --- UART ---
32+
#ifndef PICO_DEFAULT_UART
33+
#define PICO_DEFAULT_UART 0
34+
#endif
35+
#ifndef PICO_DEFAULT_UART_TX_PIN
36+
#define PICO_DEFAULT_UART_TX_PIN 0
37+
#endif
38+
#ifndef PICO_DEFAULT_UART_RX_PIN
39+
#define PICO_DEFAULT_UART_RX_PIN 1
40+
#endif
41+
42+
// --- LED ---
43+
#ifndef PICO_DEFAULT_LED_PIN
44+
#define PICO_DEFAULT_LED_PIN 25
45+
#endif
46+
// no PICO_DEFAULT_WS2812_PIN
47+
48+
// --- I2C ---
49+
#ifndef PICO_DEFAULT_I2C
50+
#define PICO_DEFAULT_I2C 0
51+
#endif
52+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
53+
#define PICO_DEFAULT_I2C_SDA_PIN 4
54+
#endif
55+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
56+
#define PICO_DEFAULT_I2C_SCL_PIN 5
57+
#endif
58+
59+
// --- SPI ---
60+
#ifndef PICO_DEFAULT_SPI
61+
#define PICO_DEFAULT_SPI 0
62+
#endif
63+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
64+
#define PICO_DEFAULT_SPI_SCK_PIN 18
65+
#endif
66+
#ifndef PICO_DEFAULT_SPI_TX_PIN
67+
#define PICO_DEFAULT_SPI_TX_PIN 19
68+
#endif
69+
#ifndef PICO_DEFAULT_SPI_RX_PIN
70+
#define PICO_DEFAULT_SPI_RX_PIN 16
71+
#endif
72+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
73+
#define PICO_DEFAULT_SPI_CSN_PIN 17
74+
#endif
75+
76+
// --- FLASH ---
77+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
78+
79+
#ifndef PICO_FLASH_SPI_CLKDIV
80+
#define PICO_FLASH_SPI_CLKDIV 2
81+
#endif
82+
83+
#ifndef PICO_FLASH_SIZE_BYTES
84+
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
85+
#endif
86+
87+
// All boards have B1 RP2040
88+
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
89+
#define PICO_FLOAT_SUPPORT_ROM_V1 0
90+
#endif
91+
92+
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
93+
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
94+
#endif
95+
96+
#endif
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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_PICOLIPO_4MB_H
13+
#define _BOARDS_PIMORONI_PICOLIPO_4MB_H
14+
15+
// For board detection
16+
#define PIMORONI_PICOLIPO_4MB
17+
18+
// --- BOARD SPECIFIC ---
19+
#ifndef PICOLIPO_USER_SW_PIN
20+
#define PICOLIPO_USER_SW_PIN 23
21+
#endif
22+
23+
#ifndef PICOLIPO_VBUS_DETECT_PIN
24+
#define PICOLIPO_VBUS_DETECT_PIN 24
25+
#endif
26+
27+
#ifndef PICOLIPO_BAT_SENSE_PIN
28+
#define PICOLIPO_BAT_SENSE_PIN 29
29+
#endif
30+
31+
// --- UART ---
32+
#ifndef PICO_DEFAULT_UART
33+
#define PICO_DEFAULT_UART 0
34+
#endif
35+
#ifndef PICO_DEFAULT_UART_TX_PIN
36+
#define PICO_DEFAULT_UART_TX_PIN 0
37+
#endif
38+
#ifndef PICO_DEFAULT_UART_RX_PIN
39+
#define PICO_DEFAULT_UART_RX_PIN 1
40+
#endif
41+
42+
// --- LED ---
43+
#ifndef PICO_DEFAULT_LED_PIN
44+
#define PICO_DEFAULT_LED_PIN 25
45+
#endif
46+
// no PICO_DEFAULT_WS2812_PIN
47+
48+
// --- I2C ---
49+
#ifndef PICO_DEFAULT_I2C
50+
#define PICO_DEFAULT_I2C 0
51+
#endif
52+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
53+
#define PICO_DEFAULT_I2C_SDA_PIN 4
54+
#endif
55+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
56+
#define PICO_DEFAULT_I2C_SCL_PIN 5
57+
#endif
58+
59+
// --- SPI ---
60+
#ifndef PICO_DEFAULT_SPI
61+
#define PICO_DEFAULT_SPI 0
62+
#endif
63+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
64+
#define PICO_DEFAULT_SPI_SCK_PIN 18
65+
#endif
66+
#ifndef PICO_DEFAULT_SPI_TX_PIN
67+
#define PICO_DEFAULT_SPI_TX_PIN 19
68+
#endif
69+
#ifndef PICO_DEFAULT_SPI_RX_PIN
70+
#define PICO_DEFAULT_SPI_RX_PIN 16
71+
#endif
72+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
73+
#define PICO_DEFAULT_SPI_CSN_PIN 17
74+
#endif
75+
76+
// --- FLASH ---
77+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
78+
79+
#ifndef PICO_FLASH_SPI_CLKDIV
80+
#define PICO_FLASH_SPI_CLKDIV 2
81+
#endif
82+
83+
#ifndef PICO_FLASH_SIZE_BYTES
84+
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
85+
#endif
86+
87+
// All boards have B1 RP2040
88+
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
89+
#define PICO_FLOAT_SUPPORT_ROM_V1 0
90+
#endif
91+
92+
#ifndef PICO_DOUBLE_SUPPORT_ROM_V1
93+
#define PICO_DOUBLE_SUPPORT_ROM_V1 0
94+
#endif
95+
96+
#endif

src/boards/include/boards/pimoroni_picosystem.h

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,21 @@
1515
// For board detection
1616
#define PIMORONI_PICOSYSTEM
1717

18+
// --- BOARD SPECIFIC ---
1819
#ifndef PICOSYSTEM_VBUS_DETECT_PIN
1920
#define PICOSYSTEM_VBUS_DETECT_PIN 2
2021
#endif
2122

23+
#ifndef PICOSYSTEM_LCD_SPI
24+
#define PICOSYSTEM_LCD_SPI 0
25+
#endif
26+
2227
#ifndef PICOSYSTEM_LCD_RESET_PIN
2328
#define PICOSYSTEM_LCD_RESET_PIN 4
2429
#endif
2530

26-
#ifndef PICOSYSTEM_LCD_CS_PIN
27-
#define PICOSYSTEM_LCD_CS_PIN 5
31+
#ifndef PICOSYSTEM_LCD_CSN_PIN
32+
#define PICOSYSTEM_LCD_CSN_PIN 5
2833
#endif
2934

3035
#ifndef PICOSYSTEM_LCD_SCLK_PIN
@@ -103,6 +108,7 @@
103108
#define PICOSYSTEM_BAT_SENSE_PIN 26
104109
#endif
105110

111+
// --- UART ---
106112
#ifndef PICO_DEFAULT_UART
107113
#define PICO_DEFAULT_UART 0
108114
#endif
@@ -115,15 +121,30 @@
115121
#define PICO_DEFAULT_UART_RX_PIN 1
116122
#endif
117123

124+
// --- LED ---
118125
// Included so basic examples will work, and set it to the green LED
119126
#ifndef PICO_DEFAULT_LED_PIN
120127
#define PICO_DEFAULT_LED_PIN PICOSYSTEM_LED_G_PIN
121128
#endif
129+
// no PICO_DEFAULT_WS2812_PIN
122130

123131
#ifndef PICO_DEFAULT_LED_PIN_INVERTED
124132
#define PICO_DEFAULT_LED_PIN_INVERTED 1
125133
#endif
126134

135+
// --- I2C ---
136+
//no PICO_DEFAULT_I2C
137+
//no PICO_DEFAULT_I2C_SDA_PIN
138+
//no PICO_DEFAULT_I2C_SCL_PIN
139+
140+
// --- SPI ---
141+
// no PICO_DEFAULT_SPI
142+
// no PICO_DEFAULT_SPI_SCK_PIN
143+
// no PICO_DEFAULT_SPI_TX_PIN
144+
// no PICO_DEFAULT_SPI_RX_PIN
145+
// no PICO_DEFAULT_SPI_CSN_PIN
146+
147+
// --- FLASH ---
127148
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
128149

129150
#ifndef PICO_FLASH_SPI_CLKDIV
@@ -135,7 +156,6 @@
135156
#endif
136157

137158
// All boards have B1 RP2040
138-
139159
#ifndef PICO_FLOAT_SUPPORT_ROM_V1
140160
#define PICO_FLOAT_SUPPORT_ROM_V1 0
141161
#endif

0 commit comments

Comments
 (0)