WISP ERT (Client)
1.0.0
The WISP Extended Runtime (WISP side)
|
UART module for transmitting/receiving data using the USCI_A0 peripheral. More...
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 () |
__interrupt void | USCI_A0_ISR (void) |
Variables | |
struct { | |
uint8_t isTxBusy | |
uint8_t * txPtr | |
uint16_t txBytesRemaining | |
uint8_t isRxBusy | |
uint8_t * rxPtr | |
uint16_t rxBytesRemaining | |
uint8_t rxTermChar | |
} | UART_SM |
UART module for transmitting/receiving data using the USCI_A0 peripheral.
void UART_asyncReceive | ( | uint8_t * | rxBuf, |
uint16_t | size, | ||
uint8_t | terminate | ||
) |
Receive character buffer. Do not block.
rxBuf | the character buffer to be received to |
size | the number of bytes to receive |
void UART_asyncSend | ( | uint8_t * | txBuf, |
uint16_t | size | ||
) |
Transmit the contents of the given character buffer. Do not block.
txBuf | the character buffer to be transmitted |
size | the number of bytes to send |
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.
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.
void UART_init | ( | void | ) |
Configure the eUSCI_A0 module in UART mode and prepare for UART transmission.
void UART_initCustom | ( | uint32_t | fsmclk, |
uint32_t | baudrate | ||
) |
Configure the eUSCI_A0 module in UART mode and prepare for UART transmission.
fsmclk | SMCLK frequency |
baudrate | UART baudrate to be set |
uint8_t UART_isRxBusy | ( | ) |
Return true if UART RX module is in the middle of an operation, false if not.
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.
uint8_t UART_isTxBusy | ( | ) |
Return true if UART TX module is in the middle of an operation, false if not.
void UART_receive | ( | uint8_t * | rxBuf, |
uint16_t | size, | ||
uint8_t | terminate | ||
) |
Receive character buffer. Block until complete.
rxBuf | the character buffer to be received to |
size | the number of bytes to receive |
void UART_send | ( | uint8_t * | txBuf, |
uint16_t | size | ||
) |
Transmit the contents of the given character buffer. Block until complete.
txBuf | the character buffer to be transmitted |
size | the number of bytes to send |
__interrupt void USCI_A0_ISR | ( | void | ) |
Handles transmit and receive interrupts for the UART module. Interrupts typically occur once after each byte transmitted/received.
uint8_t isRxBusy |
uint8_t isTxBusy |
uint16_t rxBytesRemaining |
uint8_t* rxPtr |
uint8_t rxTermChar |
uint16_t txBytesRemaining |
uint8_t* txPtr |
struct { ... } UART_SM |
State variables for the UART module