Function esp_idf_sys::sigmadelta_set_duty
source ยท pub unsafe extern "C" fn sigmadelta_set_duty(
channel: sigmadelta_channel_t,
duty: i8,
) -> esp_err_t
Expand description
@brief Set Sigma-delta channel duty.
This function is used to set Sigma-delta channel duty,
If you add a capacitor between the output pin and ground,
the average output voltage will be Vdc = VDDIO / 256 * duty + VDDIO/2,
where VDDIO is the power supply voltage.
@param channel Sigma-delta channel number @param duty Sigma-delta duty of one channel, the value ranges from -128 to 127, recommended range is -90 ~ 90. The waveform is more like a random one in this range.
@return - ESP_OK Success - ESP_ERR_INVALID_STATE sigmadelta driver has not been initialized - ESP_ERR_INVALID_ARG Parameter error