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
9#pragma once
10
20
21#include "board.h"
22#include "soft_uart.h"
23#include "macros/units.h"
24#include "kernel_defines.h"
25
26#ifdef __cplusplus
27extern "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
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:52
Unit helper macros.