BSPACM  20150113
Board Support Package for ARM Cortex-M Microcontrollers
default_appconf.h
Go to the documentation of this file.
1 /* BSPACM - config header for generic EFM32 boards
2  *
3  * Written in 2014 by Peter A. Bigot <http://pabigot.github.io/bspacm/>
4  *
5  * To the extent possible under law, the author(s) have dedicated all
6  * copyright and related and neighboring rights to this software to
7  * the public domain worldwide. This software is distributed without
8  * any warranty.
9  *
10  * You should have received a copy of the CC0 Public Domain Dedication
11  * along with this software. If not, see
12  * <http://creativecommons.org/publicdomain/zero/1.0/>.
13  */
14 
33 #ifndef BSPACM_DEVICE_EFM32_BOARD_DEFAULT_APPCONF_H
34 #define BSPACM_DEVICE_EFM32_BOARD_DEFAULT_APPCONF_H
35 
36 /* Use USART1 as the default UART unless one of the defaults is
37  * explicitly configured. */
38 #if ! (defined(BSPACM_CONFIG_DEFAULT_USART0) \
39  || defined(BSPACM_CONFIG_DEFAULT_USART1) \
40  || defined(BSPACM_CONFIG_DEFAULT_USART2) \
41  || defined(BSPACM_CONFIG_DEFAULT_UART0) \
42  || defined(BSPACM_CONFIG_DEFAULT_UART1) \
43  || defined(BSPACM_CONFIG_DEFAULT_LEUART0) \
44  || defined(BSPACM_CONFIG_DEFAULT_LEUART1))
45 #define BSPACM_CONFIG_DEFAULT_USART1 1
46 #endif /* BSPACM_CONFIG_DEFAULT */
47 
48 /* Propagate to each supported peripheral. USART1 is the default
49  * UART, and is the only one implicitly enabled. */
50 #ifndef BSPACM_CONFIG_ENABLE_USART1
51 #define BSPACM_CONFIG_ENABLE_USART1 (BSPACM_CONFIG_DEFAULT_USART1 - 0)
52 #endif /* BSPACM_CONFIG_ENABLE_USART1 */
53 #ifndef BSPACM_CONFIG_ENABLE_UART0
54 #define BSPACM_CONFIG_ENABLE_UART0 (BSPACM_CONFIG_DEFAULT_UART0 - 0)
55 #endif /* BSPACM_CONFIG_ENABLE_UART0 */
56 #ifndef BSPACM_CONFIG_ENABLE_LEUART0
57 #define BSPACM_CONFIG_ENABLE_LEUART0 (BSPACM_CONFIG_DEFAULT_LEUART0 - 0)
58 #endif /* BSPACM_CONFIG_ENABLE_LEUART0 */
59 
60 /* Propagate default UART constants to USART1, UART0, and LEUART0, the
61  * three most likely candidates for the default UART. */
62 
63 #if defined(BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE)
64 #if (BSPACM_CONFIG_DEFAULT_USART1 - 0) && ! defined(BSPACM_PERIPH_USART1_TX_BUFFER_SIZE)
65 #define BSPACM_PERIPH_USART1_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
66 #elif (BSPACM_CONFIG_DEFAULT_UART0 - 0) && ! defined(BSPACM_PERIPH_UART0_TX_BUFFER_SIZE)
67 #define BSPACM_PERIPH_UART0_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
68 #elif (BSPACM_CONFIG_DEFAULT_LEUART0 - 0) && ! defined(BSPACM_PERIPH_LEUART0_TX_BUFFER_SIZE)
69 #define BSPACM_PERIPH_LEUART0_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
70 #endif /* select default UART */
71 #endif /* propagate default TX_BUFFER_SIZE */
72 
73 #if defined(BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE)
74 #if (BSPACM_CONFIG_DEFAULT_USART1 - 0) && ! defined(BSPACM_PERIPH_USART1_RX_BUFFER_SIZE)
75 #define BSPACM_PERIPH_USART1_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
76 #elif (BSPACM_CONFIG_DEFAULT_UART0 - 0) && ! defined(BSPACM_PERIPH_UART0_RX_BUFFER_SIZE)
77 #define BSPACM_PERIPH_UART0_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
78 #elif (BSPACM_CONFIG_DEFAULT_LEUART0 - 0) && ! defined(BSPACM_PERIPH_LEUART0_RX_BUFFER_SIZE)
79 #define BSPACM_PERIPH_LEUART0_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
80 #endif /* select default UART */
81 #endif /* propagate default TX_BUFFER_SIZE */
82 
83 #endif /* BSPACM_DEVICE_EFM32_BOARD_DEFAULT_APPCONF_H */