RTEMS
5.1
|
Data Structures | |
struct | ALT_DMA_CFG_s |
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 |
This API provides functions for configuration, control, and status queries of the DMA controller.
typedef struct ALT_DMA_CFG_s ALT_DMA_CFG_t |
This type defines the structure used to specify the configuration of the security states and peripheral interface MUX selections for the DMA controller.
typedef enum ALT_DMA_CHANNEL_FAULT_e ALT_DMA_CHANNEL_FAULT_t |
This type definition enumerates the possible fault status that a channel may have as a register mask.
typedef enum ALT_DMA_CHANNEL_STATE_e ALT_DMA_CHANNEL_STATE_t |
This type definition enumerates the operational states that a DMA channel may have.
typedef enum ALT_DMA_EVENT_SELECT_e ALT_DMA_EVENT_SELECT_t |
This type definition enumerates the possible DMA event-interrupt behavior option selections when a DMASEV instruction is executed.
typedef enum ALT_DMA_MANAGER_FAULT_e ALT_DMA_MANAGER_FAULT_t |
This type definition enumerates the possible fault status that the DMA manager can have as a register mask.
typedef enum ALT_DMA_MANAGER_STATE_e ALT_DMA_MANAGER_STATE_t |
This type definition enumerates the operational states that the DMA manager may have.
typedef enum ALT_DMA_PERIPH_MUX_e ALT_DMA_PERIPH_MUX_t |
This type enumerates the DMA peripheral interface MUX selection options available.
This type definition enumerates the possible fault status that a channel may have as a register mask.
This type definition enumerates the operational states that a DMA channel may have.
This type definition enumerates the possible DMA event-interrupt behavior option selections when a DMASEV instruction is executed.
This type definition enumerates the possible fault status that the DMA manager can have as a register mask.
This type definition enumerates the operational states that the DMA manager may have.
enum ALT_DMA_PERIPH_MUX_e |
ALT_STATUS_CODE alt_dma_channel_alloc | ( | ALT_DMA_CHANNEL_t | channel | ) |
Allocate a DMA channel resource for use.
channel | A DMA controller channel. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_STATUS_CODE alt_dma_channel_alloc_any | ( | ALT_DMA_CHANNEL_t * | allocated | ) |
Allocate a free DMA channel resource for use if there are any.
allocated | [out] A pointer to an output parameter that will contain the channel allocated. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. An unallocated channel may not be available at the time of the API call. |
ALT_STATUS_CODE alt_dma_channel_exec | ( | ALT_DMA_CHANNEL_t | channel, |
ALT_DMA_PROGRAM_t * | pgm | ||
) |
Start execution of a DMA microcode program on the specified DMA channel thread resource.
channel | The DMA channel thread used to execute the microcode program. |
pgm | The DMA microcode program. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_STATUS_CODE alt_dma_channel_fault_status_get | ( | ALT_DMA_CHANNEL_t | channel, |
ALT_DMA_CHANNEL_FAULT_t * | fault | ||
) |
Return the current fault status of the specified DMA channel thread.
channel | The DMA channel thread to return the fault status of. |
fault | [out] Pointer to an output parameter to contain the DMA channel fault status. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given channel identifier is invalid. |
ALT_STATUS_CODE alt_dma_channel_free | ( | ALT_DMA_CHANNEL_t | channel | ) |
Free a DMA channel resource for reuse.
channel | The DMA controller channel resource to free. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. The channel may not be in the STOPPED state. |
ALT_STATUS_CODE alt_dma_channel_kill | ( | ALT_DMA_CHANNEL_t | channel | ) |
Kill (abort) execution of any microcode program executing on the specified DMA channel thread resource.
Terminates the channel thread of execution by issuing a DMAKILL instruction using the DMA APB slave interface.
channel | The DMA channel thread to abort any executing microcode program on. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_TMO | Timeout waiting for the channel to change into KILLING or STOPPED state. |
ALT_STATUS_CODE alt_dma_channel_reg_get | ( | ALT_DMA_CHANNEL_t | channel, |
ALT_DMA_PROGRAM_REG_t | reg, | ||
uint32_t * | val | ||
) |
Returns the current register value for the given DMA channel.
channel | The DMA channel thread to abort any executing microcode program on. |
reg | Register to get the value for. |
val | [out] The current value of the requested register. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The specified channel or register is invalid. |
ALT_STATUS_CODE alt_dma_channel_state_get | ( | ALT_DMA_CHANNEL_t | channel, |
ALT_DMA_CHANNEL_STATE_t * | state | ||
) |
Returns the current operational state of the specified DMA channel thread.
channel | The DMA channel thread to return the operational state of. |
state | [out] Pointer to an output parameter to contain the DMA channel thread state. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given channel identifier is invalid. |
ALT_STATUS_CODE alt_dma_event_int_select | ( | ALT_DMA_EVENT_t | evt_num, |
ALT_DMA_EVENT_SELECT_t | opt | ||
) |
Select whether the DMA controller sends the specific event to all channel threads or signals an interrupt using the corressponding irq when a DMASEV instruction is executed for the specified event-interrupt resource number.
evt_num | The event-interrupt resource number. Valid values are ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT. |
opt | The desired behavior selection for evt_num when a DMASEV is executed. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given selection identifier is invalid. |
ALT_STATUS_CODE alt_dma_event_int_status_get_raw | ( | ALT_DMA_EVENT_t | evt_num | ) |
Returns the status of the specified event-interrupt resource.
Returns ALT_E_TRUE if event is active or irq[N] is HIGH and returns ALT_E_FALSE if event is inactive or irq[N] is LOW.
evt_num | The event-interrupt resource number. Valid values are ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT. |
ALT_E_TRUE | Event is active or irq[N] is HIGH. |
ALT_E_FALSE | Event is inactive or irq[N] is LOW. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given event identifier is invalid. |
ALT_STATUS_CODE alt_dma_init | ( | const ALT_DMA_CFG_t * | dma_cfg | ) |
Initialize the DMA controller.
Initializes the DMA controller by setting the necessary control values to establish the security state and MUXed peripheral request interface selection configurations before taking the DMA controller out of reset.
After the DMA is initialized, the following conditions hold true:
dma_cfg | A pointer to a ALT_DMA_CFG_t structure containing the desired DMA controller security state and peripheral request interface MUX selections. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_STATUS_CODE alt_dma_int_clear | ( | ALT_DMA_EVENT_t | irq_num | ) |
Clear the active (HIGH) status of the specified interrupt resource.
If the specified interrupt is HIGH, then sets irq[N] to LOW if the event-interrupt resource is configured (see: alt_dma_event_int_enable()) to signal an interrupt. Otherwise, the status of irq[N] does not change.
irq_num | The interrupt resource number. Valid values are ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given event identifier is invalid. |
ALT_STATUS_CODE alt_dma_int_status_get | ( | ALT_DMA_EVENT_t | irq_num | ) |
Returns the status of the specified interrupt resource.
Returns ALT_E_TRUE if interrupt is active and therfore irq[N] is HIGH and returns ALT_E_FALSE if interrupt is inactive and therfore irq[N] is LOW.
irq_num | The interrupt resource number. Valid values are ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 and ALT_DMA_EVENT_ABORT. |
ALT_E_TRUE | Event is active or irq[N] is HIGH. |
ALT_E_FALSE | Event is inactive or irq[N] is LOW. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given event identifier is invalid. |
ALT_STATUS_CODE alt_dma_manager_fault_status_get | ( | ALT_DMA_MANAGER_FAULT_t * | fault | ) |
Return the current fault status of the DMA manager thread.
fault | [out] Pointer to an output parameter to contain the DMA manager fault status. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_STATUS_CODE alt_dma_manager_state_get | ( | ALT_DMA_MANAGER_STATE_t * | state | ) |
Returns the current operational state of the DMA manager thread.
state | [out] Pointer to an output parameter to contain the DMA channel thread state. |
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_STATUS_CODE alt_dma_send_event | ( | ALT_DMA_EVENT_t | evt_num | ) |
Signals the occurrence of an event or interrupt, using the specified event number.
Causes the CPU to issue a DMASEV instruction using the DMA APB slave interface.
The Interrupt Enable Register (INTEN) register is used to control if each event-interrupt resource is either an event or an interrupt. The INTEN register sets the event-interrupt resource to function as an:
When the configured to generate an event, this function may be used to restart one or more waiting DMA channels (i.e. having executed a DMAWFE instruction).
See the following sections from the ARM DDI 0424C, CoreLink DMA Controller DMA-330 Technical Reference Manual for implementation details and use cases:
evt_num |
A DMA event-interrupt resource. Allowable event values may be ALT_DMA_EVENT_0 .. ALT_DMA_EVENT_7 but ALT_DMA_EVENT_ABORT is not.
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |
ALT_E_BAD_ARG | The given event number is invalid. |
ALT_STATUS_CODE alt_dma_uninit | ( | void | ) |
Uninitializes the DMA controller.
Uninitializes the DMA controller by killing any running channel threads and putting the DMA controller into reset.
ALT_E_SUCCESS | The operation was successful. |
ALT_E_ERROR | The operation failed. |