mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 04:25:32 +00:00
feature(I2S-ADC): add ADC mode for I2S.
1. Support built-in ADC for I2S. 2. Modify code of ADC, made no change to the original APIs. 3. Add APIs in I2S: esp_err_t i2s_set_adc_mode(adc_unit_t adc_unit, adc1_channel_t adc_channel); 4. Add I2S ADC/DAC example code. 5. add old-fashion definition to make it more compatible 6. replase spi_flash_ APIs with esp_partition_ APIs 7. add example of generating audio table from wav 8. change example sound
This commit is contained in:
@@ -28,9 +28,9 @@ void app_main(void)
|
||||
#ifndef V_REF_TO_GPIO
|
||||
//Init ADC and Characteristics
|
||||
esp_adc_cal_characteristics_t characteristics;
|
||||
adc1_config_width(ADC_WIDTH_12Bit);
|
||||
adc1_config_channel_atten(ADC1_TEST_CHANNEL, ADC_ATTEN_0db);
|
||||
esp_adc_cal_get_characteristics(V_REF, ADC_ATTEN_0db, ADC_WIDTH_12Bit, &characteristics);
|
||||
adc1_config_width(ADC_WIDTH_BIT_12);
|
||||
adc1_config_channel_atten(ADC1_TEST_CHANNEL, ADC_ATTEN_DB_0);
|
||||
esp_adc_cal_get_characteristics(V_REF, ADC_ATTEN_DB_0, ADC_WIDTH_BIT_12, &characteristics);
|
||||
uint32_t voltage;
|
||||
while(1){
|
||||
voltage = adc1_to_voltage(ADC1_TEST_CHANNEL, &characteristics);
|
||||
|
Reference in New Issue
Block a user