All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
board_common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 
23 #ifndef BOARD_COMMON_H
24 #define BOARD_COMMON_H
25 
26 #include <stdint.h>
27 
28 #include "cpu.h"
29 #include "periph_conf.h"
30 #if MODULE_ARDUINO
31 #include "arduino_pinmap.h"
32 #endif
33 
34 #include "periph/gpio.h"
35 #include "sdkconfig.h"
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
47 #if defined(LED0_PIN) || DOXYGEN
48 #define LED0_MASK (BIT(LED0_PIN))
49 #define LED0_ON (gpio_write(LED0_PIN, LED0_ACTIVE))
50 #define LED0_OFF (gpio_write(LED0_PIN, !LED0_ACTIVE))
51 #define LED0_TOGGLE (gpio_toggle(LED0_PIN))
52 #endif
53 
54 #if defined(LED1_PIN) || DOXYGEN
55 #define LED1_MASK (BIT(LED1_PIN))
56 #define LED1_ON (gpio_write(LED1_PIN, LED1_ACTIVE))
57 #define LED1_OFF (gpio_write(LED1_PIN, !LED1_ACTIVE))
58 #define LED1_TOGGLE (gpio_toggle(LED1_PIN))
59 #endif
60 
61 #if defined(LED2_PIN) || DOXYGEN
62 #define LED2_MASK (BIT(LED2_PIN))
63 #define LED2_ON (gpio_write(LED2_PIN, LED2_ACTIVE))
64 #define LED2_OFF (gpio_write(LED2_PIN, !LED2_ACTIVE))
65 #define LED2_TOGGLE (gpio_toggle(LED2_PIN))
66 #endif
74 #ifndef STDIO_UART_BAUDRATE
75 #define STDIO_UART_BAUDRATE (115200)
76 #endif
79 #if MODULE_MTD || DOXYGEN
98 #ifndef SPI_FLASH_DRIVE_START
99 #define SPI_FLASH_DRIVE_START 0
100 #endif
101 
102 #define MTD_0 mtd_dev_get(0)
104 #if MODULE_MTD_SDCARD_DEFAULT || DOXYGEN
105 #define MTD_1 mtd_dev_get(1)
106 #elif MODULE_MTD_SDMMC_DEFAULT
107 #define MTD_1 mtd_dev_get(1)
108 #endif /* MODULE_MTD_SDCARD_DEFAULT || DOXYGEN */
109 
116 #ifndef CONFIG_SDCARD_GENERIC_MTD_OFFSET
117 #define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1
118 #endif
119 
126 #ifndef CONFIG_SDMMC_GENERIC_MTD_OFFSET
127 #define CONFIG_SDMMC_GENERIC_MTD_OFFSET 1
128 #endif
129 
131 #endif /* MODULE_MTD || DOXYGEN */
132 
137 
138 #ifdef __cplusplus
139 } /* end extern "C" */
140 #endif
141 
142 #endif /* BOARD_COMMON_H */
Compatibility wrapper for arduino_iomap.h.
Low-level GPIO peripheral driver interface definitions.
void print_board_config(void)
Print the board configuration in a human readable format.