Debian Codegraph @

ports/rp2/boards/SPARKFUN_XRP_CONTROLLER/sparkfun_xrp_controller.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 XRP Controller
12 //
13 // This header may be included by other board headers as "boards/sparkfun_xrp_controller.h"
14
15 // pico_cmake_set PICO_PLATFORM=rp2350
16 // pico_cmake_set PICO_CYW43_SUPPORTED = 1
17
18 #ifndef _BOARDS_SPARKFUN_XRP_CONTROLLER_H
19 #define _BOARDS_SPARKFUN_XRP_CONTROLLER_H
20
21 // For board detection
22 #define SPARKFUN_XRP_CONTROLLER
23
24 // --- RP2350 VARIANT ---
25 #define PICO_RP2350A 0
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 12
33 #endif
34 #ifndef PICO_DEFAULT_UART_RX_PIN
35 #define PICO_DEFAULT_UART_RX_PIN 13
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 37
42 #endif
43
44 // --- I2C --- Qwiic connector is on these pins
45 #ifndef PICO_DEFAULT_I2C
46 #define PICO_DEFAULT_I2C 0
47 #endif
48 #ifndef PICO_DEFAULT_I2C_SDA_PIN
49 #define PICO_DEFAULT_I2C_SDA_PIN 4
50 #endif
51 #ifndef PICO_DEFAULT_I2C_SCL_PIN
52 #define PICO_DEFAULT_I2C_SCL_PIN 5
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 18
61 #endif
62 #ifndef PICO_DEFAULT_SPI_TX_PIN
63 #define PICO_DEFAULT_SPI_TX_PIN 19
64 #endif
65 #ifndef PICO_DEFAULT_SPI_RX_PIN
66 #define PICO_DEFAULT_SPI_RX_PIN 16
67 #endif
68 #ifndef PICO_DEFAULT_SPI_CSN_PIN
69 #define PICO_DEFAULT_SPI_CSN_PIN 17
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 #ifndef CYW43_WL_GPIO_COUNT
86 #define CYW43_WL_GPIO_COUNT 3
87 #endif
88
89 #ifndef CYW43_WL_GPIO_LED_PIN
90 #define CYW43_WL_GPIO_LED_PIN 0
91 #endif
92
93 // pico_cmake_set_default PICO_RP2350_A2_SUPPORTED = 1
94 #ifndef PICO_RP2350_A2_SUPPORTED
95 #define PICO_RP2350_A2_SUPPORTED 1
96 #endif
97
98 // cyw43 SPI pins can't be changed at runtime
99 #ifndef CYW43_PIN_WL_DYNAMIC
100 #define CYW43_PIN_WL_DYNAMIC 0
101 #endif
102
103 // gpio pin to power up the cyw43 chip
104 #ifndef CYW43_DEFAULT_PIN_WL_REG_ON
105 #define CYW43_DEFAULT_PIN_WL_REG_ON 26u
106 #endif
107
108 // gpio pin for spi data out to the cyw43 chip
109 #ifndef CYW43_DEFAULT_PIN_WL_DATA_OUT
110 #define CYW43_DEFAULT_PIN_WL_DATA_OUT 29u
111 #endif
112
113 // gpio pin for spi data in from the cyw43 chip
114 #ifndef CYW43_DEFAULT_PIN_WL_DATA_IN
115 #define CYW43_DEFAULT_PIN_WL_DATA_IN 29u
116 #endif
117
118 // gpio (irq) pin for the irq line from the cyw43 chip
119 #ifndef CYW43_DEFAULT_PIN_WL_HOST_WAKE
120 #define CYW43_DEFAULT_PIN_WL_HOST_WAKE 29u
121 #endif
122
123 // gpio pin for the spi clock line to the cyw43 chip
124 #ifndef CYW43_DEFAULT_PIN_WL_CLOCK
125 #define CYW43_DEFAULT_PIN_WL_CLOCK 28u
126 #endif
127
128 // gpio pin for the spi chip select to the cyw43 chip
129 #ifndef CYW43_DEFAULT_PIN_WL_CS
130 #define CYW43_DEFAULT_PIN_WL_CS 27u
131 #endif
132
133 #endif