EasyManua.ls Logo

Espressif ESP32-S2 - Page 374

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 2. API Reference
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.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE sigmadelta driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
channel: Sigma-delta channel number
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.
esp_err_t sigmadelta_set_prescale(sigmadelta_channel_t channel, uint8_t prescale)
Set Sigma-delta channels clock pre-scale value. The source clock is APP_CLK, 80MHz. The clock frequency
of the sigma-delta channel is APP_CLK / pre_scale.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE sigmadelta driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
channel: Sigma-delta channel number
prescale: The divider of source clock, ranges from 0 to 255
esp_err_t sigmadelta_set_pin(sigmadelta_channel_t channel, gpio_num_t gpio_num)
Set Sigma-delta signal output pin.
Return
ESP_OK Success
ESP_ERR_INVALID_STATE sigmadelta driver has not been initialized
ESP_ERR_INVALID_ARG Parameter error
Parameters
channel: Sigma-delta channel number
gpio_num: GPIO number of output pin.
Header File
components/hal/include/hal/sigmadelta_types.h
Structures
struct sigmadelta_config_t
Sigma-delta configure struct.
Public Members
sigmadelta_channel_t channel
Sigma-delta channel number
int8_t sigmadelta_duty
Sigma-delta duty, duty ranges from -128 to 127.
uint8_t sigmadelta_prescale
Sigma-delta prescale, prescale ranges from 0 to 255.
uint8_t sigmadelta_gpio
Sigma-delta output io number, refer to gpio.h for more details.
Espressif Systems 363
Submit Document Feedback
Release v4.4

Table of Contents