1 #pragma once 2 3 #ifdef __cplusplus 4 extern "C" { 5 #endif 6 7 typedef enum { 8 DAC_CHAN_0 = 0, /*!< DAC channel 0 is GPIO25(ESP32) / GPIO17(ESP32S2) */ 9 DAC_CHAN_1 = 1, /*!< DAC channel 1 is GPIO26(ESP32) / GPIO18(ESP32S2) */ 10 DAC_CHANNEL_1 __attribute__((deprecated("please use 'DAC_CHAN_0' instead"))) = 0, /*!< Alias of 'DAC_CHAN_0', now the channel index start from '0' */ 11 DAC_CHANNEL_2 __attribute__((deprecated("please use 'DAC_CHAN_1' instead"))) = 1, /*!< Alias of 'DAC_CHAN_1', now the channel index start from '0' */ 12 } dac_channel_t; 13 14 /** 15 * @brief The attenuation of the amplitude of the cosine wave generator. The max amplitude is VDD3P3_RTC. 16 */ 17 typedef enum { 18 DAC_COSINE_ATTEN_DEFAULT = 0x0, /*!< No attenuation to the DAC cosine wave amplitude. Default. */ 19 DAC_COSINE_ATTEN_DB_0 = 0x0, /*!< Original amplitude of the DAC cosine wave, equals to DAC_COSINE_ATTEN_DEFAULT */ 20 DAC_COSINE_ATTEN_DB_6 = 0x1, /*!< 1/2 amplitude of the DAC cosine wave */ 21 DAC_COSINE_ATTEN_DB_12 = 0x2, /*!< 1/4 amplitude of the DAC cosine wave */ 22 DAC_COSINE_ATTEN_DB_18 = 0x3, /*!< 1/8 amplitude of the DAC cosine wave */ 23 } dac_cosine_atten_t; 24 25 /** 26 * @brief Set the phase of the cosine wave generator output. 27 * @note Only 0 or 180 are supported, 28 * it will be set to 0 as default if configured to an unsupported phase. 29 */ 30 typedef enum { 31 DAC_COSINE_PHASE_0 = 0x02, /*!< Phase shift +0° */ 32 DAC_COSINE_PHASE_180 = 0x03, /*!< Phase shift +180° */ 33 } dac_cosine_phase_t; 34 35 #ifdef __cplusplus 36 } 37 #endif 38