#include <stdint.h>
Go to the source code of this file.
|
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 () |
|
◆ UART_asyncReceive()
void UART_asyncReceive |
( |
uint8_t * |
rxBuf, |
|
|
uint16_t |
size, |
|
|
uint8_t |
terminate |
|
) |
| |
Receive character buffer. Do not block.
- Parameters
-
rxBuf | the character buffer to be received to |
size | the 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
-
txBuf | the character buffer to be transmitted |
size | the 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()
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
-
fsmclk | SMCLK frequency |
baudrate | UART 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
-
rxBuf | the character buffer to be received to |
size | the 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
-
txBuf | the character buffer to be transmitted |
size | the number of bytes to send |