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 // pico_cmake_set PICO_PLATFORM=rp2040
13 
14 #ifndef _BOARDS_PIMORONI_TINY2040_2MB_H
15 #define _BOARDS_PIMORONI_TINY2040_2MB_H
16 
17 // For board detection
18 #define PIMORONI_TINY2040_2MB
19 #define PIMORONI_TINY2040
20 
21 // --- BOARD SPECIFIC ---
22 #define TINY2040_LED_R_PIN 18
23 #define TINY2040_LED_G_PIN 19
24 #define TINY2040_LED_B_PIN 20
25 
26 #define TINY2040_USER_SW_PIN 23
27 
28 #define TINY2040_A0_PIN 26
29 #define TINY2040_A1_PIN 27
30 #define TINY2040_A2_PIN 28
31 #define TINY2040_A3_PIN 29
32 
33 #define TINY2040_NUM_IO_PINS 8
34 #define TINY2040_NUM_ADC_PINS 4
35 
36 // --- UART ---
37 #ifndef PICO_DEFAULT_UART
38 #define PICO_DEFAULT_UART 0
39 #endif
40 
41 #ifndef PICO_DEFAULT_UART_TX_PIN
42 #define PICO_DEFAULT_UART_TX_PIN 0
43 #endif
44 
45 #ifndef PICO_DEFAULT_UART_RX_PIN
46 #define PICO_DEFAULT_UART_RX_PIN 1
47 #endif
48 
49 // --- LED ---
50 // Included so basic examples will work, and set it to the green LED
51 #ifndef PICO_DEFAULT_LED_PIN
52 #define PICO_DEFAULT_LED_PIN TINY2040_LED_G_PIN
53 #endif
54 // no PICO_DEFAULT_WS2812_PIN
55 
56 #ifndef PICO_DEFAULT_LED_PIN_INVERTED
57 #define PICO_DEFAULT_LED_PIN_INVERTED 1
58 #endif
59 
60 // --- I2C ---
61 #ifndef PICO_DEFAULT_I2C
62 #define PICO_DEFAULT_I2C 1
63 #endif
64 #ifndef PICO_DEFAULT_I2C_SDA_PIN
65 #define PICO_DEFAULT_I2C_SDA_PIN 2
66 #endif
67 #ifndef PICO_DEFAULT_I2C_SCL_PIN
68 #define PICO_DEFAULT_I2C_SCL_PIN 3
69 #endif
70 
71 // --- SPI ---
72 #ifndef PICO_DEFAULT_SPI
73 #define PICO_DEFAULT_SPI 0
74 #endif
75 #ifndef PICO_DEFAULT_SPI_SCK_PIN
76 #define PICO_DEFAULT_SPI_SCK_PIN 6
77 #endif
78 #ifndef PICO_DEFAULT_SPI_TX_PIN
79 #define PICO_DEFAULT_SPI_TX_PIN 7
80 #endif
81 #ifndef PICO_DEFAULT_SPI_RX_PIN
82 #define PICO_DEFAULT_SPI_RX_PIN 4
83 #endif
84 #ifndef PICO_DEFAULT_SPI_CSN_PIN
85 #define PICO_DEFAULT_SPI_CSN_PIN 5
86 #endif
87 
88 // --- FLASH ---
89 #define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
90 
91 #ifndef PICO_FLASH_SPI_CLKDIV
92 #define PICO_FLASH_SPI_CLKDIV 2
93 #endif
94 
95 // pico_cmake_set_default PICO_FLASH_SIZE_BYTES = (2 * 1024 * 1024)
96 #ifndef PICO_FLASH_SIZE_BYTES
97 #define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
98 #endif
99 // All boards have B1 RP2040
100 #ifndef PICO_RP2040_B0_SUPPORTED
101 #define PICO_RP2040_B0_SUPPORTED 0
102 #endif
103 
104 #endif
105