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 TM4C 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_TM4C_BOARD_DEFAULT_APPCONF_H
34 #define BSPACM_DEVICE_TM4C_BOARD_DEFAULT_APPCONF_H
35 
36 /* Use UART0 as the default UART unless one of the defaults is
37  * explicitly configured. */
38 #if ! (defined(BSPACM_CONFIG_DEFAULT_UART0) \
39  || defined(BSPACM_CONFIG_DEFAULT_UART1) \
40  || defined(BSPACM_CONFIG_DEFAULT_UART2) \
41  || defined(BSPACM_CONFIG_DEFAULT_UART3) \
42  || defined(BSPACM_CONFIG_DEFAULT_UART4) \
43  || defined(BSPACM_CONFIG_DEFAULT_UART5) \
44  || defined(BSPACM_CONFIG_DEFAULT_UART6) \
45  || defined(BSPACM_CONFIG_DEFAULT_UART7))
46 #define BSPACM_CONFIG_DEFAULT_UART0 1
47 #endif /* BSPACM_CONFIG_DEFAULT */
48 
49 /* Propagate to each supported peripheral. USART1 is the default
50  * UART, and is the only one implicitly enabled. */
51 #ifndef BSPACM_CONFIG_ENABLE_UART0
52 #define BSPACM_CONFIG_ENABLE_UART0 (BSPACM_CONFIG_DEFAULT_UART0 - 0)
53 #endif /* BSPACM_CONFIG_ENABLE_UART0 */
54 #ifndef BSPACM_CONFIG_ENABLE_UART1
55 #define BSPACM_CONFIG_ENABLE_UART1 (BSPACM_CONFIG_DEFAULT_UART1 - 0)
56 #endif /* BSPACM_CONFIG_ENABLE_UART1 */
57 #ifndef BSPACM_CONFIG_ENABLE_UART2
58 #define BSPACM_CONFIG_ENABLE_UART2 (BSPACM_CONFIG_DEFAULT_UART2 - 0)
59 #endif /* BSPACM_CONFIG_ENABLE_UART2 */
60 #ifndef BSPACM_CONFIG_ENABLE_UART3
61 #define BSPACM_CONFIG_ENABLE_UART3 (BSPACM_CONFIG_DEFAULT_UART3 - 0)
62 #endif /* BSPACM_CONFIG_ENABLE_UART3 */
63 #ifndef BSPACM_CONFIG_ENABLE_UART4
64 #define BSPACM_CONFIG_ENABLE_UART4 (BSPACM_CONFIG_DEFAULT_UART4 - 0)
65 #endif /* BSPACM_CONFIG_ENABLE_UART4 */
66 #ifndef BSPACM_CONFIG_ENABLE_UART5
67 #define BSPACM_CONFIG_ENABLE_UART5 (BSPACM_CONFIG_DEFAULT_UART5 - 0)
68 #endif /* BSPACM_CONFIG_ENABLE_UART5 */
69 #ifndef BSPACM_CONFIG_ENABLE_UART6
70 #define BSPACM_CONFIG_ENABLE_UART6 (BSPACM_CONFIG_DEFAULT_UART6 - 0)
71 #endif /* BSPACM_CONFIG_ENABLE_UART6 */
72 #ifndef BSPACM_CONFIG_ENABLE_UART7
73 #define BSPACM_CONFIG_ENABLE_UART7 (BSPACM_CONFIG_DEFAULT_UART7 - 0)
74 #endif /* BSPACM_CONFIG_ENABLE_UART7 */
75 
76 /* Default enable BSPACM_CONFIG_ENABLE_UART if any specific UART is
77  * enabled. */
78 #ifndef BSPACM_CONFIG_ENABLE_UART
79 #define BSPACM_CONFIG_ENABLE_UART ((BSPACM_CONFIG_ENABLE_UART0 - 0) \
80  || (BSPACM_CONFIG_ENABLE_UART1 - 0) \
81  || (BSPACM_CONFIG_ENABLE_UART2 - 0) \
82  || (BSPACM_CONFIG_ENABLE_UART3 - 0) \
83  || (BSPACM_CONFIG_ENABLE_UART4 - 0) \
84  || (BSPACM_CONFIG_ENABLE_UART5 - 0) \
85  || (BSPACM_CONFIG_ENABLE_UART6 - 0) \
86  || (BSPACM_CONFIG_ENABLE_UART7 - 0))
87 #endif /* BSPACM_CONFIG_ENABLE_UART */
88 
89 /* Propagate default UART constants to UART0, UART1, etc. */
90 
91 #if defined(BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE)
92 #if (BSPACM_CONFIG_DEFAULT_UART0 - 0) && ! defined(BSPACM_PERIPH_UART0_TX_BUFFER_SIZE)
93 #define BSPACM_PERIPH_UART0_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
94 #elif (BSPACM_CONFIG_DEFAULT_UART1 - 0) && ! defined(BSPACM_PERIPH_UART1_TX_BUFFER_SIZE)
95 #define BSPACM_PERIPH_UART1_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
96 #elif (BSPACM_CONFIG_DEFAULT_UART2 - 0) && ! defined(BSPACM_PERIPH_UART2_TX_BUFFER_SIZE)
97 #define BSPACM_PERIPH_UART2_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
98 #elif (BSPACM_CONFIG_DEFAULT_UART3 - 0) && ! defined(BSPACM_PERIPH_UART3_TX_BUFFER_SIZE)
99 #define BSPACM_PERIPH_UART3_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
100 #elif (BSPACM_CONFIG_DEFAULT_UART4 - 0) && ! defined(BSPACM_PERIPH_UART4_TX_BUFFER_SIZE)
101 #define BSPACM_PERIPH_UART4_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
102 #elif (BSPACM_CONFIG_DEFAULT_UART5 - 0) && ! defined(BSPACM_PERIPH_UART5_TX_BUFFER_SIZE)
103 #define BSPACM_PERIPH_UART5_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
104 #elif (BSPACM_CONFIG_DEFAULT_UART6 - 0) && ! defined(BSPACM_PERIPH_UART6_TX_BUFFER_SIZE)
105 #define BSPACM_PERIPH_UART6_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
106 #elif (BSPACM_CONFIG_DEFAULT_UART7 - 0) && ! defined(BSPACM_PERIPH_UART7_TX_BUFFER_SIZE)
107 #define BSPACM_PERIPH_UART7_TX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_TX_BUFFER_SIZE
108 #endif /* select default UART */
109 #endif /* propagate default TX_BUFFER_SIZE */
110 
111 #if defined(BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE)
112 #if (BSPACM_CONFIG_DEFAULT_UART0 - 0) && ! defined(BSPACM_PERIPH_UART0_RX_BUFFER_SIZE)
113 #define BSPACM_PERIPH_UART0_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
114 #elif (BSPACM_CONFIG_DEFAULT_UART1 - 0) && ! defined(BSPACM_PERIPH_UART1_RX_BUFFER_SIZE)
115 #define BSPACM_PERIPH_UART1_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
116 #elif (BSPACM_CONFIG_DEFAULT_UART2 - 0) && ! defined(BSPACM_PERIPH_UART2_RX_BUFFER_SIZE)
117 #define BSPACM_PERIPH_UART2_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
118 #elif (BSPACM_CONFIG_DEFAULT_UART3 - 0) && ! defined(BSPACM_PERIPH_UART3_RX_BUFFER_SIZE)
119 #define BSPACM_PERIPH_UART3_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
120 #elif (BSPACM_CONFIG_DEFAULT_UART4 - 0) && ! defined(BSPACM_PERIPH_UART4_RX_BUFFER_SIZE)
121 #define BSPACM_PERIPH_UART4_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
122 #elif (BSPACM_CONFIG_DEFAULT_UART5 - 0) && ! defined(BSPACM_PERIPH_UART5_RX_BUFFER_SIZE)
123 #define BSPACM_PERIPH_UART5_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
124 #elif (BSPACM_CONFIG_DEFAULT_UART6 - 0) && ! defined(BSPACM_PERIPH_UART6_RX_BUFFER_SIZE)
125 #define BSPACM_PERIPH_UART6_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
126 #elif (BSPACM_CONFIG_DEFAULT_UART7 - 0) && ! defined(BSPACM_PERIPH_UART7_RX_BUFFER_SIZE)
127 #define BSPACM_PERIPH_UART7_RX_BUFFER_SIZE BSPACM_CONFIG_DEFAULT_UART_RX_BUFFER_SIZE
128 #endif /* select default UART */
129 #endif /* propagate default RX_BUFFER_SIZE */
130 
131 
132 #endif /* BSPACM_DEVICE_TM4C_BOARD_DEFAULT_APPCONF_H */