UART driver implementation for a CC32XX UART controller, using the micro DMA controller.
============================================================================
The UART header file should be included in an application as follows:
Refer to UART.h for a complete description of APIs & example of use.
Device Specific Pin Mode Macros
This header file contains pin mode definitions used to specify the UART TX and RX pin assignment in the UARTCC32XXDMA_HWAttrsV1 structure. Please refer to the CC32XX Techincal Reference Manual for details on pin multiplexing. The bits in the pin mode macros are as follows: The lower 8 bits of the macro refer to the pin, offset by 1, to match driverlib pin defines. For example, UARTCC32XXDMA_PIN_01_UART1_TX & 0xff = 0, which equals PIN_01 in driverlib pin.h. By matching the PIN_xx defines in driverlib pin.h, we can pass the pin directly to the driverlib functions. The upper 8 bits of the macro correspond to the pin mux confg mode value for the pin to operate in the UART mode. For example, pin 1 is configured with mode 7 to operate as UART1 TX.
Flow Control
To enable Flow Control, the RTS and CTS pins must be assigned in the UARTCC32XX_HWAttrsV1.
UARTCC32XXDMA Hardware attributes.
These fields, with the exception of intPriority, are used by driverlib APIs and therefore must be populated by driverlib macro definitions. For CC32XXWare these definitions are found in:
- inc/hw_memmap.h
- inc/hw_ints.h
intPriority is the UART peripheral's interrupt priority, as defined by the underlying OS. It is passed unmodified to the underlying OS's interrupt handler creation code, so you need to refer to the OS documentation for usage. For example, for SYS/BIOS applications, refer to the ti.sysbios.family.arm.m3.Hwi documentation for SYS/BIOS usage of interrupt priorities. If the driver uses the ti.dpl interface instead of making OS calls directly, then the HwiP port handles the interrupt priority in an OS specific way. In the case of the SYS/BIOS port, intPriority is passed unmodified to Hwi_create().
A sample structure is shown below:
{
.intNum = INT_UARTA0,
.intPriority = (~0),
.rxChannelIndex = DMA_CH8_UARTA0_RX,
.txChannelIndex = UDMA_CH9_UARTA0_TX,
.ctsPin = UARTCC32XX_DMA_PIN_UNASSIGNED
},
{
.baseAddr = UARTA1_BASE,
.intNum = INT_UARTA1,
.intPriority = (~0),
.rxChannelIndex = UDMA_CH10_UARTA1_RX,
.txChannelIndex = UDMA_CH11_UARTA1_TX,
},
};