Skip to content

Commit a24bc13

Browse files
sonodimalurch
andauthored
Add board header for Waveshare RP2350-USB-A (#2435)
* Add definition for the Waveshare RP2350-USB-A board * Set XOSC startup delay multiplier for the RP2350-USB-A * Update waveshare_rp2350_usb_a.h Tweak to the PICO_DEFAULT_PIO_USB_DP_PIN define --------- Co-authored-by: Andrew Scheller <[email protected]>
1 parent d45a090 commit a24bc13

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* Copyright (c) 2020 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+
#ifndef _BOARDS_WAVESHARE_RP2350_USB_A_H
13+
#define _BOARDS_WAVESHARE_RP2350_USB_A_H
14+
15+
pico_board_cmake_set(PICO_PLATFORM, rp2350)
16+
17+
// For board detection
18+
#define WAVESHARE_RP2350_USB_A
19+
20+
// On some samples, the xosc can take longer to stabilize than is usual
21+
#ifndef PICO_XOSC_STARTUP_DELAY_MULTIPLIER
22+
#define PICO_XOSC_STARTUP_DELAY_MULTIPLIER 64
23+
#endif
24+
25+
// --- RP2350 VARIANT ---
26+
#define PICO_RP2350A 1
27+
28+
// --- UART ---
29+
#ifndef PICO_DEFAULT_UART
30+
#define PICO_DEFAULT_UART 0
31+
#endif
32+
#ifndef PICO_DEFAULT_UART_TX_PIN
33+
#define PICO_DEFAULT_UART_TX_PIN 0
34+
#endif
35+
#ifndef PICO_DEFAULT_UART_RX_PIN
36+
#define PICO_DEFAULT_UART_RX_PIN 1
37+
#endif
38+
39+
// --- WS2812 ---
40+
#ifndef PICO_DEFAULT_WS2812_PIN
41+
#define PICO_DEFAULT_WS2812_PIN 16
42+
#endif
43+
44+
// --- I2C ---
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+
// --- PIO USB ---
73+
#ifndef WAVESHARE_RP2350_USB_A_USB_DP_PIN
74+
#define WAVESHARE_RP2350_USB_A_USB_DP_PIN 12
75+
#endif
76+
#ifndef WAVESHARE_RP2350_USB_A_USB_DM_PIN
77+
#define WAVESHARE_RP2350_USB_A_USB_DM_PIN 13
78+
#endif
79+
#define PICO_DEFAULT_PIO_USB_DP_PIN WAVESHARE_RP2350_USB_A_USB_DP_PIN
80+
81+
// --- FLASH ---
82+
#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
83+
84+
#ifndef PICO_FLASH_SPI_CLKDIV
85+
#define PICO_FLASH_SPI_CLKDIV 3
86+
#endif
87+
88+
pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (2 * 1024 * 1024))
89+
#ifndef PICO_FLASH_SIZE_BYTES
90+
#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
91+
#endif
92+
93+
// Drive high to force power supply into PWM mode (lower ripple on 3V3 at light loads)
94+
#define PICO_SMPS_MODE_PIN 23
95+
96+
pico_board_cmake_set_default(PICO_RP2350_A2_SUPPORTED, 1)
97+
#ifndef PICO_RP2350_A2_SUPPORTED
98+
#define PICO_RP2350_A2_SUPPORTED 1
99+
#endif
100+
101+
#endif

0 commit comments

Comments
 (0)