board.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2023 Gunar Schorcht
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
21 #include <stdint.h>
22 
34 #define BTN0_PIN GPIO0
35 
39 #define BTN0_MODE GPIO_IN_PU
40 
44 #ifndef BTN0_INT_FLANK
45 #define BTN0_INT_FLANK GPIO_FALLING
46 #endif
47 
51 #define BUTTON0_PIN BTN0_PIN
52 
58 #define BTN1_PIN GPIO14
59 
63 #define BTN1_MODE GPIO_IN_PU
64 
68 #ifndef BTN1_INT_FLANK
69 #define BTN1_INT_FLANK GPIO_FALLING
70 #endif
71 
75 #define BUTTON1_PIN BTN1_PIN
76 
82 #define BTN2_PIN GPIO11
83 
87 #define BTN2_MODE GPIO_IN_PU
88 
92 #ifndef BTN2_INT_FLANK
93 #define BTN2_INT_FLANK GPIO_FALLING
94 #endif
95 
99 #define BUTTON2_PIN BTN2_PIN
100 
106 #define BTN3_PIN GPIO10
107 
111 #define BTN3_MODE GPIO_IN_PU
112 
116 #ifndef BTN3_INT_FLANK
117 #define BTN3_INT_FLANK GPIO_FALLING
118 #endif
119 
123 #define BUTTON3_PIN BTN3_PIN
124 
133 #define LED0_PIN GPIO15
134 #define LED0_ACTIVE (1)
136 #define LED1_PIN GPIO16
137 #define LED1_ACTIVE (1)
146 #if MODULE_ST77XX
147 #define LCD_DC GPIO4
148 #define LCD_CS GPIO5
149 #define LCD_RST GPIO8
150 #define LCD_BACKLIGHT GPIO9
152 #define ST77XX_PARAM_CNTRL ST77XX_CNTRL_ST7789
153 #define ST77XX_PARAM_CS LCD_CS
154 #define ST77XX_PARAM_DCX LCD_DC
155 #define ST77XX_PARAM_RST LCD_RST
156 #define ST77XX_PARAM_NUM_LINES 240
157 #define ST77XX_PARAM_RGB_CHANNELS 240
158 #define ST77XX_PARAM_ROTATION ST77XX_ROTATION_0
159 #define ST77XX_PARAM_INVERTED 1
160 #define ST77XX_PARAM_RGB 1
161 
162 #define BACKLIGHT_ON gpio_set(LCD_BACKLIGHT)
163 #define BACKLIGHT_OFF gpio_clear(LCD_BACKLIGHT)
164 #endif
173 #if (MODULE_SDCARD_SPI) || DOXYGEN
174 #define SDCARD_SPI_PARAM_SPI SPI_DEV(1)
175 #define SDCARD_SPI_PARAM_CS SPI1_CS0
176 #define SDCARD_SPI_PARAM_CLK SPI1_SCK
177 #define SDCARD_SPI_PARAM_MOSI SPI1_MOSI
178 #define SDCARD_SPI_PARAM_MISO SPI1_MISO
179 #define SDCARD_SPI_PARAM_POWER GPIO_UNDEF
180 #endif
183 /* include common board definitions as last step */
184 #include "board_common.h"
185 
186 #ifdef __cplusplus
187 extern "C" {
188 #endif
189 
190 #ifdef __cplusplus
191 } /* end extern "C" */
192 #endif
193