CMSIS-Driver_PIC32CM-PL  
Peripheral Library (PLIB) Documentation
 
Loading...
Searching...
No Matches
DMAC Interface

Driver API for DMAC (plib_dmac.h) More...

Macros

#define DMAC_CHANNELS_NUMBER   DMAC_CH_NUM
 

Typedefs

typedef void(* DMAC_CHANNEL_CALLBACK_HANDLER) (DMAC_TRANSFER_EVENT event)
 DMAC channel callback function type.
 

Enumerations

enum  DMAC_CHANNEL_ID
 DMAC channel identifiers. More...
 
enum  DMAC_PRIORITY_LEVEL { DMAC_PRIORITY_LEVEL_0 = 0 , DMAC_PRIORITY_LEVEL_1 = 1 , DMAC_PRIORITY_LEVEL_2 = 2 , DMAC_PRIORITY_LEVEL_3 = 3 }
 DMAC channel priority levels. More...
 
enum  DMAC_LEVEL_ARBITRATION_SCHEME { DMAC_LEVEL_STATIC_ARBITRATION = 0 , DMAC_LEVEL_ROUND_ROBIN_ARBITRATION = 1 }
 DMAC arbitration schemes for channel levels. More...
 
enum  DMAC_SOFTWARE_COMMAND { DMAC_COMMAND_NONE = 0 , DMAC_COMMAND_SUSPEND = 1 , DMAC_COMMAND_RESUME = 2 }
 DMAC channel software commands. More...
 
enum  DMAC_TRIGGER_ACTION { DMAC_TRIGGER_BLOCK_TRANSFER = 0 , DMAC_TRIGGER_BEAT_TRANSFER = 2 , DMAC_TRIGGER_ONE_COMPLETE_TRANSACTION = 3 }
 DMAC channel trigger actions. More...
 
enum  DMAC_TRIGGER_SOURCE { DMAC_TRIGGER_SOURCE_DISABLE = 0 }
 DMAC channel trigger sources. More...
 
enum  DMAC_EVENT_INPUT_ACTION {
  DMAC_EVENT_INPUT_ACTION_NONE = 0 , DMAC_EVENT_INPUT_ACTION_TRIG = 1 , DMAC_EVENT_INPUT_ACTION_CTRIG = 2 , DMAC_EVENT_INPUT_ACTION_CBLOCK = 3 ,
  DMAC_EVENT_INPUT_ACTION_SUSPEND = 4 , DMAC_EVENT_INPUT_ACTION_RESUME = 5 , DMAC_EVENT_INPUT_ACTION_SSKIP = 6
}
 DMAC event input actions. More...
 
enum  DMAC_STEP_SIZE {
  DMAC_STEP_SIZE_1 = 0 , DMAC_STEP_SIZE_2 = 1 , DMAC_STEP_SIZE_4 = 2 , DMAC_STEP_SIZE_8 = 3 ,
  DMAC_STEP_SIZE_16 = 4 , DMAC_STEP_SIZE_32 = 5 , DMAC_STEP_SIZE_64 = 6 , DMAC_STEP_SIZE_128 = 7
}
 DMAC beat step sizes. More...
 
enum  DMAC_STEP_SIZE_TARGET { DMAC_STEPSEL_DSTADDR = 0 , DMAC_STEPSEL_SRCADDR = 1 }
 DMAC step selection for address increment. More...
 
enum  DMAC_BLOCK_TRANSFER_ACTION { DMAC_BLOCK_ACTION_NONE = 0 , DMAC_BLOCK_ACTION_INT = 1 , DMAC_BLOCK_ACTION_SUSPEND = 2 , DMAC_BLOCK_ACTION_BOTH = 3 }
 DMAC block actions. More...
 
enum  DMAC_BEAT_SIZE { DMAC_BEAT_SIZE_BYTE = 0 , DMAC_BEAT_SIZE_HWORD = 1 , DMAC_BEAT_SIZE_WORD = 2 }
 DMAC beat sizes. More...
 
enum  DMAC_EVENT_OUTPUT { DMAC_EVENT_OUTPUT_DISABLE = 0 , DMAC_EVENT_OUTPUT_ON_BLOCK_TXF = 1 , DMAC_EVENT_OUTPUT_ON_BEAT_TXF = 3 }
 DMAC event output selection. More...
 
enum  DMAC_INTERRUPT { DMAC_TRANSFER_ERROR_INTERRUPT = 0 , DMAC_TRANSFER_COMPLETE_INTERRUPT = 1 , DMAC_SUSPEND_INTERRUPT = 2 }
 DMAC interrupt types. More...
 
enum  DMAC_CRC_SOURCE { DMAC_CRC_SOURCE_NONE = 0x0 , DMAC_CRC_SOURCE_IO_INTERFACE = 0x1 }
 DMAC CRC source selection. More...
 
enum  DMAC_CRC_POLYNOMIAL { DMAC_CRC_16 = 0 , DMAC_CRC_32 = 1 }
 DMAC CRC polynomial selection. More...
 
enum  DMAC_CRC_BEAT_SIZE { DMAC_CRC_BEAT_SIZE_BYTE = 0 , DMAC_CRC_BEAT_SIZE_HWORD = 1 , DMAC_CRC_BEAT_SIZE_WORD = 2 }
 DMAC CRC beat sizes. More...
 
enum  DMAC_TRANSFER_EVENT { DMAC_TRANSFER_EVENT_NONE = 0 , DMAC_TRANSFER_EVENT_COMPLETE = 1 , DMAC_TRANSFER_EVENT_ERROR = 2 }
 DMAC transfer event types. More...
 

Functions

void DMAC_Enable (void)
 Enables the DMAC module.
 
void DMAC_Disable (void)
 Disables the DMAC module.
 
void DMAC_ResetSoftware (void)
 Performs a software reset of the DMAC module. The reset operation must be performed while both the DMAC and CRC modules are disabled.
 
void DMAC_EnablePriorityLevel (DMAC_PRIORITY_LEVEL level)
 Enables a specific DMAC priority level.
 
void DMAC_DisablePriorityLevel (DMAC_PRIORITY_LEVEL level)
 Disables a specific DMAC priority level.
 
void DMAC_EnableCRC (void)
 Enables the CRC module in DMAC.
 
void DMAC_DisableCRC (void)
 Disables the CRC module in DMAC.
 
void DMAC_ConfigureCRC (DMAC_CRC_SOURCE crc_src, DMAC_CRC_POLYNOMIAL crc_poly)
 Configures the CRC module. The CRC module must be disabled before calling this function.
 
void DMAC_SetCRCBeatSize (DMAC_CRC_BEAT_SIZE crc_beat_size)
 Sets the CRC beatsize, When the DMA is used as data source for the CRC engine, the DMA channel beat size setting will be used, When used with APB bus interface, the application must configure the CRC Beat Size bit field of CRC Control register The CRC module must be disabled before calling this function.

 
void DMAC_SetCRCInputData (uint32_t data)
 Sets the input data for CRC calculation.
 
uint32_t DMAC_GetCRCChecksum (void)
 Gets the current CRC checksum. This function should be called once the DMA transaction is completed or aborted.
 
void DMAC_SetCRCChecksum (uint32_t checksum)
 Sets the CRC checksum value. The CRC module must be disabled before calling this function.
 
bool DMAC_CRCModuleIsBusy (void)
 Checks if the CRC module is busy.
 
void DMAC_GenerateSoftwareTrigger (DMAC_CHANNEL_ID channel_id)
 Generates a software trigger for a DMAC channel.
 
void DMAC_SetLevelArbitration (DMAC_PRIORITY_LEVEL level, DMAC_LEVEL_ARBITRATION_SCHEME arbitration)
 Sets the arbitration scheme for a priority level.
 
uint8_t DMAC_GetRoundRobinLastActiveChannel (DMAC_PRIORITY_LEVEL level)
 Gets the last active channel in round-robin arbitration.
 
uint8_t DMAC_GetActiveChannelID (void)
 Gets the currently active channel ID.
 
bool DMAC_ActiveChannelIsBusy (void)
 Checks if the active channel is busy.
 
uint16_t DMAC_GetActiveChannelBlockTransferCount (void)
 Gets the block transfer count of the active channel.
 
bool DMAC_LevelTriggerReqIsPending (DMAC_PRIORITY_LEVEL level)
 Checks if a level trigger request is pending.
 
void DMAC_SetBaseAddress (void)
 Sets the base address for DMAC descriptors.
 
void DMAC_SetWriteBackAddress (void)
 Sets the write-back address for DMAC descriptors.
 
void DMAC_SelectChannel (DMAC_CHANNEL_ID channel_id)
 Selects a DMAC channel.
 
void DMAC_EnableChannel (DMAC_CHANNEL_ID channel_id)
 Enables a DMAC channel.
 
void DMAC_DisableChannel (DMAC_CHANNEL_ID channel_id)
 Disables a DMAC channel.
 
void DMAC_SoftwareResetChannel (DMAC_CHANNEL_ID channel_id)
 Performs a software reset on a DMAC channel. DMA channel must be disabled before calling this function.
 
void DMAC_RunInStandbyMode (DMAC_CHANNEL_ID channel_id)
 Runs a DMAC channel in standby mode.
 
void DMAC_HaltInStandbyMode (DMAC_CHANNEL_ID channel_id)
 Halts a DMAC channel in standby mode.
 
void DMAC_SetSoftwareCommand (DMAC_CHANNEL_ID channel_id, DMAC_SOFTWARE_COMMAND cmd)
 Sets a software command for a DMAC channel.
 
void DMAC_SetTriggerAction (DMAC_CHANNEL_ID channel_id, DMAC_TRIGGER_ACTION trig_action)
 Sets the trigger action for a DMAC channel.
 
void DMAC_SetTriggerSource (DMAC_CHANNEL_ID channel_id, DMAC_TRIGGER_SOURCE trig_src)
 Sets the trigger source for a DMAC channel.
 
void DMAC_SetPriorityLevel (DMAC_CHANNEL_ID channel_id, DMAC_PRIORITY_LEVEL level)
 Sets the priority level for a DMAC channel.
 
void DMAC_EnableEventOutput (DMAC_CHANNEL_ID channel_id)
 Enables event output for a DMAC channel.
 
void DMAC_DisableEventOutput (DMAC_CHANNEL_ID channel_id)
 Disables event output for a DMAC channel.
 
void DMAC_EnableEventInput (DMAC_CHANNEL_ID channel_id)
 Enables event input for a DMAC channel.
 
void DMAC_DisableEventInput (DMAC_CHANNEL_ID channel_id)
 Disables event input for a DMAC channel.
 
void DMAC_SetEventInputAction (DMAC_CHANNEL_ID channel_id, DMAC_EVENT_INPUT_ACTION action)
 Sets the event input action for a DMAC channel.
 
void DMAC_EnableInterrupt (DMAC_CHANNEL_ID channel_id, DMAC_INTERRUPT interrupt)
 Enables an interrupt for a DMAC channel.
 
void DMAC_DisableInterrupt (DMAC_CHANNEL_ID channel_id, DMAC_INTERRUPT interrupt)
 Disables an interrupt for a DMAC channel.
 
void DMAC_ClearInterruptFlag (DMAC_CHANNEL_ID channel_id, DMAC_INTERRUPT interrupt)
 Clears an interrupt flag for a DMAC channel.
 
bool DMAC_InterruptFlagIsSet (DMAC_CHANNEL_ID channel_id, DMAC_INTERRUPT interrupt)
 Checks if an interrupt flag is set for a DMAC channel.
 
bool DMAC_DescriptorIsInvalid (DMAC_CHANNEL_ID channel_id)
 Checks if a DMAC channel has fetched an invalid descriptor.
 
bool DMAC_ChannelIsBusy (DMAC_CHANNEL_ID channel_id)
 Checks if a DMAC channel is busy.
 
bool DMAC_TransferIsPending (DMAC_CHANNEL_ID channel_id)
 Checks if a DMAC channel transfer is pending.
 
void DMAC_SetStepSize (DMAC_CHANNEL_ID channel_id, DMAC_STEP_SIZE step_size)
 Sets the step size for a DMAC channel.
 
void DMAC_SetStepSizeTarget (DMAC_CHANNEL_ID channel_id, DMAC_STEP_SIZE_TARGET step_sel)
 Sets the step size address selection for a DMAC channel.
 
void DMAC_EnableSrcAddrIncrement (DMAC_CHANNEL_ID channel_id)
 Enables source address increment for a DMAC channel.
 
void DMAC_DisableSrcAddrIncrement (DMAC_CHANNEL_ID channel_id)
 Disables source address increment for a DMAC channel.
 
void DMAC_EnableDstAddrIncrement (DMAC_CHANNEL_ID channel_id)
 Enables destination address increment for a DMAC channel.
 
void DMAC_DisableDstAddrIncrement (DMAC_CHANNEL_ID channel_id)
 Disables destination address increment for a DMAC channel.
 
void DMAC_SetBeatSize (DMAC_CHANNEL_ID channel_id, DMAC_BEAT_SIZE beat_size)
 Sets the beat size for a DMAC channel.
 
void DMAC_SetBlockTransferAction (DMAC_CHANNEL_ID channel_id, DMAC_BLOCK_TRANSFER_ACTION block_action)
 Sets the block action for a DMAC channel.
 
void DMAC_SetEventOutput (DMAC_CHANNEL_ID channel_id, DMAC_EVENT_OUTPUT event_output)
 Sets the event output selection for a DMAC channel.
 
void DMAC_SetDescriptorValid (DMAC_CHANNEL_ID channel_id)
 Sets the descriptor valid flag for a DMAC channel.
 
void DMAC_SetDescriptorInvalid (DMAC_CHANNEL_ID channel_id)
 Clears the descriptor valid flag for a DMAC channel.
 
void DMAC_SetBlockTransferCount (DMAC_CHANNEL_ID channel_id, uint16_t block_count)
 Sets the block transfer count for a DMAC channel.
 
void DMAC_SetSourceAddress (DMAC_CHANNEL_ID channel_id, uint32_t src_addr)
 Sets the source address for a DMAC channel.
 
void DMAC_SetDestinationAddress (DMAC_CHANNEL_ID channel_id, uint32_t dst_addr)
 Sets the destination address for a DMAC channel.
 
void DMAC_SetNextDescriptorAddress (DMAC_CHANNEL_ID channel_id, uint32_t next_desc_addr)
 Sets the next descriptor address for a DMAC channel.
 
uint16_t DMAC_GetTransferredCount (DMAC_CHANNEL_ID channel_id)
 Gets the transferred count for a DMAC channel.
 
uint32_t DMAC_GetChannelSettings (DMAC_CHANNEL_ID channel_id)
 Gets the settings for a DMAC channel.
 
void DMAC_SetCallbackHandler (DMAC_CHANNEL_ID channel, DMAC_CHANNEL_CALLBACK_HANDLER callback)
 Registers a callback for a DMAC channel.
 

Description

Driver API for DMAC (plib_dmac.h)

Usage Example

The following example demonstrates typical usage of the DMAC peripheral:

#include "plib_dmac.h"
#include <stdint.h>
#include <string.h>
#define DMAC_TRANSFER_SIZE 1024U
static uint8_t src_buff[DMAC_TRANSFER_SIZE] = {0};
static uint8_t dst_buff[DMAC_TRANSFER_SIZE] = {0};
static void ch1_callback(DMAC_TRANSFER_EVENT event)
{
{
if (0 == memcmp(src_buff, dst_buff, DMAC_TRANSFER_SIZE ))
{
// Data transfer successful: source and destination buffers match
}
}
}
int32_t configure_dmac(void)
{
uint8_t beatSize = (uint8_t)DMAC_BEAT_SIZE_HWORD;
uint32_t beatSize_byte = ((uint32_t)1 << beatSize);
uint32_t BTCNT = DMAC_TRANSFER_SIZE / beatSize_byte ;
uint32_t srcaddr = (uint32_t)src_buff + (BTCNT * beatSize_byte);
uint32_t dstaddr = (uint32_t)dst_buff + (BTCNT * beatSize_byte);
for (uint32_t i=0;i<DMAC_TRANSFER_SIZE ; i++)
{
src_buff[i] = (uint8_t)i;
}
DMAC_SetCallbackHandler(DMAC_CHANNEL_ID_1, &ch1_callback);
DMAC_DisableChannel(DMAC_CHANNEL_ID_1);
DMAC_EnableSrcAddrIncrement(DMAC_CHANNEL_ID_1);
DMAC_EnableDstAddrIncrement(DMAC_CHANNEL_ID_1);
DMAC_SetBeatSize(DMAC_CHANNEL_ID_1, beatSize);
DMAC_SetBlockTransferCount(DMAC_CHANNEL_ID_1, BTCNT);
DMAC_SetSourceAddress(DMAC_CHANNEL_ID_1, srcaddr);
DMAC_SetDestinationAddress(DMAC_CHANNEL_ID_1, dstaddr);
DMAC_SetNextDescriptorAddress(DMAC_CHANNEL_ID_1, 0);
DMAC_SetDescriptorValid(DMAC_CHANNEL_ID_1);
DMAC_EnableChannel(DMAC_CHANNEL_ID_1);
DMAC_GenerateSoftwareTrigger(DMAC_CHANNEL_ID_1);
return 0;
}
void DMAC_DisableInterrupt(DMAC_CHANNEL_ID channel_id, DMAC_INTERRUPT interrupt)
Disables an interrupt for a DMAC channel.
void DMAC_SetDestinationAddress(DMAC_CHANNEL_ID channel_id, uint32_t dst_addr)
Sets the destination address for a DMAC channel.
void DMAC_Enable(void)
Enables the DMAC module.
void DMAC_SetWriteBackAddress(void)
Sets the write-back address for DMAC descriptors.
void DMAC_EnableSrcAddrIncrement(DMAC_CHANNEL_ID channel_id)
Enables source address increment for a DMAC channel.
void DMAC_DisableChannel(DMAC_CHANNEL_ID channel_id)
Disables a DMAC channel.
void DMAC_GenerateSoftwareTrigger(DMAC_CHANNEL_ID channel_id)
Generates a software trigger for a DMAC channel.
void DMAC_SetTriggerSource(DMAC_CHANNEL_ID channel_id, DMAC_TRIGGER_SOURCE trig_src)
Sets the trigger source for a DMAC channel.
DMAC_TRANSFER_EVENT
DMAC transfer event types.
Definition plib_dmac.h:523
void DMAC_Disable(void)
Disables the DMAC module.
void DMAC_SetBeatSize(DMAC_CHANNEL_ID channel_id, DMAC_BEAT_SIZE beat_size)
Sets the beat size for a DMAC channel.
void DMAC_SetDescriptorValid(DMAC_CHANNEL_ID channel_id)
Sets the descriptor valid flag for a DMAC channel.
void DMAC_SetCallbackHandler(DMAC_CHANNEL_ID channel, DMAC_CHANNEL_CALLBACK_HANDLER callback)
Registers a callback for a DMAC channel.
void DMAC_EnableChannel(DMAC_CHANNEL_ID channel_id)
Enables a DMAC channel.
void DMAC_EnableInterrupt(DMAC_CHANNEL_ID channel_id, DMAC_INTERRUPT interrupt)
Enables an interrupt for a DMAC channel.
void DMAC_ResetSoftware(void)
Performs a software reset of the DMAC module. The reset operation must be performed while both the DM...
void DMAC_SetBlockTransferCount(DMAC_CHANNEL_ID channel_id, uint16_t block_count)
Sets the block transfer count for a DMAC channel.
void DMAC_ClearInterruptFlag(DMAC_CHANNEL_ID channel_id, DMAC_INTERRUPT interrupt)
Clears an interrupt flag for a DMAC channel.
void DMAC_EnableDstAddrIncrement(DMAC_CHANNEL_ID channel_id)
Enables destination address increment for a DMAC channel.
void DMAC_SetNextDescriptorAddress(DMAC_CHANNEL_ID channel_id, uint32_t next_desc_addr)
Sets the next descriptor address for a DMAC channel.
void DMAC_SetTriggerAction(DMAC_CHANNEL_ID channel_id, DMAC_TRIGGER_ACTION trig_action)
Sets the trigger action for a DMAC channel.
void DMAC_SetPriorityLevel(DMAC_CHANNEL_ID channel_id, DMAC_PRIORITY_LEVEL level)
Sets the priority level for a DMAC channel.
void DMAC_EnablePriorityLevel(DMAC_PRIORITY_LEVEL level)
Enables a specific DMAC priority level.
void DMAC_SetBaseAddress(void)
Sets the base address for DMAC descriptors.
void DMAC_SetSourceAddress(DMAC_CHANNEL_ID channel_id, uint32_t src_addr)
Sets the source address for a DMAC channel.
@ DMAC_BEAT_SIZE_HWORD
Definition plib_dmac.h:413
@ DMAC_TRIGGER_SOURCE_DISABLE
Definition plib_dmac.h:163
@ DMAC_TRANSFER_EVENT_COMPLETE
Definition plib_dmac.h:525
@ DMAC_PRIORITY_LEVEL_0
Definition plib_dmac.h:119
@ DMAC_TRIGGER_ONE_COMPLETE_TRANSACTION
Definition plib_dmac.h:154
@ DMAC_TRANSFER_COMPLETE_INTERRUPT
Definition plib_dmac.h:435

Macro Definition Documentation

◆ DMAC_CHANNELS_NUMBER

#define DMAC_CHANNELS_NUMBER   DMAC_CH_NUM

Typedef Documentation

◆ DMAC_CHANNEL_CALLBACK_HANDLER

typedef void(* DMAC_CHANNEL_CALLBACK_HANDLER) (DMAC_TRANSFER_EVENT event)

DMAC channel callback function type.

Parameters
eventTransfer event type.

Enumeration Type Documentation

◆ DMAC_BEAT_SIZE

DMAC beat sizes.

Specifies the data size for each DMAC beat transfer.

Enumerator
DMAC_BEAT_SIZE_BYTE 

8-bit transfer

DMAC_BEAT_SIZE_HWORD 

16-bit transfer

DMAC_BEAT_SIZE_WORD 

32-bit transfer

◆ DMAC_BLOCK_TRANSFER_ACTION

DMAC block actions.

Specifies the action taken at the end of a block transfer.

Enumerator
DMAC_BLOCK_ACTION_NONE 

No action

DMAC_BLOCK_ACTION_INT 

Generate interrupt

DMAC_BLOCK_ACTION_SUSPEND 

Suspend channel

DMAC_BLOCK_ACTION_BOTH 

Interrupt and suspend

◆ DMAC_CHANNEL_ID

DMAC channel identifiers.

Enumerates all available DMAC channel IDs.

◆ DMAC_CRC_BEAT_SIZE

DMAC CRC beat sizes.

Specifies the data size for CRC calculation when CRC source is I/O interface.

Enumerator
DMAC_CRC_BEAT_SIZE_BYTE 

8-bit CRC beat size

DMAC_CRC_BEAT_SIZE_HWORD 

16-bit CRC beat size

DMAC_CRC_BEAT_SIZE_WORD 

32-bit CRC beat size

◆ DMAC_CRC_POLYNOMIAL

DMAC CRC polynomial selection.

Specifies the polynomial used for CRC calculation.

Enumerator
DMAC_CRC_16 

CRC-16 polynomial

DMAC_CRC_32 

CRC-32 polynomial

◆ DMAC_CRC_SOURCE

DMAC CRC source selection.

Specifies the source for CRC calculation.

Enumerator
DMAC_CRC_SOURCE_NONE 

No CRC source

DMAC_CRC_SOURCE_IO_INTERFACE 

I/O interface as CRC source

◆ DMAC_EVENT_INPUT_ACTION

DMAC event input actions.

Specifies the action taken when an event input occurs.

Enumerator
DMAC_EVENT_INPUT_ACTION_NONE 

No action

DMAC_EVENT_INPUT_ACTION_TRIG 

Trigger

DMAC_EVENT_INPUT_ACTION_CTRIG 

Conditional trigger

DMAC_EVENT_INPUT_ACTION_CBLOCK 

Conditional block

DMAC_EVENT_INPUT_ACTION_SUSPEND 

Suspend

DMAC_EVENT_INPUT_ACTION_RESUME 

Resume

DMAC_EVENT_INPUT_ACTION_SSKIP 

Skip

◆ DMAC_EVENT_OUTPUT

DMAC event output selection.

Specifies when event output is generated.

Enumerator
DMAC_EVENT_OUTPUT_DISABLE 

Event output disabled

DMAC_EVENT_OUTPUT_ON_BLOCK_TXF 

Event output on block transfer

DMAC_EVENT_OUTPUT_ON_BEAT_TXF 

Event output on beat transfer

◆ DMAC_INTERRUPT

DMAC interrupt types.

Enumerates available DMAC channel interrupts.

Enumerator
DMAC_TRANSFER_ERROR_INTERRUPT 

Transfer error interrupt

DMAC_TRANSFER_COMPLETE_INTERRUPT 

Transfer complete interrupt

DMAC_SUSPEND_INTERRUPT 

Suspend interrupt

◆ DMAC_LEVEL_ARBITRATION_SCHEME

DMAC arbitration schemes for channel levels.

Selects the arbitration scheme for DMAC channel levels.

Enumerator
DMAC_LEVEL_STATIC_ARBITRATION 

Static arbitration

DMAC_LEVEL_ROUND_ROBIN_ARBITRATION 

Round robin arbitration

◆ DMAC_PRIORITY_LEVEL

DMAC channel priority levels.

Specifies the priority level for DMAC channels.

Enumerator
DMAC_PRIORITY_LEVEL_0 

Priority level 0 (lowest)

DMAC_PRIORITY_LEVEL_1 

Priority level 1

DMAC_PRIORITY_LEVEL_2 

Priority level 2

DMAC_PRIORITY_LEVEL_3 

Priority level 3 (highest)

◆ DMAC_SOFTWARE_COMMAND

DMAC channel software commands.

Commands for controlling DMAC channel operation via software.

Enumerator
DMAC_COMMAND_NONE 

No action

DMAC_COMMAND_SUSPEND 

Suspend channel

DMAC_COMMAND_RESUME 

Resume channel

◆ DMAC_STEP_SIZE

DMAC beat step sizes.

Specifies the step size for DMAC beat transfers.

Enumerator
DMAC_STEP_SIZE_1 

Step size 1

DMAC_STEP_SIZE_2 

Step size 2

DMAC_STEP_SIZE_4 

Step size 4

DMAC_STEP_SIZE_8 

Step size 8

DMAC_STEP_SIZE_16 

Step size 16

DMAC_STEP_SIZE_32 

Step size 32

DMAC_STEP_SIZE_64 

Step size 64

DMAC_STEP_SIZE_128 

Step size 128

◆ DMAC_STEP_SIZE_TARGET

DMAC step selection for address increment.

Selects whether the step size applies to source or destination address.

Enumerator
DMAC_STEPSEL_DSTADDR 

Step size applies to destination address

DMAC_STEPSEL_SRCADDR 

Step size applies to source address

◆ DMAC_TRANSFER_EVENT

DMAC transfer event types.

Enumerates possible DMAC transfer events.

Enumerator
DMAC_TRANSFER_EVENT_NONE 

No event

DMAC_TRANSFER_EVENT_COMPLETE 

Transfer complete event

DMAC_TRANSFER_EVENT_ERROR 

Transfer error event

◆ DMAC_TRIGGER_ACTION

DMAC channel trigger actions.

Specifies the action taken when a trigger occurs.

Enumerator
DMAC_TRIGGER_BLOCK_TRANSFER 

One Trigger required for one block transfer

DMAC_TRIGGER_BEAT_TRANSFER 

One Trigger required for one beat transfer

DMAC_TRIGGER_ONE_COMPLETE_TRANSACTION 

One Trigger required for one complete transaction

◆ DMAC_TRIGGER_SOURCE

DMAC channel trigger sources.

Enumerates all possible trigger sources for DMAC channels.

Enumerator
DMAC_TRIGGER_SOURCE_DISABLE 

Trigger disabled

Function Documentation

◆ DMAC_ActiveChannelIsBusy()

bool DMAC_ActiveChannelIsBusy ( void )

Checks if the active channel is busy.

Parameters
None
Returns
true if busy, false otherwise.

◆ DMAC_ChannelIsBusy()

bool DMAC_ChannelIsBusy ( DMAC_CHANNEL_ID channel_id)

Checks if a DMAC channel is busy.

Parameters
channel_idChannel to check.
Returns
true if busy, false otherwise.

◆ DMAC_ClearInterruptFlag()

void DMAC_ClearInterruptFlag ( DMAC_CHANNEL_ID channel_id,
DMAC_INTERRUPT interrupt )

Clears an interrupt flag for a DMAC channel.

Parameters
channel_idChannel to configure.
interruptInterrupt type.
Returns
None

◆ DMAC_ConfigureCRC()

void DMAC_ConfigureCRC ( DMAC_CRC_SOURCE crc_src,
DMAC_CRC_POLYNOMIAL crc_poly )

Configures the CRC module. The CRC module must be disabled before calling this function.

Parameters
crc_srcCRC source selection.
crc_polyCRC polynomial selection.
Returns
None.

◆ DMAC_CRCModuleIsBusy()

bool DMAC_CRCModuleIsBusy ( void )

Checks if the CRC module is busy.

Parameters
None
Returns
true if busy, false otherwise.

◆ DMAC_DescriptorIsInvalid()

bool DMAC_DescriptorIsInvalid ( DMAC_CHANNEL_ID channel_id)

Checks if a DMAC channel has fetched an invalid descriptor.

Parameters
channel_idChannel to check.
Returns
true if invalid descriptor fetched, false otherwise.

◆ DMAC_Disable()

void DMAC_Disable ( void )

Disables the DMAC module.

Parameters
None
Returns
None

◆ DMAC_DisableChannel()

void DMAC_DisableChannel ( DMAC_CHANNEL_ID channel_id)

Disables a DMAC channel.

Parameters
channel_idChannel to disable.
Returns
None

◆ DMAC_DisableCRC()

void DMAC_DisableCRC ( void )

Disables the CRC module in DMAC.

Parameters
None.
Returns
None.

◆ DMAC_DisableDstAddrIncrement()

void DMAC_DisableDstAddrIncrement ( DMAC_CHANNEL_ID channel_id)

Disables destination address increment for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_DisableEventInput()

void DMAC_DisableEventInput ( DMAC_CHANNEL_ID channel_id)

Disables event input for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_DisableEventOutput()

void DMAC_DisableEventOutput ( DMAC_CHANNEL_ID channel_id)

Disables event output for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_DisableInterrupt()

void DMAC_DisableInterrupt ( DMAC_CHANNEL_ID channel_id,
DMAC_INTERRUPT interrupt )

Disables an interrupt for a DMAC channel.

Parameters
channel_idChannel to configure.
interruptInterrupt type.
Returns
None

◆ DMAC_DisablePriorityLevel()

void DMAC_DisablePriorityLevel ( DMAC_PRIORITY_LEVEL level)

Disables a specific DMAC priority level.

Parameters
levelPriority level to disable.
Returns
None

◆ DMAC_DisableSrcAddrIncrement()

void DMAC_DisableSrcAddrIncrement ( DMAC_CHANNEL_ID channel_id)

Disables source address increment for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_Enable()

void DMAC_Enable ( void )

Enables the DMAC module.

Parameters
None
Returns
None

◆ DMAC_EnableChannel()

void DMAC_EnableChannel ( DMAC_CHANNEL_ID channel_id)

Enables a DMAC channel.

Parameters
channel_idChannel to enable.
Returns
None

◆ DMAC_EnableCRC()

void DMAC_EnableCRC ( void )

Enables the CRC module in DMAC.

Parameters
None
Returns
None

◆ DMAC_EnableDstAddrIncrement()

void DMAC_EnableDstAddrIncrement ( DMAC_CHANNEL_ID channel_id)

Enables destination address increment for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_EnableEventInput()

void DMAC_EnableEventInput ( DMAC_CHANNEL_ID channel_id)

Enables event input for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_EnableEventOutput()

void DMAC_EnableEventOutput ( DMAC_CHANNEL_ID channel_id)

Enables event output for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_EnableInterrupt()

void DMAC_EnableInterrupt ( DMAC_CHANNEL_ID channel_id,
DMAC_INTERRUPT interrupt )

Enables an interrupt for a DMAC channel.

Parameters
channel_idChannel to configure.
interruptInterrupt type.
Returns
None

◆ DMAC_EnablePriorityLevel()

void DMAC_EnablePriorityLevel ( DMAC_PRIORITY_LEVEL level)

Enables a specific DMAC priority level.

Parameters
levelPriority level to enable.
Returns
None

◆ DMAC_EnableSrcAddrIncrement()

void DMAC_EnableSrcAddrIncrement ( DMAC_CHANNEL_ID channel_id)

Enables source address increment for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_GenerateSoftwareTrigger()

void DMAC_GenerateSoftwareTrigger ( DMAC_CHANNEL_ID channel_id)

Generates a software trigger for a DMAC channel.

Parameters
channel_idChannel to trigger.
Returns
None

◆ DMAC_GetActiveChannelBlockTransferCount()

uint16_t DMAC_GetActiveChannelBlockTransferCount ( void )

Gets the block transfer count of the active channel.

Parameters
None
Returns
Block transfer count.

◆ DMAC_GetActiveChannelID()

uint8_t DMAC_GetActiveChannelID ( void )

Gets the currently active channel ID.

Parameters
None
Returns
Active channel ID.

◆ DMAC_GetChannelSettings()

uint32_t DMAC_GetChannelSettings ( DMAC_CHANNEL_ID channel_id)

Gets the settings for a DMAC channel.

Parameters
channel_idChannel to query.
Returns
Channel settings.

◆ DMAC_GetCRCChecksum()

uint32_t DMAC_GetCRCChecksum ( void )

Gets the current CRC checksum. This function should be called once the DMA transaction is completed or aborted.

Parameters
None
Returns
CRC checksum value.

◆ DMAC_GetRoundRobinLastActiveChannel()

uint8_t DMAC_GetRoundRobinLastActiveChannel ( DMAC_PRIORITY_LEVEL level)

Gets the last active channel in round-robin arbitration.

Parameters
levelPriority level.
Returns
Last active channel ID.

◆ DMAC_GetTransferredCount()

uint16_t DMAC_GetTransferredCount ( DMAC_CHANNEL_ID channel_id)

Gets the transferred count for a DMAC channel.

Parameters
channel_idChannel to query.
Returns
Transferred count.

◆ DMAC_HaltInStandbyMode()

void DMAC_HaltInStandbyMode ( DMAC_CHANNEL_ID channel_id)

Halts a DMAC channel in standby mode.

Parameters
channel_idChannel to halt in standby.
Returns
None

◆ DMAC_InterruptFlagIsSet()

bool DMAC_InterruptFlagIsSet ( DMAC_CHANNEL_ID channel_id,
DMAC_INTERRUPT interrupt )

Checks if an interrupt flag is set for a DMAC channel.

Parameters
channel_idChannel to check.
interruptInterrupt type.
Returns
true if flag is set, false otherwise.

◆ DMAC_LevelTriggerReqIsPending()

bool DMAC_LevelTriggerReqIsPending ( DMAC_PRIORITY_LEVEL level)

Checks if a level trigger request is pending.

Parameters
levelPriority level.
Returns
true if pending, false otherwise.

◆ DMAC_ResetSoftware()

void DMAC_ResetSoftware ( void )

Performs a software reset of the DMAC module. The reset operation must be performed while both the DMAC and CRC modules are disabled.

Parameters
None
Returns
None

◆ DMAC_RunInStandbyMode()

void DMAC_RunInStandbyMode ( DMAC_CHANNEL_ID channel_id)

Runs a DMAC channel in standby mode.

Parameters
channel_idChannel to run in standby.
Returns
None

◆ DMAC_SelectChannel()

void DMAC_SelectChannel ( DMAC_CHANNEL_ID channel_id)

Selects a DMAC channel.

Parameters
channel_idChannel to select.
Returns
None

◆ DMAC_SetBaseAddress()

void DMAC_SetBaseAddress ( void )

Sets the base address for DMAC descriptors.

Parameters
None
Returns
None

◆ DMAC_SetBeatSize()

void DMAC_SetBeatSize ( DMAC_CHANNEL_ID channel_id,
DMAC_BEAT_SIZE beat_size )

Sets the beat size for a DMAC channel.

Parameters
channel_idChannel to configure.
beat_sizeBeat size.
Returns
None

◆ DMAC_SetBlockTransferAction()

void DMAC_SetBlockTransferAction ( DMAC_CHANNEL_ID channel_id,
DMAC_BLOCK_TRANSFER_ACTION block_action )

Sets the block action for a DMAC channel.

Parameters
channel_idChannel to configure.
block_actionBlock action.
Returns
None

◆ DMAC_SetBlockTransferCount()

void DMAC_SetBlockTransferCount ( DMAC_CHANNEL_ID channel_id,
uint16_t block_count )

Sets the block transfer count for a DMAC channel.

Parameters
channel_idChannel to configure.
block_countBlock transfer count.
Returns
None

◆ DMAC_SetCallbackHandler()

void DMAC_SetCallbackHandler ( DMAC_CHANNEL_ID channel,
DMAC_CHANNEL_CALLBACK_HANDLER callback )

Registers a callback for a DMAC channel.

Parameters
channelChannel to register callback for.
event_handlerCallback function.
Returns
None

◆ DMAC_SetCRCBeatSize()

void DMAC_SetCRCBeatSize ( DMAC_CRC_BEAT_SIZE crc_beat_size)

Sets the CRC beatsize, When the DMA is used as data source for the CRC engine, the DMA channel beat size setting will be used, When used with APB bus interface, the application must configure the CRC Beat Size bit field of CRC Control register The CRC module must be disabled before calling this function.

Parameters
crc_srcCRC source selection.
crc_polyCRC polynomial selection.
Returns
None.

◆ DMAC_SetCRCChecksum()

void DMAC_SetCRCChecksum ( uint32_t checksum)

Sets the CRC checksum value. The CRC module must be disabled before calling this function.

Parameters
checksumCRC checksum to set.
Returns
None.

◆ DMAC_SetCRCInputData()

void DMAC_SetCRCInputData ( uint32_t data)

Sets the input data for CRC calculation.

Parameters
dataInput data for CRC.
Returns
None

◆ DMAC_SetDescriptorInvalid()

void DMAC_SetDescriptorInvalid ( DMAC_CHANNEL_ID channel_id)

Clears the descriptor valid flag for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_SetDescriptorValid()

void DMAC_SetDescriptorValid ( DMAC_CHANNEL_ID channel_id)

Sets the descriptor valid flag for a DMAC channel.

Parameters
channel_idChannel to configure.
Returns
None

◆ DMAC_SetDestinationAddress()

void DMAC_SetDestinationAddress ( DMAC_CHANNEL_ID channel_id,
uint32_t dst_addr )

Sets the destination address for a DMAC channel.

Parameters
channel_idChannel to configure.
dst_addrDestination address.
Returns
None

◆ DMAC_SetEventInputAction()

void DMAC_SetEventInputAction ( DMAC_CHANNEL_ID channel_id,
DMAC_EVENT_INPUT_ACTION action )

Sets the event input action for a DMAC channel.

Parameters
channel_idChannel to configure.
actionEvent input action.
Returns
None

◆ DMAC_SetEventOutput()

void DMAC_SetEventOutput ( DMAC_CHANNEL_ID channel_id,
DMAC_EVENT_OUTPUT event_output )

Sets the event output selection for a DMAC channel.

Parameters
channel_idChannel to configure.
evo_selEvent output selection.
Returns
None

◆ DMAC_SetLevelArbitration()

void DMAC_SetLevelArbitration ( DMAC_PRIORITY_LEVEL level,
DMAC_LEVEL_ARBITRATION_SCHEME arbitration )

Sets the arbitration scheme for a priority level.

Parameters
levelPriority level.
arbitrationArbitration scheme.
Returns
None

◆ DMAC_SetNextDescriptorAddress()

void DMAC_SetNextDescriptorAddress ( DMAC_CHANNEL_ID channel_id,
uint32_t next_desc_addr )

Sets the next descriptor address for a DMAC channel.

Parameters
channel_idChannel to configure.
next_desc_addrNext descriptor address.
Returns
None

◆ DMAC_SetPriorityLevel()

void DMAC_SetPriorityLevel ( DMAC_CHANNEL_ID channel_id,
DMAC_PRIORITY_LEVEL level )

Sets the priority level for a DMAC channel.

Parameters
channel_idChannel to configure.
LevelPriority level.
Returns
None

◆ DMAC_SetSoftwareCommand()

void DMAC_SetSoftwareCommand ( DMAC_CHANNEL_ID channel_id,
DMAC_SOFTWARE_COMMAND cmd )

Sets a software command for a DMAC channel.

Parameters
channel_idChannel to command.
cmdSoftware command.
Returns
None

◆ DMAC_SetSourceAddress()

void DMAC_SetSourceAddress ( DMAC_CHANNEL_ID channel_id,
uint32_t src_addr )

Sets the source address for a DMAC channel.

Parameters
channel_idChannel to configure.
src_addrSource address.
Returns
None

◆ DMAC_SetStepSize()

void DMAC_SetStepSize ( DMAC_CHANNEL_ID channel_id,
DMAC_STEP_SIZE step_size )

Sets the step size for a DMAC channel.

Parameters
channel_idChannel to configure.
step_sizeStep size.
Returns
None

◆ DMAC_SetStepSizeTarget()

void DMAC_SetStepSizeTarget ( DMAC_CHANNEL_ID channel_id,
DMAC_STEP_SIZE_TARGET step_sel )

Sets the step size address selection for a DMAC channel.

Parameters
channel_idChannel to configure.
step_selStep size address selection.
Returns
None

◆ DMAC_SetTriggerAction()

void DMAC_SetTriggerAction ( DMAC_CHANNEL_ID channel_id,
DMAC_TRIGGER_ACTION trig_action )

Sets the trigger action for a DMAC channel.

Parameters
channel_idChannel to configure.
trig_actionTrigger action.
Returns
None

◆ DMAC_SetTriggerSource()

void DMAC_SetTriggerSource ( DMAC_CHANNEL_ID channel_id,
DMAC_TRIGGER_SOURCE trig_src )

Sets the trigger source for a DMAC channel.

Parameters
channel_idChannel to configure.
trig_srcTrigger source.
Returns
None

◆ DMAC_SetWriteBackAddress()

void DMAC_SetWriteBackAddress ( void )

Sets the write-back address for DMAC descriptors.

Parameters
None
Returns
None

◆ DMAC_SoftwareResetChannel()

void DMAC_SoftwareResetChannel ( DMAC_CHANNEL_ID channel_id)

Performs a software reset on a DMAC channel. DMA channel must be disabled before calling this function.

Parameters
channel_idChannel to reset.
Returns
None.

◆ DMAC_TransferIsPending()

bool DMAC_TransferIsPending ( DMAC_CHANNEL_ID channel_id)

Checks if a DMAC channel transfer is pending.

Parameters
channel_idChannel to check.
Returns
true if transfer is pending, false otherwise.