board.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2019 Inria
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
18 #include "cpu.h"
19 #include "periph_conf.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
29 #define BACKLIGHT_PIN GPIO_PIN(PORT_H, 11)
30 #define BACKLIGHT_MASK (1 << 11)
33 #define BACKLIGHT_ON (GPIOH->BSRR = BACKLIGHT_MASK)
35 #define BACKLIGHT_OFF (GPIOH->BSRR = (BACKLIGHT_MASK << 16))
37 #define BACKLIGHT_TOGGLE (GPIOH->ODR ^= BACKLIGHT_MASK)
53 #define LCD_SCREEN_WIDTH 240
54 #define LCD_SCREEN_HEIGHT 240
56 #define LCD_D0 GPIO_PIN(PORT_D, 14)
57 #define LCD_D1 GPIO_PIN(PORT_D, 15)
58 #define LCD_D2 GPIO_PIN(PORT_D, 0)
59 #define LCD_D3 GPIO_PIN(PORT_D, 1)
60 #define LCD_D4 GPIO_PIN(PORT_E, 7)
61 #define LCD_D5 GPIO_PIN(PORT_E, 8)
62 #define LCD_D6 GPIO_PIN(PORT_E, 9)
63 #define LCD_D7 GPIO_PIN(PORT_E, 10)
64 #define LCD_D8 GPIO_PIN(PORT_E, 11)
65 #define LCD_D9 GPIO_PIN(PORT_E, 12)
66 #define LCD_D10 GPIO_PIN(PORT_E, 13)
67 #define LCD_D11 GPIO_PIN(PORT_E, 14)
68 #define LCD_D12 GPIO_PIN(PORT_E, 15)
69 #define LCD_D13 GPIO_PIN(PORT_D, 8)
70 #define LCD_D14 GPIO_PIN(PORT_D, 9)
71 #define LCD_D15 GPIO_PIN(PORT_D, 10)
72 #define LCD_TE GPIO_PIN(PORT_C, 8)
73 #define LCD_WE GPIO_PIN(PORT_D, 5)
74 #define LCD_OE GPIO_PIN(PORT_D, 4)
75 #define LCD_RS GPIO_PIN(PORT_F, 0)
76 #define LCD_NE GPIO_PIN(PORT_G, 9)
77 #define LCD_RST GPIO_PIN(PORT_H, 7)
78 #define LCD_BACKLIGHT BACKLIGHT_PIN
80 #define ST77XX_PARAM_CNTRL ST77XX_CNTRL_ST7789
81 #define ST77XX_PARAM_SPI SPI_UNDEF
82 #define ST77XX_PARAM_D0 LCD_D0
83 #define ST77XX_PARAM_D1 LCD_D1
84 #define ST77XX_PARAM_D2 LCD_D2
85 #define ST77XX_PARAM_D3 LCD_D3
86 #define ST77XX_PARAM_D4 LCD_D4
87 #define ST77XX_PARAM_D5 LCD_D5
88 #define ST77XX_PARAM_D6 LCD_D6
89 #define ST77XX_PARAM_D7 LCD_D7
90 #define ST77XX_PARAM_D8 LCD_D8
91 #define ST77XX_PARAM_D9 LCD_D9
92 #define ST77XX_PARAM_D10 LCD_D10
93 #define ST77XX_PARAM_D11 LCD_D11
94 #define ST77XX_PARAM_D12 LCD_D12
95 #define ST77XX_PARAM_D13 LCD_D13
96 #define ST77XX_PARAM_D14 LCD_D14
97 #define ST77XX_PARAM_D15 LCD_D15
98 #define ST77XX_PARAM_WRX LCD_WE
99 #define ST77XX_PARAM_RDX LCD_OE
100 #define ST77XX_PARAM_DCX LCD_RS
101 #define ST77XX_PARAM_RST LCD_RST
102 #define ST77XX_PARAM_CS LCD_NE
103 #define ST77XX_PARAM_RGB 1
104 #define ST77XX_PARAM_INVERTED 1
105 #define ST77XX_PARAM_ROTATION ST77XX_ROTATION_90
106 #define ST77XX_PARAM_OFFSET_X 80
107 #define ST77XX_PARAM_NUM_LINES LCD_SCREEN_HEIGHT
108 #define ST77XX_PARAM_RGB_CHANNELS LCD_SCREEN_WIDTH
115 #define LED0_PIN_NUM 5
116 #define LED0_PORT GPIO_PORT_A
117 #define LED0_PORT_NUM PORT_A
118 
119 #define LED1_PIN_NUM 7
120 #define LED1_PORT GPIO_PORT_A
121 #define LED1_PORT_NUM PORT_A
122 
123 #define LED2_PIN_NUM 1
124 #define LED2_PORT GPIO_PORT_B
125 #define LED2_PORT_NUM PORT_B
132 #define BTN0_PIN GPIO_PIN(PORT_A, 0)
133 #define BTN0_MODE GPIO_IN
140 #define FT5X06_PARAM_I2C_DEV I2C_DEV(1)
141 #define FT5X06_PARAM_INT_PIN GPIO_PIN(PORT_I, 9)
142 #define FT5X06_PARAM_XMAX (240)
143 #define FT5X06_PARAM_YMAX (240)
144 #define FT5X06_PARAM_XYCONV FT5X06_NO_CONV
145 #define FT5X06_PARAM_TYPE FT5X06_TYPE_FT6X06
148 #ifdef __cplusplus
149 }
150 #endif
151 
152 #include "stm32_leds.h"
153 
Peripheral MCU configuration for the Zigduino board.
Common LED macros.