WISP ERT (Client)  1.0.0
The WISP Extended Runtime (WISP side)
uart.h File Reference
#include <stdint.h>

Go to the source code of this file.

Functions

void UART_init (void)
 
void UART_initCustom (uint32_t fsmclk, uint32_t baudrate)
 
void UART_asyncSend (uint8_t *txBuf, uint16_t size)
 
void UART_send (uint8_t *txBuf, uint16_t size)
 
void UART_critSend (uint8_t *txBuf, uint16_t size)
 
uint8_t UART_isTxBusy ()
 
void UART_asyncReceive (uint8_t *rxBuf, uint16_t size, uint8_t terminate)
 
void UART_receive (uint8_t *rxBuf, uint16_t size, uint8_t terminate)
 
void UART_critReceive (uint8_t *rxBuf, uint16_t size, uint8_t terminate)
 
uint8_t UART_isRxBusy ()
 
uint8_t UART_isRxDone ()
 

Function Documentation

◆ UART_asyncReceive()

void UART_asyncReceive ( uint8_t *  rxBuf,
uint16_t  size,
uint8_t  terminate 
)

Receive character buffer. Do not block.

Parameters
rxBufthe character buffer to be received to
sizethe number of bytes to receive

◆ UART_asyncSend()

void UART_asyncSend ( uint8_t *  txBuf,
uint16_t  size 
)

Transmit the contents of the given character buffer. Do not block.

Parameters
txBufthe character buffer to be transmitted
sizethe number of bytes to send

◆ UART_critReceive()

void UART_critReceive ( uint8_t *  rxBuf,
uint16_t  size,
uint8_t  terminate 
)

Receive to the given character buffer. Block until complete, and use UART status register polling instead of interrupts.

◆ UART_critSend()

void UART_critSend ( uint8_t *  txBuf,
uint16_t  size 
)

Transmit the contents of the given character buffer. Block until complete, and use UART status register polling instead of interrupts.

◆ UART_init()

void UART_init ( void  )

Configure the eUSCI_A0 module in UART mode and prepare for UART transmission.

Todo:
Currently assumes an 8MHz SMCLK. Make robust to clock frequency changes by using 32k ACLK.

◆ UART_initCustom()

void UART_initCustom ( uint32_t  fsmclk,
uint32_t  baudrate 
)

Configure the eUSCI_A0 module in UART mode and prepare for UART transmission.

Parameters
fsmclkSMCLK frequency
baudrateUART baudrate to be set
Todo:
Currently assumes SMCLK. Make robust to clock frequency changes by using ACLK.

◆ UART_isRxBusy()

uint8_t UART_isRxBusy ( )

Return true if UART RX module is in the middle of an operation, false if not.

◆ UART_isRxDone()

uint8_t UART_isRxDone ( )

Return true if UART RX module is not in the middle of an operation (e.g. done), false if not.

Could be used in combination with UART_asyncReceive.

◆ UART_isTxBusy()

uint8_t UART_isTxBusy ( )

Return true if UART TX module is in the middle of an operation, false if not.

◆ UART_receive()

void UART_receive ( uint8_t *  rxBuf,
uint16_t  size,
uint8_t  terminate 
)

Receive character buffer. Block until complete.

Parameters
rxBufthe character buffer to be received to
sizethe number of bytes to receive

◆ UART_send()

void UART_send ( uint8_t *  txBuf,
uint16_t  size 
)

Transmit the contents of the given character buffer. Block until complete.

Parameters
txBufthe character buffer to be transmitted
sizethe number of bytes to send