pimoroni_plasma2040.h
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_PIMORONI_PLASMA2040_H
13#define _BOARDS_PIMORONI_PLASMA2040_H
14
15// For board detection
16#define PIMORONI_PLASMA2040
17
18// --- BOARD SPECIFIC ---
19#ifndef PLASMA2040_SW_A_PIN
20#define PLASMA2040_SW_A_PIN 12
21#endif
22
23#ifndef PLASMA2040_SW_B_PIN
24#define PLASMA2040_SW_B_PIN 13
25#endif
26
27#ifndef PLASMA2040_CLK_PIN
28#define PLASMA2040_CLK_PIN 14
29#endif
30
31#ifndef PLASMA2040_DATA_PIN
32#define PLASMA2040_DATA_PIN 15
33#endif
34
35#ifndef PLASMA2040_LED_R_PIN
36#define PLASMA2040_LED_R_PIN 16
37#endif
38
39#ifndef PLASMA2040_LED_G_PIN
40#define PLASMA2040_LED_G_PIN 17
41#endif
42
43#ifndef PLASMA2040_LED_B_PIN
44#define PLASMA2040_LED_B_PIN 18
45#endif
46
47#ifndef PLASMA2040_I2C
48#define PLASMA2040_I2C 0
49#endif
50
51#ifndef PLASMA2040_INT_PIN
52#define PLASMA2040_INT_PIN 19
53#endif
54
55#ifndef PLASMA2040_SDA_PIN
56#define PLASMA2040_SDA_PIN 20
57#endif
58
59#ifndef PLASMA2040_SCL_PIN
60#define PLASMA2040_SCL_PIN 21
61#endif
62
63#ifndef PLASMA2040_USER_SW_PIN
64#define PLASMA2040_USER_SW_PIN 23
65#endif
66
67#ifndef PLASMA2040_A0_PIN
68#define PLASMA2040_A0_PIN 26
69#endif
70
71#ifndef PLASMA2040_A1_PIN
72#define PLASMA2040_A1_PIN 27
73#endif
74
75#ifndef PLASMA2040_A2_PIN
76#define PLASMA2040_A2_PIN 28
77#endif
78
79#ifndef PLASMA2040_NUM_ADC_PINS
80#define PLASMA2040_NUM_ADC_PINS 3
81#endif
82
83#ifndef PLASMA2040_CURRENT_SENSE_PIN
84#define PLASMA2040_CURRENT_SENSE_PIN 29
85#endif
86
87// --- UART ---
88// no PICO_DEFAULT_UART
89// no PICO_DEFAULT_UART_TX_PIN
90// no PICO_DEFAULT_UART_RX_PIN
91
92// --- LED ---
93// Included so basic examples will work, and set it to the green LED
94#ifndef PICO_DEFAULT_LED_PIN
95#define PICO_DEFAULT_LED_PIN PLASMA2040_LED_G_PIN
96#endif
97// no PICO_DEFAULT_WS2812_PIN
98
99#ifndef PICO_DEFAULT_LED_PIN_INVERTED
100#define PICO_DEFAULT_LED_PIN_INVERTED 1
101#endif
102
103// --- I2C ---
104#ifndef PICO_DEFAULT_I2C
105#define PICO_DEFAULT_I2C PLASMA2040_I2C
106#endif
107#ifndef PICO_DEFAULT_I2C_SDA_PIN
108#define PICO_DEFAULT_I2C_SDA_PIN PLASMA2040_SDA_PIN
109#endif
110#ifndef PICO_DEFAULT_I2C_SCL_PIN
111#define PICO_DEFAULT_I2C_SCL_PIN PLASMA2040_SCL_PIN
112#endif
113
114// --- SPI ---
115// no PICO_DEFAULT_SPI
116// no PICO_DEFAULT_SPI_SCK_PIN
117// no PICO_DEFAULT_SPI_TX_PIN
118// no PICO_DEFAULT_SPI_RX_PIN
119// no PICO_DEFAULT_SPI_CSN_PIN
120
121// --- FLASH ---
122#define PICO_BOOT_STAGE2_CHOOSE_W25Q080 1
123
124#ifndef PICO_FLASH_SPI_CLKDIV
125#define PICO_FLASH_SPI_CLKDIV 2
126#endif
127
128#ifndef PICO_FLASH_SIZE_BYTES
129#define PICO_FLASH_SIZE_BYTES (2 * 1024 * 1024)
130#endif
131
132// All boards have B1 RP2040
133#ifndef PICO_RP2040_B0_SUPPORTED
134#define PICO_RP2040_B0_SUPPORTED 0
135#endif
136
137#endif