Loading...
Searching...
No Matches
openwsn_uart.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 HAW Hamburg
3 * SPDX-FileCopyrightText: 2020 Inria
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
24
25#include "stdint.h"
26#include "board.h"
27#include "periph_conf.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
39#ifndef STDIO_UART_DEV
40#define STDIO_UART_DEV (UART_DEV(0))
41#endif
49#ifndef OPENWSN_UART_DEV
50#ifdef MODULE_STDIO_NULL
51#define OPENWSN_UART_DEV (STDIO_UART_DEV)
52#else
53#define OPENWSN_UART_DEV ((STDIO_UART_DEV + 1) % UART_NUMOF)
54#endif
55#endif
56
60#ifndef OPENWSN_UART_BAUDRATE
61#ifndef STDIO_UART_BAUDRATE
62#define OPENWSN_UART_BAUDRATE (115200U)
63#else
64#define OPENWSN_UART_BAUDRATE (STDIO_UART_BAUDRATE)
65#endif
66#endif
67
76
80typedef void (*uart_tx_cbt)(void);
81
85typedef void (*uart_rx_cbt)(void);
86
91
99void uart_setCTS(bool state);
100
104void uart_writeByte(uint8_t byteToWrite);
105
112uint8_t uart_readByte(void);
113
118
123
128
133
134#ifdef __cplusplus
135}
136#endif
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.