Macros | |
| #define | HPM_DMA_MGR (&s_dma_mngr_ctx) |
Typedefs | |
| typedef struct _dma_instance_info | dma_chn_info_t |
| typedef struct _dma_channel_context | dma_chn_context_t |
| DMA Channel Context Structure. More... | |
| typedef struct _dma_mgr_context | dma_mgr_context_t |
| DMA Manager Context Structure. More... | |
Functions | |
| static dma_chn_context_t * | dma_mgr_search_chn_context (const dma_resource_t *resource) |
| Search DMA channel context for specified DMA channel resource. More... | |
| static uint32_t | dma_mgr_enter_critical (void) |
| static void | dma_mgr_exit_critical (uint32_t level) |
| void | dma_mgr_isr_handler (DMA_Type *ptr, uint32_t instance) |
| DMA Manager ISR handler. More... | |
| void | dma0_isr (void) |
| void | dma_mgr_init (void) |
| Initialize DMA Manager Context. More... | |
| hpm_stat_t | dma_mgr_request_resource (dma_resource_t *resource) |
| Request DMA resource from DMA Manager. More... | |
| hpm_stat_t | dma_mgr_release_resource (const dma_resource_t *resource) |
| Release DMA resource. More... | |
| hpm_stat_t | dma_mgr_enable_dma_irq_with_priority (const dma_resource_t *resource, uint32_t priority) |
| Enable DMA interrupt with priority. More... | |
| hpm_stat_t | dma_mgr_disable_dma_irq (const dma_resource_t *resource) |
| Disable DMA interrupt NOTE: Each DMA instance consists of several DMA channels, disabling the DMA interrupt will disable the global DMA interrupt for all DMA channels. Please be aware of the impact. More... | |
| hpm_stat_t | dma_mgr_install_chn_tc_callback (const dma_resource_t *resource, dma_mgr_chn_cb_t callback, void *user_data) |
| Install Interrupt Callback for DMA channel transfer complete. More... | |
| hpm_stat_t | dma_mgr_install_chn_half_tc_callback (const dma_resource_t *resource, dma_mgr_chn_cb_t callback, void *user_data) |
| Install Interrupt Callback for DMA channel half transfer complete. More... | |
| hpm_stat_t | dma_mgr_install_chn_error_callback (const dma_resource_t *resource, dma_mgr_chn_cb_t callback, void *user_data) |
| Install Interrupt Callback for DMA channel transfer error. More... | |
| hpm_stat_t | dma_mgr_install_chn_abort_callback (const dma_resource_t *resource, dma_mgr_chn_cb_t callback, void *user_data) |
| Install Interrupt Callback for DMA channel transfer abort. More... | |
| void | dma_mgr_get_default_chn_config (dma_mgr_chn_conf_t *config) |
| Get DMA channel default config. More... | |
| hpm_stat_t | dma_mgr_setup_channel (const dma_resource_t *resource, dma_mgr_chn_conf_t *config) |
| Setup channel config. More... | |
| hpm_stat_t | dma_mgr_config_linked_descriptor (const dma_resource_t *resource, dma_mgr_chn_conf_t *config, dma_mgr_linked_descriptor_t *descriptor) |
| Setup chain linked descriptor config. More... | |
| hpm_stat_t | dma_mgr_enable_channel (const dma_resource_t *resource) |
| Enable DMA channel, start transfer. More... | |
| hpm_stat_t | dma_mgr_disable_channel (const dma_resource_t *resource) |
| Disable DMA channel. More... | |
| hpm_stat_t | dma_mgr_check_chn_enable (const dma_resource_t *resource, bool *enable) |
| Check DMA channel enable status. More... | |
| hpm_stat_t | dma_mgr_enable_chn_irq (const dma_resource_t *resource, uint32_t irq_mask) |
| Enable DMA channel interrupt. More... | |
| hpm_stat_t | dma_mgr_disable_chn_irq (const dma_resource_t *resource, uint32_t irq_mask) |
| Disable DMA channel interrupt. More... | |
| hpm_stat_t | dma_mgr_set_chn_priority (const dma_resource_t *resource, uint8_t priority) |
| Set DMA channel priority. More... | |
| hpm_stat_t | dma_mgr_set_chn_src_work_mode (const dma_resource_t *resource, uint8_t mode) |
| Set DMA channel source work mode. More... | |
| hpm_stat_t | dma_mgr_set_chn_dst_work_mode (const dma_resource_t *resource, uint8_t mode) |
| Set DMA channel destination work mode. More... | |
| hpm_stat_t | dma_mgr_set_chn_src_burst_size (const dma_resource_t *resource, uint8_t burstsize) |
| Set DMA channel source burst size. More... | |
| hpm_stat_t | dma_mgr_get_chn_remaining_transize (const dma_resource_t *resource, uint32_t *size) |
| Get DMA channel remaining transfer size. More... | |
| hpm_stat_t | dma_mgr_set_chn_transize (const dma_resource_t *resource, uint32_t size) |
| Set DMA channel transfer size. More... | |
| hpm_stat_t | dma_mgr_set_chn_src_width (const dma_resource_t *resource, uint8_t width) |
| Set DMA channel source width. More... | |
| hpm_stat_t | dma_mgr_set_chn_dst_width (const dma_resource_t *resource, uint8_t width) |
| Set DMA channel destination width. More... | |
| hpm_stat_t | dma_mgr_set_chn_src_addr (const dma_resource_t *resource, uint32_t addr) |
| Set DMA channel source address. More... | |
| hpm_stat_t | dma_mgr_set_chn_dst_addr (const dma_resource_t *resource, uint32_t addr) |
| Set DMA channel destination address. More... | |
| hpm_stat_t | dma_mgr_set_chn_src_addr_ctrl (const dma_resource_t *resource, uint8_t addr_ctrl) |
| Set DMA channel source address control mode. More... | |
| hpm_stat_t | dma_mgr_set_chn_dst_addr_ctrl (const dma_resource_t *resource, uint8_t addr_ctrl) |
| Set DMA channel destination address control mode. More... | |
| hpm_stat_t | dma_mgr_set_chn_infinite_loop_mode (const dma_resource_t *resource, bool infinite_loop) |
| Set DMA channel infinite loop mode. Attention: only DMAV2 support. More... | |
| hpm_stat_t | dma_mgr_set_chn_src_busrt_option (const dma_resource_t *resource, uint8_t burst_opt) |
| Set DMA channel source burst option. Attention: only DMAV2 support. More... | |
| hpm_stat_t | dma_mgr_set_chn_handshake_option (const dma_resource_t *resource, uint8_t handshake_opt) |
| Set DMA channel handshake option. Attention: only DMAV2 support. More... | |
| hpm_stat_t | dma_mgr_abort_chn_transfer (const dma_resource_t *resource) |
| Abort DMA channel transfer. More... | |
| hpm_stat_t | dma_mgr_check_chn_transfer_status (const dma_resource_t *resource, uint32_t *status) |
| Check DMA channel transfer status. More... | |
| hpm_stat_t | dma_mgr_set_source_burst_in_fixed_transize_enable (const dma_resource_t *resource, bool enable) |
| Set DMA channel source burst in fixed transfer size enable or disable. More... | |
| hpm_stat_t | dma_mgr_set_destination_burst_in_fix_transize_enable (const dma_resource_t *resource, bool enable) |
| Set DMA channel destination burst in fixed transfer size enable or disable. More... | |
| hpm_stat_t | dma_mgr_set_swap_mode (const dma_resource_t *resource, uint8_t swap_mode) |
| Set DMA channel swap mode. More... | |
| hpm_stat_t | dma_mgr_set_swap_table (const dma_resource_t *resource, uint32_t swap_table) |
| Set DMA channel swap table. More... | |
Variables | |
| static dma_mgr_context_t | s_dma_mngr_ctx |
| #define HPM_DMA_MGR (&s_dma_mngr_ctx) |
| typedef struct _dma_channel_context dma_chn_context_t |
DMA Channel Context Structure.
| typedef struct _dma_instance_info dma_chn_info_t |
| typedef struct _dma_mgr_context dma_mgr_context_t |
DMA Manager Context Structure.
| void dma0_isr | ( | void | ) |
| hpm_stat_t dma_mgr_abort_chn_transfer | ( | const dma_resource_t * | resource | ) |
Abort DMA channel transfer.
| [in] | resource | DMA resource |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_check_chn_enable | ( | const dma_resource_t * | resource, |
| bool * | enable | ||
| ) |
Check DMA channel enable status.
| [in] | resource | DMA resource |
| [out] | enable | enable status |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_check_chn_transfer_status | ( | const dma_resource_t * | resource, |
| uint32_t * | status | ||
| ) |
Check DMA channel transfer status.
| [in] | resource | DMA resource |
| [out] | status | transfer status DMA_MGR_CHANNEL_STATUS_ONGOING if transfer is still ongoing DMA_MGR_CHANNEL_STATUS_ERROR if any error occurred during transferring DMA_MGR_CHANNEL_STATUS_ABORT if transfer is aborted DMA_MGR_CHANNEL_STATUS_TC if transfer is finished without error DMA_MGR_CHANNEL_STATUS_HALF_TC if half transfer complete without error. Attention: only DMAV2 support |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_config_linked_descriptor | ( | const dma_resource_t * | resource, |
| dma_mgr_chn_conf_t * | config, | ||
| dma_mgr_linked_descriptor_t * | descriptor | ||
| ) |
Setup chain linked descriptor config.
| [in] | resource | DMA resource |
| [in] | config | DMA channel config |
| [out] | descriptor | linked descriptor config data pointer |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_disable_channel | ( | const dma_resource_t * | resource | ) |
Disable DMA channel.
| [in] | resource | DMA resource |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_disable_chn_irq | ( | const dma_resource_t * | resource, |
| uint32_t | irq_mask | ||
| ) |
Disable DMA channel interrupt.
| [in] | resource | DMA resource |
| [in] | irq_mask | irq mask, refer to DMA_MGR_INTERRUPT_MASK_xxxx |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_disable_dma_irq | ( | const dma_resource_t * | resource | ) |
Disable DMA interrupt NOTE: Each DMA instance consists of several DMA channels, disabling the DMA interrupt will disable the global DMA interrupt for all DMA channels. Please be aware of the impact.
| [in] | resource | DMA resource |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_enable_channel | ( | const dma_resource_t * | resource | ) |
Enable DMA channel, start transfer.
| [in] | resource | DMA resource |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_enable_chn_irq | ( | const dma_resource_t * | resource, |
| uint32_t | irq_mask | ||
| ) |
Enable DMA channel interrupt.
| [in] | resource | DMA resource |
| [in] | irq_mask | irq mask, refer to DMA_MGR_INTERRUPT_MASK_xxxx |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_enable_dma_irq_with_priority | ( | const dma_resource_t * | resource, |
| uint32_t | priority | ||
| ) |
Enable DMA interrupt with priority.
| [in] | resource | DMA resource |
| [in] | priority | Interrupt Priority |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
|
static |
|
static |
| hpm_stat_t dma_mgr_get_chn_remaining_transize | ( | const dma_resource_t * | resource, |
| uint32_t * | size | ||
| ) |
Get DMA channel remaining transfer size.
| [in] | resource | DMA resource |
| [out] | size | remaining transfer size of the channel. |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| void dma_mgr_get_default_chn_config | ( | dma_mgr_chn_conf_t * | config | ) |
Get DMA channel default config.
| [out] | config | config data pointer |
| void dma_mgr_init | ( | void | ) |
Initialize DMA Manager Context.
| hpm_stat_t dma_mgr_install_chn_abort_callback | ( | const dma_resource_t * | resource, |
| dma_mgr_chn_cb_t | callback, | ||
| void * | user_data | ||
| ) |
Install Interrupt Callback for DMA channel transfer abort.
| [in] | resource | DMA resource |
| [in] | callback | Interrupt callback for DMA resource |
| [in] | user_data | User data used in the callback |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_install_chn_error_callback | ( | const dma_resource_t * | resource, |
| dma_mgr_chn_cb_t | callback, | ||
| void * | user_data | ||
| ) |
Install Interrupt Callback for DMA channel transfer error.
| [in] | resource | DMA resource |
| [in] | callback | Interrupt callback for DMA resource |
| [in] | user_data | User data used in the callback |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_install_chn_half_tc_callback | ( | const dma_resource_t * | resource, |
| dma_mgr_chn_cb_t | callback, | ||
| void * | user_data | ||
| ) |
Install Interrupt Callback for DMA channel half transfer complete.
| [in] | resource | DMA resource |
| [in] | callback | Interrupt callback for DMA resource |
| [in] | user_data | User data used in the callback |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_install_chn_tc_callback | ( | const dma_resource_t * | resource, |
| dma_mgr_chn_cb_t | callback, | ||
| void * | user_data | ||
| ) |
Install Interrupt Callback for DMA channel transfer complete.
| [in] | resource | DMA resource |
| [in] | callback | Interrupt callback for DMA resource |
| [in] | user_data | User data used in the callback |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| void dma_mgr_isr_handler | ( | DMA_Type * | ptr, |
| uint32_t | instance | ||
| ) |
DMA Manager ISR handler.
| hpm_stat_t dma_mgr_release_resource | ( | const dma_resource_t * | resource | ) |
Release DMA resource.
| [in] | resource | DMA resource |
| status_success | if no error occurred |
| status_invalid_argument | if the parameter is invalid |
| hpm_stat_t dma_mgr_request_resource | ( | dma_resource_t * | resource | ) |
Request DMA resource from DMA Manager.
| [out] | resource | DMA resource |
| status_success | if no error occurred |
| status_invalid_argument | if the parameter is invalid |
| status_dma_mgr_no_resource | if all DMA channels are occupied; |
|
static |
Search DMA channel context for specified DMA channel resource.
| [in] | resource | DMA Channel resource |
| hpm_stat_t dma_mgr_set_chn_dst_addr | ( | const dma_resource_t * | resource, |
| uint32_t | addr | ||
| ) |
Set DMA channel destination address.
| [in] | resource | DMA resource |
| [in] | addr | destination address |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_dst_addr_ctrl | ( | const dma_resource_t * | resource, |
| uint8_t | addr_ctrl | ||
| ) |
Set DMA channel destination address control mode.
| [in] | resource | DMA resource |
| [in] | addr_ctrl | destination address control mode |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_dst_width | ( | const dma_resource_t * | resource, |
| uint8_t | width | ||
| ) |
Set DMA channel destination width.
| [in] | resource | DMA resource |
| [in] | width | transfer destination width of the channel |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_dst_work_mode | ( | const dma_resource_t * | resource, |
| uint8_t | mode | ||
| ) |
Set DMA channel destination work mode.
| [in] | resource | DMA resource |
| [in] | mode | DMA destination work mode |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_handshake_option | ( | const dma_resource_t * | resource, |
| uint8_t | handshake_opt | ||
| ) |
Set DMA channel handshake option. Attention: only DMAV2 support.
| [in] | resource | DMA resource |
| [in] | handshake_opt | handshake option |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_infinite_loop_mode | ( | const dma_resource_t * | resource, |
| bool | infinite_loop | ||
| ) |
Set DMA channel infinite loop mode. Attention: only DMAV2 support.
| [in] | resource | DMA resource |
| [in] | infinite_loop | false - normal mode(single times mode); true - infinite loop mode(cycle mode) |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_priority | ( | const dma_resource_t * | resource, |
| uint8_t | priority | ||
| ) |
Set DMA channel priority.
| [in] | resource | DMA resource |
| [in] | priority | DMA channel priority |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_src_addr | ( | const dma_resource_t * | resource, |
| uint32_t | addr | ||
| ) |
Set DMA channel source address.
| [in] | resource | DMA resource |
| [in] | addr | source address |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_src_addr_ctrl | ( | const dma_resource_t * | resource, |
| uint8_t | addr_ctrl | ||
| ) |
Set DMA channel source address control mode.
| [in] | resource | DMA resource |
| [in] | addr_ctrl | source address control mode |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_src_burst_size | ( | const dma_resource_t * | resource, |
| uint8_t | burstsize | ||
| ) |
Set DMA channel source burst size.
| [in] | resource | DMA resource |
| [in] | burstsize | DMA source burst size when BURSTOPT is 0, please reference follows:
|
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_src_busrt_option | ( | const dma_resource_t * | resource, |
| uint8_t | burst_opt | ||
| ) |
Set DMA channel source burst option. Attention: only DMAV2 support.
| [in] | resource | DMA resource |
| [in] | burst_opt | burst option |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_src_width | ( | const dma_resource_t * | resource, |
| uint8_t | width | ||
| ) |
Set DMA channel source width.
| [in] | resource | DMA resource |
| [in] | width | transfer source width of the channel |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_src_work_mode | ( | const dma_resource_t * | resource, |
| uint8_t | mode | ||
| ) |
Set DMA channel source work mode.
| [in] | resource | DMA resource |
| [in] | mode | DMA source work mode |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_chn_transize | ( | const dma_resource_t * | resource, |
| uint32_t | size | ||
| ) |
Set DMA channel transfer size.
| [in] | resource | DMA resource |
| [in] | size | transfer size of the channel. |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
| hpm_stat_t dma_mgr_set_destination_burst_in_fix_transize_enable | ( | const dma_resource_t * | resource, |
| bool | enable | ||
| ) |
Set DMA channel destination burst in fixed transfer size enable or disable.
| [in] | resource | DMA resource |
| [in] | enable | false - disable; true - enable |
| hpm_stat_t dma_mgr_set_source_burst_in_fixed_transize_enable | ( | const dma_resource_t * | resource, |
| bool | enable | ||
| ) |
Set DMA channel source burst in fixed transfer size enable or disable.
| [in] | resource | DMA resource |
| [in] | enable | false - disable; true - enable |
| hpm_stat_t dma_mgr_set_swap_mode | ( | const dma_resource_t * | resource, |
| uint8_t | swap_mode | ||
| ) |
Set DMA channel swap mode.
| [in] | resource | DMA resource |
| [in] | swap_mode | swap mode |
| hpm_stat_t dma_mgr_set_swap_table | ( | const dma_resource_t * | resource, |
| uint32_t | swap_table | ||
| ) |
Set DMA channel swap table.
| [in] | resource | DMA resource |
| [in] | swap_table | swap table |
| hpm_stat_t dma_mgr_setup_channel | ( | const dma_resource_t * | resource, |
| dma_mgr_chn_conf_t * | config | ||
| ) |
Setup channel config.
| [in] | resource | DMA resource |
| [in] | config | DMA channel config |
| status_success | if no error occurred |
| status_invalid_argument | if any parameters are invalid |
|
static |