Wirepas SDK
waps_uart.h File Reference

Detailed Description

Low level interface for WAPS. Used for transmitting and receiving data via UART.

Definition in file waps_uart.h.

Go to the source code of this file.

Functions

bool Waps_uart_init (new_frame_cb_f frame_cb, uint32_t baud, bool flow_ctrl, void *tx_buffer, void *rx_buffer)
 WAPS UART initialize, after this, WAPS UART is ready to transmit and receive serial data. More...
 
void Waps_uart_powerReset (void)
 Power config. Disable UART auto-powering on Sinks and LL Nodes. More...
 
bool Waps_uart_send (const void *buffer, uint32_t size)
 WAPS UART send, send a block of data via serial port Automatically applies SLIP encoding to data and appends CRC. More...
 
void Waps_uart_flush (void)
 Flush UART module TX buffer. Waits for operation (pend) to complete before returning. More...
 
void Waps_uart_setIrq (bool state)
 Set indication that something is pending. More...
 
void Waps_uart_AutoPowerOn (void)
 Enable automatic RX power. More...
 
void Waps_uart_AutoPowerOff (void)
 Disable automatic RX power. More...
 
void Waps_uart_keepPowerOn (void)
 Keep power on (receiver is receiving) More...
 
void Waps_uart_powerOff (void)
 Grafecully power down UART, if autopower-feature is used. More...
 
uint32_t Waps_uart_powerExec (void)
 Callback task for power manager. More...
 
void Waps_uart_clean (void)
 Clean waps from old data. More...
 

Function Documentation

◆ Waps_uart_AutoPowerOff()

void Waps_uart_AutoPowerOff ( void  )

Disable automatic RX power.

◆ Waps_uart_AutoPowerOn()

void Waps_uart_AutoPowerOn ( void  )

Enable automatic RX power.

◆ Waps_uart_clean()

void Waps_uart_clean ( void  )

Clean waps from old data.

◆ Waps_uart_flush()

void Waps_uart_flush ( void  )

Flush UART module TX buffer. Waits for operation (pend) to complete before returning.

◆ Waps_uart_init()

bool Waps_uart_init ( new_frame_cb_f  frame_cb,
uint32_t  baud,
bool  flow_ctrl,
void *  tx_buffer,
void *  rx_buffer 
)

WAPS UART initialize, after this, WAPS UART is ready to transmit and receive serial data.

Parameters
frame_cbMandatory callback for upper layer notification about a valid looking frame
baudBaudrate for communication
flow_ctrlIs flow control to be used or not
tx_bufferMemory block for transmissions
rx_bufferMemory block for receptions
Returns
True if successful, false otherwise

◆ Waps_uart_keepPowerOn()

void Waps_uart_keepPowerOn ( void  )

Keep power on (receiver is receiving)

◆ Waps_uart_powerExec()

uint32_t Waps_uart_powerExec ( void  )

Callback task for power manager.

◆ Waps_uart_powerOff()

void Waps_uart_powerOff ( void  )

Grafecully power down UART, if autopower-feature is used.

◆ Waps_uart_powerReset()

void Waps_uart_powerReset ( void  )

Power config. Disable UART auto-powering on Sinks and LL Nodes.

◆ Waps_uart_send()

bool Waps_uart_send ( const void *  buffer,
uint32_t  size 
)

WAPS UART send, send a block of data via serial port Automatically applies SLIP encoding to data and appends CRC.

Parameters
bufferPointer to memory block for transmit
sizeAmount of data in bytes to send

◆ Waps_uart_setIrq()

void Waps_uart_setIrq ( bool  state)

Set indication that something is pending.

Parameters
stateTrue means that something is pending, false that queues are empty
Note
This reflects only the WAPS frame buffers state, IRQ pin state is finally determined by the SPI interface itself