soft_uart_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 ML!PA Consulting GmbH
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 
19 #ifndef SOFT_UART_PARAMS_H
20 #define SOFT_UART_PARAMS_H
21 
22 #include "soft_uart.h"
23 #include "macros/units.h"
24 #include "kernel_defines.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #ifndef SOFT_UART_PARAM_RX
31 #define SOFT_UART_PARAM_RX GPIO_UNDEF
32 #endif
33 #ifndef SOFT_UART_PARAM_TX
34 #define SOFT_UART_PARAM_TX GPIO_UNDEF
35 #endif
36 #ifndef SOFT_UART_PARAM_TIMER_RX
37 #define SOFT_UART_PARAM_TIMER_RX (0)
38 #endif
39 #ifndef SOFT_UART_PARAM_TIMER_TX
40 #define SOFT_UART_PARAM_TIMER_TX (1)
41 #endif
42 #ifndef SOFT_UART_PARAM_FREQ
43 #define SOFT_UART_PARAM_FREQ MHZ(1)
44 #endif
45 #ifndef SOFT_UART_PARAM_FLAGS
46 #define SOFT_UART_PARAM_FLAGS (0)
47 #endif
48 
49 #ifndef SOFT_UART_PARAMS
50 #define SOFT_UART_PARAMS { .rx_pin = SOFT_UART_PARAM_RX, \
51  .tx_pin = SOFT_UART_PARAM_TX, \
52  .rx_timer = SOFT_UART_PARAM_TIMER_RX, \
53  .tx_timer = SOFT_UART_PARAM_TIMER_TX, \
54  .timer_freq = SOFT_UART_PARAM_FREQ, \
55  .flags = SOFT_UART_PARAM_FLAGS, \
56  }
57 #endif
58 
63  SOFT_UART_PARAMS,
64 };
65 
66 #define SOFT_UART_NUMOF ARRAY_SIZE(soft_uart_config)
67 
68 #ifdef __cplusplus
69 }
70 #endif
71 
72 #endif /* SOFT_UART_PARAMS_H */
73 
kernel_defines.h
Common macros and compiler attributes/pragmas configuration.
soft_uart_conf_t
Software UART port descriptor.
Definition: soft_uart.h:53
soft_uart_config
static const soft_uart_conf_t soft_uart_config[]
Sotware UART port descriptor array.
Definition: soft_uart_params.h:62
soft_uart.h
Software UART port descriptor definition.
units.h
Unit helper macros.