Skip to content

Commit c8a8313

Browse files
committed
IDF master 8131d6f46
1 parent 0174bf2 commit c8a8313

File tree

253 files changed

+3180
-1922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

253 files changed

+3180
-1922
lines changed

platform.txt

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

tools/platformio-build-esp32.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"-u", "pthread_include_pthread_impl",
9999
"-u", "pthread_include_pthread_cond_impl",
100100
"-u", "pthread_include_pthread_local_storage_impl",
101-
"-u", "ld_include_panic_highint_hdl",
101+
"-u", "ld_include_highint_hdl",
102102
"-u", "start_app",
103103
"-u", "start_app_other_cores",
104104
"-u", "__ubsan_include",
@@ -135,8 +135,8 @@
135135
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "hal", "include"),
136136
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "hal", "platform_port", "include"),
137137
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_rom", "include"),
138-
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_rom", "esp32"),
139138
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_rom", "include", "esp32"),
139+
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_rom", "esp32"),
140140
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_common", "include"),
141141
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_system", "include"),
142142
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_system", "port", "soc"),
@@ -158,9 +158,9 @@
158158
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "tcpip_adapter", "include"),
159159
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_phy", "include"),
160160
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_phy", "esp32", "include"),
161+
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_ipc", "include"),
161162
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "app_trace", "include"),
162163
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_timer", "include"),
163-
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "esp_ipc", "include"),
164164
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "mbedtls", "port", "include"),
165165
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "mbedtls", "mbedtls", "include"),
166166
join(FRAMEWORK_DIR, "tools", "sdk", "esp32", "include", "mbedtls", "esp_crt_bundle", "include"),
@@ -295,7 +295,7 @@
295295
"UNITY_INCLUDE_CONFIG_H",
296296
"WITH_POSIX",
297297
"_GNU_SOURCE",
298-
("IDF_VER", '\\"v4.4-dev-2464-g606557b48\\"'),
298+
("IDF_VER", '\\"v4.4-dev-2487-g8131d6f46\\"'),
299299
"ESP_PLATFORM",
300300
"ARDUINO_ARCH_ESP32",
301301
"ESP32",

tools/platformio-build-esp32c3.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@
162162
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "hal", "include"),
163163
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "hal", "platform_port", "include"),
164164
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_rom", "include"),
165-
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_rom", "esp32c3"),
166165
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_rom", "include", "esp32c3"),
166+
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_rom", "esp32c3"),
167167
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_common", "include"),
168168
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_system", "include"),
169169
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_system", "port", "soc"),
@@ -184,9 +184,9 @@
184184
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "tcpip_adapter", "include"),
185185
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_phy", "include"),
186186
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_phy", "esp32c3", "include"),
187+
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_ipc", "include"),
187188
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "app_trace", "include"),
188189
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_timer", "include"),
189-
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "esp_ipc", "include"),
190190
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "mbedtls", "port", "include"),
191191
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "mbedtls", "mbedtls", "include"),
192192
join(FRAMEWORK_DIR, "tools", "sdk", "esp32c3", "include", "mbedtls", "esp_crt_bundle", "include"),
@@ -281,7 +281,7 @@
281281
"UNITY_INCLUDE_CONFIG_H",
282282
"WITH_POSIX",
283283
"_GNU_SOURCE",
284-
("IDF_VER", '\\"v4.4-dev-2464-g606557b48\\"'),
284+
("IDF_VER", '\\"v4.4-dev-2487-g8131d6f46\\"'),
285285
"ESP_PLATFORM",
286286
"ARDUINO_ARCH_ESP32",
287287
"ESP32",

tools/platformio-build-esp32s2.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"-u", "pthread_include_pthread_impl",
9595
"-u", "pthread_include_pthread_cond_impl",
9696
"-u", "pthread_include_pthread_local_storage_impl",
97-
"-u", "ld_include_panic_highint_hdl",
97+
"-u", "ld_include_highint_hdl",
9898
"-u", "start_app",
9999
"-u", "__ubsan_include",
100100
"-u", "__assert_func",
@@ -131,8 +131,8 @@
131131
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "hal", "include"),
132132
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "hal", "platform_port", "include"),
133133
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_rom", "include"),
134-
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_rom", "esp32s2"),
135134
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_rom", "include", "esp32s2"),
135+
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_rom", "esp32s2"),
136136
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_common", "include"),
137137
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_system", "include"),
138138
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_system", "port", "soc"),
@@ -153,9 +153,9 @@
153153
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "tcpip_adapter", "include"),
154154
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_phy", "include"),
155155
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_phy", "esp32s2", "include"),
156+
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_ipc", "include"),
156157
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "app_trace", "include"),
157158
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_timer", "include"),
158-
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "esp_ipc", "include"),
159159
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "mbedtls", "port", "include"),
160160
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "mbedtls", "mbedtls", "include"),
161161
join(FRAMEWORK_DIR, "tools", "sdk", "esp32s2", "include", "mbedtls", "esp_crt_bundle", "include"),
@@ -281,7 +281,7 @@
281281
"UNITY_INCLUDE_CONFIG_H",
282282
"WITH_POSIX",
283283
"_GNU_SOURCE",
284-
("IDF_VER", '\\"v4.4-dev-2464-g606557b48\\"'),
284+
("IDF_VER", '\\"v4.4-dev-2487-g8131d6f46\\"'),
285285
"ESP_PLATFORM",
286286
"ARDUINO_ARCH_ESP32",
287287
"ESP32",

tools/sdk/esp32/include/config/sdkconfig.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@
254254
#define CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH 1
255255
#define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR 1
256256
#define CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES 4
257+
#define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024
258+
#define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1
259+
#define CONFIG_ESP_IPC_ISR_ENABLE 1
257260
#define CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL 120
258261
#define CONFIG_ESP_NETIF_TCPIP_LWIP 1
259262
#define CONFIG_ESP_NETIF_TCPIP_ADAPTER_COMPATIBLE_LAYER 1
@@ -280,8 +283,6 @@
280283
#define CONFIG_ESP_TASK_WDT_PANIC 1
281284
#define CONFIG_ESP_TASK_WDT_TIMEOUT_S 5
282285
#define CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0 1
283-
#define CONFIG_ESP_IPC_TASK_STACK_SIZE 1024
284-
#define CONFIG_ESP_IPC_USES_CALLERS_PRIORITY 1
285286
#define CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER 1
286287
#define CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER 1
287288
#define CONFIG_ESP_TIMER_TASK_STACK_SIZE 4096
@@ -690,5 +691,5 @@
690691
#define CONFIG_ULP_COPROC_ENABLED CONFIG_ESP32_ULP_COPROC_ENABLED
691692
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
692693
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
693-
#define CONFIG_ARDUINO_IDF_COMMIT "606557b48"
694+
#define CONFIG_ARDUINO_IDF_COMMIT "8131d6f46"
694695
#define CONFIG_ARDUINO_IDF_BRANCH "master"

tools/sdk/esp32/include/driver/include/driver/i2s.h

Lines changed: 164 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "soc/i2s_periph.h"
1414
#include "soc/rtc_periph.h"
1515
#include "soc/soc_caps.h"
16-
#include "hal/i2s_hal.h"
1716
#include "hal/i2s_types.h"
1817
#include "driver/periph_ctrl.h"
1918
#include "esp_intr_alloc.h"
@@ -28,7 +27,119 @@ extern "C" {
2827

2928
#define I2S_PIN_NO_CHANGE (-1) /*!< Use in i2s_pin_config_t for pins which should not be changed */
3029

31-
typedef intr_handle_t i2s_isr_handle_t;
30+
/**
31+
* @brief I2S port number, the max port number is (I2S_NUM_MAX -1).
32+
*/
33+
typedef enum {
34+
I2S_NUM_0 = 0, /*!< I2S port 0 */
35+
#if SOC_I2S_NUM > 1
36+
I2S_NUM_1 = 1, /*!< I2S port 1 */
37+
#endif
38+
I2S_NUM_MAX, /*!< I2S port max */
39+
} i2s_port_t;
40+
41+
#if SOC_I2S_SUPPORTS_PCM
42+
/**
43+
* @brief I2S PCM configuration
44+
*
45+
*/
46+
typedef struct {
47+
i2s_pcm_compress_t pcm_type; /*!< I2S PCM a/u-law decompress or compress type */
48+
} i2s_pcm_cfg_t;
49+
#endif
50+
51+
#if SOC_I2S_SUPPORTS_PDM_TX
52+
/**
53+
* @brief Default I2S PDM Up-Sampling Rate configuration
54+
*/
55+
#define I2S_PDM_DEFAULT_UPSAMPLE_CONFIG(rate) { \
56+
.sample_rate = rate, \
57+
.fp = 960, \
58+
.fs = (rate) / 100, \
59+
}
60+
61+
/**
62+
* @brief I2S PDM up-sample rate configuration
63+
* @note TX PDM can only be set to the following two upsampling rate configurations:
64+
* 1: fp = 960, fs = sample_rate / 100, in this case, Fpdm = 128*48000
65+
* 2: fp = 960, fs = 480, in this case, Fpdm = 128*Fpcm = 128*sample_rate
66+
* If the pdm receiver do not care the pdm serial clock, it's recommended set Fpdm = 128*48000.
67+
* Otherwise, the second configuration should be applied.
68+
*/
69+
typedef struct {
70+
int sample_rate; /*!< I2S PDM sample rate */
71+
int fp; /*!< I2S PDM TX upsampling paramater. Normally it should be set to 960 */
72+
int fs; /*!< I2S PDM TX upsampling paramater. When it is set to 480, the pdm clock frequency Fpdm = 128 * sample_rate, when it is set to sample_rate / 100, Fpdm will be fixed to 128*48000 */
73+
} i2s_pdm_tx_upsample_cfg_t;
74+
#endif
75+
76+
/**
77+
* @brief I2S pin number for i2s_set_pin
78+
*
79+
*/
80+
typedef struct {
81+
int mck_io_num; /*!< MCK in out pin*/
82+
int bck_io_num; /*!< BCK in out pin*/
83+
int ws_io_num; /*!< WS in out pin*/
84+
int data_out_num; /*!< DATA out pin*/
85+
int data_in_num; /*!< DATA in pin*/
86+
} i2s_pin_config_t;
87+
88+
/**
89+
* @brief I2S driver configuration parameters
90+
*
91+
*/
92+
typedef struct {
93+
94+
i2s_mode_t mode; /*!< I2S work mode */
95+
uint32_t sample_rate; /*!< I2S sample rate */
96+
i2s_bits_per_sample_t bits_per_sample; /*!< I2S sample bits in one channel */
97+
i2s_channel_fmt_t channel_format; /*!< I2S channel format.*/
98+
i2s_comm_format_t communication_format; /*!< I2S communication format */
99+
int intr_alloc_flags; /*!< Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info */
100+
int dma_buf_count; /*!< I2S DMA Buffer Count */
101+
int dma_buf_len; /*!< I2S DMA Buffer Length */
102+
bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */
103+
bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */
104+
int fixed_mclk; /*!< I2S using fixed MCLK output. If use_apll = true and fixed_mclk > 0, then the clock output for i2s is fixed and equal to the fixed_mclk value. If fixed_mclk set, mclk_multiple won't take effect */
105+
i2s_mclk_multiple_t mclk_multiple; /*!< The multiple of I2S master clock(MCLK) to sample rate */
106+
i2s_bits_per_chan_t bits_per_chan; /*!< I2S total bits in one channel, only take effect when larger than 'bits_per_sample', default '0' means equal to 'bits_per_sample' */
107+
108+
#if SOC_I2S_SUPPORTS_TDM
109+
i2s_channel_t chan_mask; /*!< I2S active channel bit mask, set value in `i2s_channel_t` to enable specific channel, the bit map of active channel can not exceed (0x1<<total_chan). */
110+
uint32_t total_chan; /*!< I2S Total number of channels. If it is smaller than the biggest active channel number, it will be set to this number automatically. */
111+
bool left_align; /*!< Set to enable left alignment */
112+
bool big_edin; /*!< Set to enable big edin */
113+
bool bit_order_msb; /*!< Set to enable msb order */
114+
bool skip_msk; /*!< Set to enable skip mask. If it is enabled, only the data of the enabled channels will be sent, otherwise all data stored in DMA TX buffer will be sent */
115+
#endif // SOC_I2S_SUPPORTS_TDM
116+
117+
} i2s_driver_config_t;
118+
119+
typedef i2s_driver_config_t i2s_config_t; // for backward compatible
120+
typedef intr_handle_t i2s_isr_handle_t; // for backward compatible
121+
122+
/**
123+
* @brief I2S event queue types
124+
*
125+
*/
126+
typedef enum {
127+
I2S_EVENT_DMA_ERROR,
128+
I2S_EVENT_TX_DONE, /*!< I2S DMA finish sent 1 buffer*/
129+
I2S_EVENT_RX_DONE, /*!< I2S DMA finish received 1 buffer*/
130+
I2S_EVENT_TX_Q_OVF, /*!< I2S DMA sent queue overflow*/
131+
I2S_EVENT_RX_Q_OVF, /*!< I2S DMA receive queue overflow*/
132+
I2S_EVENT_MAX, /*!< I2S event max index*/
133+
} i2s_event_type_t;
134+
135+
/**
136+
* @brief Event structure used in I2S event queue
137+
*
138+
*/
139+
typedef struct {
140+
i2s_event_type_t type; /*!< I2S event type */
141+
size_t size; /*!< I2S data size for I2S_DATA event*/
142+
} i2s_event_t;
32143

33144
/**
34145
* @brief Set I2S pin number
@@ -54,15 +165,15 @@ typedef intr_handle_t i2s_isr_handle_t;
54165
*/
55166
esp_err_t i2s_set_pin(i2s_port_t i2s_num, const i2s_pin_config_t *pin);
56167

57-
#if SOC_I2S_SUPPORTS_PDM
168+
#if SOC_I2S_SUPPORTS_PDM_RX
58169
/**
59170
* @brief Set PDM mode down-sample rate
60171
* In PDM RX mode, there would be 2 rounds of downsample process in hardware.
61172
* In the first downsample process, the sampling number can be 16 or 8.
62173
* In the second downsample process, the sampling number is fixed as 8.
63174
* So the clock frequency in PDM RX mode would be (fpcm * 64) or (fpcm * 128) accordingly.
64175
* @param i2s_num I2S_NUM_0, I2S_NUM_1
65-
* @param dsr i2s RX down sample rate for PDM mode.
176+
* @param downsample i2s RX down sample rate for PDM mode.
66177
*
67178
* @note After calling this function, it would call i2s_set_clk inside to update the clock frequency.
68179
* Please call this function after I2S driver has been initialized.
@@ -72,7 +183,25 @@ esp_err_t i2s_set_pin(i2s_port_t i2s_num, const i2s_pin_config_t *pin);
72183
* - ESP_ERR_INVALID_ARG Parameter error
73184
* - ESP_ERR_NO_MEM Out of memory
74185
*/
75-
esp_err_t i2s_set_pdm_rx_down_sample(i2s_port_t i2s_num, i2s_pdm_dsr_t dsr);
186+
esp_err_t i2s_set_pdm_rx_down_sample(i2s_port_t i2s_num, i2s_pdm_dsr_t downsample);
187+
#endif
188+
189+
#if SOC_I2S_SUPPORTS_PDM_TX
190+
/**
191+
* @brief Set TX PDM mode up-sample rate
192+
* @note If you have set PDM mode while calling 'i2s_driver_install',
193+
* default PDM TX upsample parameters have already been set,
194+
* no need to call this function again if you don't have to change the default configuration
195+
*
196+
* @param i2s_num I2S_NUM_0, I2S_NUM_1
197+
* @param upsample_cfg Set I2S PDM up-sample rate configuration
198+
*
199+
* @return
200+
* - ESP_OK Success
201+
* - ESP_ERR_INVALID_ARG Parameter error
202+
* - ESP_ERR_NO_MEM Out of memory
203+
*/
204+
esp_err_t i2s_set_pdm_tx_up_sample(i2s_port_t i2s_num, const i2s_pdm_tx_upsample_cfg_t *upsample_cfg);
76205
#endif
77206

78207
/**
@@ -93,7 +222,7 @@ esp_err_t i2s_set_pdm_rx_down_sample(i2s_port_t i2s_num, i2s_pdm_dsr_t dsr);
93222
* - ESP_ERR_INVALID_ARG Parameter error
94223
* - ESP_ERR_NO_MEM Out of memory
95224
*/
96-
esp_err_t i2s_driver_install(i2s_port_t i2s_num, const i2s_config_t *i2s_config, int queue_size, void* i2s_queue);
225+
esp_err_t i2s_driver_install(i2s_port_t i2s_num, const i2s_config_t *i2s_config, int queue_size, void *i2s_queue);
97226

98227
/**
99228
* @brief Uninstall I2S driver.
@@ -243,25 +372,51 @@ esp_err_t i2s_start(i2s_port_t i2s_num);
243372
*/
244373
esp_err_t i2s_zero_dma_buffer(i2s_port_t i2s_num);
245374

375+
#if SOC_I2S_SUPPORTS_PCM
376+
/**
377+
* @brief Configure I2S a/u-law decompress or compress
378+
*
379+
* @note This function should be called after i2s driver installed
380+
* Only take effecttive when the i2s 'communication_format' is set to 'I2S_COMM_FORMAT_STAND_PCM_SHORT' or 'I2S_COMM_FORMAT_STAND_PCM_LONG'
381+
*
382+
* @param i2s_num I2S_NUM_0
383+
*
384+
* @param pcm_cfg including mode selection and a/u-law decompress or compress configuration paramater
385+
*
386+
* @return
387+
* - ESP_OK Success
388+
* - ESP_ERR_INVALID_ARG Parameter error
389+
*/
390+
esp_err_t i2s_pcm_config(i2s_port_t i2s_num, const i2s_pcm_cfg_t *pcm_cfg);
391+
#endif
392+
246393
/**
247394
* @brief Set clock & bit width used for I2S RX and TX.
248395
*
249396
* Similar to i2s_set_sample_rates(), but also sets bit width.
250397
*
398+
* 1. stop i2s;
399+
* 2. calculate mclk, bck, bck_factor
400+
* 3. malloc dma buffer;
401+
* 4. start i2s
402+
*
251403
* @param i2s_num I2S_NUM_0, I2S_NUM_1
252404
*
253405
* @param rate I2S sample rate (ex: 8000, 44100...)
254406
*
255-
* @param bits I2S bit width (I2S_BITS_PER_SAMPLE_16BIT, I2S_BITS_PER_SAMPLE_24BIT, I2S_BITS_PER_SAMPLE_32BIT)
407+
* @param bits_cfg I2S bits configuration
408+
* the low 16 bits is for data bits per sample in one channel (see 'i2s_bits_per_sample_t')
409+
* the high 16 bits is for total bits in one channel (see 'i2s_bits_per_chan_t')
410+
* high 16bits =0 means same as the bits per sample.
256411
*
257-
* @param ch I2S channel, (I2S_CHANNEL_MONO, I2S_CHANNEL_STEREO)
412+
* @param ch I2S channel, (I2S_CHANNEL_MONO, I2S_CHANNEL_STEREO or specific channel in TDM mode)
258413
*
259414
* @return
260415
* - ESP_OK Success
261416
* - ESP_ERR_INVALID_ARG Parameter error
262417
* - ESP_ERR_NO_MEM Out of memory
263418
*/
264-
esp_err_t i2s_set_clk(i2s_port_t i2s_num, uint32_t rate, i2s_bits_per_sample_t bits, i2s_channel_t ch);
419+
esp_err_t i2s_set_clk(i2s_port_t i2s_num, uint32_t rate, uint32_t bits_cfg, i2s_channel_t ch);
265420

266421
/**
267422
* @brief get clock set on particular port number.

0 commit comments

Comments
 (0)