Select one of the symbols to view example projects that use it.
 
Outline
#include "driver/dac_types.h"
#include "esp_err.h"
dac_oneshot_s
dac_oneshot_config_t
dac_oneshot_new_channel(const dac_oneshot_config_t *, dac_oneshot_handle_t *);
dac_oneshot_del_channel(dac_oneshot_handle_t);
dac_oneshot_output_voltage(dac_oneshot_handle_t, uint8_t);
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/esp_driver_dac/include/driver/dac_oneshot.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #pragma once #include "driver/dac_types.h" #include "esp_err.h" #ifdef __cplusplus extern "C" { #endif #if SOC_DAC_SUPPORTED typedef struct dac_oneshot_s *dac_oneshot_handle_t; /*!< DAC oneshot channel handle */ /** * @brief DAC oneshot channel configuration * *//* ... */ typedef struct { dac_channel_t chan_id; /*!< DAC channel id */ }{ ... } dac_oneshot_config_t; /** * @brief Allocate a new DAC oneshot channel * @note The channel will be enabled as well when the channel allocated * * @param[in] oneshot_cfg The configuration for the oneshot channel * @param[out] ret_handle The returned oneshot channel handle * @return * - ESP_ERR_INVALID_ARG The input parameter is invalid * - ESP_ERR_INVALID_STATE The DAC channel has been registered already * - ESP_ERR_NO_MEM No memory for the DAC oneshot channel resources * - ESP_OK Allocate the new DAC oneshot channel success *//* ... */ esp_err_t dac_oneshot_new_channel(const dac_oneshot_config_t *oneshot_cfg, dac_oneshot_handle_t *ret_handle); /** * @brief Delete the DAC oneshot channel * @note The channel will be disabled as well when the channel deleted * * @param[in] handle The DAC oneshot channel handle * @return * - ESP_ERR_INVALID_ARG The input parameter is invalid * - ESP_ERR_INVALID_STATE The channel has already been de-registered * - ESP_OK Delete the oneshot channel success *//* ... */ esp_err_t dac_oneshot_del_channel(dac_oneshot_handle_t handle); /** * @brief Output the voltage * @note Generally it'll take 7~11 us on ESP32 and 10~21 us on ESP32-S2 * * @param[in] handle The DAC oneshot channel handle * @param[in] digi_value The digital value that need to be converted * @return * - ESP_ERR_INVALID_ARG The input parameter is invalid * - ESP_OK Convert the digital value success *//* ... */ esp_err_t dac_oneshot_output_voltage(dac_oneshot_handle_t handle, uint8_t digi_value); /* ... */ #endif // SOC_DAC_SUPPORTED #ifdef __cplusplus }{...} #endif
Details