Debian Codegraph @

ports/rp2/boards/SPARKFUN_IOTREDBOARD_RP2350/sparkfun_iotredboard_rp2350.h

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