CC23x0R5DriverLibrary
|
Macros | |
#define | UART_INT_EOT (UART_IMSC_EOTIM) |
End Of Transmission Interrupt Mask. More... | |
#define | UART_INT_OE (UART_IMSC_OEIM) |
Overrun Error Interrupt Mask. More... | |
#define | UART_INT_BE (UART_IMSC_BEIM) |
Break Error Interrupt Mask. More... | |
#define | UART_INT_PE (UART_IMSC_PEIM) |
Parity Error Interrupt Mask. More... | |
#define | UART_INT_FE (UART_IMSC_FEIM) |
Framing Error Interrupt Mask. More... | |
#define | UART_INT_RT (UART_IMSC_RTIM) |
Receive Timeout Interrupt Mask. More... | |
#define | UART_INT_RX (UART_IMSC_RXIM) |
Receive Interrupt Mask. More... | |
#define | UART_INT_TX (UART_IMSC_TXIM) |
Transmit Interrupt Mask. More... | |
#define | UART_INT_CTS (UART_IMSC_CTSMIM) |
CTS Modem Interrupt Mask. More... | |
#define | UART_INT_TXDMADONE (UART_IMSC_TXDMADONEIM) |
Tx DMA done interrupt mask. More... | |
#define | UART_INT_RXDMADONE (UART_IMSC_RXDMADONEIM) |
Rx DMA done interrupt mask. More... | |
#define | UART_CONFIG_WLEN_MASK 0x00000060 |
Mask for extracting word length. More... | |
#define | UART_CONFIG_WLEN_8 0x00000060 |
8 bit data More... | |
#define | UART_CONFIG_WLEN_7 0x00000040 |
7 bit data More... | |
#define | UART_CONFIG_WLEN_6 0x00000020 |
6 bit data More... | |
#define | UART_CONFIG_WLEN_5 0x00000000 |
5 bit data More... | |
#define | UART_CONFIG_STOP_MASK 0x00000008 |
Mask for extracting stop bits. More... | |
#define | UART_CONFIG_STOP_ONE 0x00000000 |
One stop bit. More... | |
#define | UART_CONFIG_STOP_TWO 0x00000008 |
Two stop bits. More... | |
#define | UART_CONFIG_PAR_MASK 0x00000086 |
Mask for extracting parity. More... | |
#define | UART_CONFIG_PAR_NONE 0x00000000 |
No parity. More... | |
#define | UART_CONFIG_PAR_EVEN 0x00000006 |
Even parity. More... | |
#define | UART_CONFIG_PAR_ODD 0x00000002 |
Odd parity. More... | |
#define | UART_CONFIG_PAR_ONE 0x00000082 |
Parity bit is one. More... | |
#define | UART_CONFIG_PAR_ZERO 0x00000086 |
Parity bit is zero. More... | |
#define | UART_FIFO_TX2_8 0x00000001 |
Transmit interrupt at 1/4 Full. More... | |
#define | UART_FIFO_TX4_8 0x00000002 |
Transmit interrupt at 1/2 Full. More... | |
#define | UART_FIFO_TX6_8 0x00000003 |
Transmit interrupt at 3/4 Full. More... | |
#define | UART_FIFO_RX2_8 0x00000008 |
Receive interrupt at 1/4 Full. More... | |
#define | UART_FIFO_RX4_8 0x00000010 |
Receive interrupt at 1/2 Full. More... | |
#define | UART_FIFO_RX6_8 0x00000018 |
Receive interrupt at 3/4 Full. More... | |
#define | UART_DMA_ERR_RXSTOP 0x00000004 |
Stop DMA receive if UART error. More... | |
#define | UART_DMA_TX 0x00000002 |
Enable DMA for transmit. More... | |
#define | UART_DMA_RX 0x00000001 |
Enable DMA for receive. More... | |
#define | UART_RXERROR_OVERRUN 0x00000008 |
#define | UART_RXERROR_BREAK 0x00000004 |
#define | UART_RXERROR_PARITY 0x00000002 |
#define | UART_RXERROR_FRAMING 0x00000001 |
Functions | |
__STATIC_INLINE void | UARTSetFifoLevel (uint32_t base, uint32_t txLevel, uint32_t rxLevel) |
Sets the FIFO level at which interrupts are generated. More... | |
void | UARTConfigSetExpClk (uint32_t base, uint32_t UARTClkFreq, uint32_t baudFreq, uint32_t config) |
Sets the configuration of a UART. More... | |
void | UARTDisable (uint32_t base) |
Disables transmitting and receiving. More... | |
__STATIC_INLINE void | UARTEnableFifo (uint32_t base) |
Enables the transmit and receive FIFOs. More... | |
__STATIC_INLINE void | UARTDisableFIFO (uint32_t base) |
Disables the transmit and receive FIFOs. More... | |
__STATIC_INLINE bool | UARTCharAvailable (uint32_t base) |
Determines if there are any characters in the receive FIFO. More... | |
__STATIC_INLINE uint8_t | UARTGetCharNonBlocking (uint32_t base) |
Receives a character from the specified port. More... | |
uint8_t | UARTGetChar (uint32_t base) |
Waits for a character from the specified port. More... | |
__STATIC_INLINE bool | UARTSpaceAvailable (uint32_t base) |
Determines if there is any space in the transmit FIFO. More... | |
__STATIC_INLINE void | UARTPutCharNonBlocking (uint32_t base, uint8_t data) |
Sends a character to the specified port. More... | |
void | UARTPutChar (uint32_t base, uint8_t data) |
Waits to send a character to the specified port. More... | |
__STATIC_INLINE bool | UARTBusy (uint32_t base) |
Determines whether the UART transmitter is busy or not. More... | |
__STATIC_INLINE void | UARTEnableInt (uint32_t base, uint32_t intFlags) |
Enables individual UART interrupt sources. More... | |
__STATIC_INLINE void | UARTDisableInt (uint32_t base, uint32_t intFlags) |
Disables individual UART interrupt sources. More... | |
__STATIC_INLINE uint32_t | UARTIntStatus (uint32_t base, bool masked) |
Gets the current interrupt status. More... | |
__STATIC_INLINE void | UARTClearInt (uint32_t base, uint32_t intFlags) |
Clears UART interrupt sources. More... | |
__STATIC_INLINE void | UARTEnableDMA (uint32_t base, uint32_t dmaFlags) |
Enable UART DMA operation. More... | |
__STATIC_INLINE void | UARTDisableDMA (uint32_t base, uint32_t dmaFlags) |
Disable UART DMA operation. More... | |
__STATIC_INLINE uint32_t | UARTGetRxError (uint32_t base) |
Gets current receiver errors. More... | |
__STATIC_INLINE void | UARTClearRxError (uint32_t base) |
Clears all reported receiver errors. More... | |
__STATIC_INLINE void | UARTEnableCTS (uint32_t base) |
Enable CTS flow control. More... | |
__STATIC_INLINE void | UARTEnableRTS (uint32_t base) |
Enable RTS flow control. More... | |
__STATIC_INLINE void | UARTDisableCTS (uint32_t base) |
Disable CTS flow control. More... | |
__STATIC_INLINE void | UARTDisableRTS (uint32_t base) |
Disable RTS flow control. More... | |
#define UART_INT_EOT (UART_IMSC_EOTIM) |
End Of Transmission Interrupt Mask.
#define UART_INT_OE (UART_IMSC_OEIM) |
Overrun Error Interrupt Mask.
#define UART_INT_BE (UART_IMSC_BEIM) |
Break Error Interrupt Mask.
#define UART_INT_PE (UART_IMSC_PEIM) |
Parity Error Interrupt Mask.
#define UART_INT_FE (UART_IMSC_FEIM) |
Framing Error Interrupt Mask.
#define UART_INT_RT (UART_IMSC_RTIM) |
Receive Timeout Interrupt Mask.
#define UART_INT_RX (UART_IMSC_RXIM) |
Receive Interrupt Mask.
#define UART_INT_TX (UART_IMSC_TXIM) |
Transmit Interrupt Mask.
#define UART_INT_CTS (UART_IMSC_CTSMIM) |
CTS Modem Interrupt Mask.
#define UART_INT_TXDMADONE (UART_IMSC_TXDMADONEIM) |
Tx DMA done interrupt mask.
#define UART_INT_RXDMADONE (UART_IMSC_RXDMADONEIM) |
Rx DMA done interrupt mask.
#define UART_CONFIG_WLEN_MASK 0x00000060 |
Mask for extracting word length.
#define UART_CONFIG_WLEN_8 0x00000060 |
8 bit data
#define UART_CONFIG_WLEN_7 0x00000040 |
7 bit data
#define UART_CONFIG_WLEN_6 0x00000020 |
6 bit data
#define UART_CONFIG_WLEN_5 0x00000000 |
5 bit data
#define UART_CONFIG_STOP_MASK 0x00000008 |
Mask for extracting stop bits.
#define UART_CONFIG_STOP_ONE 0x00000000 |
One stop bit.
#define UART_CONFIG_STOP_TWO 0x00000008 |
Two stop bits.
#define UART_CONFIG_PAR_MASK 0x00000086 |
Mask for extracting parity.
#define UART_CONFIG_PAR_NONE 0x00000000 |
No parity.
#define UART_CONFIG_PAR_EVEN 0x00000006 |
Even parity.
#define UART_CONFIG_PAR_ODD 0x00000002 |
Odd parity.
#define UART_CONFIG_PAR_ONE 0x00000082 |
Parity bit is one.
#define UART_CONFIG_PAR_ZERO 0x00000086 |
Parity bit is zero.
#define UART_FIFO_TX2_8 0x00000001 |
Transmit interrupt at 1/4 Full.
Referenced by UARTSetFifoLevel().
#define UART_FIFO_TX4_8 0x00000002 |
Transmit interrupt at 1/2 Full.
Referenced by UARTSetFifoLevel().
#define UART_FIFO_TX6_8 0x00000003 |
Transmit interrupt at 3/4 Full.
Referenced by UARTSetFifoLevel().
#define UART_FIFO_RX2_8 0x00000008 |
Receive interrupt at 1/4 Full.
Referenced by UARTSetFifoLevel().
#define UART_FIFO_RX4_8 0x00000010 |
Receive interrupt at 1/2 Full.
Referenced by UARTSetFifoLevel().
#define UART_FIFO_RX6_8 0x00000018 |
Receive interrupt at 3/4 Full.
Referenced by UARTSetFifoLevel().
#define UART_DMA_ERR_RXSTOP 0x00000004 |
Stop DMA receive if UART error.
#define UART_DMA_TX 0x00000002 |
Enable DMA for transmit.
#define UART_DMA_RX 0x00000001 |
Enable DMA for receive.
#define UART_RXERROR_OVERRUN 0x00000008 |
#define UART_RXERROR_BREAK 0x00000004 |
#define UART_RXERROR_PARITY 0x00000002 |
#define UART_RXERROR_FRAMING 0x00000001 |
__STATIC_INLINE void UARTSetFifoLevel | ( | uint32_t | base, |
uint32_t | txLevel, | ||
uint32_t | rxLevel | ||
) |
Sets the FIFO level at which interrupts are generated.
This function sets the FIFO level at which transmit and receive interrupts are generated.
base | is the base address of the UART port. |
txLevel | is the transmit FIFO interrupt level, specified as one of: |
rxLevel | is the receive FIFO interrupt level, specified as one of: |
References ASSERT, HWREG, UART_FIFO_RX2_8, UART_FIFO_RX4_8, UART_FIFO_RX6_8, UART_FIFO_TX2_8, UART_FIFO_TX4_8, UART_FIFO_TX6_8, UART_O_IFLS, UARTConfigSetExpClk(), and UARTDisable().
void UARTConfigSetExpClk | ( | uint32_t | base, |
uint32_t | UARTClkFreq, | ||
uint32_t | baudFreq, | ||
uint32_t | config | ||
) |
Sets the configuration of a UART.
This function configures the UART for operation in the specified data format.
base | is the base address of the UART port. |
UARTClkFreq | is the rate of the clock supplied to the UART module. |
baudFreq | is the desired baud rate.
|
config | is the data format for the port. The parameter is the bitwise OR of three values:
|
References ASSERT, HWREG, UART_O_FBRD, UART_O_IBRD, UART_O_LCRH, and UARTDisable().
Referenced by UARTSetFifoLevel().
void UARTDisable | ( | uint32_t | base | ) |
Disables transmitting and receiving.
This function waits until all data in the TX FIFO has been transmitted, and then clears the UARTEN, TXE, and RXE bits, and disables the FIFO.
base | is the base address of the UART port. |
References HWREG, UART_CTL_RXE, UART_CTL_TXE, UART_CTL_UARTEN, UART_FR_BUSY, UART_LCRH_FEN, UART_O_CTL, UART_O_FR, and UART_O_LCRH.
Referenced by UARTConfigSetExpClk(), and UARTSetFifoLevel().
__STATIC_INLINE void UARTEnableFifo | ( | uint32_t | base | ) |
Enables the transmit and receive FIFOs.
This functions enables the transmit and receive FIFOs in the UART.
base | is the base address of the UART port. |
References HWREG, UART_LCRH_FEN, and UART_O_LCRH.
__STATIC_INLINE void UARTDisableFIFO | ( | uint32_t | base | ) |
Disables the transmit and receive FIFOs.
This functions disables the transmit and receive FIFOs in the UART.
base | is the base address of the UART port. |
References HWREG, UART_LCRH_FEN, and UART_O_LCRH.
__STATIC_INLINE bool UARTCharAvailable | ( | uint32_t | base | ) |
Determines if there are any characters in the receive FIFO.
This function returns a flag indicating whether or not there is data available in the receive FIFO.
base | is the base address of the UART port. |
true
: There is data in the receive FIFO.false
: There is no data in the receive FIFO. References HWREG, UART_FR_RXFE, and UART_O_FR.
__STATIC_INLINE uint8_t UARTGetCharNonBlocking | ( | uint32_t | base | ) |
Receives a character from the specified port.
This function gets a character from the receive FIFO for the specified port.
[in] | base | is the base address of the UART port. |
References HWREGB, UART_O_DR, and UARTGetChar().
uint8_t UARTGetChar | ( | uint32_t | base | ) |
Waits for a character from the specified port.
This function gets a character from the receive FIFO for the specified port. If there are no characters available, this function waits until a character is received before returning.
base | is the base address of the UART port. |
References HWREG, UART_FR_RXFE, UART_O_DR, and UART_O_FR.
Referenced by UARTGetCharNonBlocking().
__STATIC_INLINE bool UARTSpaceAvailable | ( | uint32_t | base | ) |
Determines if there is any space in the transmit FIFO.
This function returns a flag indicating whether or not there is space available in the transmit FIFO.
base | is the base address of the UART port. |
true
: There is space available in the transmit FIFO.false
: There is no space available in the transmit FIFO. References HWREG, UART_FR_TXFF, and UART_O_FR.
__STATIC_INLINE void UARTPutCharNonBlocking | ( | uint32_t | base, |
uint8_t | data | ||
) |
Sends a character to the specified port.
This function writes the character data
to the transmit FIFO for the specified port.
base | is the base address of the UART port. |
data | is the character to be transmitted. |
References HWREG, UART_O_DR, and UARTPutChar().
void UARTPutChar | ( | uint32_t | base, |
uint8_t | data | ||
) |
Waits to send a character to the specified port.
This function sends the character data
to the transmit FIFO for the specified port. If there is no space available in the transmit FIFO, this function waits until there is space available before returning.
base | is the base address of the UART port. |
data | is the character to be transmitted. |
References HWREG, UART_FR_TXFF, UART_O_DR, and UART_O_FR.
Referenced by UARTPutCharNonBlocking().
__STATIC_INLINE bool UARTBusy | ( | uint32_t | base | ) |
Determines whether the UART transmitter is busy or not.
Allows the caller to determine whether all transmitted bytes have cleared the transmitter hardware. If false
is returned, the transmit FIFO is empty and all bits of the last transmitted character, including all stop bits, have left the hardware shift register.
base | is the base address of the UART port. |
true
: UART is transmitting.false
: All transmissions are complete. References HWREG, UART_FR_BUSY, and UART_O_FR.
__STATIC_INLINE void UARTEnableInt | ( | uint32_t | base, |
uint32_t | intFlags | ||
) |
Enables individual UART interrupt sources.
This function enables the indicated UART interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
base | is the base address of the UART port. |
intFlags | is the bit mask of the interrupt sources to be enabled. The parameter is the bitwise OR of any of the following:
|
References HWREG, and UART_O_IMSC.
__STATIC_INLINE void UARTDisableInt | ( | uint32_t | base, |
uint32_t | intFlags | ||
) |
Disables individual UART interrupt sources.
This function disables the indicated UART interrupt sources. Only the sources that are enabled can be reflected to the processor interrupt; disabled sources have no effect on the processor.
base | is the base address of the UART port. |
intFlags | is the bit mask of the interrupt sources to be disabled.
|
References HWREG, and UART_O_IMSC.
__STATIC_INLINE uint32_t UARTIntStatus | ( | uint32_t | base, |
bool | masked | ||
) |
Gets the current interrupt status.
This function returns the interrupt status for the specified UART. Either the raw interrupt status or the status of interrupts that are allowed to reflect to the processor can be returned.
base | is the base address of the UART port. |
masked | selects either raw or masked interrupt.
|
References HWREG, UART_O_MIS, and UART_O_RIS.
__STATIC_INLINE void UARTClearInt | ( | uint32_t | base, |
uint32_t | intFlags | ||
) |
Clears UART interrupt sources.
The specified UART interrupt sources are cleared, so that they no longer assert. This function must be called in the interrupt handler to keep the interrupt from being recognized again immediately upon exit.
base | is the base address of the UART port. |
intFlags | is a bit mask of the interrupt sources to be cleared.
|
References HWREG, and UART_O_ICR.
__STATIC_INLINE void UARTEnableDMA | ( | uint32_t | base, |
uint32_t | dmaFlags | ||
) |
Enable UART DMA operation.
The specified UART DMA features are enabled. The UART can be configured to use DMA for transmit or receive, and to disable receive if an error occurs.
base | is the base address of the UART port. |
dmaFlags | is a bit mask of the DMA features to enable. The parameter is the bitwise OR of any of the following values:
|
References HWREG, and UART_O_DMACTL.
__STATIC_INLINE void UARTDisableDMA | ( | uint32_t | base, |
uint32_t | dmaFlags | ||
) |
Disable UART DMA operation.
This function is used to disable UART DMA features that were enabled by UARTEnableDMA(). The specified UART DMA features are disabled.
base | is the base address of the UART port. |
dmaFlags | is a bit mask of the DMA features to disable. The parameter is the bitwise OR of any of the following values:
|
References HWREG, and UART_O_DMACTL.
__STATIC_INLINE uint32_t UARTGetRxError | ( | uint32_t | base | ) |
Gets current receiver errors.
This function returns the current state of each of the 4 receiver error sources. The returned errors are equivalent to the four error bits returned via the previous call to UARTGetChar() or UARTGetCharNonBlocking() with the exception that the overrun error is set immediately the overrun occurs rather than when a character is next read.
base | is the base address of the UART port. |
References HWREG, and UART_O_RSR_ECR.
__STATIC_INLINE void UARTClearRxError | ( | uint32_t | base | ) |
Clears all reported receiver errors.
This function is used to clear all receiver error conditions reported via UARTGetRxError(). If using the overrun, framing error, parity error or break interrupts, this function must be called after clearing the interrupt to ensure that later errors of the same type trigger another interrupt.
base | is the base address of the UART port. |
References HWREG, and UART_O_RSR_ECR.
__STATIC_INLINE void UARTEnableCTS | ( | uint32_t | base | ) |
Enable CTS flow control.
Hardware flow control is disabled by default.
base | is the base address of the UART port. |
References HWREG, UART_CTL_CTSEN, and UART_O_CTL.
__STATIC_INLINE void UARTEnableRTS | ( | uint32_t | base | ) |
Enable RTS flow control.
Hardware flow control is disabled by default.
base | is the base address of the UART port. |
References HWREG, UART_CTL_RTSEN, and UART_O_CTL.
__STATIC_INLINE void UARTDisableCTS | ( | uint32_t | base | ) |
Disable CTS flow control.
Hardware flow control is disabled by default.
base | is the base address of the UART port. |
References HWREG, UART_CTL_CTSEN, and UART_O_CTL.
__STATIC_INLINE void UARTDisableRTS | ( | uint32_t | base | ) |
Disable RTS flow control.
Hardware flow control is disabled by default.
base | is the base address of the UART port. |
References HWREG, UART_CTL_RTSEN, and UART_O_CTL.