CC23x0R5DriverLibrary
[udma.h] Micro Direct Memory Access
Collaboration diagram for [udma.h] Micro Direct Memory Access:

Data Structures

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

Macros

#define uDMATaskStructEntry(transferCount, itemSize, srcIncrement, pSrcAddr, dstIncrement, pDstAddr, arbSize, mode)
 A helper macro for building scatter-gather task table entries. More...
 
#define UDMA_NUM_CHANNELS   8
 
#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_CHANNEL_0_M   0x01
 UDMA channel 0 (SSI0_TX or UART0_RX) More...
 
#define UDMA_CHANNEL_1_M   0x02
 UDMA channel 1 (SSI0_RX or UART0_TX) More...
 
#define UDMA_CHANNEL_2_M   0x04
 UDMA channel 2 (LRFD or UART0_TX) More...
 
#define UDMA_CHANNEL_3_M   0x08
 UDMA channel 3 (ADC0 or UART0_RX) More...
 
#define UDMA_CHANNEL_4_M   0x10
 UDMA channel 4 (AES_A or LRFD) More...
 
#define UDMA_CHANNEL_5_M   0x20
 UDMA channel 5 (AES_B or ADC0) More...
 
#define UDMA_CHANNEL_6_M   0x40
 UDMA channel 6 (Software Event Channel 0) More...
 
#define UDMA_CHANNEL_7_M   0x80
 UDMA channel 7 (Software Event Channel 1) More...
 
#define UDMA_PRI_SELECT   0x00000000
 
#define UDMA_ALT_SELECT   0x00000008
 

Functions

__STATIC_INLINE void uDMAEnable (void)
 Enables the uDMA controller for use. More...
 
__STATIC_INLINE void uDMADisable (void)
 Disables the uDMA controller for use. More...
 
__STATIC_INLINE uint32_t uDMAGetErrorStatus (void)
 Gets the uDMA error status. More...
 
__STATIC_INLINE void uDMAClearErrorStatus (void)
 Clears the uDMA error interrupt. More...
 
__STATIC_INLINE void uDMAEnableChannel (uint32_t channelBitMask)
 Enables a uDMA channel for operation. More...
 
__STATIC_INLINE void uDMADisableChannel (uint32_t channelBitMask)
 Disables a uDMA channel for operation. More...
 
__STATIC_INLINE bool uDMAIsChannelEnabled (uint32_t channelBitMask)
 Checks if a uDMA channel is enabled for operation. More...
 
__STATIC_INLINE void uDMASetControlBase (void *pControlTable)
 Sets the base address for the channel control table. More...
 
__STATIC_INLINE void * uDMAGetControlBase (void)
 Gets the base address for the channel control table. More...
 
__STATIC_INLINE void * uDMAGetControlAlternateBase (void)
 Gets the base address for the channel control table alternate structures. More...
 
__STATIC_INLINE void uDMARequestChannel (uint32_t channelBitMask)
 Requests a uDMA channel to start a transfer. More...
 
void uDMAEnableChannelAttribute (uint32_t channelBitMask, uint32_t attr)
 Enables attributes of a uDMA channel. More...
 
void uDMADisableChannelAttribute (uint32_t channelBitMask, uint32_t attr)
 Disables attributes of an uDMA channel. More...
 
uint32_t uDMAGetChannelAttribute (uint32_t channelBitMask)
 Gets the enabled attributes of a uDMA channel. More...
 
void uDMASetChannelControl (volatile uDMAControlTableEntry *pChannelControlStruct, uint32_t control)
 Sets the control parameters for a uDMA channel control structure. More...
 
void uDMASetChannelTransfer (volatile uDMAControlTableEntry *pChannelControlStruct, uint32_t mode, void *pSrcAddr, void *pDstAddr, uint32_t transferSize)
 Sets the transfer parameters for a uDMA channel control structure. More...
 
uint32_t uDMAGetChannelSize (volatile uDMAControlTableEntry const *pChannelControlStruct)
 Gets the current transfer size for a uDMA channel control structure. More...
 
uint32_t uDMAGetChannelMode (volatile uDMAControlTableEntry const *pChannelControlStruct)
 Gets the transfer mode for a uDMA channel control structure. More...
 
__STATIC_INLINE void uDMARegisterInt (uint32_t intChannel, void(*pfnHandler)(void))
 Registers an interrupt handler for the uDMA controller in the dynamic interrupt table. More...
 
__STATIC_INLINE void uDMAUnregisterInt (uint32_t intChannel)
 Unregisters an interrupt handler for the uDMA controller in the dynamic interrupt table. More...
 
__STATIC_INLINE void uDMAClearInt (uint32_t channelBitMask)
 Clears uDMA interrupt done status. More...
 
__STATIC_INLINE uint32_t uDMAIntStatus (void)
 Get the uDMA interrupt status. More...
 
__STATIC_INLINE void uDMAEnableSwEventInt (uint32_t intChannel)
 Enable interrupt on software event driven uDMA transfers. More...
 
__STATIC_INLINE void uDMADisableSwEventInt (uint32_t intChannel)
 Disable interrupt on software event driven uDMA transfers. More...
 
__STATIC_INLINE uint32_t uDMAGetStatus (void)
 Return the status of the uDMA module. More...
 
__STATIC_INLINE void uDMASetChannelPriority (uint32_t channelBitMask)
 Set the priority of a uDMA channel. More...
 
__STATIC_INLINE bool uDMAGetChannelPriority (uint32_t channelBitMask)
 Get the priority of a uDMA channel. More...
 
__STATIC_INLINE void uDMAClearChannelPriority (uint32_t channelBitMask)
 Clear the priority of a uDMA channel. More...
 

Detailed Description

Macro Definition Documentation

§ uDMATaskStructEntry

#define uDMATaskStructEntry (   transferCount,
  itemSize,
  srcIncrement,
  pSrcAddr,
  dstIncrement,
  pDstAddr,
  arbSize,
  mode 
)
Value:
{ \
(((srcIncrement) == UDMA_SRC_INC_NONE) \
? (pSrcAddr) \
: ((void *)(&((uint8_t *)(pSrcAddr))[((transferCount) << ((srcIncrement) >> 26)) - 1]))), \
(((dstIncrement) == UDMA_DST_INC_NONE) \
? (pDstAddr) \
: ((void *)(&((uint8_t *)(pDstAddr))[((transferCount) << ((dstIncrement) >> 30)) - 1]))), \
(srcIncrement) | (dstIncrement) | (itemSize) | (arbSize) | (((transferCount)-1) << 4) | \
? (mode) | UDMA_MODE_ALT_SELECT \
: (mode)), \
0 \
}
#define UDMA_MODE_MEM_SCATTER_GATHER
Definition: udma.h:203
#define UDMA_MODE_ALT_SELECT
Definition: udma.h:206
#define UDMA_SRC_INC_NONE
Definition: udma.h:222
#define UDMA_MODE_PER_SCATTER_GATHER
Definition: udma.h:204
#define UDMA_DST_INC_NONE
Definition: udma.h:216

A helper macro for building scatter-gather task table entries.

This macro is intended to be used to help populate a table of uDMA tasks for a scatter-gather transfer. This macro will calculate the values for the fields of a task structure entry based on the input parameters.

There are specific requirements for the values of each parameter. No checking is done so it is up to the caller to ensure that correct values are used for the parameters.

This macro is intended to be used to initialize individual entries of a structure of uDMAControlTableEntry type, like this:

  uDMAControlTableEntry MyTaskList[] =
  {
      uDMATaskStructEntry(Task1Count, UDMA_SIZE_8,
                          UDMA_SRC_INC_8, MySourceBuf,
                          UDMA_DST_INC_8, MyDestBuf,
                          UDMA_ARB_8, UDMA_MODE_MEM_SCATTER_GATHER),
      uDMATaskStructEntry(Task2Count, ... ),
  }
Parameters
transferCountis the count of items to transfer for this task. It must be in the range 1-1024.
itemSizeis the bit size of the items to transfer for this task. It must be one of:
srcIncrementis the bit size increment for source data. It must be one of:
pSrcAddris the starting address of the data to transfer.
dstIncrementis the bit size increment for destination data. It must be one of:
pDstAddris the starting address of the destination data.
arbSizeis the arbitration size to use for the transfer task. This is used to select the arbitration size in powers of 2, from 1 to 1024. It must be one of:
modeis the transfer mode for this task. Note that normally all tasks will be one of the scatter-gather modes while the last task is a task list will be AUTO or BASIC. It must be one of:
Returns
None (this is not a function)

§ UDMA_NUM_CHANNELS

#define UDMA_NUM_CHANNELS   8

§ UDMA_PRIORITY_LOW

#define UDMA_PRIORITY_LOW   0x00000000

Referenced by uDMAGetChannelPriority().

§ UDMA_PRIORITY_HIGH

#define UDMA_PRIORITY_HIGH   0x00000001

Referenced by uDMAGetChannelPriority().

§ UDMA_ATTR_USEBURST

#define UDMA_ATTR_USEBURST   0x00000001

§ UDMA_ATTR_ALTSELECT

#define UDMA_ATTR_ALTSELECT   0x00000002

§ UDMA_ATTR_HIGH_PRIORITY

#define UDMA_ATTR_HIGH_PRIORITY   0x00000004

§ UDMA_ATTR_REQMASK

#define UDMA_ATTR_REQMASK   0x00000008

§ UDMA_ATTR_ALL

#define UDMA_ATTR_ALL   0x0000000F

§ UDMA_MODE_STOP

#define UDMA_MODE_STOP   0x00000000

§ UDMA_MODE_BASIC

#define UDMA_MODE_BASIC   0x00000001

§ UDMA_MODE_AUTO

#define UDMA_MODE_AUTO   0x00000002

§ UDMA_MODE_PINGPONG

#define UDMA_MODE_PINGPONG   0x00000003

§ UDMA_MODE_MEM_SCATTER_GATHER

#define UDMA_MODE_MEM_SCATTER_GATHER   0x00000004

§ UDMA_MODE_PER_SCATTER_GATHER

#define UDMA_MODE_PER_SCATTER_GATHER   0x00000006

§ UDMA_MODE_M

#define UDMA_MODE_M   0x00000007

§ UDMA_MODE_ALT_SELECT

#define UDMA_MODE_ALT_SELECT   0x00000001

§ UDMA_DST_INC_8

#define UDMA_DST_INC_8   0x00000000

§ UDMA_DST_INC_16

#define UDMA_DST_INC_16   0x40000000

§ UDMA_DST_INC_32

#define UDMA_DST_INC_32   0x80000000

§ UDMA_DST_INC_NONE

#define UDMA_DST_INC_NONE   0xC0000000

Referenced by uDMASetChannelTransfer().

§ UDMA_DST_INC_M

#define UDMA_DST_INC_M   0xC0000000

§ UDMA_DST_INC_S

#define UDMA_DST_INC_S   30

Referenced by uDMASetChannelTransfer().

§ UDMA_SRC_INC_8

#define UDMA_SRC_INC_8   0x00000000

§ UDMA_SRC_INC_16

#define UDMA_SRC_INC_16   0x04000000

§ UDMA_SRC_INC_32

#define UDMA_SRC_INC_32   0x08000000

§ UDMA_SRC_INC_NONE

#define UDMA_SRC_INC_NONE   0x0c000000

Referenced by uDMASetChannelTransfer().

§ UDMA_SRC_INC_M

#define UDMA_SRC_INC_M   0x0C000000

§ UDMA_SRC_INC_S

#define UDMA_SRC_INC_S   26

Referenced by uDMASetChannelTransfer().

§ UDMA_SIZE_8

#define UDMA_SIZE_8   0x00000000

§ UDMA_SIZE_16

#define UDMA_SIZE_16   0x11000000

§ UDMA_SIZE_32

#define UDMA_SIZE_32   0x22000000

§ UDMA_SIZE_M

#define UDMA_SIZE_M   0x33000000

Referenced by uDMASetChannelControl().

§ UDMA_SIZE_S

#define UDMA_SIZE_S   24

§ UDMA_ARB_1

#define UDMA_ARB_1   0x00000000

§ UDMA_ARB_2

#define UDMA_ARB_2   0x00004000

§ UDMA_ARB_4

#define UDMA_ARB_4   0x00008000

§ UDMA_ARB_8

#define UDMA_ARB_8   0x0000c000

§ UDMA_ARB_16

#define UDMA_ARB_16   0x00010000

§ UDMA_ARB_32

#define UDMA_ARB_32   0x00014000

§ UDMA_ARB_64

#define UDMA_ARB_64   0x00018000

§ UDMA_ARB_128

#define UDMA_ARB_128   0x0001c000

§ UDMA_ARB_256

#define UDMA_ARB_256   0x00020000

§ UDMA_ARB_512

#define UDMA_ARB_512   0x00024000

§ UDMA_ARB_1024

#define UDMA_ARB_1024   0x00028000

§ UDMA_ARB_M

#define UDMA_ARB_M   0x0003C000

Referenced by uDMASetChannelControl().

§ UDMA_ARB_S

#define UDMA_ARB_S   14

§ UDMA_NEXT_USEBURST

#define UDMA_NEXT_USEBURST   0x00000008

Referenced by uDMASetChannelControl().

§ UDMA_XFER_SIZE_MAX

#define UDMA_XFER_SIZE_MAX   1024

Referenced by uDMASetChannelTransfer().

§ UDMA_XFER_SIZE_M

#define UDMA_XFER_SIZE_M   0x00003FF0

§ UDMA_XFER_SIZE_S

#define UDMA_XFER_SIZE_S   4

§ UDMA_CHANNEL_0_M

#define UDMA_CHANNEL_0_M   0x01

UDMA channel 0 (SSI0_TX or UART0_RX)

§ UDMA_CHANNEL_1_M

#define UDMA_CHANNEL_1_M   0x02

UDMA channel 1 (SSI0_RX or UART0_TX)

§ UDMA_CHANNEL_2_M

#define UDMA_CHANNEL_2_M   0x04

UDMA channel 2 (LRFD or UART0_TX)

§ UDMA_CHANNEL_3_M

#define UDMA_CHANNEL_3_M   0x08

UDMA channel 3 (ADC0 or UART0_RX)

§ UDMA_CHANNEL_4_M

#define UDMA_CHANNEL_4_M   0x10

UDMA channel 4 (AES_A or LRFD)

§ UDMA_CHANNEL_5_M

#define UDMA_CHANNEL_5_M   0x20

UDMA channel 5 (AES_B or ADC0)

§ UDMA_CHANNEL_6_M

#define UDMA_CHANNEL_6_M   0x40

UDMA channel 6 (Software Event Channel 0)

§ UDMA_CHANNEL_7_M

#define UDMA_CHANNEL_7_M   0x80

UDMA channel 7 (Software Event Channel 1)

§ UDMA_PRI_SELECT

#define UDMA_PRI_SELECT   0x00000000

§ UDMA_ALT_SELECT

#define UDMA_ALT_SELECT   0x00000008

Referenced by uDMASetChannelTransfer().

Function Documentation

§ uDMAEnable()

__STATIC_INLINE void uDMAEnable ( void  )

Enables the uDMA controller for use.

This function enables the uDMA controller. The uDMA controller must be enabled before it can be configured and used.

Returns
None

References DMA_BASE, DMA_CFG_MASTERENABLE, DMA_O_CFG, and HWREG.

§ uDMADisable()

__STATIC_INLINE void uDMADisable ( void  )

Disables the uDMA controller for use.

This function disables the uDMA controller. Once disabled, the uDMA controller will not operate until re-enabled with uDMAEnable().

Returns
None.

References DMA_BASE, DMA_O_CFG, and HWREG.

§ uDMAGetErrorStatus()

__STATIC_INLINE uint32_t uDMAGetErrorStatus ( void  )

Gets the uDMA error status.

This function returns the uDMA error status. It should be called from within the uDMA error interrupt handler to determine if a uDMA error occurred.

Returns
Returns non-zero if a uDMA error is pending.

References DMA_BASE, DMA_O_ERROR, and HWREG.

§ uDMAClearErrorStatus()

__STATIC_INLINE void uDMAClearErrorStatus ( void  )

Clears the uDMA error interrupt.

This function clears a pending uDMA error interrupt. It should be called from within the uDMA error interrupt handler to clear the interrupt.

Returns
None

References DMA_BASE, DMA_ERROR_STATUS, DMA_O_ERROR, and HWREG.

§ uDMAEnableChannel()

__STATIC_INLINE void uDMAEnableChannel ( uint32_t  channelBitMask)

Enables a uDMA channel for operation.

This function enables the specified uDMA channels for use. This function must be used to enable a channel before it can be used to perform a uDMA transfer.

When a uDMA transfer is completed, the channel will be automatically disabled by the uDMA controller. Therefore, this function should be called prior to starting up any new transfer.

Parameters
channelBitMaskis the bitmask of the channels to enable.
Returns
None

References DMA_BASE, DMA_O_SETCHANNELEN, and HWREG.

§ uDMADisableChannel()

__STATIC_INLINE void uDMADisableChannel ( uint32_t  channelBitMask)

Disables a uDMA channel for operation.

This function disables the specified uDMA channels. Once disabled, a channel will not respond to uDMA transfer requests until re-enabled via uDMAEnableChannel().

Parameters
channelBitMaskis the bitmask of the channels to disable.
Returns
None.

References DMA_BASE, DMA_O_CLEARCHANNELEN, and HWREG.

§ uDMAIsChannelEnabled()

__STATIC_INLINE bool uDMAIsChannelEnabled ( uint32_t  channelBitMask)

Checks if a uDMA channel is enabled for operation.

This function checks to see if a specific uDMA channel is enabled. This can be used to check the status of a transfer, since the channel will be automatically disabled at the end of a transfer. Note that if multiple channels are specified in the bitmask, the return value will be true if at least one channel is enabled.

Parameters
channelBitMaskis the bitmask of the channel to check.
Returns
Returns status of uDMA channel.
  • true : Channel is enabled.
  • false : Channel is disabled.

References DMA_BASE, DMA_O_SETCHANNELEN, and HWREG.

§ uDMASetControlBase()

__STATIC_INLINE void uDMASetControlBase ( void *  pControlTable)

Sets the base address for the channel control table.

This function sets the base address of the channel control table. This table resides in system memory and holds control information for each uDMA channel. The table must be aligned on a 1024 byte boundary. The base address must be set before any of the channel functions can be used. Setting the base address of the primary control table will automatically set the address for the alternate control table as the next memory location after the primary control table.

The size of the channel control table depends on the number of uDMA channels, and which transfer modes are used. Refer to the introductory text and the microcontroller datasheet for more information about the channel control table.

Note
This register cannot be read when the controller is in the reset state.
Parameters
pControlTableis a pointer to the 1024 byte aligned base address of the uDMA channel control table. The address must be an absolute address in system memory space.
Returns
None

References ASSERT, DMA_BASE, DMA_O_CTRL, HWREG, and SRAM_BASE.

§ uDMAGetControlBase()

__STATIC_INLINE void* uDMAGetControlBase ( void  )

Gets the base address for the channel control table.

This function gets the base address of the channel control table. This table resides in system memory and holds control information for each uDMA channel.

Returns
Returns a pointer to the base address of the channel control table.

References DMA_BASE, DMA_O_CTRL, and HWREG.

§ uDMAGetControlAlternateBase()

__STATIC_INLINE void* uDMAGetControlAlternateBase ( void  )

Gets the base address for the channel control table alternate structures.

This function gets the base address of the second half of the channel control table that holds the alternate control structures for each channel.

Returns
Returns a pointer to the base address of the second half of the channel control table.

References DMA_BASE, DMA_O_ALTCTRL, and HWREG.

§ uDMARequestChannel()

__STATIC_INLINE void uDMARequestChannel ( uint32_t  channelBitMask)

Requests a uDMA channel to start a transfer.

This function allows software to request a uDMA channel to begin a transfer. This could be used for performing a memory to memory transfer, or if for some reason a transfer needs to be initiated by software instead of the peripheral associated with that channel.

Note
If the channel is a software channel and interrupts are used, then the completion will be signaled on the uDMA dedicated interrupt. If a peripheral channel is used, then the completion will be signaled on the peripheral's interrupt.
Parameters
channelBitMaskis the bitmask of the channel on which to request a uDMA transfer.
Returns
None.

References DMA_BASE, DMA_O_SOFTREQ, HWREG, uDMADisableChannelAttribute(), uDMAEnableChannelAttribute(), uDMAGetChannelAttribute(), uDMAGetChannelMode(), uDMAGetChannelSize(), uDMASetChannelControl(), and uDMASetChannelTransfer().

§ uDMAEnableChannelAttribute()

void uDMAEnableChannelAttribute ( uint32_t  channelBitMask,
uint32_t  attr 
)

Enables attributes of a uDMA channel.

This function is used to enable attributes of a uDMA channel.

Parameters
channelBitMaskis bitmask of the channel to configure.
attris a combination of attributes for the channel. The parameter is the bitwise OR of any of the following:
  • UDMA_ATTR_USEBURST is used to restrict transfers to use only a burst mode.
  • UDMA_ATTR_ALTSELECT is used to select the alternate control structure for this channel (it is very unlikely that this flag should be used).
  • UDMA_ATTR_HIGH_PRIORITY is used to set this channel to high priority.
  • UDMA_ATTR_REQMASK is used to mask the hardware request signal from the peripheral for this channel.
Returns
None

References ASSERT, DMA_BASE, DMA_O_SETBURST, DMA_O_SETCHNLPRIALT, DMA_O_SETCHNLPRIORITY, DMA_O_SETREQMASK, HWREG, UDMA_ATTR_ALTSELECT, UDMA_ATTR_HIGH_PRIORITY, UDMA_ATTR_REQMASK, and UDMA_ATTR_USEBURST.

Referenced by uDMARequestChannel().

§ uDMADisableChannelAttribute()

void uDMADisableChannelAttribute ( uint32_t  channelBitMask,
uint32_t  attr 
)

Disables attributes of an uDMA channel.

This function is used to disable attributes of a uDMA channel.

Parameters
channelBitMaskis bitmask of the channel to configure.
attris a combination of attributes for the channel. The parameter is the bitwise OR of any of the following:
  • UDMA_ATTR_USEBURST is used to restrict transfers to use only a burst mode.
  • UDMA_ATTR_ALTSELECT is used to select the alternate control structure for this channel (it is very unlikely that this flag should be used).
  • UDMA_ATTR_HIGH_PRIORITY is used to set this channel to high priority.
  • UDMA_ATTR_REQMASK is used to mask the hardware request signal from the peripheral for this channel.
Returns
None

References ASSERT, DMA_BASE, DMA_O_CLEARBURST, DMA_O_CLEARCHNLPRIALT, DMA_O_CLEARCHNLPRIORITY, DMA_O_CLEARREQMASK, HWREG, UDMA_ATTR_ALTSELECT, UDMA_ATTR_HIGH_PRIORITY, UDMA_ATTR_REQMASK, and UDMA_ATTR_USEBURST.

Referenced by uDMARequestChannel().

§ uDMAGetChannelAttribute()

uint32_t uDMAGetChannelAttribute ( uint32_t  channelBitMask)

Gets the enabled attributes of a uDMA channel.

This function returns a combination of flags representing the attributes of the uDMA channel.

Parameters
channelBitMaskis the bitmask of the channel to configure.
Returns
Returns the bitwise OR of the attributes of the uDMA channel, which can be any of the following:
  • UDMA_ATTR_USEBURST is used to restrict transfers to use only a burst mode.
  • UDMA_ATTR_ALTSELECT is used to select the alternate control structure for this channel (it is very unlikely that this flag should be used).
  • UDMA_ATTR_HIGH_PRIORITY is used to set this channel to high priority.
  • UDMA_ATTR_REQMASK is used to mask the hardware request signal from the peripheral for this channel.

References DMA_BASE, DMA_O_SETBURST, DMA_O_SETCHNLPRIALT, DMA_O_SETCHNLPRIORITY, DMA_O_SETREQMASK, HWREG, UDMA_ATTR_ALTSELECT, UDMA_ATTR_HIGH_PRIORITY, UDMA_ATTR_REQMASK, and UDMA_ATTR_USEBURST.

Referenced by uDMARequestChannel().

§ uDMASetChannelControl()

void uDMASetChannelControl ( volatile uDMAControlTableEntry pChannelControlStruct,
uint32_t  control 
)

Sets the control parameters for a uDMA channel control structure.

This function is used to set control parameters for a uDMA transfer. These are typically parameters that are not changed often.

Note
The address increment cannot be smaller than the data size.
Parameters
pChannelControlStructis a pointer to the primary or alternate control table of the uDMA channel to be set.
controlis the bitwise OR of five values:
Returns
None

References ASSERT, uDMAControlTableEntry::control, DMA_BASE, DMA_O_CTRL, HWREG, UDMA_ARB_M, UDMA_DST_INC_M, UDMA_NEXT_USEBURST, UDMA_SIZE_M, and UDMA_SRC_INC_M.

Referenced by uDMARequestChannel().

§ uDMASetChannelTransfer()

void uDMASetChannelTransfer ( volatile uDMAControlTableEntry pChannelControlStruct,
uint32_t  mode,
void *  pSrcAddr,
void *  pDstAddr,
uint32_t  transferSize 
)

Sets the transfer parameters for a uDMA channel control structure.

This function is used to set the parameters for a uDMA transfer. These are typically parameters that are changed often. The function uDMASetChannelControl() MUST be called at least once for this channel prior to calling this function.

The pSrcAddr and pDstAddr parameters are pointers to the first location of the data to be transferred. These addresses should be aligned according to the item size. The compiler will take care of this if the pointers are pointing to storage of the appropriate data type.

The two scatter/gather modes, MEMORY and PERIPHERAL, are actually different depending on whether the primary or alternate control structure is selected. This function will recognize from the address of the pChannelControlStruct if it's a primary or alternate control structure and will set the scatter/gather mode as appropriate for it.

The channel must also be enabled using uDMAEnableChannel() after calling this function. The transfer will not begin until the channel has been set up and enabled. Note that the channel is automatically disabled after the transfer is completed, meaning that uDMAEnableChannel() must be called again after setting up the next transfer.

Note
Great care must be taken to not modify a channel control structure that is in use or else the results will be unpredictable, including the possibility of undesired data transfers to or from memory or peripherals. For BASIC and AUTO modes, it is safe to make changes when the channel is disabled, or the uDMAGetChannelMode() returns UDMA_MODE_STOP. For PINGPONG or one of the SCATTER_GATHER modes, it is safe to modify the primary or alternate control structure only when the other is being used. The uDMAGetChannelMode() function will return UDMA_MODE_STOP when a channel control structure is inactive and safe to modify.
Parameters
pChannelControlStructis a pointer to the primary or alternate control table of the uDMA channel to be set.
modeis the type of uDMA transfer. The parameter should be one of the following values:
  • UDMA_MODE_STOP : Stops the uDMA transfer. The controller sets the mode to this value at the end of a transfer.
  • UDMA_MODE_BASIC : Perform a basic transfer based on request.
  • UDMA_MODE_AUTO to perform a transfer that will always complete once started even if request is removed.
  • UDMA_MODE_PINGPONG : Set up a transfer that switches between the primary and alternate control structures for the channel. This allows use of ping-pong buffering for uDMA transfers.
  • UDMA_MODE_MEM_SCATTER_GATHER : Set up a memory scatter-gather transfer.
  • UDMA_MODE_PER_SCATTER_GATHER : Set up a peripheral scatter-gather transfer.
pSrcAddris the source address for the transfer.
pDstAddris the destination address for the transfer.
transferSizeis the number of data items to transfer (NOT bytes).
Returns
None

References ASSERT, uDMAControlTableEntry::control, DMA_BASE, DMA_O_CTRL, HWREG, uDMAControlTableEntry::pDstEndAddr, uDMAControlTableEntry::pSrcEndAddr, uDMAControlTableEntry::spare, UDMA_ALT_SELECT, UDMA_DST_INC_M, UDMA_DST_INC_NONE, UDMA_DST_INC_S, UDMA_MODE_ALT_SELECT, UDMA_MODE_M, UDMA_MODE_MEM_SCATTER_GATHER, UDMA_MODE_PER_SCATTER_GATHER, UDMA_SRC_INC_M, UDMA_SRC_INC_NONE, UDMA_SRC_INC_S, UDMA_XFER_SIZE_M, UDMA_XFER_SIZE_MAX, and UDMA_XFER_SIZE_S.

Referenced by uDMARequestChannel().

§ uDMAGetChannelSize()

uint32_t uDMAGetChannelSize ( volatile uDMAControlTableEntry const *  pChannelControlStruct)

Gets the current transfer size for a uDMA channel control structure.

This function is used to get the uDMA transfer size for a channel. The transfer size is the number of items to transfer, where the size of an item might be 8, 16, or 32 bits. If a partial transfer has already occurred, then the number of remaining items will be returned. If the transfer is complete, then 0 will be returned.

Parameters
pChannelControlStructis a pointer to the primary or alternate control table of the uDMA channel in use.
Returns
Returns the number of items remaining to transfer.

References ASSERT, uDMAControlTableEntry::control, DMA_BASE, DMA_O_CTRL, HWREG, UDMA_MODE_M, UDMA_XFER_SIZE_M, and UDMA_XFER_SIZE_S.

Referenced by uDMARequestChannel().

§ uDMAGetChannelMode()

uint32_t uDMAGetChannelMode ( volatile uDMAControlTableEntry const *  pChannelControlStruct)

Gets the transfer mode for a uDMA channel control structure.

This function is used to get the transfer mode for the uDMA channel. It can be used to query the status of a transfer on a channel. When the transfer is complete the mode will be UDMA_MODE_STOP.

Parameters
pChannelControlStructis a pointer to the primary or alternate control table of the uDMA channel in use.
Returns
Returns the transfer mode of the specified channel and control structure, which will be one of the following values:

References ASSERT, uDMAControlTableEntry::control, DMA_BASE, DMA_O_CTRL, HWREG, UDMA_MODE_ALT_SELECT, UDMA_MODE_M, UDMA_MODE_MEM_SCATTER_GATHER, and UDMA_MODE_PER_SCATTER_GATHER.

Referenced by uDMARequestChannel().

§ uDMARegisterInt()

__STATIC_INLINE void uDMARegisterInt ( uint32_t  intChannel,
void(*)(void)  pfnHandler 
)

Registers an interrupt handler for the uDMA controller in the dynamic interrupt table.

Note
Only use this function if you want to use the dynamic vector table (in SRAM)!

This function registers a function as the interrupt handler for a specific interrupt and enables the corresponding interrupt in the interrupt controller.

Note
The interrupt handler for uDMA is for transfer completion when the software channel is used. The interrupts for each peripheral channel are handled through the individual peripheral interrupt handlers.
Parameters
intChannelspecifies which uDMA interrupt is to be registered.
  • INT_DMA_DONE_COMB : Register an interrupt handler to process interrupts from the uDMA software channel.
pfnHandleris a pointer to the function to be called when the interrupt is activated.
Returns
None
See also
IntRegister() for important information about registering interrupt handlers.

References ASSERT, INT_DMA_DONE_COMB, IntEnable(), and IntRegister().

§ uDMAUnregisterInt()

__STATIC_INLINE void uDMAUnregisterInt ( uint32_t  intChannel)

Unregisters an interrupt handler for the uDMA controller in the dynamic interrupt table.

This function will disable and clear the handler to be called for the specified uDMA interrupt.

Parameters
intChannelspecifies which uDMA interrupt to unregister.
  • INT_DMA_DONE_COMB : Register an interrupt handler to process interrupts from the uDMA software channel.
Returns
None
See also
IntRegister() for important information about registering interrupt handlers.

References ASSERT, INT_DMA_DONE_COMB, IntDisable(), and IntUnregister().

§ uDMAClearInt()

__STATIC_INLINE void uDMAClearInt ( uint32_t  channelBitMask)

Clears uDMA interrupt done status.

Clears bits in the uDMA interrupt status register according to which bits are set in channelBitMask. There is one bit for each channel. If a a bit is set in channelBitMask, then that corresponding channel's interrupt status will be cleared (if it was set).

Parameters
channelBitMaskis a mask with one bit for each uDMA channel.
Returns
None

References DMA_BASE, DMA_O_REQDONE, and HWREG.

§ uDMAIntStatus()

__STATIC_INLINE uint32_t uDMAIntStatus ( void  )

Get the uDMA interrupt status.

This function returns the interrupt status for the specified UDMA. This function does not differentiate between software or hardware activated interrupts.

Returns
None

References DMA_BASE, DMA_O_REQDONE, and HWREG.

§ uDMAEnableSwEventInt()

__STATIC_INLINE void uDMAEnableSwEventInt ( uint32_t  intChannel)

Enable interrupt on software event driven uDMA transfers.

Note
The main purpose of this function is to prevent propagation of uDMA status signals to a peripheral, if a peripheral and a software event is sharing the uDMA channel. If it is desired to initiate a transfer by writing to a register inside the uDMA (this means a software driven channel), then the uDMA status signals propagation need to be blocked to the hardware peripherals.
Parameters
intChannelidentifies which uDMA interrupt to enable software interrupts for.
Returns
None

References ASSERT, DMA_BASE, DMA_O_DONEMASK, HWREG, and UDMA_NUM_CHANNELS.

§ uDMADisableSwEventInt()

__STATIC_INLINE void uDMADisableSwEventInt ( uint32_t  intChannel)

Disable interrupt on software event driven uDMA transfers.

This register disables the blocking of the uDMA status signals propagation to the hardware peripheral connected to the uDMA on the intChannel.

Parameters
intChannelidentifies which uDMA interrupt to disable software interrupts for.
Returns
None
See also
uDMAEnableSwEventInt()

References ASSERT, DMA_BASE, DMA_O_DONEMASK, HWREG, and UDMA_NUM_CHANNELS.

§ uDMAGetStatus()

__STATIC_INLINE uint32_t uDMAGetStatus ( void  )

Return the status of the uDMA module.

Note
This status register cannot be read when the controller is in the reset state.
Returns
Current status of the uDMA module.

References DMA_BASE, DMA_O_STATUS, and HWREG.

§ uDMASetChannelPriority()

__STATIC_INLINE void uDMASetChannelPriority ( uint32_t  channelBitMask)

Set the priority of a uDMA channel.

Note
Writing 0 to a bit has no effect on the priority. To reset a channel priority to the default value use uDMAClearChannelPriority().
Parameters
channelBitMaskis bitmask of the uDMA channel to set the priority for.
Returns
None

References DMA_BASE, DMA_O_SETCHNLPRIORITY, and HWREG.

§ uDMAGetChannelPriority()

__STATIC_INLINE bool uDMAGetChannelPriority ( uint32_t  channelBitMask)

Get the priority of a uDMA channel.

Parameters
channelBitMaskThe bitmask of the uDMA channel to get the priority for.
Returns
Returns one of:

References DMA_BASE, DMA_O_SETCHNLPRIORITY, HWREG, UDMA_PRIORITY_HIGH, and UDMA_PRIORITY_LOW.

§ uDMAClearChannelPriority()

__STATIC_INLINE void uDMAClearChannelPriority ( uint32_t  channelBitMask)

Clear the priority of a uDMA channel.

Note
Writing 0 to a bit has no effect on the priority. To set a channel priority to high use uDMASetChannelPriority().
Parameters
channelBitMaskThe bitmask of the uDMA channel to clear the priority for.
Returns
None

References DMA_BASE, DMA_O_CLEARCHNLPRIORITY, and HWREG.