FD32M0P Microcontroller SDK
|
Data Structures | |
struct | dma_channel_cfg_t |
Channel based transfer configuration. More... | |
struct | dma_mem_ctrl_cfg_t |
Channel Control Configuration Struct. More... | |
struct | dma_mem_channel_cfg_t |
Channel Configuration struct. More... |
Macros | |
#define | DMA_STRIDE_MODE_LOOKUP_SRC_ADDR 0x20010004 |
Define for Stride Source and Destination Address. | |
#define | DMA_STRIDE_MODE_LOOKUP_DST_ADDR 0x20010008 |
#define | CHANNEL_TRANSFER_CFG_DEFAULT |
Default initializer for channel_transfer_cfg struct. |
Functions | |
void | dma_init (PL230_REGS_s *PL230_REGS, uint32_t base_ptr_address) |
This function initalizes the dma, waits if there is any current transaction, set dma structure addressm disable all the channels and enables the controller. | |
void | dma_channel_cfg (DMA_REGS_s *DMA_REGS, PL230_REGS_s *PL230_REGS, dma_channel_cfg_t *dma_channel_cfg, uint8_t channel) |
This function configures the DMA channel with required configuration. | |
void | dma_channel_en_set (PL230_REGS_s *PL230_REGS, uint8_t channel) |
This function enables a particular dma channel. | |
uint8_t | dma_channel_en_get (PL230_REGS_s *PL230_REGS, uint8_t channel) |
This function returns status of channel enable of a given channel. | |
void | dma_channel_en_clr (PL230_REGS_s *PL230_REGS, uint8_t channel) |
This function clear a particular dma channel. | |
void | dma_channel_sw_trig (PL230_REGS_s *PL230_REGS, uint8_t channel) |
This function generate a SW trigger for a given channel. | |
void | dma_channel_priority_cfg (DMA_REGS_s *DMA_REGS, DMA_ARBITRATION_DMA_RR_EN_E mode, uint16_t round_robin_mask) |
This function set the dma arbitration. | |
bool | dma_is_idle (PL230_REGS_s *PL230_REGS) |
This function check if dma fsm is in idle/stalled/done state. |
struct dma_channel_cfg_t |
Channel based transfer configuration.
Data Fields | ||
---|---|---|
uint32_t | src_addr |
DMA source address |
uint32_t | dst_addr |
DMA destination address |
uint16_t | total_transaction |
DMA total number of transaction |
uint16_t | repeated_transfer_en |
DMA Repeated Transfer Enable |
DMA_SRC_SIZE_E | src_size |
DMA source size 0:byte 1:halfword 2:word |
DMA_SRC_INC_E | src_incr |
DMA source address increement |
DMA_SRC_SIZE_E | dst_size |
DMA destination size 0:byte 1:halfword 2:word |
DMA_SRC_INC_E | dst_incr |
DMA destination address increement |
uint8_t | r_power |
DMA Arbitration rate |
uint8_t | next_useburst |
DMA Set this to disable Single reqs |
uint8_t | src_prot_ctrl |
DMA source protection control |
uint8_t | dst_prot_ctrl |
DMA destination protection control |
uint8_t | alternate_cfg_sel |
DMA alternate configuration select |
uint8_t | fill_en |
DMA fill mode enable |
uint8_t | fill_incr_value |
DMA fill increement value |
uint8_t | fill_init_value |
DMA fill initial value |
uint8_t | stride_en |
DMA stride mode enable |
DMA_STRIDE_MODE_CFG_0_SRC_INC_E | stride_src_incr |
DMA stride source address increement value |
DMA_STRIDE_MODE_CFG_0_DST_INC_E | stride_dst_incr |
DMA stride destination address increement value |
DMA_TRANSACTION_TYPE_E | transfer_type |
DMA transaction type |
struct dma_mem_ctrl_cfg_t |
struct dma_mem_channel_cfg_t |
Channel Configuration struct.
Data Fields | ||
---|---|---|
uint32_t | rsp | |
uint32_t | rdp | |
dma_mem_ctrl_cfg_t | ctrl | |
uint32_t | rsvd |
#define DMA_STRIDE_MODE_LOOKUP_SRC_ADDR 0x20010004 |
Define for Stride Source and Destination Address.
Referenced by dma_channel_cfg().
#define DMA_STRIDE_MODE_LOOKUP_DST_ADDR 0x20010008 |
Referenced by dma_channel_cfg().
#define CHANNEL_TRANSFER_CFG_DEFAULT |
Default initializer for channel_transfer_cfg struct.
enum DMA_SRC_INC_E |
enum DMA_SRC_SIZE_E |
enum DMA_CHANNEL_E |
Channel Number Enum.
void dma_init | ( | PL230_REGS_s * | PL230_REGS, |
uint32_t | base_ptr_address ) |
This function initalizes the dma, waits if there is any current transaction, set dma structure addressm disable all the channels and enables the controller.
base_ptr | : pointer to base address of the dma channel configration memory |
pl230_regs | : pointer to the pl230 register space |
void |
References PL230_REGS_s::CHNL_ENABLE_CLR, PL230_REGS_s::CTRL_BASE_PTR, PL230_REGS_s::DMA_CFG, dma_is_idle(), PL230_CHNL_ENABLE_CLR_u::packed_w, PL230_CTRL_BASE_PTR_u::packed_w, and PL230_CHNL_ENABLE_CLR_CHNL_ENABLE_CLR_MASK.
void dma_channel_cfg | ( | DMA_REGS_s * | DMA_REGS, |
PL230_REGS_s * | PL230_REGS, | ||
dma_channel_cfg_t * | dma_channel_cfg, | ||
uint8_t | channel ) |
This function configures the DMA channel with required configuration.
channel_transfer_cfg | struct containing all the required configuration |
channel | : the channel id for which the configuration is being done |
pl230_regs | : pointer to the pl230 register space |
dma_regs | : pointer to the dma register space |
void |
References dma_channel_cfg().
void dma_channel_en_set | ( | PL230_REGS_s * | PL230_REGS, |
uint8_t | channel ) |
This function enables a particular dma channel.
enable | : set this value to enable the channel |
channel | : channel id |
pl230_regs | : pointer to the pl230 register space |
void |
uint8_t dma_channel_en_get | ( | PL230_REGS_s * | PL230_REGS, |
uint8_t | channel ) |
This function returns status of channel enable of a given channel.
channel | : channel id |
pl230_regs | : pointer to the pl230 register space |
channel | enable status |
void dma_channel_en_clr | ( | PL230_REGS_s * | PL230_REGS, |
uint8_t | channel ) |
This function clear a particular dma channel.
channel | : channel id |
pl230_regs | : pointer to the pl230 register space |
<br> |
void dma_channel_sw_trig | ( | PL230_REGS_s * | PL230_REGS, |
uint8_t | channel ) |
This function generate a SW trigger for a given channel.
channel | : channel id |
pl230_regs | : pointer to the pl230 register space |
<br> |
void dma_channel_priority_cfg | ( | DMA_REGS_s * | DMA_REGS, |
DMA_ARBITRATION_DMA_RR_EN_E | mode, | ||
uint16_t | round_robin_mask ) |
This function set the dma arbitration.
dma_regs | : pointer to the dma register space |
mode | : 1 for round robin, 0 for pl230 based arbitration |
<br> |
References DMA_REGS_s::ARBITRATION, DMA_REGS_s::ARBITRATION_MASK, and DMA_ARBITRATION_DMA_RR_EN_SET.
bool dma_is_idle | ( | PL230_REGS_s * | PL230_REGS | ) |
This function check if dma fsm is in idle/stalled/done state.
pl230_regs | : pointer to the pl230 register space |
status | of pl230 fsm |
References PL230_REGS_s::DMA_STATUS, PL230_DMA_STATUS_STATE_DONE, PL230_DMA_STATUS_STATE_IDLE, and PL230_DMA_STATUS_STATE_STALLED.
Referenced by dma_init().