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 
9 #pragma once
10 
24 #include <stdint.h>
25 
37 #define BTN0_PIN GPIO0
38 
42 #define BTN0_MODE GPIO_IN_PU
43 
47 #ifndef BTN0_INT_FLANK
48 #define BTN0_INT_FLANK GPIO_FALLING
49 #endif
50 
54 #define BUTTON0_PIN BTN0_PIN
55 
61 #define BTN1_PIN GPIO14
62 
66 #define BTN1_MODE GPIO_IN_PU
67 
71 #ifndef BTN1_INT_FLANK
72 #define BTN1_INT_FLANK GPIO_FALLING
73 #endif
74 
78 #define BUTTON1_PIN BTN1_PIN
79 
85 #define BTN2_PIN GPIO11
86 
90 #define BTN2_MODE GPIO_IN_PU
91 
95 #ifndef BTN2_INT_FLANK
96 #define BTN2_INT_FLANK GPIO_FALLING
97 #endif
98 
102 #define BUTTON2_PIN BTN2_PIN
103 
109 #define BTN3_PIN GPIO10
110 
114 #define BTN3_MODE GPIO_IN_PU
115 
119 #ifndef BTN3_INT_FLANK
120 #define BTN3_INT_FLANK GPIO_FALLING
121 #endif
122 
126 #define BUTTON3_PIN BTN3_PIN
127 
136 #define LED0_PIN GPIO15
137 #define LED0_ACTIVE (1)
139 #define LED1_PIN GPIO16
140 #define LED1_ACTIVE (1)
149 #if MODULE_ST77XX
150 #define LCD_DC GPIO4
151 #define LCD_CS GPIO5
152 #define LCD_RST GPIO8
153 #define LCD_BACKLIGHT GPIO9
155 #define ST77XX_PARAM_CNTRL ST77XX_CNTRL_ST7789
156 #define ST77XX_PARAM_CS LCD_CS
157 #define ST77XX_PARAM_DCX LCD_DC
158 #define ST77XX_PARAM_RST LCD_RST
159 #define ST77XX_PARAM_NUM_LINES 240
160 #define ST77XX_PARAM_RGB_CHANNELS 240
161 #define ST77XX_PARAM_ROTATION ST77XX_ROTATION_0
162 #define ST77XX_PARAM_INVERTED 1
163 #define ST77XX_PARAM_RGB 1
164 
165 #define BACKLIGHT_ON gpio_set(LCD_BACKLIGHT)
166 #define BACKLIGHT_OFF gpio_clear(LCD_BACKLIGHT)
167 #endif
176 #if (MODULE_SDCARD_SPI) || DOXYGEN
177 #define SDCARD_SPI_PARAM_SPI SPI_DEV(1)
178 #define SDCARD_SPI_PARAM_CS SPI1_CS0
179 #define SDCARD_SPI_PARAM_CLK SPI1_SCK
180 #define SDCARD_SPI_PARAM_MOSI SPI1_MOSI
181 #define SDCARD_SPI_PARAM_MISO SPI1_MISO
182 #define SDCARD_SPI_PARAM_POWER GPIO_UNDEF
183 #endif
186 /* include common board definitions as last step */
187 #include "board_common.h"
188 
189 #ifdef __cplusplus
190 extern "C" {
191 #endif
192 
193 #ifdef __cplusplus
194 } /* end extern "C" */
195 #endif
196