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