![]() |
![]() |
MSPM0L11XX_L13XX Driver Library
1.10.01.05
|
![]() |
Modules | |
DL_DMA_INTERRUPT | |
DL_DMA_EVENT | |
Data Structures | |
struct | DL_DMA_Config |
Configuration struct for DL_DMA_initChannel. More... | |
Macros | |
#define | DEVICE_HAS_DMA_FULL_CHANNEL |
Device has support for DMA FULL channels. | |
Enumerations | |
enum | DL_DMA_TRANSFER_MODE { DL_DMA_SINGLE_TRANSFER_MODE = DMA_DMACTL_DMATM_SINGLE, DL_DMA_SINGLE_BLOCK_TRANSFER_MODE = DMA_DMACTL_DMATM_BLOCK, DL_DMA_FULL_CH_REPEAT_SINGLE_TRANSFER_MODE = DMA_DMACTL_DMATM_RPTSNGL, DL_DMA_FULL_CH_REPEAT_BLOCK_TRANSFER_MODE = DMA_DMACTL_DMATM_RPTBLCK } |
enum | DL_DMA_EXTENDED_MODE { DL_DMA_NORMAL_MODE = DMA_DMACTL_DMAEM_NORMAL, DL_DMA_FULL_CH_FILL_MODE = DMA_DMACTL_DMAEM_FILLMODE, DL_DMA_FULL_CH_TABLE_MODE = DMA_DMACTL_DMAEM_TABLEMODE } |
enum | DL_DMA_INCREMENT { DL_DMA_ADDR_UNCHANGED = DMA_DMACTL_DMASRCINCR_UNCHANGED, DL_DMA_ADDR_DECREMENT = DMA_DMACTL_DMASRCINCR_DECREMENT, DL_DMA_ADDR_INCREMENT = DMA_DMACTL_DMASRCINCR_INCREMENT, DL_DMA_ADDR_STRIDE_2 = DMA_DMACTL_DMASRCINCR_STRIDE_2, DL_DMA_ADDR_STRIDE_3 = DMA_DMACTL_DMASRCINCR_STRIDE_3, DL_DMA_ADDR_STRIDE_4 = DMA_DMACTL_DMASRCINCR_STRIDE_4, DL_DMA_ADDR_STRIDE_5 = DMA_DMACTL_DMASRCINCR_STRIDE_5, DL_DMA_ADDR_STRIDE_6 = DMA_DMACTL_DMASRCINCR_STRIDE_6, DL_DMA_ADDR_STRIDE_7 = DMA_DMACTL_DMASRCINCR_STRIDE_7, DL_DMA_ADDR_STRIDE_8 = DMA_DMACTL_DMASRCINCR_STRIDE_8, DL_DMA_ADDR_STRIDE_9 = DMA_DMACTL_DMASRCINCR_STRIDE_9 } |
enum | DL_DMA_EARLY_INTERRUPT_THRESHOLD { DL_DMA_EARLY_INTERRUPT_THRESHOLD_DISABLED = DMA_DMACTL_DMAPREIRQ_PREIRQ_DISABLE, DL_DMA_EARLY_INTERRUPT_THRESHOLD_1 = DMA_DMACTL_DMAPREIRQ_PREIRQ_1, DL_DMA_EARLY_INTERRUPT_THRESHOLD_2 = DMA_DMACTL_DMAPREIRQ_PREIRQ_2, DL_DMA_EARLY_INTERRUPT_THRESHOLD_4 = DMA_DMACTL_DMAPREIRQ_PREIRQ_4, DL_DMA_EARLY_INTERRUPT_THRESHOLD_8 = DMA_DMACTL_DMAPREIRQ_PREIRQ_8, DL_DMA_EARLY_INTERRUPT_THRESHOLD_32 = DMA_DMACTL_DMAPREIRQ_PREIRQ_32, DL_DMA_EARLY_INTERRUPT_THRESHOLD_64 = DMA_DMACTL_DMAPREIRQ_PREIRQ_64, DL_DMA_EARLY_INTERRUPT_THRESHOLD_HALF = DMA_DMACTL_DMAPREIRQ_PREIRQ_HALF } |
enum | DL_DMA_BURST_SIZE { DL_DMA_BURST_SIZE_INFINITY = DMA_DMAPRIO_BURSTSZ_INFINITI, DL_DMA_BURST_SIZE_8 = DMA_DMAPRIO_BURSTSZ_BURST_8, DL_DMA_BURST_SIZE_16 = DMA_DMAPRIO_BURSTSZ_BUSRT_16, DL_DMA_BURST_SIZE_32 = DMA_DMAPRIO_BURSTSZ_BURST_32 } |
enum | DL_DMA_TRIGGER_TYPE { DL_DMA_TRIGGER_TYPE_INTERNAL = DMA_DMATCTL_DMATINT_INTERNAL, DL_DMA_TRIGGER_TYPE_EXTERNAL = DMA_DMATCTL_DMATINT_EXTERNAL } |
enum | DL_DMA_WIDTH { DL_DMA_WIDTH_BYTE = DMA_DMACTL_DMASRCWDTH_BYTE, DL_DMA_WIDTH_HALF_WORD = DMA_DMACTL_DMASRCWDTH_HALF, DL_DMA_WIDTH_WORD = DMA_DMACTL_DMASRCWDTH_WORD, DL_DMA_WIDTH_LONG = DMA_DMACTL_DMASRCWDTH_LONG } |
enum | DL_DMA_EVENT_IIDX { DL_DMA_EVENT_IIDX_NO_INTR = DMA_GEN_EVENT_IIDX_STAT_NO_INTR, DL_DMA_EVENT_IIDX_DMACH0 = DMA_GEN_EVENT_IIDX_STAT_DMACH0, DL_DMA_EVENT_IIDX_DMACH1 = DMA_GEN_EVENT_IIDX_STAT_DMACH1, DL_DMA_EVENT_IIDX_DMACH2 = DMA_GEN_EVENT_IIDX_STAT_DMACH2, DL_DMA_EVENT_IIDX_DMACH3 = DMA_GEN_EVENT_IIDX_STAT_DMACH3, DL_DMA_EVENT_IIDX_DMACH4 = DMA_GEN_EVENT_IIDX_STAT_DMACH4, DL_DMA_EVENT_IIDX_DMACH5 = DMA_GEN_EVENT_IIDX_STAT_DMACH5, DL_DMA_EVENT_IIDX_DMACH6 = DMA_GEN_EVENT_IIDX_STAT_DMACH6, DL_DMA_EVENT_IIDX_DMACH7 = DMA_GEN_EVENT_IIDX_STAT_DMACH7, DL_DMA_EVENT_IIDX_DMACH8 = DMA_GEN_EVENT_IIDX_STAT_DMACH8, DL_DMA_EVENT_IIDX_DMACH9 = DMA_GEN_EVENT_IIDX_STAT_DMACH9, DL_DMA_EVENT_IIDX_DMACH10 = DMA_GEN_EVENT_IIDX_STAT_DMACH10, DL_DMA_EVENT_IIDX_DMACH11 = DMA_GEN_EVENT_IIDX_STAT_DMACH11, DL_DMA_EVENT_IIDX_DMACH12 = DMA_GEN_EVENT_IIDX_STAT_DMACH12, DL_DMA_EVENT_IIDX_DMACH13 = DMA_GEN_EVENT_IIDX_STAT_DMACH13, DL_DMA_EVENT_IIDX_DMACH14 = DMA_GEN_EVENT_IIDX_STAT_DMACH14, DL_DMA_EVENT_IIDX_DMACH15 = DMA_GEN_EVENT_IIDX_STAT_DMACH15, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH0 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH0, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH1 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH1, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH2 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH2, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH3 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH3, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH4 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH4, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH5 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH5, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH6 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH6, DL_DMA_FULL_CH_EVENT_IIDX_EARLY_IRQ_DMACH7 = DMA_GEN_EVENT_IIDX_STAT_PREIRQCH7, DL_DMA_EVENT_IIDX_ADDR_ERROR = DMA_GEN_EVENT_IIDX_STAT_ADDRERR, DL_DMA_EVENT_IIDX_DATA_ERROR = DMA_GEN_EVENT_IIDX_STAT_DATAERR } |
enum | DL_DMA_PUBLISHER_INDEX { DL_DMA_PUBLISHER_INDEX_0 = 0 } |
enum | DL_DMA_SUBSCRIBER_INDEX { DL_DMA_SUBSCRIBER_INDEX_0 = 0, DL_DMA_SUBSCRIBER_INDEX_1 = 1 } |
Functions | |
void | DL_DMA_initChannel (DMA_Regs *dma, uint8_t channelNum, DL_DMA_Config *config) |
Initialize a DMA channel. More... | |
__STATIC_INLINE void | DL_DMA_configTransfer (DMA_Regs *dma, uint8_t channelNum, DL_DMA_TRANSFER_MODE transferMode, DL_DMA_EXTENDED_MODE extendedMode, DL_DMA_WIDTH srcWidth, DL_DMA_WIDTH destWidth, DL_DMA_INCREMENT srcIncrement, DL_DMA_INCREMENT destIncrement) |
Configure a DMA channel for a transfer. More... | |
__STATIC_INLINE void | DL_DMA_enableRoundRobinPriority (DMA_Regs *dma) |
Configure the DMA for round-robin priority. More... | |
__STATIC_INLINE void | DL_DMA_disableRoundRobinPriority (DMA_Regs *dma) |
Disable round-robin priority for the DMA. More... | |
__STATIC_INLINE bool | DL_DMA_isRoundRobinPriorityEnabled (DMA_Regs *dma) |
Check if round-robin priority is enabled for the DMA. More... | |
__STATIC_INLINE void | DL_DMA_setBurstSize (DMA_Regs *dma, DL_DMA_BURST_SIZE burstSize) |
Set the burst size for block transfers. More... | |
__STATIC_INLINE DL_DMA_BURST_SIZE | DL_DMA_getBurstSize (DMA_Regs *dma) |
Get the burst size for block transfers. More... | |
__STATIC_INLINE void | DL_DMA_enableChannel (DMA_Regs *dma, uint8_t channelNum) |
Enable a DMA channel for transfers. More... | |
__STATIC_INLINE void | DL_DMA_disableChannel (DMA_Regs *dma, uint8_t channelNum) |
Disable a DMA channel for transfers. More... | |
__STATIC_INLINE bool | DL_DMA_isChannelEnabled (DMA_Regs *dma, uint8_t channelNum) |
Check if a DMA channel is enabled for transfers. More... | |
__STATIC_INLINE void | DL_DMA_configMode (DMA_Regs *dma, uint8_t channelNum, DL_DMA_TRANSFER_MODE transferMode, DL_DMA_EXTENDED_MODE extendedMode) |
Configure the mode for a DMA channel. More... | |
__STATIC_INLINE void | DL_DMA_setTransferMode (DMA_Regs *dma, uint8_t channelNum, DL_DMA_TRANSFER_MODE transferMode) |
Set a DMA channel's transfer mode. More... | |
__STATIC_INLINE DL_DMA_TRANSFER_MODE | DL_DMA_getTransferMode (DMA_Regs *dma, uint8_t channelNum) |
Get a DMA channel's transfer mode. More... | |
__STATIC_INLINE void | DL_DMA_setExtendedMode (DMA_Regs *dma, uint8_t channelNum, DL_DMA_EXTENDED_MODE extendedMode) |
Set a DMA channel's extended mode. More... | |
__STATIC_INLINE DL_DMA_EXTENDED_MODE | DL_DMA_getExtendedMode (DMA_Regs *dma, uint8_t channelNum) |
Get a DMA channel's extended mode. More... | |
__STATIC_INLINE void | DL_DMA_startTransfer (DMA_Regs *dma, uint8_t channelNum) |
Start a DMA transfer using software. More... | |
__STATIC_INLINE void | DL_DMA_setTrigger (DMA_Regs *dma, uint8_t channelNum, uint8_t trigger, DL_DMA_TRIGGER_TYPE triggerType) |
Set a channel's trigger for a DMA transfer. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getTrigger (DMA_Regs *dma, uint8_t channelNum) |
Get the current trigger for a DMA channel. More... | |
__STATIC_INLINE DL_DMA_TRIGGER_TYPE | DL_DMA_getTriggerType (DMA_Regs *dma, uint8_t channelNum) |
Get the current trigger type for a DMA channel. More... | |
__STATIC_INLINE void | DL_DMA_setSrcAddr (DMA_Regs *dma, uint8_t channelNum, uint32_t srcAddr) |
Set a DMA channel's source address. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getSrcAddr (DMA_Regs *dma, uint8_t channelNum) |
Get a DMA channel's source address. More... | |
__STATIC_INLINE void | DL_DMA_setDestAddr (DMA_Regs *dma, uint8_t channelNum, uint32_t destAddr) |
Set a DMA channel's destination address. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getDestAddr (DMA_Regs *dma, uint8_t channelNum) |
Get a DMA channel's destination address. More... | |
__STATIC_INLINE void | DL_DMA_setTransferSize (DMA_Regs *dma, uint8_t channelNum, uint16_t size) |
Set the size of a block for a DMA transfer. More... | |
__STATIC_INLINE uint16_t | DL_DMA_getTransferSize (DMA_Regs *dma, uint8_t channelNum) |
Get a channel's size of block of data for a DMA transfer. More... | |
__STATIC_INLINE void | DL_DMA_setSrcIncrement (DMA_Regs *dma, uint8_t channelNum, DL_DMA_INCREMENT srcIncrement) |
Set a channel's source address increment amount. More... | |
__STATIC_INLINE DL_DMA_INCREMENT | DL_DMA_getSrcIncrement (DMA_Regs *dma, uint8_t channelNum) |
Return a channel's source address increment amount. More... | |
__STATIC_INLINE void | DL_DMA_setDestIncrement (DMA_Regs *dma, uint8_t channelNum, DL_DMA_INCREMENT destIncrement) |
Set a channel's destination address increment amount. More... | |
__STATIC_INLINE DL_DMA_INCREMENT | DL_DMA_getDestIncrement (DMA_Regs *dma, uint8_t channelNum) |
Return a channel's destination address increment amount. More... | |
__STATIC_INLINE void | DL_DMA_setSrcWidth (DMA_Regs *dma, uint8_t channelNum, DL_DMA_WIDTH srcWidth) |
Set the width of the DMA source address for a channel. More... | |
__STATIC_INLINE DL_DMA_WIDTH | DL_DMA_getSrcWidth (DMA_Regs *dma, uint8_t channelNum) |
Get the width of the DMA source address for a channel. More... | |
__STATIC_INLINE void | DL_DMA_setDestWidth (DMA_Regs *dma, uint8_t channelNum, DL_DMA_WIDTH destWidth) |
Set the width of the DMA destination address for a channel. More... | |
__STATIC_INLINE DL_DMA_WIDTH | DL_DMA_getDestWidth (DMA_Regs *dma, uint8_t channelNum) |
Get the width of the DMA destination address for a channel. More... | |
__STATIC_INLINE void | DL_DMA_Full_Ch_setEarlyInterruptThreshold (DMA_Regs *dma, uint8_t channelNum, DL_DMA_EARLY_INTERRUPT_THRESHOLD threshold) |
Set the early interrupt event. More... | |
__STATIC_INLINE DL_DMA_EARLY_INTERRUPT_THRESHOLD | DL_DMA_Full_Ch_getEarlyInterruptThreshold (DMA_Regs *dma, uint8_t channelNum) |
Get the early interrupt event threshold. More... | |
__STATIC_INLINE void | DL_DMA_enableInterrupt (DMA_Regs *dma, uint32_t interruptMask) |
Enable DMA interrupts. More... | |
__STATIC_INLINE void | DL_DMA_disableInterrupt (DMA_Regs *dma, uint32_t interruptMask) |
Disable DMA interrupts. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getEnabledInterrupts (DMA_Regs *dma, uint32_t interruptMask) |
Check which DMA interrupts are enabled. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getEnabledInterruptStatus (DMA_Regs *dma, uint32_t interruptMask) |
Check interrupt flag of enabled DMA interrupts. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getRawInterruptStatus (DMA_Regs *dma, uint32_t interruptMask) |
Check interrupt flag of any DMA interrupt. More... | |
__STATIC_INLINE DL_DMA_EVENT_IIDX | DL_DMA_getPendingInterrupt (DMA_Regs *dma) |
Get highest priority pending DMA interrupt. More... | |
__STATIC_INLINE void | DL_DMA_clearInterruptStatus (DMA_Regs *dma, uint32_t interruptMask) |
Clear pending DMA interrupts. More... | |
__STATIC_INLINE void | DL_DMA_setPublisherChanID (DMA_Regs *dma, DL_DMA_PUBLISHER_INDEX index, uint8_t chanID) |
Sets the event publisher channel id. More... | |
__STATIC_INLINE uint8_t | DL_DMA_getPublisherChanID (DMA_Regs *dma, DL_DMA_PUBLISHER_INDEX index) |
Gets the event publisher channel id. More... | |
__STATIC_INLINE void | DL_DMA_setSubscriberChanID (DMA_Regs *dma, DL_DMA_SUBSCRIBER_INDEX index, uint8_t chanID) |
Sets the event subscriber channel id. More... | |
__STATIC_INLINE uint8_t | DL_DMA_getSubscriberChanID (DMA_Regs *dma, DL_DMA_SUBSCRIBER_INDEX index) |
Gets the event subscriber channel id. More... | |
__STATIC_INLINE void | DL_DMA_enableEvent (DMA_Regs *dma, uint32_t eventMask) |
Enable DMA event. More... | |
__STATIC_INLINE void | DL_DMA_disableEvent (DMA_Regs *dma, uint32_t eventMask) |
Disable DMA event. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getEnabledEvents (DMA_Regs *dma, uint32_t eventMask) |
Check which dma events triggers are enabled. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getEnabledEventStatus (DMA_Regs *dma, uint32_t eventMask) |
Check event flag of enabled dma event. More... | |
__STATIC_INLINE uint32_t | DL_DMA_getRawEventsStatus (DMA_Regs *dma, uint32_t eventMask) |
Check event flag of any dma event. More... | |
__STATIC_INLINE void | DL_DMA_clearEventsStatus (DMA_Regs *dma, uint32_t eventMask) |
Clear pending dma events. More... | |
The Direct Memory Access (DMA) Library allows full configuration of the MSPM0 DMA module. The DMA controller transfers data from one address to another, without CPU intervention, across the entire address range. DMA controllers have multiple channels that can be configured independently
enum DL_DMA_TRANSFER_MODE |
enum DL_DMA_EXTENDED_MODE |
enum DL_DMA_INCREMENT |
enum DL_DMA_BURST_SIZE |
enum DL_DMA_TRIGGER_TYPE |
enum DL_DMA_WIDTH |
enum DL_DMA_EVENT_IIDX |
void DL_DMA_initChannel | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_Config * | config | ||
) |
Initialize a DMA channel.
Initializes all the configurable options for a DMA channel. The DMA channel is not enabled in this API.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | config | Pointer to DMA channel configuration settings |
__STATIC_INLINE void DL_DMA_configTransfer | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_TRANSFER_MODE | transferMode, | ||
DL_DMA_EXTENDED_MODE | extendedMode, | ||
DL_DMA_WIDTH | srcWidth, | ||
DL_DMA_WIDTH | destWidth, | ||
DL_DMA_INCREMENT | srcIncrement, | ||
DL_DMA_INCREMENT | destIncrement | ||
) |
Configure a DMA channel for a transfer.
Configures the transfer settings for a DMA channel. The DMA channel is not enabled in this API.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | transferMode | The transfer mode to use. Refer to the device datasheet to determine which modes are supported in the selected channel. One of DL_DMA_TRANSFER_MODE. |
[in] | extendedMode | The extended mode to use. One of DL_DMA_EXTENDED_MODE. |
[in] | srcWidth | The width of the DMA source. One of DL_DMA_WIDTH. |
[in] | destWidth | The width of the DMA destination. One of DL_DMA_WIDTH. |
[in] | srcIncrement | Amount to increment/decrement the DMA source address by. One of DL_DMA_INCREMENT. |
[in] | destIncrement | Amount to increment/decrement the DMA destination address by. One of DL_DMA_INCREMENT. |
__STATIC_INLINE void DL_DMA_enableRoundRobinPriority | ( | DMA_Regs * | dma | ) |
Configure the DMA for round-robin priority.
When round-robin priority is enabled, the channel that completes a transfer becomes the lowest priority. If multiple triggers happen simultaneously or are pending, the channel that transferred least recently will transfer first. Once it's complete the next highest priority channel will transfer.
[in] | dma | Pointer to the register overlay for the peripheral |
__STATIC_INLINE void DL_DMA_disableRoundRobinPriority | ( | DMA_Regs * | dma | ) |
Disable round-robin priority for the DMA.
When round-robin priority is disabled, the channel priorities are fixed in ascending order (Channel 0 is the lowed priority). If multiple triggers happen simultaneously or are pending, the channel with the highest priority completes its transfer before the next-highest transfer can start.
[in] | dma | Pointer to the register overlay for the peripheral |
__STATIC_INLINE bool DL_DMA_isRoundRobinPriorityEnabled | ( | DMA_Regs * | dma | ) |
Check if round-robin priority is enabled for the DMA.
[in] | dma | Pointer to the register overlay for the peripheral |
true | Round-robin priority is enabled |
false | Round-robin priority is disabled |
__STATIC_INLINE void DL_DMA_setBurstSize | ( | DMA_Regs * | dma, |
DL_DMA_BURST_SIZE | burstSize | ||
) |
Set the burst size for block transfers.
After the DMA transfers the amount of transfers defined by DL_DMA_BURST_SIZE, the ongoing block transfer is interrupted and the priority encoder has the chance to assign a higher priority channel. The previously interrupted block transfer is internally marked as pending and when no other high priority channel is pending the block transfer will continue with the next burst or until DMASZ counts down to 0.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | burstSize | The burst size to set. One of DL_DMA_BURST_SIZE. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_BURST_SIZE DL_DMA_getBurstSize | ( | DMA_Regs * | dma | ) |
Get the burst size for block transfers.
[in] | dma | Pointer to the register overlay for the peripheral |
One | of DL_DMA_BURST_SIZE |
__STATIC_INLINE void DL_DMA_enableChannel | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Enable a DMA channel for transfers.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
__STATIC_INLINE void DL_DMA_disableChannel | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Disable a DMA channel for transfers.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
__STATIC_INLINE bool DL_DMA_isChannelEnabled | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Check if a DMA channel is enabled for transfers.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
true | The DMA channel is enabled |
false | The DMA channel is disabled |
__STATIC_INLINE void DL_DMA_configMode | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_TRANSFER_MODE | transferMode, | ||
DL_DMA_EXTENDED_MODE | extendedMode | ||
) |
Configure the mode for a DMA channel.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | transferMode | The transfer mode to set for the channel. Refer to the device datasheet to determine which modes are supported in the selected channel. One of DL_DMA_TRANSFER_MODE. |
[in] | extendedMode | The extended operation mode to set for the channel. One of DL_DMA_EXTENDED_MODE. |
References DL_Common_updateReg().
__STATIC_INLINE void DL_DMA_setTransferMode | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_TRANSFER_MODE | transferMode | ||
) |
Set a DMA channel's transfer mode.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | transferMode | The transfer mode to use. Refer to the device datasheet to determine which modes are supported in the selected channel. One of DL_DMA_TRANSFER_MODE. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_TRANSFER_MODE DL_DMA_getTransferMode | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get a DMA channel's transfer mode.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_TRANSFER_MODE |
__STATIC_INLINE void DL_DMA_setExtendedMode | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_EXTENDED_MODE | extendedMode | ||
) |
Set a DMA channel's extended mode.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | extendedMode | The transfer mode to use. One of DL_DMA_EXTENDED_MODE. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_EXTENDED_MODE DL_DMA_getExtendedMode | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get a DMA channel's extended mode.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_EXTENDED_MODE |
__STATIC_INLINE void DL_DMA_startTransfer | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Start a DMA transfer using software.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
__STATIC_INLINE void DL_DMA_setTrigger | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
uint8_t | trigger, | ||
DL_DMA_TRIGGER_TYPE | triggerType | ||
) |
Set a channel's trigger for a DMA transfer.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | trigger | What should trigger a DMA transfer. Refer to the datasheet of the device for which DMA trigger values map to which events. |
[in] | triggerType | Whether an internal or external DMA channel is selected as the DMA trigger. Refer to the datasheet for more information on the DMA channels. |
References DL_Common_updateReg().
__STATIC_INLINE uint32_t DL_DMA_getTrigger | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get the current trigger for a DMA channel.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
Check | the device datasheet for what values are mapped to on your device. |
__STATIC_INLINE DL_DMA_TRIGGER_TYPE DL_DMA_getTriggerType | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get the current trigger type for a DMA channel.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_TRIGGER_TYPE |
__STATIC_INLINE void DL_DMA_setSrcAddr | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
uint32_t | srcAddr | ||
) |
Set a DMA channel's source address.
Set the source address for a DMA channel for transferring data from. This address can be automatically incremented/decremented after the completion of a transfer by using the DL_DMA_setSrcIncrement function.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | srcAddr | Address to set as the DMA source |
__STATIC_INLINE uint32_t DL_DMA_getSrcAddr | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get a DMA channel's source address.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
__STATIC_INLINE void DL_DMA_setDestAddr | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
uint32_t | destAddr | ||
) |
Set a DMA channel's destination address.
Set the destination address for a DMA channel for transferring data to. This address can be automatically incremented/decremented after the completion of a transfer by using the DL_DMA_setDestIncrement function.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | destAddr | Address to set as the DMA destination |
__STATIC_INLINE uint32_t DL_DMA_getDestAddr | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get a DMA channel's destination address.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
__STATIC_INLINE void DL_DMA_setTransferSize | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
uint16_t | size | ||
) |
Set the size of a block for a DMA transfer.
Defines the size of the block of data to transfer.
When the transfer mode DL_DMA_TRANSFER_MODE is a Block transfer mode, this is the size of the block of data transferred every trigger.
When in the transfer mode DL_DMA_TRANSFER_MODE is a Single transfer mode, this is how many triggers need to occur before the block is considered done, which then sets the interrupt status.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | size | The size of the block of data to transfer. Value between 0 - 65535. |
__STATIC_INLINE uint16_t DL_DMA_getTransferSize | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get a channel's size of block of data for a DMA transfer.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
A | value between 0 - 65535. |
__STATIC_INLINE void DL_DMA_setSrcIncrement | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_INCREMENT | srcIncrement | ||
) |
Set a channel's source address increment amount.
After each DMA transfer the channel source address, which can be set by DL_DMA_setSrcAddr, can be incremented, decremented or remain unchanged. This controls if the DMA is copying from a fixed address or a block of addresses.
The amount that is incremented/decremented is controlled by the width of the source, set by DL_DMA_setSrcWidth.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | srcIncrement | Amount to increment/decrement the DMA source address by. One of DL_DMA_INCREMENT. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_INCREMENT DL_DMA_getSrcIncrement | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Return a channel's source address increment amount.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_INCREMENT. |
__STATIC_INLINE void DL_DMA_setDestIncrement | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_INCREMENT | destIncrement | ||
) |
Set a channel's destination address increment amount.
After each DMA transfer the channel destination address, which can be set by DL_DMA_setDestAddr, can be incremented, decremented or remain unchanged. This controls if the DMA is copying from a fixed address or a block of addresses.
The amount that is incremented/decremented is controlled by the width of the destination, set by DL_DMA_setDestWidth.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | destIncrement | Amount to increment/decrement the DMA destination address by. One of DL_DMA_INCREMENT. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_INCREMENT DL_DMA_getDestIncrement | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Return a channel's destination address increment amount.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_INCREMENT. |
__STATIC_INLINE void DL_DMA_setSrcWidth | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_WIDTH | srcWidth | ||
) |
Set the width of the DMA source address for a channel.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | srcWidth | The width of the DMA source. One of DL_DMA_WIDTH. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_WIDTH DL_DMA_getSrcWidth | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get the width of the DMA source address for a channel.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_WIDTH. |
__STATIC_INLINE void DL_DMA_setDestWidth | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_WIDTH | destWidth | ||
) |
Set the width of the DMA destination address for a channel.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | destWidth | The width of the DMA destination. One of DL_DMA_WIDTH. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_WIDTH DL_DMA_getDestWidth | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get the width of the DMA destination address for a channel.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_WIDTH. |
__STATIC_INLINE void DL_DMA_Full_Ch_setEarlyInterruptThreshold | ( | DMA_Regs * | dma, |
uint8_t | channelNum, | ||
DL_DMA_EARLY_INTERRUPT_THRESHOLD | threshold | ||
) |
Set the early interrupt event.
This functionality is available for FULL-channel configuration only. Please refer to the device datasheet to map which channels have FULL or BASIC capability.
The DMA has the capability to generate an early interrupt with a given amount of transfer cycles before the DMA complete-interrupt is issued. This allows to start the ISR context switch in parallel with the completion of the DMA, and compensates the latency for the task switch into the ISR.
Ideally when the ISR starts to execute and read IIDX, the IIDX will already point to the channel-complete interrupt (always higher priority than the PRE-IRQ). In this case the latency is minimal and the ISR needs to clear the PRE-IRQ interrupt flag (RIS) manually. Should for whatever reason the DMA not complete in time, the IIDX will point to the PRE-IRQ handler and the handler needs to poll for the DMAEN bit in the DMA channel control register (DMACTL) to catch the moment that the DMA transfer has completed. Then the handler needs to clear the DMA channel-complete IRQ flag manually.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
[in] | threshold | When to generate the early interrupt. One of DL_DMA_EARLY_INTERRUPT_THRESHOLD. |
References DL_Common_updateReg().
__STATIC_INLINE DL_DMA_EARLY_INTERRUPT_THRESHOLD DL_DMA_Full_Ch_getEarlyInterruptThreshold | ( | DMA_Regs * | dma, |
uint8_t | channelNum | ||
) |
Get the early interrupt event threshold.
This functionality is available for FULL-channel configuration only. Please refer to the device datasheet to map which channels have FULL or BASIC capability.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | channelNum | DMA channel to operate on |
One | of DL_DMA_EARLY_INTERRUPT_THRESHOLD. |
__STATIC_INLINE void DL_DMA_enableInterrupt | ( | DMA_Regs * | dma, |
uint32_t | interruptMask | ||
) |
Enable DMA interrupts.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | interruptMask | Bit mask of interrupts to enable. Bitwise OR of DL_DMA_INTERRUPT. |
__STATIC_INLINE void DL_DMA_disableInterrupt | ( | DMA_Regs * | dma, |
uint32_t | interruptMask | ||
) |
Disable DMA interrupts.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | interruptMask | Bit mask of interrupts to disable. Bitwise OR of DL_DMA_INTERRUPT. |
__STATIC_INLINE uint32_t DL_DMA_getEnabledInterrupts | ( | DMA_Regs * | dma, |
uint32_t | interruptMask | ||
) |
Check which DMA interrupts are enabled.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_DMA_INTERRUPT. |
Bitwise | OR of DL_DMA_INTERRUPT values |
__STATIC_INLINE uint32_t DL_DMA_getEnabledInterruptStatus | ( | DMA_Regs * | dma, |
uint32_t | interruptMask | ||
) |
Check interrupt flag of enabled DMA interrupts.
Checks if any of the DMA interrupts that were previously enabled are pending.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_DMA_INTERRUPT. |
Bitwise | OR of DL_DMA_INTERRUPT values |
__STATIC_INLINE uint32_t DL_DMA_getRawInterruptStatus | ( | DMA_Regs * | dma, |
uint32_t | interruptMask | ||
) |
Check interrupt flag of any DMA interrupt.
Checks if any of the DMA interrupts are pending. Interrupts do not have to be previously enabled.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | interruptMask | Bit mask of interrupts to check. Bitwise OR of DL_DMA_INTERRUPT. |
Bitwise | OR of DL_DMA_INTERRUPT values |
__STATIC_INLINE DL_DMA_EVENT_IIDX DL_DMA_getPendingInterrupt | ( | DMA_Regs * | dma | ) |
Get highest priority pending DMA interrupt.
Checks if any of the DMA interrupts are pending. Interrupts do not have to be previously enabled.
[in] | dma | Pointer to the register overlay for the peripheral |
One | of DL_DMA_EVENT_IIDX |
__STATIC_INLINE void DL_DMA_clearInterruptStatus | ( | DMA_Regs * | dma, |
uint32_t | interruptMask | ||
) |
Clear pending DMA interrupts.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | interruptMask | Bit mask of interrupts to clear. Bitwise OR of DL_DMA_INTERRUPT. |
__STATIC_INLINE void DL_DMA_setPublisherChanID | ( | DMA_Regs * | dma, |
DL_DMA_PUBLISHER_INDEX | index, | ||
uint8_t | chanID | ||
) |
Sets the event publisher channel id.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | index | Specifies the register event index to be configured |
[in] | chanID | Channel ID number. Valid range 0-15. If ChanID == 0 publisher is disconnected. |
__STATIC_INLINE uint8_t DL_DMA_getPublisherChanID | ( | DMA_Regs * | dma, |
DL_DMA_PUBLISHER_INDEX | index | ||
) |
Gets the event publisher channel id.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | index | Specifies the register event index to be configured |
__STATIC_INLINE void DL_DMA_setSubscriberChanID | ( | DMA_Regs * | dma, |
DL_DMA_SUBSCRIBER_INDEX | index, | ||
uint8_t | chanID | ||
) |
Sets the event subscriber channel id.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | index | Specifies the register event index to be configured |
[in] | chanID | Channel ID number. Valid range 0-15. If ChanID == 0 subscriber is disconnected. |
__STATIC_INLINE uint8_t DL_DMA_getSubscriberChanID | ( | DMA_Regs * | dma, |
DL_DMA_SUBSCRIBER_INDEX | index | ||
) |
Gets the event subscriber channel id.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | index | Specifies the register event index to be configured |
__STATIC_INLINE void DL_DMA_enableEvent | ( | DMA_Regs * | dma, |
uint32_t | eventMask | ||
) |
Enable DMA event.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | eventMask | Bit mask of events to enable. Bitwise OR of DL_DMA_EVENT. |
__STATIC_INLINE void DL_DMA_disableEvent | ( | DMA_Regs * | dma, |
uint32_t | eventMask | ||
) |
Disable DMA event.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | eventMask | Bit mask of events to enable. Bitwise OR of DL_DMA_EVENT. |
__STATIC_INLINE uint32_t DL_DMA_getEnabledEvents | ( | DMA_Regs * | dma, |
uint32_t | eventMask | ||
) |
Check which dma events triggers are enabled.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | eventMask | Bit mask of events to check. Bitwise OR of DL_DMA_EVENT. |
Bitwise | OR of DL_DMA_EVENT values |
__STATIC_INLINE uint32_t DL_DMA_getEnabledEventStatus | ( | DMA_Regs * | dma, |
uint32_t | eventMask | ||
) |
Check event flag of enabled dma event.
Checks if any of the dma events that were previously enabled are pending.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | eventMask | Bit mask of events to check. Bitwise OR of DL_DMA_EVENT. |
Bitwise | OR of DL_DMA_EVENT values |
__STATIC_INLINE uint32_t DL_DMA_getRawEventsStatus | ( | DMA_Regs * | dma, |
uint32_t | eventMask | ||
) |
Check event flag of any dma event.
Checks if any events are pending. Events do not have to be previously enabled.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | eventMask | Bit mask of event to check. Bitwise OR of DL_DMA_EVENT. |
Bitwise | OR of DL_DMA_EVENT values |
__STATIC_INLINE void DL_DMA_clearEventsStatus | ( | DMA_Regs * | dma, |
uint32_t | eventMask | ||
) |
Clear pending dma events.
[in] | dma | Pointer to the register overlay for the peripheral |
[in] | eventMask | Bit mask of events to clear. Bitwise OR of DL_DMA_EVENT. |