Skip to content

Commit fe018f9

Browse files
authored
Add SparkFun ThingPlus RP2350 (#2038)
* Add SparkFun Thing Plus RP2350 * Add pico_cmake_set_default to Thing Plus RP2350
1 parent 7ceca31 commit fe018f9

File tree

1 file changed

+157
-0
lines changed

1 file changed

+157
-0
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
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_THINGPLUS_RP2350_H
19+
#define _BOARDS_SPARKFUN_THINGPLUS_RP2350_H
20+
21+
// For board detection
22+
#define SPARKFUN_THINGPLUS_RP2350
23+
24+
// --- RP2350 VARIANT ---
25+
#define PICO_RP2350A 1
26+
27+
// --- UART ---
28+
#ifndef PICO_DEFAULT_UART
29+
#define PICO_DEFAULT_UART 0
30+
#endif
31+
#ifndef PICO_DEFAULT_UART_TX_PIN
32+
#define PICO_DEFAULT_UART_TX_PIN 0
33+
#endif
34+
#ifndef PICO_DEFAULT_UART_RX_PIN
35+
#define PICO_DEFAULT_UART_RX_PIN 1
36+
#endif
37+
38+
// --- LED ---
39+
// no PICO_DEFAULT_LED_PIN - LED is on Wireless chip
40+
#ifndef PICO_DEFAULT_WS2812_PIN
41+
#define PICO_DEFAULT_WS2812_PIN 14
42+
#endif
43+
44+
// --- I2C --- Qwiic connector is on these pins
45+
#ifndef PICO_DEFAULT_I2C
46+
#define PICO_DEFAULT_I2C 1
47+
#endif
48+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
49+
#define PICO_DEFAULT_I2C_SDA_PIN 6
50+
#endif
51+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
52+
#define PICO_DEFAULT_I2C_SCL_PIN 7
53+
#endif
54+
55+
// --- SPI ---
56+
#ifndef PICO_DEFAULT_SPI
57+
#define PICO_DEFAULT_SPI 0
58+
#endif
59+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
60+
#define PICO_DEFAULT_SPI_SCK_PIN 2
61+
#endif
62+
#ifndef PICO_DEFAULT_SPI_TX_PIN
63+
#define PICO_DEFAULT_SPI_TX_PIN 3
64+
#endif
65+
#ifndef PICO_DEFAULT_SPI_RX_PIN
66+
#define PICO_DEFAULT_SPI_RX_PIN 4
67+
#endif
68+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
69+
#define PICO_DEFAULT_SPI_CSN_PIN 5
70+
#endif
71+
72+
// --- FLASH ---
73+
74+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
75+
76+
#ifndef PICO_FLASH_SPI_CLKDIV
77+
#define PICO_FLASH_SPI_CLKDIV 2
78+
#endif
79+
80+
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (16 * 1024 * 1024)
81+
#ifndef PICO_FLASH_SIZE_BYTES
82+
#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
83+
#endif
84+
85+
// The thing plus has a SD Card.
86+
#ifndef PICO_SD_CLK_PIN
87+
#define PICO_SD_CLK_PIN 2
88+
#endif
89+
#ifndef PICO_SD_CMD_PIN
90+
#define PICO_SD_CMD_PIN 3
91+
#endif
92+
#ifndef PICO_SD_DAT0_PIN
93+
#define PICO_SD_DAT0_PIN 4
94+
#endif
95+
#ifndef PICO_SD_DAT3_PIN
96+
#define PICO_SD_DAT3_PIN 8 // DAT3 of the SD card is the chip select pin
97+
#endif
98+
#ifndef PICO_SD_DAT_PIN_COUNT
99+
#define PICO_SD_DAT_PIN_COUNT 1
100+
#endif
101+
102+
#ifndef CYW43_WL_GPIO_COUNT
103+
#define CYW43_WL_GPIO_COUNT 3
104+
#endif
105+
106+
#ifndef CYW43_WL_GPIO_LED_PIN
107+
#define CYW43_WL_GPIO_LED_PIN 0
108+
#endif
109+
110+
// If CYW43_WL_GPIO_VBUS_PIN is defined then a CYW43 GPIO has to be used to read VBUS.
111+
// This can be passed to cyw43_arch_gpio_get to determine if the device is battery powered.
112+
// PICO_VBUS_PIN and CYW43_WL_GPIO_VBUS_PIN should not both be defined.
113+
#ifndef CYW43_WL_GPIO_VBUS_PIN
114+
#define CYW43_WL_GPIO_VBUS_PIN 2
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+
// cyw43 SPI pins can't be changed at runtime
123+
#ifndef CYW43_PIN_WL_DYNAMIC
124+
#define CYW43_PIN_WL_DYNAMIC 0
125+
#endif
126+
127+
// gpio pin to power up the cyw43 chip
128+
#ifndef CYW43_DEFAULT_PIN_WL_REG_ON
129+
#define CYW43_DEFAULT_PIN_WL_REG_ON 23u
130+
#endif
131+
132+
// gpio pin for spi data out to the cyw43 chip
133+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT
134+
#define CYW43_DEFAULT_PIN_WL_DATA_OUT 24u
135+
#endif
136+
137+
// gpio pin for spi data in from the cyw43 chip
138+
#ifndef CYW43_DEFAULT_PIN_WL_DATA_IN
139+
#define CYW43_DEFAULT_PIN_WL_DATA_IN 24u
140+
#endif
141+
142+
// gpio (irq) pin for the irq line from the cyw43 chip
143+
#ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE
144+
#define CYW43_DEFAULT_PIN_WL_HOST_WAKE 24u
145+
#endif
146+
147+
// gpio pin for the spi clock line to the cyw43 chip
148+
#ifndef CYW43_DEFAULT_PIN_WL_CLOCK
149+
#define CYW43_DEFAULT_PIN_WL_CLOCK 29u
150+
#endif
151+
152+
// gpio pin for the spi chip select to the cyw43 chip
153+
#ifndef CYW43_DEFAULT_PIN_WL_CS
154+
#define CYW43_DEFAULT_PIN_WL_CS 25u
155+
#endif
156+
157+
#endif

0 commit comments

Comments
 (0)