Chapter 2. API Reference
This function gets called from network stack when the rx buffer to be freed in IO driver context, i.e. to
deallocate a buffer owned by io driver (when data packets were passed to higher levels to avoid copying)
Parameters
• [in] esp_netif: Handle to esp-netif instance
• [in] buffer: Rx buffer pointer
Code examples for TCP/IP socket APIs are provided in the
The TCP/IP Adapter (legacy network interface library) has been deprecated, please consult the
Migration Guide
to update existing IDF applications.
2.1.5 Application Layer
Documentation for Application layer network protocols (above the IP Network layer) are provided in
Protocols.
2.2 Peripherals API
2.2.1 Analog to Digital Converter (ADC)
ADC Channels
The ESP32-S2 integrates 2 SAR
channels (analog enabled pins).
These channels are supported:
ADC1:
• 10 channels: GPIO1 - GPIO10
ADC2:
• 10 channels: GPIO11 - GPIO20
ADC Attenuation
Vref is the reference voltage used internally by ESP32-S2 ADCs for measuring the input voltage. The ESP32-S2
ADCs can measure analog voltages from 0 V to Vref. Among different chips, the Vref varies, the median is 1.1 V.
In order to convert voltages larger than Vref, input voltages can be attenuated before being input to the ADCs. There
are 4 available attenuation options, the higher the attenuation is, the higher the measurable input voltage could be.
ADC Conversion
An ADC conversion is to convert the input analog voltage to a digital value. The ADC conversion results provided
by the ADC driver APIs are raw data. Resolution of ESP32-S2 ADC raw results under Single Read mode is 12-bit.
•
adc1_get_raw()
•
adc2_get_raw()
To calculate the voltage based on the ADC raw results, this formula can be used:
Espressif Systems
(Successive Approximation
Attenuation
ADC_ATTEN_DB_0
ADC_ATTEN_DB_2_5
ADC_ATTEN_DB_6
ADC_ATTEN_DB_11
Submit Document Feedback
protocols/sockets
directory of ESP-IDF examples.
Register) ADCs, supporting a total of 20 measurement
Measurable input voltage range
0 mV ~ 750 mV
0 mV ~ 1050 mV
0 mV ~ 1300 mV
0 mV ~ 2500 mV
214
TCP/IP Adapter
Application
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?