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 |
Macros | |
#define | DMA_CMD_B2B (0b00 << DMA_TTYPE_QSEL_LSB) |
#define | DMA_CMD_B2UW (0b01 << DMA_TTYPE_QSEL_LSB) |
#define | DMA_CMD_B2SW (0b10 << DMA_TTYPE_QSEL_LSB) |
#define | DMA_CMD_W2W (0b11 << DMA_TTYPE_QSEL_LSB) |
#define | DMA_CMD_SRC_CONST (0b0 << DMA_TTYPE_SRC_INC) |
#define | DMA_CMD_SRC_INC (0b1 << DMA_TTYPE_SRC_INC) |
#define | DMA_CMD_DST_CONST (0b0 << DMA_TTYPE_DST_INC) |
#define | DMA_CMD_DST_INC (0b1 << DMA_TTYPE_DST_INC) |
#define | DMA_CMD_ENDIAN (0b1 << DMA_TTYPE_ENDIAN) |
Enumerations | |
enum | NEORV32_DMA_STATUS_enum { DMA_STATUS_ERR_WR = -2 , DMA_STATUS_ERR_RD = -1 , DMA_STATUS_IDLE = 0 , DMA_STATUS_BUSY = 1 } |
Functions | |
Prototypes | |
int | neorv32_dma_available (void) |
void | neorv32_dma_enable (void) |
void | neorv32_dma_disable (void) |
void | neorv32_dma_fence_enable (void) |
void | neorv32_dma_fence_disable (void) |
void | neorv32_dma_transfer (uint32_t base_src, uint32_t base_dst, uint32_t num, uint32_t config) |
void | neorv32_dma_transfer_auto (uint32_t base_src, uint32_t base_dst, uint32_t num, uint32_t config, int firq_sel, int firq_type) |
int | neorv32_dma_status (void) |
int | neorv32_dma_done (void) |
IO Device: Direct Memory Access Controller (DMA) | |
#define | NEORV32_DMA ((neorv32_dma_t*) (NEORV32_DMA_BASE)) |
enum | NEORV32_DMA_CTRL_enum { DMA_CTRL_EN = 0 , DMA_CTRL_AUTO = 1 , DMA_CTRL_FENCE = 2 , DMA_CTRL_ERROR_RD = 8 , DMA_CTRL_ERROR_WR = 9 , DMA_CTRL_BUSY = 10 , DMA_CTRL_DONE = 11 , DMA_CTRL_FIRQ_TYPE = 15 , DMA_CTRL_FIRQ_SEL_LSB = 16 , DMA_CTRL_FIRQ_SEL_MSB = 19 } |
enum | NEORV32_DMA_TTYPE_enum { DMA_TTYPE_NUM_LSB = 0 , DMA_TTYPE_NUM_MSB = 23 , DMA_TTYPE_QSEL_LSB = 27 , DMA_TTYPE_QSEL_MSB = 28 , DMA_TTYPE_SRC_INC = 29 , DMA_TTYPE_DST_INC = 30 , DMA_TTYPE_ENDIAN = 31 } |
Direct Memory Access Controller (DMA) HW driver header file.
#define DMA_CMD_B2B (0b00 << DMA_TTYPE_QSEL_LSB) |
DMA transfer type commands
#define DMA_CMD_B2SW (0b10 << DMA_TTYPE_QSEL_LSB) |
DMA transfer type commands
#define DMA_CMD_B2UW (0b01 << DMA_TTYPE_QSEL_LSB) |
DMA transfer type commands
#define DMA_CMD_DST_CONST (0b0 << DMA_TTYPE_DST_INC) |
DMA transfer type commands
#define DMA_CMD_DST_INC (0b1 << DMA_TTYPE_DST_INC) |
DMA transfer type commands
#define DMA_CMD_ENDIAN (0b1 << DMA_TTYPE_ENDIAN) |
DMA transfer type commands
#define DMA_CMD_SRC_CONST (0b0 << DMA_TTYPE_SRC_INC) |
DMA transfer type commands
#define DMA_CMD_SRC_INC (0b1 << DMA_TTYPE_SRC_INC) |
DMA transfer type commands
#define DMA_CMD_W2W (0b11 << DMA_TTYPE_QSEL_LSB) |
DMA transfer type commands
#define NEORV32_DMA ((neorv32_dma_t*) (NEORV32_DMA_BASE)) |
DMA module hardware access (neorv32_dma_t)
DMA control and status register bits
DMA transfer type bits
int neorv32_dma_available | ( | void | ) |
Check if DMA controller was synthesized.
void neorv32_dma_disable | ( | void | ) |
Disable DMA. This will reset the DMA and will also terminate the current transfer.
int neorv32_dma_done | ( | void | ) |
Check if a transfer has actually been executed.
void neorv32_dma_enable | ( | void | ) |
Enable DMA.
void neorv32_dma_fence_disable | ( | void | ) |
Disable memory barrier (fence).
void neorv32_dma_fence_enable | ( | void | ) |
Enable memory barrier (fence): issue a FENCE operation when DMA transfer completes without errors.
int neorv32_dma_status | ( | void | ) |
Get DMA status.
void neorv32_dma_transfer | ( | uint32_t | base_src, |
uint32_t | base_dst, | ||
uint32_t | num, | ||
uint32_t | config ) |
Trigger manual DMA transfer.
[in] | base_src | Source base address (has to be aligned to source data type!). |
[in] | base_dst | Destination base address (has to be aligned to destination data type!). |
[in] | num | Number of elements to transfer (24-bit). |
[in] | config | Transfer type configuration/commands. |
void neorv32_dma_transfer_auto | ( | uint32_t | base_src, |
uint32_t | base_dst, | ||
uint32_t | num, | ||
uint32_t | config, | ||
int | firq_sel, | ||
int | firq_type ) |
Configure automatic DMA transfer (triggered by CPU FIRQ).
[in] | base_src | Source base address (has to be aligned to source data type!). |
[in] | base_dst | Destination base address (has to be aligned to destination data type!). |
[in] | num | Number of elements to transfer (24-bit). |
[in] | config | Transfer type configuration/commands. |
[in] | firq_sel | FIRQ trigger select (NEORV32_CSR_MIP_enum); only FIRQ0..FIRQ15 = 16..31. |
[in] | firq_type | Trigger on rising-edge (0) or high-level (1) of FIRQ channel. |