Skip to content

Commit 2c984cd

Browse files
committed
Create sparkfun_iotredboard_rp2350.h
1 parent ee68c78 commit 2c984cd

File tree

1 file changed

+184
-0
lines changed

1 file changed

+184
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
/*
2+
* Copyright (c) 2024 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+
// Board definition for the SparkFun RP2350 Thing Plus
12+
//
13+
// This header may be included by other board headers as "boards/sparkfun_thingplus_rp2350.h"
14+
15+
// pico_cmake_set PICO_PLATFORM=rp2350
16+
// pico_cmake_set PICO_CYW43_SUPPORTED = 1
17+
18+
#ifndef _BOARDS_SPARKFUN_IOTREDBOARD_RP2350_H
19+
#define _BOARDS_SPARKFUN_IOTREDBOARD_RP2350_H
20+
21+
// For board detection
22+
#define SPARKFUN_IOTREDBOARD_RP2350
23+
24+
// --- RP2350 VARIANT ---
25+
#define PICO_RP2350B 1
26+
#define PICO_RP2350A 0
27+
28+
// --- BOARD SPECIFIC ---
29+
#define SPARKFUN_IOTREDBOARD_RP2350_USER_SW_PIN 39
30+
#define SPARKFUN_IOTREDBOARD_RP2350_PSRAM_CS_PIN 47
31+
32+
33+
// --- UART ---
34+
#ifndef PICO_DEFAULT_UART
35+
#define PICO_DEFAULT_UART 0
36+
#endif
37+
#ifndef PICO_DEFAULT_UART_TX_PIN
38+
#define PICO_DEFAULT_UART_TX_PIN 0
39+
#endif
40+
#ifndef PICO_DEFAULT_UART_RX_PIN
41+
#define PICO_DEFAULT_UART_RX_PIN 1
42+
#endif
43+
44+
// --- LED ---
45+
#ifndef PICO_DEFAULT_LED_PIN
46+
#define PICO_DEFAULT_LED_PIN 25
47+
#endif
48+
49+
#ifndef PICO_DEFAULT_WS2812_PIN
50+
#define PICO_DEFAULT_WS2812_PIN 3
51+
#endif
52+
53+
// --- I2C --- Qwiic connector is on these pins
54+
#ifndef PICO_DEFAULT_I2C
55+
#define PICO_DEFAULT_I2C 0
56+
#endif
57+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
58+
#define PICO_DEFAULT_I2C_SDA_PIN 4
59+
#endif
60+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
61+
#define PICO_DEFAULT_I2C_SCL_PIN 5
62+
#endif
63+
64+
// --- SPI ---
65+
#ifndef PICO_DEFAULT_SPI
66+
#define PICO_DEFAULT_SPI 0
67+
#endif
68+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
69+
#define PICO_DEFAULT_SPI_SCK_PIN 22
70+
#endif
71+
#ifndef PICO_DEFAULT_SPI_TX_PIN
72+
#define PICO_DEFAULT_SPI_TX_PIN 23
73+
#endif
74+
#ifndef PICO_DEFAULT_SPI_RX_PIN
75+
#define PICO_DEFAULT_SPI_RX_PIN 20
76+
#endif
77+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
78+
#define PICO_DEFAULT_SPI_CSN_PIN 21
79+
#endif
80+
81+
// --- FLASH ---
82+
83+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
84+
85+
#ifndef PICO_FLASH_SPI_CLKDIV
86+
#define PICO_FLASH_SPI_CLKDIV 2
87+
#endif
88+
89+
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
90+
#ifndef PICO_FLASH_SIZE_BYTES
91+
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
92+
#endif
93+
94+
// The IoT RedBoard has an SD Card.
95+
#ifndef PICO_SD_CLK_PIN
96+
#define PICO_SD_CLK_PIN 10
97+
#endif
98+
#ifndef PICO_SD_CMD_PIN
99+
#define PICO_SD_CMD_PIN 11
100+
#endif
101+
#ifndef PICO_SD_DAT0_PIN
102+
#define PICO_SD_DAT0_PIN 8
103+
#endif
104+
#ifndef PICO_SD_DAT3_PIN
105+
#define PICO_SD_DAT3_PIN 9 // DAT3 of the SD card is the chip select pin
106+
#endif
107+
#ifndef PICO_SD_DAT_PIN_COUNT
108+
#define PICO_SD_DAT_PIN_COUNT 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 46
115+
#endif
116+
117+
// pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
118+
#ifndef PICO_RP2350_A2_SUPPORTED
119+
#define PICO_RP2350_A2_SUPPORTED 1
120+
#endif
121+
122+
// Bootloader activity LED in double reset mode.
123+
#ifndef PICO_BOOTSEL_VIA_DOUBLE_RESET_ACTIVITY_LED
124+
#define PICO_BOOTSEL_VIA_DOUBLE_RESET_ACTIVITY_LED PICO_DEFAULT_LED_PIN
125+
#endif
126+
127+
// Bootloader activity LED in USB reset mode.
128+
#ifndef PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED
129+
#define PICO_STDIO_USB_RESET_BOOTSEL_ACTIVITY_LED PICO_DEFAULT_LED_PIN
130+
#endif
131+
132+
// --- CYW43 ---
133+
134+
#ifndef CYW43_WL_GPIO_COUNT
135+
#define CYW43_WL_GPIO_COUNT 3
136+
#endif
137+
138+
#ifndef CYW43_WL_GPIO_LED_PIN
139+
#define CYW43_WL_GPIO_LED_PIN 0
140+
#endif
141+
142+
// If CYW43_WL_GPIO_VBUS_PIN is defined then a CYW43 GPIO has to be used to read VBUS.
143+
// This can be passed to cyw43_arch_gpio_get to determine if the device is battery powered.
144+
// PICO_VBUS_PIN and CYW43_WL_GPIO_VBUS_PIN should not both be defined.
145+
#ifndef CYW43_WL_GPIO_VBUS_PIN
146+
#define CYW43_WL_GPIO_VBUS_PIN 2
147+
#endif
148+
149+
// cyw43 SPI pins can't be changed at runtime
150+
#ifndef CYW43_PIN_WL_DYNAMIC
151+
#define CYW43_PIN_WL_DYNAMIC 0
152+
#endif
153+
154+
// gpio pin to power up the cyw43 chip
155+
#ifndef CYW43_DEFAULT_PIN_WL_REG_ON
156+
#define CYW43_DEFAULT_PIN_WL_REG_ON 24u
157+
#endif
158+
159+
// gpio pin for spi data out to the cyw43 chip
160+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT
161+
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 38u
162+
#endif
163+
164+
// gpio pin for spi data in from the cyw43 chip
165+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_IN
166+
#define CYW43_DEFAULT_PIN_WL_DATA_IN 38u
167+
#endif
168+
169+
// gpio (irq) pin for the irq line from the cyw43 chip
170+
#ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE
171+
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 38u
172+
#endif
173+
174+
// gpio pin for the spi clock line to the cyw43 chip
175+
#ifndef CYW43_DEFAULT_PIN_WL_CLOCK
176+
#define CYW43_DEFAULT_PIN_WL_CLOCK 37u
177+
#endif
178+
179+
// gpio pin for the spi chip select to the cyw43 chip
180+
#ifndef CYW43_DEFAULT_PIN_WL_CS
181+
#define CYW43_DEFAULT_PIN_WL_CS 36u
182+
#endif
183+
184+
#endif // _BOARDS_SPARKFUN_IOTREDBOARD_RP2350_H

0 commit comments

Comments
 (0)