Select one of the symbols to view example projects that use it.
 
Outline
#include "freertos/FreeRTOS.h"
#include "hal/dac_types.h"
#include "hal/dac_ll.h"
#include "esp_err.h"
rtc_spinlock;
#define DAC_RTC_ENTER_CRITICAL
#define DAC_RTC_EXIT_CRITICAL
#define DAC_RTC_ENTER_CRITICAL_SAFE
#define DAC_RTC_EXIT_CRITICAL_SAFE
#define DAC_NULL_POINTER_CHECK
#define DAC_NULL_POINTER_CHECK_ISR
dac_priv_register_channel(dac_channel_t, const char *);
dac_priv_deregister_channel(dac_channel_t);
dac_priv_enable_channel(dac_channel_t);
dac_priv_disable_channel(dac_channel_t);
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/esp_driver_dac/dac_priv_common.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
71
72
73
74
75
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #pragma once #include "freertos/FreeRTOS.h" #include "hal/dac_types.h" #include "hal/dac_ll.h" #include "esp_err.h" #ifdef __cplusplus extern "C" { #endif extern portMUX_TYPE rtc_spinlock; /*!< Extern global rtc spinlock */ #define DAC_RTC_ENTER_CRITICAL() portENTER_CRITICAL(&rtc_spinlock) #define DAC_RTC_EXIT_CRITICAL() portEXIT_CRITICAL(&rtc_spinlock) #define DAC_RTC_ENTER_CRITICAL_SAFE() portENTER_CRITICAL_SAFE(&rtc_spinlock) #define DAC_RTC_EXIT_CRITICAL_SAFE() portEXIT_CRITICAL_SAFE(&rtc_spinlock) #define DAC_NULL_POINTER_CHECK(p) ESP_RETURN_ON_FALSE((p), ESP_ERR_INVALID_ARG, TAG, "input parameter '"#p"' is NULL") #define DAC_NULL_POINTER_CHECK_ISR(p) ESP_RETURN_ON_FALSE_ISR((p), ESP_ERR_INVALID_ARG, TAG, "input parameter '"#p"' is NULL")6 defines /** * @brief Register dac channel in the driver, in case a same channel is reused by different modes * * @param[in] chan_id DAC channel id * @param[in] mode_name The const string of mode name * @return * - ESP_ERR_INVALID_STATE The channel has been occupied * - ESP_ERR_INVALID_ARG The channel id is incorrect * - ESP_OK Register the channel success *//* ... */ esp_err_t dac_priv_register_channel(dac_channel_t chan_id, const char *mode_name); /** * @brief Deregister dac channel in the driver * * @param[in] chan_id DAC channel id * @return * - ESP_ERR_INVALID_STATE The channel has been freed * - ESP_ERR_INVALID_ARG The channel id is incorrect * - ESP_OK Deregister the channel success *//* ... */ esp_err_t dac_priv_deregister_channel(dac_channel_t chan_id); /** * @brief Enable the DAC channel and turn on its power * * @param chan_id DAC channel id * @return * - ESP_ERR_INVALID_STATE The channel has not been registered * - ESP_ERR_INVALID_ARG The channel id is incorrect * - ESP_OK Deregister the channel success *//* ... */ esp_err_t dac_priv_enable_channel(dac_channel_t chan_id); /** * @brief Disable the DAC channel and turn off its power * * @param chan_id DAC channel id * @return * - ESP_ERR_INVALID_STATE The channel has not been registered * - ESP_ERR_INVALID_ARG The channel id is incorrect * - ESP_OK Deregister the channel success *//* ... */ esp_err_t dac_priv_disable_channel(dac_channel_t chan_id); #ifdef __cplusplus }{...} #endif
Details