Loading...
Searching...
No Matches
openwsn_uart.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Hamburg University of Applied Sciences
3 * 2020 Inria
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser
6 * General Public License v2.1. See the file LICENSE in the top level
7 * directory for more details.
8 */
9
26#ifndef OPENWSN_UART_H
27#define OPENWSN_UART_H
28
29#include "stdint.h"
30#include "board.h"
31#include "periph_conf.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
43#ifndef STDIO_UART_DEV
44#define STDIO_UART_DEV (UART_DEV(0))
45#endif
53#ifndef OPENWSN_UART_DEV
54#ifdef MODULE_STDIO_NULL
55#define OPENWSN_UART_DEV (STDIO_UART_DEV)
56#else
57#define OPENWSN_UART_DEV ((STDIO_UART_DEV + 1) % UART_NUMOF)
58#endif
59#endif
60
64#ifndef OPENWSN_UART_BAUDRATE
65#ifndef STDIO_UART_BAUDRATE
66#define OPENWSN_UART_BAUDRATE (115200U)
67#else
68#define OPENWSN_UART_BAUDRATE (STDIO_UART_BAUDRATE)
69#endif
70#endif
71
80
84typedef void (*uart_tx_cbt)(void);
85
89typedef void (*uart_rx_cbt)(void);
90
95
103void uart_setCTS(bool state);
104
108void uart_writeByte(uint8_t byteToWrite);
109
116uint8_t uart_readByte(void);
117
122
127
132
137
138#ifdef __cplusplus
139}
140#endif
141
142#endif /* OPENWSN_UART_H */
void uart_disableInterrupts(void)
Unused in RIOT, needs to be defined for OpenWSN.
void uart_enableInterrupts(void)
Unused in RIOT, needs to be defined for OpenWSN.
void uart_writeByte(uint8_t byteToWrite)
Write a single byte to the configured OpenWSN uart.
void uart_setCallbacks(uart_tx_cbt txCb, uart_rx_cbt rxCb)
OpenWSN uart tx callback type.
uint8_t uart_readByte(void)
Reads a single byte received through uart.
void uart_setCTS(bool state)
Sets software flow control CTS.
void uart_init_openwsn(void)
Initialize OpenWSN uart.
void(* uart_rx_cbt)(void)
OpenWSN uart rx callback type.
void uart_clearRxInterrupts(void)
Unused in RIOT, needs to be defined for OpenWSN.
void(* uart_tx_cbt)(void)
OpenWSN uart tx callback type.
void uart_clearTxInterrupts(void)
Unused in RIOT, needs to be defined for OpenWSN.