2020-06-18 16:40:46 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 ML!PA Consulting GmbH
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU Lesser
|
|
|
|
* General Public License v2.1. See the file LICENSE in the top level
|
|
|
|
* directory for more details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @ingroup drivers_soft_uart
|
|
|
|
* @{
|
|
|
|
*
|
|
|
|
* @file
|
|
|
|
* @brief Software UART configuration
|
|
|
|
*
|
2021-04-26 17:15:17 +02:00
|
|
|
* @author Benjamin Valentin <benjamin.valentin@ml-pa.com>
|
2020-06-18 16:40:46 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef SOFT_UART_PARAMS_H
|
|
|
|
#define SOFT_UART_PARAMS_H
|
|
|
|
|
2023-11-23 13:33:55 +01:00
|
|
|
#include "board.h"
|
2020-06-18 16:40:46 +02:00
|
|
|
#include "soft_uart.h"
|
|
|
|
#include "macros/units.h"
|
2020-10-21 17:25:21 +02:00
|
|
|
#include "kernel_defines.h"
|
2020-06-18 16:40:46 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SOFT_UART_PARAM_RX
|
|
|
|
#define SOFT_UART_PARAM_RX GPIO_UNDEF
|
|
|
|
#endif
|
|
|
|
#ifndef SOFT_UART_PARAM_TX
|
|
|
|
#define SOFT_UART_PARAM_TX GPIO_UNDEF
|
|
|
|
#endif
|
|
|
|
#ifndef SOFT_UART_PARAM_TIMER_RX
|
|
|
|
#define SOFT_UART_PARAM_TIMER_RX (0)
|
|
|
|
#endif
|
|
|
|
#ifndef SOFT_UART_PARAM_TIMER_TX
|
|
|
|
#define SOFT_UART_PARAM_TIMER_TX (1)
|
|
|
|
#endif
|
|
|
|
#ifndef SOFT_UART_PARAM_FREQ
|
|
|
|
#define SOFT_UART_PARAM_FREQ MHZ(1)
|
|
|
|
#endif
|
2020-06-23 17:52:25 +02:00
|
|
|
#ifndef SOFT_UART_PARAM_FLAGS
|
|
|
|
#define SOFT_UART_PARAM_FLAGS (0)
|
|
|
|
#endif
|
2020-06-18 16:40:46 +02:00
|
|
|
|
|
|
|
#ifndef SOFT_UART_PARAMS
|
|
|
|
#define SOFT_UART_PARAMS { .rx_pin = SOFT_UART_PARAM_RX, \
|
|
|
|
.tx_pin = SOFT_UART_PARAM_TX, \
|
|
|
|
.rx_timer = SOFT_UART_PARAM_TIMER_RX, \
|
|
|
|
.tx_timer = SOFT_UART_PARAM_TIMER_TX, \
|
2020-06-23 17:52:25 +02:00
|
|
|
.timer_freq = SOFT_UART_PARAM_FREQ, \
|
|
|
|
.flags = SOFT_UART_PARAM_FLAGS, \
|
|
|
|
}
|
2020-06-18 16:40:46 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sotware UART port descriptor array
|
|
|
|
*/
|
|
|
|
static const soft_uart_conf_t soft_uart_config[] = {
|
|
|
|
SOFT_UART_PARAMS,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SOFT_UART_NUMOF ARRAY_SIZE(soft_uart_config)
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* SOFT_UART_PARAMS_H */
|
|
|
|
/** @} */
|