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
32#ifdef __cplusplus
33extern "C" {
34#endif
35
42#ifndef STDIO_UART_DEV
43#define STDIO_UART_DEV (UART_DEV(0))
44#endif
52#ifndef OPENWSN_UART_DEV
53#ifdef MODULE_STDIO_NULL
54#define OPENWSN_UART_DEV (STDIO_UART_DEV)
55#else
56#define OPENWSN_UART_DEV ((STDIO_UART_DEV + 1) % UART_NUMOF)
57#endif
58#endif
59
63#ifndef OPENWSN_UART_BAUDRATE
64#ifndef STDIO_UART_BAUDRATE
65#define OPENWSN_UART_BAUDRATE (115200U)
66#else
67#define OPENWSN_UART_BAUDRATE (STDIO_UART_BAUDRATE)
68#endif
69#endif
70
79
83typedef void (*uart_tx_cbt)(void);
84
88typedef void (*uart_rx_cbt)(void);
89
94
102void uart_setCTS(bool state);
103
107void uart_writeByte(uint8_t byteToWrite);
108
115uint8_t uart_readByte(void);
116
121
126
131
136
137#ifdef __cplusplus
138}
139#endif
140
141#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.