Functions for DMA driver. More...
Functions | |
| dma_status_en | dma_init (dma_instance_en instance) |
| dma_status_en | dma_deinit (dma_instance_en instance) |
| dma_status_en | dma_channel_request (dma_instance_en instance, uint32_t *channel, dma_channel_attr_t *attr) |
| dma_status_en | dma_request_specific_channel (dma_instance_en instance, uint32_t channel) |
| dma_status_en | dma_free_channel (dma_instance_en instance, uint32_t channel) |
| dma_status_en | dma_prepare_transfer (dma_instance_en instance, uint32_t channel, dma_channel_config_t *config) |
| dma_status_en | dma_start_transfer (dma_instance_en instance, uint32_t channel) |
| dma_status_en | dma_sw_trig_config (dma_instance_en instance, uint32_t channel, const dma_sw_trigger_config_t *config) |
| dma_status_en | dma_sw_trig (dma_instance_en instance, uint32_t channel, dma_trigger_target_en trigger_target) |
| dma_status_en | dma_get_status (dma_instance_en instance, uint32_t channel, uint32_t *status) |
| dma_status_en | dma_clear_status (dma_instance_en instance, uint32_t channel, uint32_t mask) |
| dma_status_en | dma_enable_ints (dma_instance_en instance, uint32_t channel, uint32_t mask) |
| dma_status_en | dma_disable_ints (dma_instance_en instance, uint32_t channel, uint32_t mask) |
| dma_status_en | dma_get_error (dma_instance_en instance, uint32_t channel, uint32_t *error) |
| dma_status_en | dma_pause_transfer (dma_instance_en instance, uint32_t channel) |
| dma_status_en | dma_resume_transfer (dma_instance_en instance, uint32_t channel) |
| dma_status_en | dma_stop_transfer (dma_instance_en instance, uint32_t channel) |
| dma_status_en | dma_abort_transfer (dma_instance_en instance, uint32_t channel) |
| dma_status_en | dma_get_remaining_bytes (dma_instance_en instance, uint32_t channel, uint32_t *remaining) |
| dma_status_en | dma_channel_is_active (dma_instance_en instance, uint32_t channel, bool *active) |
| dma_status_en | dma_create_descriptor (dma_instance_en instance, uint32_t channel, const dma_channel_config_t *config, dma_descriptor_handle_t *descriptor_out) |
| dma_status_en | dma_link_descriptors (dma_descriptor_handle_t first_desc, dma_descriptor_handle_t second_desc) |
| dma_status_en | dma_start_descriptor_chain (dma_instance_en instance, uint32_t channel, dma_descriptor_handle_t *first_desc) |
| dma_status_en | dma_free_descriptor (dma_descriptor_handle_t descriptor) |
Functions for DMA driver.
General functions for DMA driver. These functions provide basic functionality on top of DMA hardware registers.
| dma_status_en dma_init | ( | dma_instance_en | instance | ) |
Initializes the DMA controller instance and internal driver state.
| [in] | instance | DMA controller instance identifier. |
| dma_status_en dma_deinit | ( | dma_instance_en | instance | ) |
Deinitializes the DMA controller instance and resets internal driver state.
| [in] | instance | DMA controller instance identifier. |
| dma_status_en dma_channel_request | ( | dma_instance_en | instance, |
| uint32_t * | channel, | ||
| dma_channel_attr_t * | attr ) |
Requests and reserves a free DMA channel for use based on requirements.
| [in] | instance | DMA controller instance identifier. |
| [out] | channel | Pointer to variable that receives the allocated channel number. |
| [in] | attr | Pointer to channel requirements structure specifying desired channel attributes. |
| dma_status_en dma_request_specific_channel | ( | dma_instance_en | instance, |
| uint32_t | channel ) |
Requests and reserves a specific DMA channel by channel number.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| dma_status_en dma_free_channel | ( | dma_instance_en | instance, |
| uint32_t | channel ) |
Releases a previously requested DMA channel, making it available for reuse.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| dma_status_en dma_prepare_transfer | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| dma_channel_config_t * | config ) |
Prepares and configures a DMA transfer, making it ready to start. This function validates parameters, configures hardware registers, and prepares the channel for execution.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [in] | config | Pointer to the complete DMA channel configuration structure containing transfer parameters, source/destination addresses, and callback settings. |
| dma_status_en dma_start_transfer | ( | dma_instance_en | instance, |
| uint32_t | channel ) |
Starts the DMA transfer on the specified channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| dma_status_en dma_sw_trig_config | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| const dma_sw_trigger_config_t * | config ) |
Configures software trigger settings for the specified DMA channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [in] | config | Pointer to software trigger configuration structure. |
| dma_status_en dma_sw_trig | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| dma_trigger_target_en | trigger_target ) |
Issues a software trigger to the specified DMA channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [in] | trigger_target | Source or destination trigger target (dma_trigger_target_en). |
| dma_status_en dma_get_status | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| uint32_t * | status ) |
Returns the current status flags of the specified DMA channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [out] | status | Pointer to store the current status flags (combination of dma_status_flags_en). |
| dma_status_en dma_clear_status | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| uint32_t | mask ) |
Clears the specified status flags for the DMA channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [in] | mask | Status mask specifying which flags to clear (combination of dma_status_flags_en). |
| dma_status_en dma_enable_ints | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| uint32_t | mask ) |
Enables interrupts for the specified DMA channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [in] | mask | Interrupt mask specifying which interrupts to enable (combination of dma_interrupt_flags_en). |
| dma_status_en dma_disable_ints | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| uint32_t | mask ) |
Disables the specified interrupt sources for the given DMA channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel for which interrupts need to be disabled (0 to max channels - 1). |
| [in] | mask | Interrupt mask specifying which interrupts to disable (combination of dma_ch_interrupt_en flags). |
| dma_status_en dma_get_error | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| uint32_t * | error ) |
Retrieves error information for the specified DMA channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [out] | error | Pointer to store the error information and error codes. |
| dma_status_en dma_pause_transfer | ( | dma_instance_en | instance, |
| uint32_t | channel ) |
Pauses the active DMA transfer on the specified channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| dma_status_en dma_resume_transfer | ( | dma_instance_en | instance, |
| uint32_t | channel ) |
Resumes a previously paused DMA transfer on the specified channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| dma_status_en dma_stop_transfer | ( | dma_instance_en | instance, |
| uint32_t | channel ) |
Stops the DMA transfer on the specified channel and resets channel state.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| dma_status_en dma_abort_transfer | ( | dma_instance_en | instance, |
| uint32_t | channel ) |
Aborts an ongoing DMA transfer on the specified channel.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| dma_status_en dma_get_remaining_bytes | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| uint32_t * | remaining ) |
Retrieves the number of bytes remaining in the current DMA transfer.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [out] | remaining | Pointer to store the remaining byte count for the current transfer. |
| dma_status_en dma_channel_is_active | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| bool * | active ) |
Checks if the specified DMA channel is currently active.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [out] | active | Pointer to store the channel active status (true if active, false if idle). |
| dma_status_en dma_create_descriptor | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| const dma_channel_config_t * | config, | ||
| dma_descriptor_handle_t * | descriptor_out ) |
Creates a DMA command descriptor based on the provided configuration. Automatically generates the header and includes only the relevant fields required for the DMA transfer.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used. |
| [in] | config | Pointer to the DMA channel configuration structure. |
| [out] | descriptor_out | Pointer to a variable that receives the created descriptor handle. The descriptor memory must be pre-allocated by the caller and aligned as per hardware requirements (typically 32-byte alignment). The caller is responsible for memory management. |
| dma_status_en dma_link_descriptors | ( | dma_descriptor_handle_t | first_desc, |
| dma_descriptor_handle_t | second_desc ) |
Links two descriptors together to form a command chain.
| [in] | first_desc | Handle to the first descriptor in the chain. |
| [in] | second_desc | Handle to the second descriptor to link to the first descriptor. |
| dma_status_en dma_start_descriptor_chain | ( | dma_instance_en | instance, |
| uint32_t | channel, | ||
| dma_descriptor_handle_t * | first_desc ) |
Starts execution of a descriptor chain by setting the initial command and linking to the first descriptor.
| [in] | instance | DMA controller instance identifier. |
| [in] | channel | Number of the channel being used (0 to max channels - 1). |
| [in] | first_desc | Pointer to handle of the first descriptor in the chain to execute. |
| dma_status_en dma_free_descriptor | ( | dma_descriptor_handle_t | descriptor | ) |
Frees a descriptor handle and releases associated resources. This function only releases internal driver resources associated with the descriptor. It does NOT free the descriptor memory itself, as that memory was provided by the caller.
| [in] | descriptor | Descriptor handle to free and release associated driver resources. |