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 
9 #pragma once
10 
19 /* not required when compiling ESP vendor code parts */
20 #ifndef ESP_PLATFORM
21 
22 #include <stdint.h>
23 
24 #include "cpu.h"
25 #include "periph_conf.h"
26 #include "periph_conf_common.h"
27 #include "periph/gpio.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
37 #ifdef LED0_PIN
38 #define LED0_MASK (BIT(LED0_PIN))
39 #define LED0_TOGGLE (gpio_toggle(LED0_PIN))
40 #define LED0_ON (gpio_write(LED0_PIN, LED0_ACTIVE))
41 #define LED0_OFF (gpio_write(LED0_PIN, !LED0_ACTIVE))
42 #endif
43 
44 #ifdef LED1_PIN
45 #define LED1_MASK (BIT(LED1_PIN))
46 #define LED1_TOGGLE (gpio_toggle(LED1_PIN))
47 #define LED1_ON (gpio_write(LED1_PIN, LED1_ACTIVE))
48 #define LED1_OFF (gpio_write(LED1_PIN, !LED1_ACTIVE))
49 #endif
50 
51 #ifdef LED2_PIN
52 #define LED2_MASK (BIT(LED2_PIN))
53 #define LED2_TOGGLE (gpio_toggle(LED2_PIN))
54 #define LED2_ON (gpio_write(LED2_PIN, LED2_ACTIVE))
55 #define LED2_OFF (gpio_write(LED2_PIN, !LED2_ACTIVE))
56 #endif
63 #ifndef STDIO_UART_BAUDRATE
64 #define STDIO_UART_BAUDRATE (115200)
65 #endif
68 #ifndef DOXYGEN
73 #if defined(MODULE_ESP_SW_TIMER)
74 #define XTIMER_BACKOFF (100U)
75 #define XTIMER_ISR_BACKOFF (100U)
76 #endif /* MODULE_ESP_SW_TIMER */
77 
79 #endif /* DOXYGEN */
80 
81 #if defined(MODULE_MTD) || defined(DOXYGEN)
91 #define MTD_0 mtd_dev_get(0)
92 
98 #ifndef CONFIG_SDCARD_GENERIC_MTD_OFFSET
99 #define CONFIG_SDCARD_GENERIC_MTD_OFFSET 1
100 #endif
101 
103 #endif /* defined(MODULE_MTD) || defined(DOXYGEN) */
104 
105 #if defined(MODULE_SPIFFS) || defined(DOXYGEN)
112 #define SPIFFS_ALIGNED_OBJECT_INDEX_TABLES 1
113 #define SPIFFS_READ_ONLY 0
114 #define SPIFFS_SINGLETON 0
115 #define SPIFFS_HAL_CALLBACK_EXTRA 1
116 #define SPIFFS_CACHE 1
118 #endif /* defined(MODULE_SPIFFS) || defined(DOXYGEN) */
119 
123 void board_print_config (void);
124 
125 #ifdef __cplusplus
126 } /* end extern "C" */
127 #endif
128 
129 /* include definitions for optional off-board hardware modules */
130 #include "board_modules.h"
131 
134 #endif /* ESP_PLATFORM */
Definitions for Wemos stackable hardware modules (shields)
void board_print_config(void)
Print the board configuration in a human readable format.
Low-level GPIO peripheral driver interface definitions.
Common peripheral configuration for the Particle Mesh.