board.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 Gunar Schorcht <gunar@schorcht.net>
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 
22 #include "board_common.h"
23 #include "periph/gpio.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #define BTN0_PIN GPIO_PIN(PORT_A, 8)
34 #define BTN0_MODE GPIO_IN
35 #define BTN0_INT_FLANK GPIO_RISING
42 #define LED0_PIN GPIO_PIN(PORT_C, 13)
43 #define LED0_MASK (1 << 13)
44 #define LED0_ON (GPIOC->BC = LED0_MASK)
45 #define LED0_OFF (GPIOC->BOP = LED0_MASK)
46 #define LED0_TOGGLE (GPIOC->OCTL ^= LED0_MASK)
47 
48 #define LED1_PIN GPIO_PIN(PORT_A, 1)
49 #define LED1_MASK (1 << 1)
50 #define LED1_ON (GPIOA->BC = LED1_MASK)
51 #define LED1_OFF (GPIOA->BOP = LED1_MASK)
52 #define LED1_TOGGLE (GPIOA->OCTL ^= LED1_MASK)
53 
54 #define LED2_PIN GPIO_PIN(PORT_A, 2)
55 #define LED2_MASK (1 << 2)
56 #define LED2_ON (GPIOA->BC = LED2_MASK)
57 #define LED2_OFF (GPIOA->BOP = LED2_MASK)
58 #define LED2_TOGGLE (GPIOA->OCTL ^= LED2_MASK)
59 
60 #define LED_RED_PIN LED0_PIN
61 #define LED_GREEN_PIN LED1_PIN
62 #define LED_BLUE_PIN LED2_PIN
69 #define MTD_0 mtd_dev_get(0)
76 #define SDCARD_SPI_PARAM_SPI SPI_DEV(0)
77 #define SDCARD_SPI_PARAM_CS GPIO_PIN(PORT_B, 12)
78 #define SDCARD_SPI_PARAM_CLK GPIO_PIN(PORT_B, 13)
79 #define SDCARD_SPI_PARAM_MISO GPIO_PIN(PORT_B, 14)
80 #define SDCARD_SPI_PARAM_MOSI GPIO_PIN(PORT_B, 15)
83 #if defined(MODULE_ST77XX) && defined(BOARD_SIPEED_LONGAN_NANO_TFT)
84 #define ST77XX_PARAM_SPI SPI_DEV(1)
85 #define ST77XX_PARAM_SPI_CLK SPI_CLK_5MHZ
86 #define ST77XX_PARAM_SPI_MODE SPI_MODE_0
87 #define ST77XX_PARAM_CS GPIO_PIN(PORT_B, 2)
88 #define ST77XX_PARAM_DCX GPIO_PIN(PORT_B, 0)
89 #define ST77XX_PARAM_RST GPIO_PIN(PORT_B, 1)
90 #define ST77XX_PARAM_RGB 0
91 #define ST77XX_PARAM_INVERTED 1
92 #define ST77XX_PARAM_NUM_LINES 160U
93 #define ST77XX_PARAM_RGB_CHANNELS 80U
94 #define ST77XX_PARAM_ROTATION ST77XX_ROTATION_270
95 #define ST77XX_PARAM_OFFSET_Y 25
96 #endif
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
Low-level GPIO peripheral driver interface definitions.