Skip to content

Commit 972d7e1

Browse files
committed
Add board file for pico2_w
This is a copy of pico2 with the definitions from pico_w added. Set PICO_BOARD=pico2_w
1 parent f4a691a commit 972d7e1

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
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+
12+
// This header may be included by other board headers as "boards/pico2_w.h"
13+
14+
// pico_cmake_set PICO_PLATFORM=rp2350
15+
// pico_cmake_set PICO_CYW43_SUPPORTED = 1
16+
17+
#ifndef _BOARDS_PICO2_W_H
18+
#define _BOARDS_PICO2_W_H
19+
20+
// For board detection
21+
#define RASPBERRYPI_PICO2_W
22+
23+
// --- RP2350 VARIANT ---
24+
#define PICO_RP2350A 1
25+
26+
// --- UART ---
27+
#ifndef PICO_DEFAULT_UART
28+
#define PICO_DEFAULT_UART 0
29+
#endif
30+
#ifndef PICO_DEFAULT_UART_TX_PIN
31+
#define PICO_DEFAULT_UART_TX_PIN 0
32+
#endif
33+
#ifndef PICO_DEFAULT_UART_RX_PIN
34+
#define PICO_DEFAULT_UART_RX_PIN 1
35+
#endif
36+
37+
// --- LED ---
38+
// no PICO_DEFAULT_LED_PIN - LED is on Wireless chip
39+
// no PICO_DEFAULT_WS2812_PIN
40+
41+
// --- I2C ---
42+
#ifndef PICO_DEFAULT_I2C
43+
#define PICO_DEFAULT_I2C 0
44+
#endif
45+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
46+
#define PICO_DEFAULT_I2C_SDA_PIN 4
47+
#endif
48+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
49+
#define PICO_DEFAULT_I2C_SCL_PIN 5
50+
#endif
51+
52+
// --- SPI ---
53+
#ifndef PICO_DEFAULT_SPI
54+
#define PICO_DEFAULT_SPI 0
55+
#endif
56+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
57+
#define PICO_DEFAULT_SPI_SCK_PIN 18
58+
#endif
59+
#ifndef PICO_DEFAULT_SPI_TX_PIN
60+
#define PICO_DEFAULT_SPI_TX_PIN 19
61+
#endif
62+
#ifndef PICO_DEFAULT_SPI_RX_PIN
63+
#define PICO_DEFAULT_SPI_RX_PIN 16
64+
#endif
65+
#ifndef PICO_DEFAULT_SPI_CSN_PIN
66+
#define PICO_DEFAULT_SPI_CSN_PIN 17
67+
#endif
68+
69+
// --- FLASH ---
70+
71+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
72+
73+
#ifndef PICO_FLASH_SPI_CLKDIV
74+
#define PICO_FLASH_SPI_CLKDIV 2
75+
#endif
76+
77+
// pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (4 * 1024 * 1024)
78+
#ifndef PICO_FLASH_SIZE_BYTES
79+
#define PICO_FLASH_SIZE_BYTES (4 * 1024 * 1024)
80+
#endif
81+
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
82+
// note the SMSP mode pin is on WL_GPIO1
83+
84+
#ifndef CYW43_PIN_WL_HOST_WAKE
85+
#define CYW43_PIN_WL_HOST_WAKE 24
86+
#endif
87+
88+
#ifndef CYW43_PIN_WL_REG_ON
89+
#define CYW43_PIN_WL_REG_ON 23
90+
#endif
91+
92+
#ifndef CYW43_WL_GPIO_COUNT
93+
#define CYW43_WL_GPIO_COUNT 3
94+
#endif
95+
96+
#ifndef CYW43_WL_GPIO_LED_PIN
97+
#define CYW43_WL_GPIO_LED_PIN 0
98+
#endif
99+
100+
// If CYW43_WL_GPIO_VBUS_PIN is defined then a CYW43 GPIO has to be used to read VBUS.
101+
// This can be passed to cyw43_arch_gpio_get to determine if the device is battery powered.
102+
// PICO_VBUS_PIN and CYW43_WL_GPIO_VBUS_PIN should not both be defined.
103+
#ifndef CYW43_WL_GPIO_VBUS_PIN
104+
#define CYW43_WL_GPIO_VBUS_PIN 2
105+
#endif
106+
107+
// If CYW43_USES_VSYS_PIN is defined then CYW43 uses the VSYS GPIO (defined by PICO_VSYS_PIN) for other purposes.
108+
// If this is the case, to use the VSYS GPIO it's necessary to ensure CYW43 is not using it.
109+
// This can be achieved by wrapping the use of the VSYS GPIO in cyw43_thread_enter / cyw43_thread_exit.
110+
#ifndef CYW43_USES_VSYS_PIN
111+
#define CYW43_USES_VSYS_PIN 1
112+
#endif
113+
114+
// The GPIO Pin used to monitor VSYS. Typically you would use this with ADC.
115+
// There is an example in adc/read_vsys in pico-examples.
116+
#ifndef PICO_VSYS_PIN
117+
#define PICO_VSYS_PIN 29
118+
#endif
119+
120+
#ifndef PICO_RP2350_A2_SUPPORTED
121+
#define PICO_RP2350_A2_SUPPORTED 1
122+
#endif
123+
124+
#endif

0 commit comments

Comments
 (0)