Simulator_Test/main/dac_continuous_example.h

38 lines
914 B
C

/*
* SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/
#define CONST_PERIOD_2_PI 6.2832 // 2 * π
#define EXAMPLE_ARRAY_LEN 400 // 波形数组长度
#define EXAMPLE_DAC_AMPLITUDE 255 // DAC电压幅度。如果超过256会导致dac_output_voltage()输出0
typedef enum {
DAC_SINE_WAVE,
DAC_TRIANGLE_WAVE,
DAC_SAWTOOTH_WAVE,
DAC_SQUARE_WAVE,
DAC_WAVE_MAX,
} dac_example_wave_type_t;
/**
* @brief 使用DMA连续转换
*
*/
void example_dac_continuous_by_dma(void);
/**
* @brief 使用定时器连续转换
*
*/
void example_dac_continuous_by_timer(void);
/**
* @brief 打印示例日志信息
*
* @param conv_freq DAC转换频率
* @param wave_freq 波形频率
*/
void example_log_info(uint32_t conv_freq, uint32_t wave_freq);