CC26xx Driver Library
uart.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "../inc/hw_types.h"
#include "../inc/hw_uart.h"
#include "../inc/hw_memmap.h"
#include "../inc/hw_ints.h"
#include "interrupt.h"
#include "debug.h"

Macros

#define UART_INT_EOT   ( UART_IMSC_EOTIM )
 
#define UART_INT_OE   ( UART_IMSC_OEIM )
 
#define UART_INT_BE   ( UART_IMSC_BEIM )
 
#define UART_INT_PE   ( UART_IMSC_PEIM )
 
#define UART_INT_FE   ( UART_IMSC_FEIM )
 
#define UART_INT_RT   ( UART_IMSC_RTIM )
 
#define UART_INT_TX   ( UART_IMSC_TXIM )
 
#define UART_INT_RX   ( UART_IMSC_RXIM )
 
#define UART_INT_CTS   ( UART_IMSC_CTSMIM )
 
#define UART_CONFIG_WLEN_MASK   0x00000060
 
#define UART_CONFIG_WLEN_8   0x00000060
 
#define UART_CONFIG_WLEN_7   0x00000040
 
#define UART_CONFIG_WLEN_6   0x00000020
 
#define UART_CONFIG_WLEN_5   0x00000000
 
#define UART_CONFIG_STOP_MASK   0x00000008
 
#define UART_CONFIG_STOP_ONE   0x00000000
 
#define UART_CONFIG_STOP_TWO   0x00000008
 
#define UART_CONFIG_PAR_MASK   0x00000086
 
#define UART_CONFIG_PAR_NONE   0x00000000
 
#define UART_CONFIG_PAR_EVEN   0x00000006
 
#define UART_CONFIG_PAR_ODD   0x00000002
 
#define UART_CONFIG_PAR_ONE   0x00000082
 
#define UART_CONFIG_PAR_ZERO   0x00000086
 
#define UART_FIFO_TX1_8   0x00000000
 
#define UART_FIFO_TX2_8   0x00000001
 
#define UART_FIFO_TX4_8   0x00000002
 
#define UART_FIFO_TX6_8   0x00000003
 
#define UART_FIFO_TX7_8   0x00000004
 
#define UART_FIFO_RX1_8   0x00000000
 
#define UART_FIFO_RX2_8   0x00000008
 
#define UART_FIFO_RX4_8   0x00000010
 
#define UART_FIFO_RX6_8   0x00000018
 
#define UART_FIFO_RX7_8   0x00000020
 
#define UART_DMA_ERR_RXSTOP   0x00000004
 
#define UART_DMA_TX   0x00000002
 
#define UART_DMA_RX   0x00000001
 
#define UART_RXERROR_OVERRUN   0x00000008
 
#define UART_RXERROR_BREAK   0x00000004
 
#define UART_RXERROR_PARITY   0x00000002
 
#define UART_RXERROR_FRAMING   0x00000001
 
#define UART_BUSY   0x00000001
 
#define UART_IDLE   0x00000000
 

Functions

static void UARTParityModeSet (uint32_t ui32Base, uint32_t ui32Parity)
 Sets the type of parity. More...
 
static uint32_t UARTParityModeGet (uint32_t ui32Base)
 Gets the type of parity currently being used. More...
 
static void UARTFIFOLevelSet (uint32_t ui32Base, uint32_t ui32TxLevel, uint32_t ui32RxLevel)
 Sets the FIFO level at which interrupts are generated. More...
 
void UARTFIFOLevelGet (uint32_t ui32Base, uint32_t *pui32TxLevel, uint32_t *pui32RxLevel)
 Gets the FIFO level at which interrupts are generated. More...
 
void UARTConfigSetExpClk (uint32_t ui32Base, uint32_t ui32UARTClk, uint32_t ui32Baud, uint32_t ui32Config)
 Sets the configuration of a UART. More...
 
void UARTConfigGetExpClk (uint32_t ui32Base, uint32_t ui32UARTClk, uint32_t *pui32Baud, uint32_t *pui32Config)
 Gets the current configuration of a UART. More...
 
static void UARTEnable (uint32_t ui32Base)
 Enables transmitting and receiving. More...
 
void UARTDisable (uint32_t ui32Base)
 Disables transmitting and receiving. More...
 
static void UARTFIFOEnable (uint32_t ui32Base)
 Enables the transmit and receive FIFOs. More...
 
static void UARTFIFODisable (uint32_t ui32Base)
 Disables the transmit and receive FIFOs. More...
 
static bool UARTCharsAvail (uint32_t ui32Base)
 Determines if there are any characters in the receive FIFO. More...
 
static bool UARTSpaceAvail (uint32_t ui32Base)
 Determines if there is any space in the transmit FIFO. More...
 
int32_t UARTCharGetNonBlocking (uint32_t ui32Base)
 Receives a character from the specified port. More...
 
int32_t UARTCharGet (uint32_t ui32Base)
 Waits for a character from the specified port. More...
 
bool UARTCharPutNonBlocking (uint32_t ui32Base, uint8_t ui8Data)
 Sends a character to the specified port. More...
 
void UARTCharPut (uint32_t ui32Base, uint8_t ui8Data)
 Waits to send a character from the specified port. More...
 
static bool UARTBusy (uint32_t ui32Base)
 Determines whether the UART transmitter is busy or not. More...
 
static void UARTBreakCtl (uint32_t ui32Base, bool bBreakState)
 Causes a BREAK to be sent. More...
 
void UARTIntRegister (uint32_t ui32Base, void(*pfnHandler)(void))
 Registers an interrupt handler for a UART interrupt in the dynamic interrupt table. More...
 
void UARTIntUnregister (uint32_t ui32Base)
 Unregisters an interrupt handler for a UART interrupt in the dynamic interrupt table. More...
 
static void UARTIntEnable (uint32_t ui32Base, uint32_t ui32IntFlags)
 Enables individual UART interrupt sources. More...
 
static void UARTIntDisable (uint32_t ui32Base, uint32_t ui32IntFlags)
 Disables individual UART interrupt sources. More...
 
static uint32_t UARTIntStatus (uint32_t ui32Base, bool bMasked)
 Gets the current interrupt status. More...
 
static void UARTIntClear (uint32_t ui32Base, uint32_t ui32IntFlags)
 Clears UART interrupt sources. More...
 
static void UARTDMAEnable (uint32_t ui32Base, uint32_t ui32DMAFlags)
 Enable UART DMA operation. More...
 
static void UARTDMADisable (uint32_t ui32Base, uint32_t ui32DMAFlags)
 Disable UART DMA operation. More...
 
static uint32_t UARTRxErrorGet (uint32_t ui32Base)
 Gets current receiver errors. More...
 
static void UARTRxErrorClear (uint32_t ui32Base)
 Clears all reported receiver errors. More...
 
static void UARTHwFlowControlEnable (uint32_t ui32Base)
 Enables hardware flow control for both CTS and RTS. More...
 
static void UARTHwFlowControlDisable (uint32_t ui32Base)
 Disables hardware flow control for both CTS and RTS. More...