Skip to content

Commit 7d58f95

Browse files
authored
Add board definition for Adafruit Feather RP2040 Adalogger (#2524)
* Add board definition for Adafruit Feather RP2040 Adalogger * Fix default SPI instance and pin mapping
1 parent 2871965 commit 7d58f95

File tree

1 file changed

+120
-0
lines changed

1 file changed

+120
-0
lines changed
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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_ADAFRUIT_FEATHER_RP2040_ADALOGGER_H
13+
#define _BOARDS_ADAFRUIT_FEATHER_RP2040_ADALOGGER_H
14+
15+
pico_board_cmake_set(PICO_PLATFORM, rp2040)
16+
17+
// For board detection
18+
#define ADAFRUIT_FEATHER_RP2040_ADALOGGER
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+
//------------- UART -------------//
26+
#ifndef PICO_DEFAULT_UART
27+
#define PICO_DEFAULT_UART 0
28+
#endif
29+
30+
#ifndef PICO_DEFAULT_UART_TX_PIN
31+
#define PICO_DEFAULT_UART_TX_PIN 0
32+
#endif
33+
34+
#ifndef PICO_DEFAULT_UART_RX_PIN
35+
#define PICO_DEFAULT_UART_RX_PIN 1
36+
#endif
37+
38+
//------------- LED -------------//
39+
#ifndef PICO_DEFAULT_LED_PIN
40+
#define PICO_DEFAULT_LED_PIN 13
41+
#endif
42+
43+
#ifndef PICO_DEFAULT_WS2812_PIN
44+
#define PICO_DEFAULT_WS2812_PIN 17
45+
#endif
46+
47+
//------------- I2C -------------//
48+
#ifndef PICO_DEFAULT_I2C
49+
#define PICO_DEFAULT_I2C 1
50+
#endif
51+
52+
#ifndef PICO_DEFAULT_I2C_SDA_PIN
53+
#define PICO_DEFAULT_I2C_SDA_PIN 2
54+
#endif
55+
56+
#ifndef PICO_DEFAULT_I2C_SCL_PIN
57+
#define PICO_DEFAULT_I2C_SCL_PIN 3
58+
#endif
59+
60+
//------------- SPI -------------//
61+
#ifndef PICO_DEFAULT_SPI
62+
#define PICO_DEFAULT_SPI 1
63+
#endif
64+
65+
#ifndef PICO_DEFAULT_SPI_TX_PIN
66+
#define PICO_DEFAULT_SPI_TX_PIN 15
67+
#endif
68+
69+
#ifndef PICO_DEFAULT_SPI_RX_PIN
70+
#define PICO_DEFAULT_SPI_RX_PIN 8
71+
#endif
72+
73+
#ifndef PICO_DEFAULT_SPI_SCK_PIN
74+
#define PICO_DEFAULT_SPI_SCK_PIN 14
75+
#endif
76+
77+
//------------- SD -------------//
78+
#ifndef PICO_SD_CARD_DETECT_PIN
79+
#define PICO_SD_CARD_DETECT_PIN 16
80+
#endif
81+
82+
#ifndef PICO_SD_CLK_PIN
83+
#define PICO_SD_CLK_PIN 18
84+
#endif
85+
86+
#ifndef PICO_SD_CMD_PIN
87+
#define PICO_SD_CMD_PIN 19
88+
#endif
89+
90+
#ifndef PICO_SD_DAT0_PIN
91+
#define PICO_SD_DAT0_PIN 20
92+
#endif
93+
94+
#ifndef PICO_SD_DAT_PIN_INCREMENT
95+
#define PICO_SD_DAT_PIN_INCREMENT 1
96+
#endif
97+
98+
#ifndef PICO_SD_DAT_PIN_COUNT
99+
#define PICO_SD_DAT_PIN_COUNT 4
100+
#endif
101+
102+
//------------- FLASH -------------//
103+
104+
// Use slower generic flash access
105+
#define PICO_BOOT_STAGE2_CHOOSE_GENERIC_03H 1
106+
107+
#ifndef PICO_FLASH_SPI_CLKDIV
108+
#define PICO_FLASH_SPI_CLKDIV 4
109+
#endif
110+
111+
pico_board_cmake_set_default(PICO_FLASH_SIZE_BYTES, (8 * 1024 * 1024))
112+
#ifndef PICO_FLASH_SIZE_BYTES
113+
#define PICO_FLASH_SIZE_BYTES (8 * 1024 * 1024)
114+
#endif
115+
// All boards have B1 RP2040
116+
#ifndef PICO_RP2040_B0_SUPPORTED
117+
#define PICO_RP2040_B0_SUPPORTED 0
118+
#endif
119+
120+
#endif

0 commit comments

Comments
 (0)