![]() |
NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
Direct Memory Access Controller (DMA) HW driver header file. More...
#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | neorv32_dma_t |
Enumerations | |
| enum | NEORV32_DMA_STATUS_enum { DMA_STATUS_ERROR = -1 , DMA_STATUS_IDLE = 0 , DMA_STATUS_BUSY = 1 , DMA_STATUS_DONE = 2 } |
Functions | |
Prototypes | |
| int | neorv32_dma_available (void) |
| int | neorv32_dma_get_descriptor_fifo_depth (void) |
| int | neorv32_dma_descriptor_fifo_full (void) |
| int | neorv32_dma_descriptor_fifo_empty (void) |
| void | neorv32_dma_enable (void) |
| void | neorv32_dma_disable (void) |
| void | neorv32_dma_irq_ack (void) |
| int | neorv32_dma_program (uint32_t src_addr, uint32_t dst_addr, uint32_t config) |
| void | neorv32_dma_program_nocheck (uint32_t src_addr, uint32_t dst_addr, uint32_t config) |
| void | neorv32_dma_start (void) |
| int | neorv32_dma_status (void) |
Direct Memory Access Controller (DMA) HW driver header file.
| #define DMA_BSWAP (1 << DMA_CONF_BSWAP) |
Endianness conversion
| #define DMA_DST_CONST_BYTE (DMA_TYPE_CONST_BYTE << DMA_CONF_DST_LSB) |
destination aliases
| #define DMA_DST_CONST_WORD (DMA_TYPE_CONST_WORD << DMA_CONF_DST_LSB) |
source aliases
| #define DMA_DST_INC_BYTE (DMA_TYPE_INC_BYTE << DMA_CONF_DST_LSB) |
source aliases
| #define DMA_DST_INC_WORD (DMA_TYPE_INC_WORD << DMA_CONF_DST_LSB) |
source aliases
| #define DMA_SRC_CONST_BYTE (DMA_TYPE_CONST_BYTE << DMA_CONF_SRC_LSB) |
source aliases
| #define DMA_SRC_CONST_WORD (DMA_TYPE_CONST_WORD << DMA_CONF_SRC_LSB) |
source aliases
| #define DMA_SRC_INC_BYTE (DMA_TYPE_INC_BYTE << DMA_CONF_SRC_LSB) |
source aliases
| #define DMA_SRC_INC_WORD (DMA_TYPE_INC_WORD << DMA_CONF_SRC_LSB) |
source aliases
| #define NEORV32_DMA ((neorv32_dma_t*) (NEORV32_DMA_BASE)) |
DMA module hardware handle (neorv32_dma_t)
DMA transfer configuration
| Enumerator | |
|---|---|
| DMA_CONF_NUM_LSB | DMA transfer type register(0) (r/w): Number of elements to transfer, LSB |
| DMA_CONF_NUM_MSB | DMA transfer type register(23) (r/w): Number of elements to transfer, MSB |
| DMA_CONF_BSWAP | DMA transfer type register(27) (r/w): Swap byte order when set |
| DMA_CONF_SRC_LSB | DMA transfer type register(28) (r/w): SRC transfer type select (NEORV32_DMA_TYPE_enum), LSB |
| DMA_CONF_SRC_MSB | DMA transfer type register(29) (r/w): SRC transfer type select (NEORV32_DMA_TYPE_enum), MSB |
| DMA_CONF_DST_LSB | DMA transfer type register(30) (r/w): DST transfer type select (NEORV32_DMA_TYPE_enum), LSB |
| DMA_CONF_DST_MSB | DMA transfer type register(31) (r/w): DST transfer type select (NEORV32_DMA_TYPE_enum), MSB |
DMA control and status register bits
| int neorv32_dma_available | ( | void | ) |
Check if DMA controller was synthesized.
| int neorv32_dma_descriptor_fifo_empty | ( | void | ) |
Check if descriptor FIFO is empty.
| int neorv32_dma_descriptor_fifo_full | ( | void | ) |
Check if descriptor FIFO is full.
| void neorv32_dma_disable | ( | void | ) |
Disable DMA. This will reset the DMA and will also terminate the current transfer.
| void neorv32_dma_enable | ( | void | ) |
Enable DMA.
| int neorv32_dma_get_descriptor_fifo_depth | ( | void | ) |
Get DMA descriptor FIFO depth.
| void neorv32_dma_irq_ack | ( | void | ) |
Manually clear pending DMA interrupt. This will also clear the transfer-error and transfer-done status flags.
| int neorv32_dma_program | ( | uint32_t | src_addr, |
| uint32_t | dst_addr, | ||
| uint32_t | config ) |
Program DMA descriptor.
| [in] | base_src | Source data base address. |
| [in] | base_dst | Destination data base address. |
| [in] | config | Transfer type configuration (NEORV32_DMA_CONF_enum). |
| void neorv32_dma_program_nocheck | ( | uint32_t | src_addr, |
| uint32_t | dst_addr, | ||
| uint32_t | config ) |
Program DMA descriptor (without checking FIFO level).
| [in] | base_src | Source data base address. |
| [in] | base_dst | Destination data base address. |
| [in] | config | Transfer type configuration (NEORV32_DMA_CONF_enum). |
| void neorv32_dma_start | ( | void | ) |
Trigger pre-programmed DMA transfer(s)
| int neorv32_dma_status | ( | void | ) |
Get DMA status.