1414#ifndef _BOARDS_METROTECH_XERXES_RP2040_H
1515#define _BOARDS_METROTECH_XERXES_RP2040_H
1616
17-
18- #define USR_SW_PIN 18
19- #define USR_BTN_PIN 24
20- #define USR_LED_PIN 25
21-
22- #define UART1_TX_PIN 8
23- #define UART1_RX_PIN 9
24-
25- #define UART0_TX_PIN 16
26- #define UART0_RX_PIN 17
27-
28- #define SPI0_MISO_PIN 0
29- #define SPI0_CSN_PIN 1
30- #define SPI0_CLK_PIN 2
31- #define SPI0_MOSI_PIN 3
32-
33- #define I2C0_SDA_PIN 4
34- #define I2C0_SCL_PIN 5
35-
36- #define EXT_3V3_EN_PIN 6
37-
38- #define RS_EN_PIN 19
39- #define RS_TX_PIN UART0_TX_PIN
40- #define RS_RX_PIN UART0_RX_PIN
41-
42- #define ADC0_PIN 26 // ADC0 and PWM5_A share the same pin
43- #define ADC1_PIN 27 // ADC1 and PWM5_B share the same pin
44- #define ADC2_PIN 28 // ADC2 and PWM6_A share the same pin
45- #define ADC3_PIN 29 // ADC3 and PWM6_B share the same pin
46-
47- #define TMP0_PIN 22 // TMP0 and I2C1 share the same pin
48- #define TMP1_PIN 23 // TMP1 and I2C1 share the same pin
49-
50- #define I2C1_SDA_PIN 22 // I2C1 and TMP0 share the same pin
51- #define I2C1_SCL_PIN 23 // I2C1 and TMP1 share the same pin
52-
53- #define PWM0_A_PIN 0 // PWM0_A and SPI0_MISO share the same pin
54- #define PWM0_B_PIN 1 // PWM0_B and SPI0_CSN share the same pin
55- #define PWM1_A_PIN 2 // PWM1_A and SPI0_CLK share the same pin
56- #define PWM1_B_PIN 3 // PWM1_B and SPI0_MOSI share the same pin
57- #define PWM2_A_PIN 4 // PWM2_A and I2C0_SDA share the same pin
58- #define PWM2_B_PIN 5 // PWM2_B and I2C0_SCL share the same pin
59- #define PWM3_A_PIN 22 // PWM3_A and TMP0 share the same pin
60- #define PWM3_B_PIN 23 // PWM3_B and TMP1 share the same pin
61- #define PWM4_A_PIN 24 // PWM4_A and USR_BTN share the same pin
62- #define PWM4_B_PIN 25 // PWM4_B and USR_LED share the same pin
63- #define PWM5_A_PIN 26 // PWM5_A and ADC0 share the same pin
64- #define PWM5_B_PIN 27 // PWM5_B and ADC1 share the same pin
65- #define PWM6_A_PIN 28 // PWM6_A and ADC2 share the same pin
66- #define PWM6_B_PIN 29 // PWM6_B and ADC3 share the same pin
67-
68- #define CLK_GPIN1_PIN 22 // CLK_GPIN1 and TMP0 share the same pin
69- #define CLK_GPOUT1_PIN 23 // CLK_GPOUT1 and TMP1 share the same pin
17+ #define USR_SW_PIN 18
18+ #define USR_BTN_PIN 24
19+ #define USR_LED_PIN 25
20+
21+ #define UART1_TX_PIN 8
22+ #define UART1_RX_PIN 9
23+
24+ #define UART0_TX_PIN 16
25+ #define UART0_RX_PIN 17
26+
27+ #define SPI0_MISO_PIN 0
28+ #define SPI0_CSN_PIN 1
29+ #define SPI0_CLK_PIN 2
30+ #define SPI0_MOSI_PIN 3
31+
32+ #define I2C0_SDA_PIN 4
33+ #define I2C0_SCL_PIN 5
34+
35+ #define EXT_3V3_EN_PIN 6
36+
37+ #define RS_EN_PIN 19
38+ #define RS_TX_PIN UART0_TX_PIN
39+ #define RS_RX_PIN UART0_RX_PIN
40+
41+ #define ADC0_PIN 26 // ADC0 and PWM5_A share the same pin
42+ #define ADC1_PIN 27 // ADC1 and PWM5_B share the same pin
43+ #define ADC2_PIN 28 // ADC2 and PWM6_A share the same pin
44+ #define ADC3_PIN 29 // ADC3 and PWM6_B share the same pin
45+
46+ #define TMP0_PIN 22 // TMP0 and I2C1 share the same pin
47+ #define TMP1_PIN 23 // TMP1 and I2C1 share the same pin
48+
49+ #define I2C1_SDA_PIN 22 // I2C1 and TMP0 share the same pin
50+ #define I2C1_SCL_PIN 23 // I2C1 and TMP1 share the same pin
51+
52+ #define PWM0_A_PIN 0 // PWM0_A and SPI0_MISO share the same pin
53+ #define PWM0_B_PIN 1 // PWM0_B and SPI0_CSN share the same pin
54+ #define PWM1_A_PIN 2 // PWM1_A and SPI0_CLK share the same pin
55+ #define PWM1_B_PIN 3 // PWM1_B and SPI0_MOSI share the same pin
56+ #define PWM2_A_PIN 4 // PWM2_A and I2C0_SDA share the same pin
57+ #define PWM2_B_PIN 5 // PWM2_B and I2C0_SCL share the same pin
58+ #define PWM3_A_PIN 22 // PWM3_A and TMP0 share the same pin
59+ #define PWM3_B_PIN 23 // PWM3_B and TMP1 share the same pin
60+ #define PWM4_A_PIN 24 // PWM4_A and USR_BTN share the same pin
61+ #define PWM4_B_PIN 25 // PWM4_B and USR_LED share the same pin
62+ #define PWM5_A_PIN 26 // PWM5_A and ADC0 share the same pin
63+ #define PWM5_B_PIN 27 // PWM5_B and ADC1 share the same pin
64+ #define PWM6_A_PIN 28 // PWM6_A and ADC2 share the same pin
65+ #define PWM6_B_PIN 29 // PWM6_B and ADC3 share the same pin
66+
67+ #define CLK_GPIN1_PIN 22 // CLK_GPIN1 and TMP0 share the same pin
68+ #define CLK_GPOUT1_PIN 23 // CLK_GPOUT1 and TMP1 share the same pin
7069
7170/// @brief Mask of pins that are used by the shield and not used by the board, eq. 0x3fc0033f
72- #define SHIELD_MASK 1 << SPI0_MISO_PIN | 1 << SPI0_CSN_PIN | 1 << SPI0_CLK_PIN | 1 << SPI0_MOSI_PIN | \
73- 1 << I2C0_SDA_PIN | 1 << I2C0_SCL_PIN | \
74- 1 << UART1_TX_PIN | 1 << UART1_RX_PIN | \
75- 1 << ADC0_PIN | 1 << ADC1_PIN | 1 << ADC2_PIN | 1 << ADC3_PIN | \
76- 1 << TMP0_PIN | 1 << TMP1_PIN
77-
71+ #define SHIELD_MASK 1 << SPI0_MISO_PIN | 1 << SPI0_CSN_PIN | 1 << SPI0_CLK_PIN | 1 << SPI0_MOSI_PIN | \
72+ 1 << I2C0_SDA_PIN | 1 << I2C0_SCL_PIN | \
73+ 1 << UART1_TX_PIN | 1 << UART1_RX_PIN | \
74+ 1 << ADC0_PIN | 1 << ADC1_PIN | 1 << ADC2_PIN | 1 << ADC3_PIN | \
75+ 1 << TMP0_PIN | 1 << TMP1_PIN
7876
7977// For board detection
8078#define XERXES_RP2040
127125// --- FLASH ---
128126#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
129127
130- #ifndef __CLKDIV
128+ #ifndef __CLKDIV
131129#define __CLKDIV 4
132130#endif // !__CLKDIV
133131
134132#ifndef PICO_FLASH_SPI_CLKDIV
135133/**
136134 * @brief divisor for SPI clock (default 4), must be divisible by 2
137- *
138- * This is critical for some flash chips, and can be set to 4 for some,
135+ *
136+ * This is critical for some flash chips, and can be set to 4 for some,
139137 * but needs to be at least 32 for others. Set using -DCLKDIV=<N*2> in cmake.
140138 * @note Increasing this value will help with BOOTLOOPs, but will slow down the flash chip.
141139 */
142140#define PICO_FLASH_SPI_CLKDIV __CLKDIV
143141#endif // !PICO_FLASH_SPI_CLKDIV
144142
145-
146143#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
147144#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 16
148145#endif // !PICO_XOSC_STARTUP_DELAY_MULTIPLIER
151148#ifndef PICO_FLASH_SIZE_BYTES
152149/**
153150 * @brief 16MiB, Flash size in bytes
154- *
151+ *
155152 * This is the size of the flash chip on the board, not the size of the flash chip that is used for the bootloader.
156153 */
157154#define PICO_FLASH_SIZE_BYTES (16 * 1024 * 1024)
158155#endif // !PICO_FLASH_SIZE_BYTES
159156
160157// All boards have B1 RP2040
161- #ifndef PICO_RP2040_B0_SUPPORTED
162- #define PICO_RP2040_B0_SUPPORTED 0
158+ #ifndef PICO_RP2040_B0_SUPPORTED
159+ #define PICO_RP2040_B0_SUPPORTED 0
163160#endif // !PICO_RP2040_B0_SUPPORTED
164161
165-
166- #ifdef __cplusplus
167- }
168- #endif // __cplusplus
169-
170162#endif // _BOARDS_METROTECH_XERXES_RP2040_H
0 commit comments