RTEMS  5.1
Data Structures | Macros | Typedefs | Enumerations | Functions
#include "hwlib.h"
#include "alt_dma_common.h"
#include "alt_dma_program.h"

Go to the source code of this file.

Data Structures

struct  ALT_DMA_CFG_s
 

Macros

#define ALT_DMA_PERIPH_PROVISION_16550_SUPPORT   (1)
 
#define ALT_DMA_PERIPH_PROVISION_QSPI_SUPPORT   (1)
 

Typedefs

typedef enum ALT_DMA_MANAGER_STATE_e ALT_DMA_MANAGER_STATE_t
 
typedef enum ALT_DMA_CHANNEL_STATE_e ALT_DMA_CHANNEL_STATE_t
 
typedef enum ALT_DMA_MANAGER_FAULT_e ALT_DMA_MANAGER_FAULT_t
 
typedef enum ALT_DMA_CHANNEL_FAULT_e ALT_DMA_CHANNEL_FAULT_t
 
typedef enum ALT_DMA_EVENT_SELECT_e ALT_DMA_EVENT_SELECT_t
 
typedef enum ALT_DMA_PERIPH_MUX_e ALT_DMA_PERIPH_MUX_t
 
typedef struct ALT_DMA_CFG_s ALT_DMA_CFG_t
 

Enumerations

enum  ALT_DMA_MANAGER_STATE_e {
  ALT_DMA_MANAGER_STATE_STOPPED = 0, ALT_DMA_MANAGER_STATE_EXECUTING = 1, ALT_DMA_MANAGER_STATE_CACHE_MISS = 2, ALT_DMA_MANAGER_STATE_UPDATING_PC = 3,
  ALT_DMA_MANAGER_STATE_WFE = 4, ALT_DMA_MANAGER_STATE_FAULTING = 15
}
 
enum  ALT_DMA_CHANNEL_STATE_e {
  ALT_DMA_CHANNEL_STATE_STOPPED = 0, ALT_DMA_CHANNEL_STATE_EXECUTING = 1, ALT_DMA_CHANNEL_STATE_CACHE_MISS = 2, ALT_DMA_CHANNEL_STATE_UPDATING_PC = 3,
  ALT_DMA_CHANNEL_STATE_WFE = 4, ALT_DMA_CHANNEL_STATE_AT_BARRIER = 5, ALT_DMA_CHANNEL_STATE_WFP = 7, ALT_DMA_CHANNEL_STATE_KILLING = 8,
  ALT_DMA_CHANNEL_STATE_COMPLETING = 9, ALT_DMA_CHANNEL_STATE_FAULTING_COMPLETING = 14, ALT_DMA_CHANNEL_STATE_FAULTING = 15
}
 
enum  ALT_DMA_MANAGER_FAULT_e {
  ALT_DMA_MANAGER_FAULT_DBG_INSTR = (int32_t)(1UL << 30), ALT_DMA_MANAGER_FAULT_INSTR_FETCH_ERR = (int32_t)(1UL << 16), ALT_DMA_MANAGER_FAULT_MGR_EVNT_ERR = (int32_t)(1UL << 5), ALT_DMA_MANAGER_FAULT_DMAGO_ERR = (int32_t)(1UL << 4),
  ALT_DMA_MANAGER_FAULT_OPERAND_INVALID = (int32_t)(1UL << 1), ALT_DMA_MANAGER_FAULT_UNDEF_INSTR = (int32_t)(1UL << 0)
}
 
enum  ALT_DMA_CHANNEL_FAULT_e {
  ALT_DMA_CHANNEL_FAULT_LOCKUP_ERR = (int32_t)(1UL << 31), ALT_DMA_CHANNEL_FAULT_DBG_INSTR = (int32_t)(1UL << 30), ALT_DMA_CHANNEL_FAULT_DATA_READ_ERR = (int32_t)(1UL << 18), ALT_DMA_CHANNEL_FAULT_DATA_WRITE_ERR = (int32_t)(1UL << 17),
  ALT_DMA_CHANNEL_FAULT_INSTR_FETCH_ERR = (int32_t)(1UL << 16), ALT_DMA_CHANNEL_FAULT_ST_DATA_UNAVAILABLE = (int32_t)(1UL << 13), ALT_DMA_CHANNEL_FAULT_MFIFO_ERR = (int32_t)(1UL << 12), ALT_DMA_CHANNEL_FAULT_CH_RDWR_ERR = (int32_t)(1UL << 7),
  ALT_DMA_CHANNEL_FAULT_CH_PERIPH_ERR = (int32_t)(1UL << 6), ALT_DMA_CHANNEL_FAULT_CH_EVNT_ERR = (int32_t)(1UL << 5), ALT_DMA_CHANNEL_FAULT_OPERAND_INVALID = (int32_t)(1UL << 1), ALT_DMA_CHANNEL_FAULT_UNDEF_INSTR = (int32_t)(1UL << 0)
}
 
enum  ALT_DMA_EVENT_SELECT_e { ALT_DMA_EVENT_SELECT_SEND_EVT, ALT_DMA_EVENT_SELECT_SIG_IRQ }
 
enum  ALT_DMA_PERIPH_MUX_e { ALT_DMA_PERIPH_MUX_DEFAULT = 0, ALT_DMA_PERIPH_MUX_FPGA = 1, ALT_DMA_PERIPH_MUX_CAN = 2 }
 

Functions

ALT_STATUS_CODE alt_dma_init (const ALT_DMA_CFG_t *dma_cfg)
 
ALT_STATUS_CODE alt_dma_uninit (void)
 
ALT_STATUS_CODE alt_dma_channel_alloc (ALT_DMA_CHANNEL_t channel)
 
ALT_STATUS_CODE alt_dma_channel_alloc_any (ALT_DMA_CHANNEL_t *allocated)
 
ALT_STATUS_CODE alt_dma_channel_free (ALT_DMA_CHANNEL_t channel)
 
ALT_STATUS_CODE alt_dma_channel_exec (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_t *pgm)
 
ALT_STATUS_CODE alt_dma_channel_kill (ALT_DMA_CHANNEL_t channel)
 
ALT_STATUS_CODE alt_dma_channel_reg_get (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_REG_t reg, uint32_t *val)
 
ALT_STATUS_CODE alt_dma_send_event (ALT_DMA_EVENT_t evt_num)
 
ALT_STATUS_CODE alt_dma_manager_state_get (ALT_DMA_MANAGER_STATE_t *state)
 
ALT_STATUS_CODE alt_dma_channel_state_get (ALT_DMA_CHANNEL_t channel, ALT_DMA_CHANNEL_STATE_t *state)
 
ALT_STATUS_CODE alt_dma_manager_fault_status_get (ALT_DMA_MANAGER_FAULT_t *fault)
 
ALT_STATUS_CODE alt_dma_channel_fault_status_get (ALT_DMA_CHANNEL_t channel, ALT_DMA_CHANNEL_FAULT_t *fault)
 
ALT_STATUS_CODE alt_dma_event_int_select (ALT_DMA_EVENT_t evt_num, ALT_DMA_EVENT_SELECT_t opt)
 
ALT_STATUS_CODE alt_dma_event_int_status_get_raw (ALT_DMA_EVENT_t evt_num)
 
ALT_STATUS_CODE alt_dma_int_status_get (ALT_DMA_EVENT_t irq_num)
 
ALT_STATUS_CODE alt_dma_int_clear (ALT_DMA_EVENT_t irq_num)
 
ALT_STATUS_CODE alt_dma_memory_to_memory (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_t *program, void *dest, const void *src, size_t size, bool send_evt, ALT_DMA_EVENT_t evt)
 
ALT_STATUS_CODE alt_dma_zero_to_memory (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_t *program, void *buf, size_t size, bool send_evt, ALT_DMA_EVENT_t evt)
 
ALT_STATUS_CODE alt_dma_memory_to_register (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_t *program, void *dst_reg, const void *src_buf, size_t count, uint32_t register_width_bits, bool send_evt, ALT_DMA_EVENT_t evt)
 
ALT_STATUS_CODE alt_dma_register_to_memory (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_t *program, void *dst_buf, const void *src_reg, size_t count, uint32_t register_width_bits, bool send_evt, ALT_DMA_EVENT_t evt)
 
ALT_STATUS_CODE alt_dma_memory_to_periph (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_t *program, ALT_DMA_PERIPH_t dest, const void *src, size_t size, void *periph_info, bool send_evt, ALT_DMA_EVENT_t evt)
 
ALT_STATUS_CODE alt_dma_periph_to_memory (ALT_DMA_CHANNEL_t channel, ALT_DMA_PROGRAM_t *program, void *dest, ALT_DMA_PERIPH_t src, size_t size, void *periph_info, bool send_evt, ALT_DMA_EVENT_t evt)