Function esp_idf_sys::esp_dma_capable_malloc

source ·
pub unsafe extern "C" fn esp_dma_capable_malloc(
    size: usize,
    dma_mem_info: *const esp_dma_mem_info_t,
    out_ptr: *mut *mut c_void,
    actual_size: *mut usize,
) -> esp_err_t
Expand description

@brief Helper function for malloc a DMA capable memory buffer

@note This API will take care of the cache alignment internally, you will need to set esp_dma_mem_info_t: dma_alignment_bytes with either the custom alignment or DMA alignment of used peripheral driver.

@param[in] size Size in bytes, the amount of memory to allocate @param[in] dma_mem_info DMA and memory info, see esp_dma_mem_info_t @param[out] out_ptr A pointer to the memory allocated successfully @param[out] actual_size Actual size for allocation in bytes, when the size you specified doesn’t meet the DMA alignment requirements, this value might be bigger than the size you specified. Set null if you don’t care this value.

@return - ESP_OK: - ESP_ERR_INVALID_ARG: Invalid argument - ESP_ERR_NO_MEM: No enough memory for allocation