Function esp_idf_sys::dac_continuous_write_cyclically

source ·
pub unsafe extern "C" fn dac_continuous_write_cyclically(
    handle: dac_continuous_handle_t,
    buf: *mut u8,
    buf_size: usize,
    bytes_loaded: *mut usize,
) -> esp_err_t
Expand description

@brief Write DAC continuous data cyclically @note The data in buffer will be converted cyclically using DMA once this function is called, This function will return once the data loaded into DMA buffers. @note The buffer size of cyclically output is limited by the descriptor number and dma buffer size while initializing the continuous mode. Concretely, in order to load all the data into descriptors, the cyclic buffer size is not supposed to be greater than desc_num * buf_size @note Specially, on ESP32, the data bit width of DAC continuous data is fixed to 16 bits while only the high 8 bits are available, The driver will help to expand the inputted buffer automatically by default, you can also align the data to 16 bits manually by clearing CONFIG_DAC_DMA_AUTO_16BIT_ALIGN in menuconfig.

@param[in] handle The DAC continuous channel handle that obtained from ‘dac_continuous_new_channels’ @param[in] buf The digital data buffer to convert @param[in] buf_size The buffer size of digital data buffer @param[out] bytes_loaded The bytes that has been loaded into DMA buffer, can be NULL if don’t need it @return - ESP_ERR_INVALID_ARG The input parameter is invalid - ESP_ERR_INVALID_STATE The DAC continuous mode has not been enabled yet - ESP_OK Success to output the acyclic DAC data