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 
10 #pragma once
11 
28 #include "stdint.h"
29 #include "board.h"
30 #include "periph_conf.h"
31 
32 #ifdef __cplusplus
33 extern "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 
78 void uart_init_openwsn(void);
79 
83 typedef void (*uart_tx_cbt)(void);
84 
88 typedef void (*uart_rx_cbt)(void);
89 
94 
102 void uart_setCTS(bool state);
103 
107 void uart_writeByte(uint8_t byteToWrite);
108 
115 uint8_t uart_readByte(void);
116 
121 
126 
131 
136 
137 #ifdef __cplusplus
138 }
139 #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.
Definition: openwsn_uart.h:88
void uart_clearRxInterrupts(void)
Unused in RIOT, needs to be defined for OpenWSN.
void(* uart_tx_cbt)(void)
OpenWSN uart tx callback type.
Definition: openwsn_uart.h:83
void uart_clearTxInterrupts(void)
Unused in RIOT, needs to be defined for OpenWSN.