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