board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Gunar Schorcht
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
22 #ifndef BOARD_H
23 #define BOARD_H
24 
25 #include <stdint.h>
26 
38 #define BTN0_PIN GPIO0
39 
43 #define BTN0_MODE GPIO_IN_PU
44 
48 #ifndef BTN0_INT_FLANK
49 #define BTN0_INT_FLANK GPIO_FALLING
50 #endif
51 
55 #define BUTTON0_PIN BTN0_PIN
56 
62 #define BTN1_PIN GPIO14
63 
67 #define BTN1_MODE GPIO_IN_PU
68 
72 #ifndef BTN1_INT_FLANK
73 #define BTN1_INT_FLANK GPIO_FALLING
74 #endif
75 
79 #define BUTTON1_PIN BTN1_PIN
80 
86 #define BTN2_PIN GPIO11
87 
91 #define BTN2_MODE GPIO_IN_PU
92 
96 #ifndef BTN2_INT_FLANK
97 #define BTN2_INT_FLANK GPIO_FALLING
98 #endif
99 
103 #define BUTTON2_PIN BTN2_PIN
104 
110 #define BTN3_PIN GPIO10
111 
115 #define BTN3_MODE GPIO_IN_PU
116 
120 #ifndef BTN3_INT_FLANK
121 #define BTN3_INT_FLANK GPIO_FALLING
122 #endif
123 
127 #define BUTTON3_PIN BTN3_PIN
128 
137 #define LED0_PIN GPIO15
138 #define LED0_ACTIVE (1)
140 #define LED1_PIN GPIO16
141 #define LED1_ACTIVE (1)
150 #if MODULE_ST77XX
151 #define LCD_DC GPIO4
152 #define LCD_CS GPIO5
153 #define LCD_RST GPIO8
154 #define LCD_BACKLIGHT GPIO9
156 #define ST77XX_PARAM_CNTRL ST77XX_CNTRL_ST7789
157 #define ST77XX_PARAM_CS LCD_CS
158 #define ST77XX_PARAM_DCX LCD_DC
159 #define ST77XX_PARAM_RST LCD_RST
160 #define ST77XX_PARAM_NUM_LINES 240
161 #define ST77XX_PARAM_RGB_CHANNELS 240
162 #define ST77XX_PARAM_ROTATION ST77XX_ROTATION_0
163 #define ST77XX_PARAM_INVERTED 1
164 #define ST77XX_PARAM_RGB 1
165 
166 #define BACKLIGHT_ON gpio_set(LCD_BACKLIGHT)
167 #define BACKLIGHT_OFF gpio_clear(LCD_BACKLIGHT)
168 #endif
177 #if (MODULE_SDCARD_SPI) || DOXYGEN
178 #define SDCARD_SPI_PARAM_SPI SPI_DEV(1)
179 #define SDCARD_SPI_PARAM_CS SPI1_CS0
180 #define SDCARD_SPI_PARAM_CLK SPI1_SCK
181 #define SDCARD_SPI_PARAM_MOSI SPI1_MOSI
182 #define SDCARD_SPI_PARAM_MISO SPI1_MISO
183 #define SDCARD_SPI_PARAM_POWER GPIO_UNDEF
184 #endif
187 /* include common board definitions as last step */
188 #include "board_common.h"
189 
190 #ifdef __cplusplus
191 extern "C" {
192 #endif
193 
194 #ifdef __cplusplus
195 } /* end extern "C" */
196 #endif
197 
198 #endif /* BOARD_H */