Azure Sphere MT3620 M4 API Reference Manual
|
This section provides DMA OS-HAL APIs to use DMA channel for data transfer. More...
This section provides DMA OS-HAL APIs to use DMA channel for data transfer.
Functions | |
int | mtk_os_hal_dma_alloc_chan (enum dma_channel chn) |
This function is used to allocate one DMA channel. More... | |
int | mtk_os_hal_dma_config (enum dma_channel chn, struct dma_setting *setting) |
This function is used to config one DMA channel. More... | |
int | mtk_os_hal_dma_start (enum dma_channel chn) |
This function is used to start one DMA channel. More... | |
int | mtk_os_hal_dma_stop (enum dma_channel chn) |
This function is used to stop one DMA channel. More... | |
int | mtk_os_hal_dma_pause (enum dma_channel chn) |
This function is used to pause one DMA channel. More... | |
int | mtk_os_hal_dma_resume (enum dma_channel chn) |
This function is used to resume one DMA channel. More... | |
int | mtk_os_hal_dma_get_status (enum dma_channel chn) |
This function is used to get DMA channel status. More... | |
int | mtk_os_hal_dma_register_isr (enum dma_channel chn, dma_interrupt_callback callback, void *callback_data, enum dma_interrupt_type isr_type) |
This function is used to register interrupt callback. More... | |
int | mtk_os_hal_dma_dump_register (enum dma_channel chn) |
This function is used to dump DMA registers for debug. More... | |
int | mtk_os_hal_dma_set_param (enum dma_channel chn, enum dma_param_type param_type, u32 value) |
This function is used to set DMA parameter which is defined in the dma_param_type. More... | |
int | mtk_os_hal_dma_get_param (enum dma_channel chn, enum dma_param_type param_type) |
This function is used to get DMA parameter which is defined in the dma_param_type. More... | |
int | mtk_os_hal_dma_update_swptr (enum dma_channel chn, u32 length_byte) |
This function is used to update VFF DMA channel swptr. More... | |
int | mtk_os_hal_dma_vff_read_data (enum dma_channel chn, u8 *buffer, u32 length) |
This function is used to read data from FIFO of VFF DMA channel. More... | |
int | mtk_os_hal_dma_release_chan (enum dma_channel chn) |
This function is used to release one DMA channel. More... | |
int | mtk_os_hal_dma_reset (enum dma_channel chn) |
This function is used to reset DMA channel. More... | |
int | mtk_os_hal_dma_clr_dreq (enum dma_channel chn) |
This function is used to clear dreq signal of DMA channel. More... | |
int mtk_os_hal_dma_alloc_chan | ( | enum dma_channel | chn | ) |
This function is used to allocate one DMA channel.
Usage: Users should call it as the first step when use DMA OS-HAL APIs.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_config | ( | enum dma_channel | chn, |
struct dma_setting * | setting | ||
) |
This function is used to config one DMA channel.
Usage: Used to config one DMA channel.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
[in] | setting | : The DMA channel data transfer setting, please refer to dma_setting. |
int mtk_os_hal_dma_start | ( | enum dma_channel | chn | ) |
This function is used to start one DMA channel.
Usage: Used to start one DMA channel.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_stop | ( | enum dma_channel | chn | ) |
This function is used to stop one DMA channel.
Usage: Used to stop one DMA channel.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_pause | ( | enum dma_channel | chn | ) |
This function is used to pause one DMA channel.
Usage: Used to pause one DMA channel.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_resume | ( | enum dma_channel | chn | ) |
This function is used to resume one DMA channel.
Usage: Used to resume one DMA channel.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_get_status | ( | enum dma_channel | chn | ) |
This function is used to get DMA channel status.
Usage: Used to get DMA channel status. The DMA channel status can refer to dma_status in M-HAL.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_register_isr | ( | enum dma_channel | chn, |
dma_interrupt_callback | callback, | ||
void * | callback_data, | ||
enum dma_interrupt_type | isr_type | ||
) |
This function is used to register interrupt callback.
Usage: Used to register interrupt callback.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
[in] | callback | : The DMA interrupt callback, please refer to dma_interrupt_callback. |
[in] | callback_data | : The users data of callback. |
[in] | isr_type | : The interrupt type, please refer to dma_interrupt_type. |
int mtk_os_hal_dma_dump_register | ( | enum dma_channel | chn | ) |
This function is used to dump DMA registers for debug.
Usage: Used to dump DMA registers for debug.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_set_param | ( | enum dma_channel | chn, |
enum dma_param_type | param_type, | ||
u32 | value | ||
) |
This function is used to set DMA parameter which is defined in the dma_param_type.
Usage: Users should call this function carefully if DMA channel is running.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
[in] | param_type | : The parameter type whose value to be set. |
[in] | value | : The new parameter value. |
int mtk_os_hal_dma_get_param | ( | enum dma_channel | chn, |
enum dma_param_type | param_type | ||
) |
This function is used to get DMA parameter which is defined in the dma_param_type.
Usage: Users should call this function carefully if DMA channel is running.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
[in] | param_type | : The parameter type whose value to be got. |
int mtk_os_hal_dma_update_swptr | ( | enum dma_channel | chn, |
u32 | length_byte | ||
) |
This function is used to update VFF DMA channel swptr.
Usage: Used to update VFF DMA channel swptr. If users read data from Virtual FIFO or write data into Virtual FIFO, users should update swptr to control read pointer or write pointer of fifo control engine. This API is only for VFF DMA.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
[in] | length_byte | : The updated byte count. It cannot be larger than vfifo size. |
int mtk_os_hal_dma_vff_read_data | ( | enum dma_channel | chn, |
u8 * | buffer, | ||
u32 | length | ||
) |
This function is used to read data from FIFO of VFF DMA channel.
Usage: Used to read data from FIFO of VFF DMA channel. This api will also update swptr after reading data. This API is only for VFF DMA.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
[out] | buffer | : buffer for saving read data. |
[in] | length | : byte number which users want to read. It cannot be larger than vfifo size. |
int mtk_os_hal_dma_release_chan | ( | enum dma_channel | chn | ) |
This function is used to release one DMA channel.
Usage: Users should call it as the last step when use DMA OS-HAL APIs.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_reset | ( | enum dma_channel | chn | ) |
This function is used to reset DMA channel.
Usage: Users can call this API to reset DMA channel.
[in] | chn | : The DMA channel number, please refer to dma_channel. |
int mtk_os_hal_dma_clr_dreq | ( | enum dma_channel | chn | ) |
This function is used to clear dreq signal of DMA channel.
Usage: This function is specified for HALF-SIZE DMA and VFF DMA.
[in] | chn | : The DMA channel number, please refer to dma_channel. |