FD32M0P Microcontroller SDK
Loading...
Searching...
No Matches
dma.h File Reference
#include "DMA_REGS.h"
#include "DMA_RW_API.h"
#include "PL230_REGS.h"
#include "PL230_RW_API.h"
#include <stdbool.h>
Include dependency graph for dma.h:
This graph shows which files directly or indirectly include this file:

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.

Enumerations

enum  DMA_SRC_INC_E { DMA_SRC_INC_BYTE = 0 , DMA_SRC_INC_HALF_WORD = 1 , DMA_SRC_INC_WORD = 2 , DMA_SRC_INC_NO_INCR = 3 }
 Enum for src inc. More...
enum  DMA_SRC_SIZE_E { DMA_SRC_SIZE_BYTE = 0 , DMA_SRC_SIZE_HALF_WORD = 1 , DMA_SRC_SIZE_WORD = 2 , DMA_SRC_SIZE_RESERVED = 3 }
 Enum for src size. More...
enum  DMA_CHANNEL_E {
  DMA_CHANNEL_0 = 0 , DMA_CHANNEL_1 = 1 , DMA_CHANNEL_2 = 2 , DMA_CHANNEL_3 = 3 ,
  DMA_CHANNEL_4 = 4 , DMA_CHANNEL_5 = 5 , DMA_CHANNEL_6 = 6 , DMA_CHANNEL_7 = 7 ,
  DMA_CHANNEL_8 = 8 , DMA_CHANNEL_9 = 9 , DMA_CHANNEL_10 = 10 , DMA_CHANNEL_11 = 11 ,
  DMA_CHANNEL_12 = 12 , DMA_CHANNEL_13 = 13 , DMA_CHANNEL_14 = 14 , DMA_CHANNEL_15 = 15
}
 Channel Number Enum. More...
enum  DMA_TRANSACTION_TYPE_E {
  DMA_TRANS_TYPE_INVALID = 0 , DMA_TRANS_TYPE_BASIC = 1 , DMA_TRANS_TYPE_AUTO_REQ = 2 , DMA_TRANS_TYPE_PING_PONG = 3 ,
  DMA_TRANS_TYPE_PRIMARY_MEM_SCATTER_GATHER = 4 , DMA_TRANS_TYPE_ALTERNATE_MEM_SCATTER_GATHER = 5 , DMA_TRANS_TYPE_PRIMARY_PER_SCATTER_GATHER = 6 , DMA_TRANS_TYPE_ALTERNATE_PER_SCATTER_GATHER = 7
}
 Transaction Type Enum. More...

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.