openwsn_uart.h File Reference

For details on the implementation check pkg/openwsn/doc.txt. More...

Detailed Description

For details on the implementation check pkg/openwsn/doc.txt.

RIOT adaption-specific definition of the "uart" bsp module.

Author
Thomas Watteyne watte.nosp@m.yne@.nosp@m.eecs..nosp@m.berk.nosp@m.eley..nosp@m.edu, February 2012
Peter Kietzmann peter.nosp@m..kie.nosp@m.tzman.nosp@m.n@ha.nosp@m.w-ham.nosp@m.burg.nosp@m..de, July 2018
Francisco Molina franc.nosp@m.ois-.nosp@m.xavie.nosp@m.r.mo.nosp@m.lina@.nosp@m.inri.nosp@m.a.fr

Definition in file openwsn_uart.h.

#include "stdint.h"
#include "board.h"
+ Include dependency graph for openwsn_uart.h:

Go to the source code of this file.

Macros

#define STDIO_UART_DEV   (UART_DEV(0))
 UART device to use for STDIO. More...
 
#define OPENWSN_UART_DEV   ((STDIO_UART_DEV + 1) % UART_NUMOF)
 OpenWSN default uart dev. More...
 
#define OPENWSN_UART_BAUDRATE   (115200U)
 OpenWSN uart baudrate.
 

Typedefs

typedef void(* uart_tx_cbt) (void)
 OpenWSN uart tx callback type.
 
typedef void(* uart_rx_cbt) (void)
 OpenWSN uart rx callback type.
 

Functions

void uart_init_openwsn (void)
 Initialize OpenWSN uart. More...
 
void uart_setCallbacks (uart_tx_cbt txCb, uart_rx_cbt rxCb)
 OpenWSN uart tx callback type.
 
void uart_setCTS (bool state)
 Sets software flow control CTS. More...
 
void uart_writeByte (uint8_t byteToWrite)
 Write a single byte to the configured OpenWSN uart.
 
uint8_t uart_readByte (void)
 Reads a single byte received through uart. More...
 
void uart_enableInterrupts (void)
 Unused in RIOT, needs to be defined for OpenWSN.
 
void uart_disableInterrupts (void)
 Unused in RIOT, needs to be defined for OpenWSN.
 
void uart_clearRxInterrupts (void)
 Unused in RIOT, needs to be defined for OpenWSN.
 
void uart_clearTxInterrupts (void)
 Unused in RIOT, needs to be defined for OpenWSN.
 

Macro Definition Documentation

◆ OPENWSN_UART_DEV

#define OPENWSN_UART_DEV   ((STDIO_UART_DEV + 1) % UART_NUMOF)

OpenWSN default uart dev.

Note
If only one UART is available that uart might collide with STDIO_UART_DEV, otherwise the next available UART will be used.

Definition at line 56 of file openwsn_uart.h.

◆ STDIO_UART_DEV

#define STDIO_UART_DEV   (UART_DEV(0))

UART device to use for STDIO.

Dont want to include the stdio header, so redefine the default value

Definition at line 43 of file openwsn_uart.h.

Function Documentation

◆ uart_init_openwsn()

void uart_init_openwsn ( void  )

Initialize OpenWSN uart.

This will initialize a uart device at STDIO_UART_BAUDRATE/8N1. It will also initialize a timer to set sw tx_isr.

◆ uart_readByte()

uint8_t uart_readByte ( void  )

Reads a single byte received through uart.

OpenWSN will call this thrpugh uart_rx_cbt.

◆ uart_setCTS()

void uart_setCTS ( bool  state)

Sets software flow control CTS.

This function sends XON or XOFF bytes to "set" or "unset" CTS by sw.

Parameters
[in]statetrue sets CTS, false clears CTS