|
| 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...
|
| |
|
| 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.
|
| |
#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};
{
{
if (0 == memcmp(src_buff, dst_buff, DMAC_TRANSFER_SIZE ))
{
}
}
}
int32_t configure_dmac(void)
{
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;
}
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