Skip to content

Commit 5480ac2

Browse files
committed
Tidy up/fix pins for i75w variants.
* i75w RP2040 used a Pico-aboard and the Pico W board file, this specified GPIO18 which was reserved by the HUB75 "Blue" pin. Move it to GPIO22 for users who want to deadbug peripherals onto the Pico. * i75w RP2350 has been corrected to remove all non broken out pins, and to not specify a default SPI instance or pins.
1 parent c7b5cdf commit 5480ac2

File tree

5 files changed

+182
-57
lines changed

5 files changed

+182
-57
lines changed

boards/i75w_rp2040/mpconfigboard.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# cmake file for Raspberry Pi Pico W
2-
set(PICO_BOARD "pico_w")
1+
set(PICO_BOARD "pimoroni_i75w_2040")
2+
set(PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR})
33

44
# Board specific version of the frozen manifest
55
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
/*
2+
* Copyright (c) 2022 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+
// pico_cmake_set PICO_PLATFORM = rp2040
13+
// pico_cmake_set PICO_CYW43_SUPPORTED = 1
14+
15+
// This header may be included by other board headers as "boards/pico_w.h"
16+
17+
#ifndef _BOARDS_PICO_W_H
18+
#define _BOARDS_PICO_W_H
19+
20+
// For board detection
21+
#define RASPBERRYPI_PICO_W
22+
23+
// --- UART ---
24+
#ifndef PICO_DEFAULT_UART
25+
#define PICO_DEFAULT_UART 0
26+
#endif
27+
#ifndef PICO_DEFAULT_UART_TX_PIN
28+
#define PICO_DEFAULT_UART_TX_PIN 0
29+
#endif
30+
#ifndef PICO_DEFAULT_UART_RX_PIN
31+
#define PICO_DEFAULT_UART_RX_PIN 1
32+
#endif
33+
34+
// --- LED ---
35+
// no PICO_DEFAULT_LED_PIN - LED is on Wireless chip
36+
// no PICO_DEFAULT_WS2812_PIN
37+
38+
// --- I2C ---
39+
#ifndef PICO_DEFAULT_I2C
40+
#define PICO_DEFAULT_I2C 0
41+
#endif
42+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
43+
#define PICO_DEFAULT_I2C_SDA_PIN 4
44+
#endif
45+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
46+
#define PICO_DEFAULT_I2C_SCL_PIN 5
47+
#endif
48+
49+
// --- SPI ---
50+
#ifndef PICO_DEFAULT_SPI
51+
#define PICO_DEFAULT_SPI 0
52+
#endif
53+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
54+
#define PICO_DEFAULT_SPI_SCK_PIN 22
55+
#endif
56+
#ifndef PICO_DEFAULT_SPI_TX_PIN
57+
#define PICO_DEFAULT_SPI_TX_PIN 19
58+
#endif
59+
#ifndef PICO_DEFAULT_SPI_RX_PIN
60+
#define PICO_DEFAULT_SPI_RX_PIN 16
61+
#endif
62+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
63+
#define PICO_DEFAULT_SPI_CSN_PIN 17
64+
#endif
65+
66+
// --- FLASH ---
67+
68+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
69+
70+
#ifndef PICO_FLASH_SPI_CLKDIV
71+
#define PICO_FLASH_SPI_CLKDIV 2
72+
#endif
73+
74+
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
75+
#ifndef PICO_FLASH_SIZE_BYTES
76+
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
77+
#endif
78+
// note the SMSP mode pin is on WL_GPIO1
79+
// #define PICO_SMPS_MODE_PIN
80+
81+
#ifndef PICO_RP2040_B0_SUPPORTED
82+
#define PICO_RP2040_B0_SUPPORTED 0
83+
#endif
84+
85+
#ifndef PICO_RP2040_B1_SUPPORTED
86+
#define PICO_RP2040_B1_SUPPORTED 0
87+
#endif
88+
89+
#ifndef CYW43_WL_GPIO_COUNT
90+
#define CYW43_WL_GPIO_COUNT 3
91+
#endif
92+
93+
#ifndef CYW43_WL_GPIO_LED_PIN
94+
#define CYW43_WL_GPIO_LED_PIN 0
95+
#endif
96+
97+
// If CYW43_WL_GPIO_VBUS_PIN is defined then a CYW43 GPIO has to be used to read VBUS.
98+
// This can be passed to cyw43_arch_gpio_get to determine if the device is battery powered.
99+
// PICO_VBUS_PIN and CYW43_WL_GPIO_VBUS_PIN should not both be defined.
100+
#ifndef CYW43_WL_GPIO_VBUS_PIN
101+
#define CYW43_WL_GPIO_VBUS_PIN 2
102+
#endif
103+
104+
// If CYW43_USES_VSYS_PIN is defined then CYW43 uses the VSYS GPIO (defined by PICO_VSYS_PIN) for other purposes.
105+
// If this is the case, to use the VSYS GPIO it's necessary to ensure CYW43 is not using it.
106+
// This can be achieved by wrapping the use of the VSYS GPIO in cyw43_thread_enter / cyw43_thread_exit.
107+
#ifndef CYW43_USES_VSYS_PIN
108+
#define CYW43_USES_VSYS_PIN 1
109+
#endif
110+
111+
// The GPIO Pin used to monitor VSYS. Typically you would use this with ADC.
112+
// There is an example in adc/read_vsys in pico-examples.
113+
#ifndef PICO_VSYS_PIN
114+
#define PICO_VSYS_PIN 29
115+
#endif
116+
117+
// cyw43 SPI pins can't be changed at runtime
118+
#ifndef CYW43_PIN_WL_DYNAMIC
119+
#define CYW43_PIN_WL_DYNAMIC 0
120+
#endif
121+
122+
// gpio pin to power up the cyw43 chip
123+
#ifndef CYW43_DEFAULT_PIN_WL_REG_ON
124+
#define CYW43_DEFAULT_PIN_WL_REG_ON 23u
125+
#endif
126+
127+
// gpio pin for spi data out to the cyw43 chip
128+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT
129+
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 24u
130+
#endif
131+
132+
// gpio pin for spi data in from the cyw43 chip
133+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_IN
134+
#define CYW43_DEFAULT_PIN_WL_DATA_IN 24u
135+
#endif
136+
137+
// gpio (irq) pin for the irq line from the cyw43 chip
138+
#ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE
139+
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 24u
140+
#endif
141+
142+
// gpio pin for the spi clock line to the cyw43 chip
143+
#ifndef CYW43_DEFAULT_PIN_WL_CLOCK
144+
#define CYW43_DEFAULT_PIN_WL_CLOCK 29u
145+
#endif
146+
147+
// gpio pin for the spi chip select to the cyw43 chip
148+
#ifndef CYW43_DEFAULT_PIN_WL_CS
149+
#define CYW43_DEFAULT_PIN_WL_CS 25u
150+
#endif
151+
152+
#endif

boards/i75w_rp2350/mpconfigboard.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
set(PICO_BOARD "pico2_w")
1+
set(PICO_BOARD "pimoroni_i75w_2350")
2+
set(PICO_BOARD_HEADER_DIRS ${CMAKE_CURRENT_LIST_DIR})
23

34
# Board specific version of the frozen manifest
45
set(MICROPY_FROZEN_MANIFEST ${MICROPY_BOARD_DIR}/manifest.py)

boards/i75w_rp2350/pimoroni_i75w_2350.h

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
#define RASPBERRYPI_PICO2_W
2222

2323
// --- RP2350 VARIANT ---
24-
//#define PICO_RP2350A 1
24+
#define PICO_RP2350A 1
2525

2626
// --- UART ---
2727
#ifndef PICO_DEFAULT_UART
2828
#define PICO_DEFAULT_UART 0
2929
#endif
3030
#ifndef PICO_DEFAULT_UART_TX_PIN
31-
#define PICO_DEFAULT_UART_TX_PIN 0
31+
#define PICO_DEFAULT_UART_TX_PIN 16
3232
#endif
3333
#ifndef PICO_DEFAULT_UART_RX_PIN
34-
#define PICO_DEFAULT_UART_RX_PIN 1
34+
#define PICO_DEFAULT_UART_RX_PIN 17
3535
#endif
3636

3737
// --- LED ---
@@ -43,28 +43,14 @@
4343
#define PICO_DEFAULT_I2C 0
4444
#endif
4545
#ifndef PICO_DEFAULT_I2C_SDA_PIN
46-
#define PICO_DEFAULT_I2C_SDA_PIN 4
46+
#define PICO_DEFAULT_I2C_SDA_PIN 20
4747
#endif
4848
#ifndef PICO_DEFAULT_I2C_SCL_PIN
49-
#define PICO_DEFAULT_I2C_SCL_PIN 5
49+
#define PICO_DEFAULT_I2C_SCL_PIN 21
5050
#endif
5151

5252
// --- SPI ---
53-
#ifndef PICO_DEFAULT_SPI
54-
#define PICO_DEFAULT_SPI 0
55-
#endif
56-
#ifndef PICO_DEFAULT_SPI_SCK_PIN
57-
#define PICO_DEFAULT_SPI_SCK_PIN 18
58-
#endif
59-
#ifndef PICO_DEFAULT_SPI_TX_PIN
60-
#define PICO_DEFAULT_SPI_TX_PIN 19
61-
#endif
62-
#ifndef PICO_DEFAULT_SPI_RX_PIN
63-
#define PICO_DEFAULT_SPI_RX_PIN 16
64-
#endif
65-
#ifndef PICO_DEFAULT_SPI_CSN_PIN
66-
#define PICO_DEFAULT_SPI_CSN_PIN 17
67-
#endif
53+
// no PICO_DEFAULT_SPI - Not broken out, pins are split between SPI0 and SPI1
6854

6955
// --- FLASH ---
7056

@@ -109,41 +95,42 @@
10995
#define PICO_VSYS_PIN 29
11096
#endif
11197

98+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
11299
#ifndef PICO_RP2350_A2_SUPPORTED
113100
#define PICO_RP2350_A2_SUPPORTED 1
114101
#endif
115102

116-
// PICO_CONFIG: CYW43_PIN_WL_DYNAMIC, flag to indicate if cyw43 SPI pins can be changed at runtime, type=bool, default=false, advanced=true, group=pico_cyw43_driver
103+
// cyw43 SPI pins can't be changed at runtime
117104
#ifndef CYW43_PIN_WL_DYNAMIC
118105
#define CYW43_PIN_WL_DYNAMIC 0
119106
#endif
120107

121-
// PICO_CONFIG: CYW43_DEFAULT_PIN_WL_REG_ON, gpio pin to power up the cyw43 chip, type=int, default=23, advanced=true, group=pico_cyw43_driver
108+
// gpio pin to power up the cyw43 chip
122109
#ifndef CYW43_DEFAULT_PIN_WL_REG_ON
123110
#define CYW43_DEFAULT_PIN_WL_REG_ON 23u
124111
#endif
125112

126-
// PICO_CONFIG: CYW43_DEFAULT_PIN_WL_DATA_OUT, gpio pin for spi data out to the cyw43 chip, type=int, default=24, advanced=true, group=pico_cyw43_driver
113+
// gpio pin for spi data out to the cyw43 chip
127114
#ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT
128115
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 24u
129116
#endif
130117

131-
// PICO_CONFIG: CYW43_DEFAULT_PIN_WL_DATA_IN, gpio pin for spi data in from the cyw43 chip, type=int, default=24, advanced=true, group=pico_cyw43_driver
118+
// gpio pin for spi data in from the cyw43 chip
132119
#ifndef CYW43_DEFAULT_PIN_WL_DATA_IN
133120
#define CYW43_DEFAULT_PIN_WL_DATA_IN 24u
134121
#endif
135122

136-
// PICO_CONFIG: CYW43_DEFAULT_PIN_WL_HOST_WAKE, gpio (irq) pin for the irq line from the cyw43 chip, type=int, default=24, advanced=true, group=pico_cyw43_driver
123+
// gpio (irq) pin for the irq line from the cyw43 chip
137124
#ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE
138125
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 24u
139126
#endif
140127

141-
// PICO_CONFIG: CYW43_DEFAULT_PIN_WL_CLOCK, gpio pin for the spi clock line to the cyw43 chip, type=int, default=29, advanced=true, group=pico_cyw43_driver
128+
// gpio pin for the spi clock line to the cyw43 chip
142129
#ifndef CYW43_DEFAULT_PIN_WL_CLOCK
143130
#define CYW43_DEFAULT_PIN_WL_CLOCK 29u
144131
#endif
145132

146-
// PICO_CONFIG: CYW43_DEFAULT_PIN_WL_CS, gpio pin for the spi chip select to the cyw43 chip, type=int, default=25, advanced=true, group=pico_cyw43_driver
133+
// gpio pin for the spi chip select to the cyw43 chip
147134
#ifndef CYW43_DEFAULT_PIN_WL_CS
148135
#define CYW43_DEFAULT_PIN_WL_CS 25u
149136
#endif

boards/i75w_rp2350/pins.csv

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
1-
GP0,GPIO0
2-
GP1,GPIO1
3-
GP2,GPIO2
4-
GP3,GPIO3
5-
GP4,GPIO4
6-
GP5,GPIO5
7-
GP6,GPIO6
8-
GP7,GPIO7
9-
GP8,GPIO8
10-
GP9,GPIO9
11-
GP10,GPIO10
12-
GP11,GPIO11
13-
GP12,GPIO12
14-
GP13,GPIO13
15-
GP14,GPIO14
16-
GP15,GPIO15
17-
GP16,GPIO16
18-
GP17,GPIO17
19-
GP18,GPIO18
20-
GP19,GPIO19
21-
GP20,GPIO20
22-
GP21,GPIO21
23-
GP22,GPIO22
24-
GP25,GPIO25
25-
GP26,GPIO26
26-
GP27,GPIO27
27-
GP28,GPIO28
1+
TX,GPIO16
2+
RX,GPIO17
3+
INT,GPIO19
4+
SDA,GPIO20
5+
SCK,GPIO21
6+
BOOT,GPIO22
7+
A0,GPIO26
8+
A1,GPIO27
9+
BUTTON_A,GPIO14
10+
BUTTON_B,GPIO15
11+
RGBLED,GPIO18
12+
BUTTON_USER,GPIO22
2813
WL_GPIO0,EXT_GPIO0
2914
WL_GPIO1,EXT_GPIO1
3015
WL_GPIO2,EXT_GPIO2

0 commit comments

Comments
 (0)