|
InPlay API
|
HAL_DMA. More...
Data Structures | |
| struct | dma_bd_t |
| DMA block descriptor structure. More... | |
Functions | |
| void * | hal_dma_open (int id, int periph_id, uint32_t sar, uint32_t dar, int size, int sdw, int ddw, int sai, int dai, int sbz, int dbz, int sahb, int dahb, int ttype) |
| Open the DMA driver. More... | |
| void * | hal_dma_soft_open (int id, uint32_t sar, uint32_t dar, int size, int sdw, int ddw, int sai, int dai, int sbz, int dbz, int sahb, int dahb, int ttype) |
| Open a Software Control DMA driver. More... | |
| void | hal_dma_close (void *hdl) |
| Close the DMA driver. More... | |
| int | hal_dma_ch_enable (void *hdl, void *arg, void(*callback)(int id, void *arg, uint32_t status)) |
| (Software Control) DMA channel enable More... | |
| int | hal_dma_ch_disable (void *hdl) |
| DMA channel disable. More... | |
| char | hal_dma_ch_is_enabled (void *hdl) |
| DMA channel is enabled. More... | |
| int | hal_dma_switch_buffer (void *hdl, int sa_da, uint32_t buffer_addr) |
| DMA change source or destination buffer address : This function is provided to quickly switch buffer without re-program all the DMA register. More... | |
| int | hal_dma_src_req (void *hdl) |
| DMA controlled by software to transfer data from or to peripheral. More... | |
| uint32_t | hal_dma_get_tran_len (void *hdl) |
| Get DMA transfer length. More... | |
| int | hal_dma_add_mb_item (uint32_t ba, uint32_t next_ba, uint32_t dar, uint32_t sar, int dtw, int stw, int dai, int sai, int dbz, int sbz, int dms, int sms, int tt_fc, int size) |
| Add DMA each block descriptor for block chaining : Call this function before start DMA block chaining. More... | |
| void * | hal_dma_mb_open (int id, uint32_t bd_addr, int bda_nb, int src_periph_id, int dst_periph_id) |
| DMA block chaining open. More... | |
| int | hal_dma_mb_ch_enable (void *hdl, void *arg, void(*callback)(int id, void *arg, uint32_t status)) |
| DMA link list driver open. More... | |
| int | hal_dma_mb_ch_disable (void *hdl, uint32_t baddr) |
| DMA link list driver open. More... | |
| int | hal_dma_pcm_en (void *buffer0, void *buffer1, uint16_t buffer_len, void *arg, void(*callback)(void *arg, int id, uint32_t status)) |
| DMA Audio block's PCM data to memory : This function is not responsible for setting up Audio Block's PCM output. More... | |
| void * | hal_dma_open (int id, int periph_id, int sai, int dai, int sahb, int dahb, int ttype, int prio) |
| Open the DMA driver. More... | |
HAL_DMA.
| int hal_dma_add_mb_item | ( | uint32_t | ba, |
| uint32_t | next_ba, | ||
| uint32_t | dar, | ||
| uint32_t | sar, | ||
| int | dtw, | ||
| int | stw, | ||
| int | dai, | ||
| int | sai, | ||
| int | dbz, | ||
| int | sbz, | ||
| int | dms, | ||
| int | sms, | ||
| int | tt_fc, | ||
| int | size | ||
| ) |
Add DMA each block descriptor for block chaining : Call this function before start DMA block chaining.
| [in] | ba | Block address. This should be system memory address with 4 bytes alignment |
| [in] | next_ba | Next block address. |
| [in] | dar | The destination address of the DMA trandfer. |
| [in] | sar | The source address of the DMA trandfer. |
| [in] | dtw | The destination transfer data width, |
| [in] | stw | The source transfer data width, |
| [in] | dai | The destination address changes, |
| [in] | sai | The source address changes, |
| [in] | dbz | The destination burst size, |
| [in] | sbz | The source burst size, |
| [in] | dms | The destination AHB master, |
| [in] | sms | The source AHB master, |
| [in] | tt_fc |
| int hal_dma_ch_disable | ( | void * | hdl | ) |
DMA channel disable.
| [in] | hdl | The handle from the previous "open" function. |
| int hal_dma_ch_enable | ( | void * | hdl, |
| void * | arg, | ||
| void(*)(int id, void *arg, uint32_t status) | callback | ||
| ) |
(Software Control) DMA channel enable
| [in] | hdl | The handle from the previous "open" function. |
| [in] | *arg | The pointer to the caller's argument. |
| [in] | *callback | The call back function for DMA complete. |
| char hal_dma_ch_is_enabled | ( | void * | hdl | ) |
DMA channel is enabled.
| hdl | The handle from the previous "open" function. |
| void hal_dma_close | ( | void * | hdl | ) |
Close the DMA driver.
| [in] | hdl | The handle from the previous "open" function. |
| uint32_t hal_dma_get_tran_len | ( | void * | hdl | ) |
Get DMA transfer length.
| [in] | hdl | The handle from the previous "open" function. |
| int hal_dma_mb_ch_disable | ( | void * | hdl, |
| uint32_t | baddr | ||
| ) |
DMA link list driver open.
| [in] | hdl | The handle from the previous "open" function. |
| [in] | baddr | Block address to stop. |
| int hal_dma_mb_ch_enable | ( | void * | hdl, |
| void * | arg, | ||
| void(*)(int id, void *arg, uint32_t status) | callback | ||
| ) |
DMA link list driver open.
| [in] | hdl | The handle from the previous "open" function. |
| [in] | arg | Arguement pass to call back. |
| [in] | callback | Call back after each block finish |
| void * hal_dma_mb_open | ( | int | id, |
| uint32_t | bd_addr, | ||
| int | bda_nb, | ||
| int | src_periph_id, | ||
| int | dst_periph_id | ||
| ) |
DMA block chaining open.
| [in] | id | The DMAI ID, |
| [in] | bd_addr | FIrst block descriptor base address. |
| [in] | bda_nb | Number of block descriptor |
| [in] | src_periph_id | The peripheral ID, |
| [in] | dst_periph_id | The peripheral ID, |
| void* hal_dma_open | ( | int | id, |
| int | periph_id, | ||
| int | sai, | ||
| int | dai, | ||
| int | sahb, | ||
| int | dahb, | ||
| int | ttype, | ||
| int | prio | ||
| ) |
Open the DMA driver.
| [in] | id | The DMAI ID, |
| [in] | periph_id | The peripheral ID, |
| [in] | sar | The source address of the DMA trandfer. |
| [in] | dar | The destination address of the DMA trandfer. |
| [in] | size | The total transfer size. |
| [in] | sdw | The source data width, |
| [in] | ddw | The destination data width, |
| [in] | sai | The source address changes, |
| [in] | dai | The destination address changes, |
| [in] | sbz | The source burst size, |
| [in] | dbz | The destination burst size, |
| [in] | sahb | The source AHB master, |
| [in] | dahb | The destination AHB master, |
| [in] | ttype | The DMA transfer type, |
| void* hal_dma_open | ( | int | id, |
| int | periph_id, | ||
| uint32_t | sar, | ||
| uint32_t | dar, | ||
| int | size, | ||
| int | sdw, | ||
| int | ddw, | ||
| int | sai, | ||
| int | dai, | ||
| int | sbz, | ||
| int | dbz, | ||
| int | sahb, | ||
| int | dahb, | ||
| int | ttype | ||
| ) |
Open the DMA driver.
| [in] | id | The DMAI ID, |
| [in] | periph_id | The peripheral ID, |
| [in] | sar | The source address of the DMA trandfer. |
| [in] | dar | The destination address of the DMA trandfer. |
| [in] | size | The total transfer size. |
| [in] | sdw | The source data width, |
| [in] | ddw | The destination data width, |
| [in] | sai | The source address changes, |
| [in] | dai | The destination address changes, |
| [in] | sbz | The source burst size, |
| [in] | dbz | The destination burst size, |
| [in] | sahb | The source AHB master, |
| [in] | dahb | The destination AHB master, |
| [in] | ttype | The DMA transfer type, |
| int hal_dma_pcm_en | ( | void * | buffer0, |
| void * | buffer1, | ||
| uint16_t | buffer_len, | ||
| void * | arg, | ||
| void(*)(void *arg, int id, uint32_t status) | callback | ||
| ) |
DMA Audio block's PCM data to memory : This function is not responsible for setting up Audio Block's PCM output.
| [in] | buffer0 | Ping buffer |
| [in] | buffer1 | Pong buffer |
| [in] | buffer_len | Ping/Pong buffer size in 4 bytes unit |
| [in] | arg | Pointer to the user's argument to pass to DMA ping/pong transfer done call back function |
| [in] | callback | Pointer to the user's call back function for the DMA ping/pong transfer done. |
| void * hal_dma_soft_open | ( | int | id, |
| uint32_t | sar, | ||
| uint32_t | dar, | ||
| int | size, | ||
| int | sdw, | ||
| int | ddw, | ||
| int | sai, | ||
| int | dai, | ||
| int | sbz, | ||
| int | dbz, | ||
| int | sahb, | ||
| int | dahb, | ||
| int | ttype | ||
| ) |
Open a Software Control DMA driver.
| [in] | id | The DMAI ID, |
| [in] | sar | The source address of the DMA trandfer. |
| [in] | dar | The destination address of the DMA trandfer. |
| [in] | size | The total transfer size. |
| [in] | sdw | The source data width, |
| [in] | ddw | The destination data width, |
| [in] | sai | The source address changes, |
| [in] | dai | The destination address changes, |
| [in] | sbz | The source burst size, |
| [in] | dbz | The destination burst size, |
| [in] | sahb | The source AHB master, |
| [in] | dahb | The destination AHB master, |
| [in] | ttype | The DMA transfer type, |
| int hal_dma_src_req | ( | void * | hdl | ) |
DMA controlled by software to transfer data from or to peripheral.
| [in] | hdl | The handle from the previous "open" function. |
| int hal_dma_switch_buffer | ( | void * | hdl, |
| int | sa_da, | ||
| uint32_t | buffer_addr | ||
| ) |
DMA change source or destination buffer address : This function is provided to quickly switch buffer without re-program all the DMA register.
| [in] | hdl | The handle from the previous "open" function. |
| [in] | sa_da | Flag to indicate which buffer address to change, 1: Source address, 0: Destination address |
| [in] | buffer_addr | New buffer address. |