48 #include "../inc/hw_types.h" 49 #include "../inc/hw_memmap.h" 50 #include "../inc/hw_host_dma.h" 51 #include "../inc/hw_soc_aaon.h" 52 #include "../inc/hw_soc_aon.h" 66 #define DMA_NUM_CHANNELS 12 67 #define DMA_CH_OFFSET 0x1000 69 #define DMA_CHCTL_FIELD_WIDTH HOST_DMA_CHCTL0_CH0_W 71 #define DMA_CHCTRL_NUMBER_OF_FIELDS (32 / DMA_CHCTL_FIELD_WIDTH) 81 #define DMA_CONFIG_SRC_PTR_WRAP HOST_DMA_CH0JCTL_BLKMODESRC 82 #define DMA_CONFIG_DST_PTR_WRAP HOST_DMA_CH0JCTL_BLKMODEDST 85 #define DMA_CONFIG_FORCE_REQ HOST_DMA_CH0JCTL_DMASIGBPS 88 #define DMA_CONFIG_SRC_PTR_FIFO HOST_DMA_CH0JCTL_FIFOMODS 90 #define DMA_CONFIG_DST_PTR_FIFO HOST_DMA_CH0JCTL_FIFOMODD 92 #define DMA_CONFIG_RX 0x00000000U 94 #define DMA_CONFIG_TX HOST_DMA_CH0JCTL_SRCDSTCFG 96 #define DMA_CONFIG_CLEAR_AT_JOB_START HOST_DMA_CH0JCTL_ENCLR 98 #define DMA_CONFIG_ALLOWED_MASK \ 100 (DMA_CONFIG_SRC_PTR_WRAP | DMA_CONFIG_DST_PTR_WRAP | DMA_CONFIG_FORCE_REQ | DMA_CONFIG_SRC_PTR_FIFO | \ 101 DMA_CONFIG_DST_PTR_FIFO | DMA_CONFIG_TX | DMA_CONFIG_CLEAR_AT_JOB_START) 109 #define DMA_WORD_SIZE_1B 2 110 #define DMA_WORD_SIZE_2B 1 112 #define DMA_WORD_SIZE_4B 0 215 extern void DMAConfigureChannel(uint32_t channel, uint8_t blockSize, uint8_t wordSize, uint32_t config);
247 const uint32_t *srcStartAddr,
248 uint32_t *dstStartAddr,
249 uint16_t transLenByte,
250 bool remainingBytesBurst);
495 peripheral = (channelReg & (HOST_DMA_CHCTL0_CH0_M << shiftValue)) >> shiftValue;
SPI1.
Definition: dma.h:128
#define DMA_CHCTL_FIELD_WIDTH
DMA channel control field width, in number of bits (CHCTL register)
Definition: dma.h:70
DMAPeripheral
DMA peripheral ports enumerations for use with DMAInitChannel().
Definition: dma.h:123
__STATIC_INLINE void DMAEnableDestinationFifoMode(uint32_t channel)
Enable FIFO mode behavior for the destination pointer.
Definition: dma.h:434
Transaction aborted by SW.
Definition: dma.h:146
PDM.
Definition: dma.h:135
#define SOC_AAON_BASE
Definition: hw_memmap.h:77
#define HOST_DMA_O_CHCTL0
Definition: hw_host_dma.h:45
#define HOST_DMA_TGT_BASE
Definition: hw_memmap.h:84
Transaction done.
Definition: dma.h:145
#define HWREG(x)
Definition: hw_types.h:78
#define __STATIC_INLINE
Definition: hw_types.h:57
DMACommand
Definition: dma.h:150
ADC.
Definition: dma.h:134
SPI0.
Definition: dma.h:127
uint32_t DMAGetChannelDirection(uint32_t channel)
Returns the direction of the specified channel.
Definition: dma.c:173
#define HOST_DMA_O_CH0JCTL
Definition: hw_host_dma.h:72
void DMAStartTransaction(uint32_t channel, const uint32_t *srcStartAddr, uint32_t *dstStartAddr, uint16_t transLenByte, bool remainingBytesBurst)
Start job for the specified channel.
Definition: dma.c:108
#define DMA_NUM_CHANNELS
Number of available DMA channels.
Definition: dma.h:66
void DMAConfigureChannel(uint32_t channel, uint8_t blockSize, uint8_t wordSize, uint32_t config)
Configure job for the specified channel.
Definition: dma.c:84
SDMMC.
Definition: dma.h:131
__STATIC_INLINE void DMAEnableInt(uint32_t channelMask)
Enables DMA interrupt sources.
Definition: dma.h:290
#define DMA_CH_OFFSET
DMA channel memory map offset, in bytes.
Definition: dma.h:68
Number of different DMA peripherals supported.
Definition: dma.h:138
uint32_t DMAGetChannelStatus(uint32_t channel)
Returns the status of the specified channel.
Definition: dma.c:155
I2C0.
Definition: dma.h:129
UARTLIN0.
Definition: dma.h:125
void DMAInitChannel(uint32_t channel, DMAPeripheral peripheral)
Initialize DMA channel by mapping it to a peripheral.
Definition: dma.c:50
MCAN.
Definition: dma.h:133
I2C1.
Definition: dma.h:130
UARTLIN2.
Definition: dma.h:137
SDIO.
Definition: dma.h:132
#define DMA_CONFIG_ALLOWED_MASK
Bitmask of allowed flags passed to DMAConfigureChannel() and DMAConfigureChannelFlags().
Definition: dma.h:99
UARTLIN1.
Definition: dma.h:126
#define SOC_AAON_O_DMASMIS
Definition: hw_soc_aaon.h:63
__STATIC_INLINE void DMADisableDestinationFifoMode(uint32_t channel)
Disable FIFO mode behavior for the destination pointer.
Definition: dma.h:456
#define ASSERT(expr)
Definition: debug.h:81
__STATIC_INLINE uint32_t DMAGetChannelPeripheral(uint32_t channel)
Get channel linked peripheral.
Definition: dma.h:478
__STATIC_INLINE void DMAConfigureChannelFlags(uint32_t channel, uint32_t config)
Clear all flags and set the specified channel flags.
Definition: dma.h:403
#define SOC_AAON_O_DMASICLR
Definition: hw_soc_aaon.h:51
HIF.
Definition: dma.h:136
No pending event // TODO: hw_ doc calls this "processing".
Definition: dma.h:144
__STATIC_INLINE uint32_t DMAIntStatus(bool masked)
Gets the current interrupt status.
Definition: dma.h:356
#define HOST_DMA_CH0JCTL_FIFOMODD
Definition: hw_host_dma.h:1700
DMAChannelStatus
Definition: dma.h:142
#define DMA_CHCTRL_NUMBER_OF_FIELDS
Number of fields in CHCTL register.
Definition: dma.h:72
#define SOC_AAON_O_DMASIMASK
Definition: hw_soc_aaon.h:45
__STATIC_INLINE void DMAClearInt(uint32_t channelMask)
Clears DMA interrupt sources.
Definition: dma.h:333
An error has occurred.
Definition: dma.h:147
__STATIC_INLINE void DMADisableInt(uint32_t channelMask)
Disables DMA channel interrupts.
Definition: dma.h:312