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

Data Structures

struct  tDMAControlTable
 A structure that defines an entry in the channel control table. More...
 

Macros

#define uDMATaskStructEntry(ui32TransferCount, ui32ItemSize, ui32SrcIncrement, pvSrcAddr, ui32DstIncrement, pvDstAddr, ui32ArbSize, ui32Mode)
 A helper macro for building scatter-gather task table entries. More...
 
#define UDMA_NUM_CHANNELS   21
 
#define UDMA_PRIORITY_LOW   0x00000000
 
#define UDMA_PRIORITY_HIGH   0x00000001
 
#define UDMA_ATTR_USEBURST   0x00000001
 
#define UDMA_ATTR_ALTSELECT   0x00000002
 
#define UDMA_ATTR_HIGH_PRIORITY   0x00000004
 
#define UDMA_ATTR_REQMASK   0x00000008
 
#define UDMA_ATTR_ALL   0x0000000F
 
#define UDMA_MODE_STOP   0x00000000
 
#define UDMA_MODE_BASIC   0x00000001
 
#define UDMA_MODE_AUTO   0x00000002
 
#define UDMA_MODE_PINGPONG   0x00000003
 
#define UDMA_MODE_MEM_SCATTER_GATHER   0x00000004
 
#define UDMA_MODE_PER_SCATTER_GATHER   0x00000006
 
#define UDMA_MODE_M   0x00000007
 
#define UDMA_MODE_ALT_SELECT   0x00000001
 
#define UDMA_DST_INC_8   0x00000000
 
#define UDMA_DST_INC_16   0x40000000
 
#define UDMA_DST_INC_32   0x80000000
 
#define UDMA_DST_INC_NONE   0xC0000000
 
#define UDMA_DST_INC_M   0xC0000000
 
#define UDMA_DST_INC_S   30
 
#define UDMA_SRC_INC_8   0x00000000
 
#define UDMA_SRC_INC_16   0x04000000
 
#define UDMA_SRC_INC_32   0x08000000
 
#define UDMA_SRC_INC_NONE   0x0c000000
 
#define UDMA_SRC_INC_M   0x0C000000
 
#define UDMA_SRC_INC_S   26
 
#define UDMA_SIZE_8   0x00000000
 
#define UDMA_SIZE_16   0x11000000
 
#define UDMA_SIZE_32   0x22000000
 
#define UDMA_SIZE_M   0x33000000
 
#define UDMA_SIZE_S   24
 
#define UDMA_ARB_1   0x00000000
 
#define UDMA_ARB_2   0x00004000
 
#define UDMA_ARB_4   0x00008000
 
#define UDMA_ARB_8   0x0000c000
 
#define UDMA_ARB_16   0x00010000
 
#define UDMA_ARB_32   0x00014000
 
#define UDMA_ARB_64   0x00018000
 
#define UDMA_ARB_128   0x0001c000
 
#define UDMA_ARB_256   0x00020000
 
#define UDMA_ARB_512   0x00024000
 
#define UDMA_ARB_1024   0x00028000
 
#define UDMA_ARB_M   0x0003C000
 
#define UDMA_ARB_S   14
 
#define UDMA_NEXT_USEBURST   0x00000008
 
#define UDMA_XFER_SIZE_MAX   1024
 
#define UDMA_XFER_SIZE_M   0x00003FF0
 
#define UDMA_XFER_SIZE_S   4
 
#define UDMA_CHAN_SW_EVT0   0
 
#define UDMA_CHAN_UART0_RX   1
 
#define UDMA_CHAN_UART0_TX   2
 
#define UDMA_CHAN_SSI0_RX   3
 
#define UDMA_CHAN_SSI0_TX   4
 
#define UDMA_CHAN_AUX_ADC   7
 
#define UDMA_CHAN_AUX_SW   8
 
#define UDMA_CHAN_TIMER0_A   9
 
#define UDMA_CHAN_TIMER0_B   10
 
#define UDMA_CHAN_TIMER1_A   11
 
#define UDMA_CHAN_TIMER1_B   12
 
#define UDMA_CHAN_AON_PROG2   13
 
#define UDMA_CHAN_DMA_PROG   14
 
#define UDMA_CHAN_AON_RTC   15
 
#define UDMA_CHAN_SSI1_RX   16
 
#define UDMA_CHAN_SSI1_TX   17
 
#define UDMA_CHAN_SW_EVT1   18
 
#define UDMA_CHAN_SW_EVT2   19
 
#define UDMA_CHAN_SW_EVT3   20
 
#define UDMA_PRI_SELECT   0x00000000
 
#define UDMA_ALT_SELECT   0x00000020
 

Functions

static void uDMAEnable (uint32_t ui32Base)
 Enables the uDMA controller for use. More...
 
static void uDMADisable (uint32_t ui32Base)
 Disables the uDMA controller for use. More...
 
static uint32_t uDMAErrorStatusGet (uint32_t ui32Base)
 Gets the uDMA error status. More...
 
static void uDMAErrorStatusClear (uint32_t ui32Base)
 Clears the uDMA error interrupt. More...
 
static void uDMAChannelEnable (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Enables a uDMA channel for operation. More...
 
static void uDMAChannelDisable (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Disables a uDMA channel for operation. More...
 
static bool uDMAChannelIsEnabled (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Checks if a uDMA channel is enabled for operation. More...
 
static void uDMAControlBaseSet (uint32_t ui32Base, void *pControlTable)
 Sets the base address for the channel control table. More...
 
static void * uDMAControlBaseGet (uint32_t ui32Base)
 Gets the base address for the channel control table. More...
 
static void * uDMAControlAlternateBaseGet (uint32_t ui32Base)
 Gets the base address for the channel control table alternate structures. More...
 
static void uDMAChannelRequest (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Requests a uDMA channel to start a transfer. More...
 
void uDMAChannelAttributeEnable (uint32_t ui32Base, uint32_t ui32ChannelNum, uint32_t ui32Attr)
 Enables attributes of a uDMA channel. More...
 
void uDMAChannelAttributeDisable (uint32_t ui32Base, uint32_t ui32ChannelNum, uint32_t ui32Attr)
 Disables attributes of an uDMA channel. More...
 
uint32_t uDMAChannelAttributeGet (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Gets the enabled attributes of a uDMA channel. More...
 
void uDMAChannelControlSet (uint32_t ui32Base, uint32_t ui32ChannelStructIndex, uint32_t ui32Control)
 Sets the control parameters for a uDMA channel control structure. More...
 
void uDMAChannelTransferSet (uint32_t ui32Base, uint32_t ui32ChannelStructIndex, uint32_t ui32Mode, void *pvSrcAddr, void *pvDstAddr, uint32_t ui32TransferSize)
 Sets the transfer parameters for a uDMA channel control structure. More...
 
void uDMAChannelScatterGatherSet (uint32_t ui32Base, uint32_t ui32ChannelNum, uint32_t ui32TaskCount, void *pvTaskList, uint32_t ui32IsPeriphSG)
 Configures a uDMA channel for scatter-gather mode. More...
 
uint32_t uDMAChannelSizeGet (uint32_t ui32Base, uint32_t ui32ChannelStructIndex)
 Gets the current transfer size for a uDMA channel control structure. More...
 
uint32_t uDMAChannelModeGet (uint32_t ui32Base, uint32_t ui32ChannelStructIndex)
 Gets the transfer mode for a uDMA channel control structure. More...
 
static void uDMAIntRegister (uint32_t ui32Base, uint32_t ui32IntChannel, void(*pfnHandler)(void))
 Registers an interrupt handler for the uDMA controller in the dynamic interrupt table. More...
 
static void uDMAIntUnregister (uint32_t ui32Base, uint32_t ui32IntChannel)
 Unregisters an interrupt handler for the uDMA controller in the dynamic interrupt table. More...
 
static void uDMAIntClear (uint32_t ui32Base, uint32_t ui32ChanMask)
 Clears uDMA interrupt done status. More...
 
static uint32_t uDMAIntStatus (uint32_t ui32Base)
 Get the uDMA interrupt status. More...
 
static void uDMAIntSwEventEnable (uint32_t ui32Base, uint32_t ui32IntChannel)
 Enable interrupt on software event driven uDMA transfers. More...
 
static void uDMAIntSwEventDisable (uint32_t ui32Base, uint32_t ui32IntChannel)
 Disable interrupt on software event driven uDMA transfers. More...
 
static uint32_t uDMAGetStatus (uint32_t ui32Base)
 Return the status of the uDMA module. More...
 
static void uDMAChannelPrioritySet (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Set the priority of a uDMA channel. More...
 
static bool uDMAChannelPriorityGet (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Get the priority of a uDMA channel. More...
 
static void uDMAChannelPriorityClear (uint32_t ui32Base, uint32_t ui32ChannelNum)
 Clear the priority of a uDMA channel. More...