The docs mention that I2S0 can be routed directly to the internal analog-to-digital converter (ADC) and digital-to-analog converter (DAC). In other words, ADC and DAC peripherals can read or write continuously via I2S0 DMA. As they are not actual communication modes, the I2S driver does not implement them. The driver does not implement the LCD mode either.
I want to record audio using the ADC and i2s. This used to be possible in the earlier versions of the idf used to have a way to enable ADC mode and I have found examples that do this using an older version of the idf and it seems fairly straightforward here.
I am new to esp-idf, can someone show me how I would implement this, or steps that I can take to do this. Thanks
How do I use the ADC mode for i2s is esp-idf v5.2.2?
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: How do I use the ADC mode for i2s is esp-idf v5.2.2?
You can use this driver for that.
Re: How do I use the ADC mode for i2s is esp-idf v5.2.2?
I've looked into this but how would I configure the i2s drivers. Will i2s_read() start reading from this buffer? How do I make multiple buffers using the continuous mode driver. Some code would help. Thanks
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: How do I use the ADC mode for i2s is esp-idf v5.2.2?
You do not have to do anything with I2S if you use that driver; it handles the fact that on the ESP32 the data transfer happens to go through I2S entirely for you.
Re: How do I use the ADC mode for i2s is esp-idf v5.2.2?
Hi @ESP_Sprite,ESP_Sprite wrote: You do not have to do anything with I2S if you use that driver; it handles the fact that on the ESP32 the data transfer happens to go through I2S entirely for you.
Nice to see a fellow Tweaker here I have to say I'm really confused whether i2s dac is possible in esp-idf 5.x . The i2s_adc_enable from the 4.x api is now gone.
If I start i2s first and then enable the adc continuous example I get:
Code: Select all
i2s_platform: i2s controller 0 has been occupied by i2s_driver
Code: Select all
W (13156) i2s_platform: i2s controller 0 has been occupied by adc
E (13166) i2s_common: i2s0 might be occupied by other component
-
- Posts: 9757
- Joined: Thu Nov 26, 2015 4:08 am
Re: How do I use the ADC mode for i2s is esp-idf v5.2.2?
There's no need to start I2S in ESP-IDF V5. The continuous ADC driver should take care of setting up I2S by itself.
Re: How do I use the ADC mode for i2s is esp-idf v5.2.2?
Ok thanks for clarifying. But then how do I set up the pin numbers and sample rate configuration etc for i2s? Sorry if this is a stupid question.
Also, I was manually setting up i2s and continuous adc for testing purposes to get something working. My actual goal is to use the bluetooth classic hfp_hf example which sets up i2s under the hood. I'm getting the feeling I can't have the continuous adc and hfp_hf both trying to automagically set up i2s for me?
Also, I was manually setting up i2s and continuous adc for testing purposes to get something working. My actual goal is to use the bluetooth classic hfp_hf example which sets up i2s under the hood. I'm getting the feeling I can't have the continuous adc and hfp_hf both trying to automagically set up i2s for me?
Who is online
Users browsing this forum: Baidu [Spider], VinayDand and 410 guests