EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #312 background imageLoading...
Page #312 background image
Chapter 2. API Reference
Return
ESP_OK Success
ESP_ERR_INVALID_ARG Parameter error
Parameters
i2s_num: I2S port number
dest: Destination address to read into
size: Size of data in bytes
[out] bytes_read: Number of bytes read, if timeout, bytes read will be less than the size
passed in.
ticks_to_wait: RX buffer wait timeout in RTOS ticks. If this many ticks pass without bytes
becoming available in the DMA receive buffer, then the function will return (note that if data is read
from the DMA buffer in pieces, the overall operation may still take longer than this timeout.) Pass
portMAX_DELAY for no timeout.
esp_err_t i2s_set_sample_rates(i2s_port_t i2s_num, uint32_t rate)
Set sample rate used for I2S RX and TX.
The bit clock rate is determined by the sample rate and i2s_config_t configuration parameters (number of
channels, bits_per_sample).
bit_clock = rate * (number of channels) * bits_per_sample
Return
ESP_OK Success
ESP_ERR_INVALID_ARG Parameter error
ESP_ERR_NO_MEM Out of memory
Parameters
i2s_num: I2S port number
rate: I2S sample rate (ex: 8000, 44100)
esp_err_t i2s_stop(i2s_port_t i2s_num)
Stop I2S driver.
There is no need to call i2s_stop() before calling i2s_driver_uninstall().
Disables I2S TX/RX, until i2s_start() is called.
Return
ESP_OK Success
ESP_ERR_INVALID_ARG Parameter error
Parameters
i2s_num: I2S port number
esp_err_t i2s_start(i2s_port_t i2s_num)
Start I2S driver.
It is not necessary to call this function after i2s_driver_install() (it is started automatically), however it is
necessary to call it after i2s_stop().
Return
ESP_OK Success
ESP_ERR_INVALID_ARG Parameter error
Parameters
i2s_num: I2S port number
esp_err_t i2s_zero_dma_buffer(i2s_port_t i2s_num)
Zero the contents of the TX DMA buffer.
Pushes zero-byte samples into the TX DMA buffer, until it is full.
Return
ESP_OK Success
ESP_ERR_INVALID_ARG Parameter error
Parameters
i2s_num: I2S port number
Espressif Systems 301
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish