Skip to content

Commit a00be36

Browse files
authored
Merge pull request #96 from Jason2866/patch-2
Update 100322
2 parents 7c59f20 + 6d4b215 commit a00be36

File tree

1,148 files changed

+37060
-1774
lines changed

Some content is hidden

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

1,148 files changed

+37060
-1774
lines changed

boards.txt

+8-3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ esp32s3.build.flash_size=4MB
5454
esp32s3.build.flash_freq=80m
5555
esp32s3.build.flash_mode=dio
5656
esp32s3.build.boot=qio
57+
esp32s3.build.boot_freq=80m
5758
esp32s3.build.partitions=default
5859
esp32s3.build.defines=
5960
esp32s3.build.loop_core=
@@ -82,21 +83,25 @@ esp32s3.menu.PSRAM.opi.build.psram_type=opi
8283
esp32s3.menu.FlashMode.qio=QIO 80MHz
8384
esp32s3.menu.FlashMode.qio.build.flash_mode=dio
8485
esp32s3.menu.FlashMode.qio.build.boot=qio
86+
esp32s3.menu.FlashMode.qio.build.boot_freq=80m
8587
esp32s3.menu.FlashMode.qio.build.flash_freq=80m
8688
esp32s3.menu.FlashMode.qio.build.flash_type=qspi
8789
esp32s3.menu.FlashMode.qio120=QIO 120MHz
8890
esp32s3.menu.FlashMode.qio120.build.flash_mode=dio
8991
esp32s3.menu.FlashMode.qio120.build.boot=qio
90-
esp32s3.menu.FlashMode.qio120.build.flash_freq=120m
92+
esp32s3.menu.FlashMode.qio120.build.boot_freq=120m
93+
esp32s3.menu.FlashMode.qio120.build.flash_freq=80m
9194
esp32s3.menu.FlashMode.qio120.build.flash_type=qspi
9295
esp32s3.menu.FlashMode.dio=DIO 80MHz
9396
esp32s3.menu.FlashMode.dio.build.flash_mode=dio
9497
esp32s3.menu.FlashMode.dio.build.boot=dio
98+
esp32s3.menu.FlashMode.dio.build.boot_freq=80m
9599
esp32s3.menu.FlashMode.dio.build.flash_freq=80m
96100
esp32s3.menu.FlashMode.dio.build.flash_type=qspi
97101
esp32s3.menu.FlashMode.opi=OPI 80MHz
98102
esp32s3.menu.FlashMode.opi.build.flash_mode=dout
99103
esp32s3.menu.FlashMode.opi.build.boot=opi
104+
esp32s3.menu.FlashMode.opi.build.boot_freq=80m
100105
esp32s3.menu.FlashMode.opi.build.flash_freq=80m
101106
esp32s3.menu.FlashMode.opi.build.flash_type=opi
102107

@@ -107,8 +112,8 @@ esp32s3.menu.FlashSize.8M.build.flash_size=8MB
107112
esp32s3.menu.FlashSize.8M.build.partitions=default_8MB
108113
esp32s3.menu.FlashSize.16M=16MB (128Mb)
109114
esp32s3.menu.FlashSize.16M.build.flash_size=16MB
110-
esp32s3.menu.FlashSize.32M=32MB (256Mb)
111-
esp32s3.menu.FlashSize.32M.build.flash_size=32MB
115+
#esp32s3.menu.FlashSize.32M=32MB (256Mb)
116+
#esp32s3.menu.FlashSize.32M.build.flash_size=32MB
112117

113118
esp32s3.menu.LoopCore.1=Core 1
114119
esp32s3.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1

libraries/RainMaker/examples/RMakerCustom/.skip.esp32s3

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32s3

Whitespace-only changes.

libraries/RainMaker/examples/RMakerSwitch/.skip.esp32s3

Whitespace-only changes.

platform.txt

+19-17
Large diffs are not rendered by default.

tools/esptool.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,7 @@ def _get_pid(self):
541541
active_port = self._port.port
542542

543543
# Pyserial only identifies regular ports, URL handlers are not supported
544-
if not active_port.startswith(("COM", "/dev/")):
544+
if not active_port.lower().startswith(("com", "/dev/")):
545545
print("\nDevice PID identification is only supported on COM and /dev/ serial ports.")
546546
return
547547
# Return the real path if the active port is a symlink
@@ -674,7 +674,8 @@ def connect(self, mode='default_reset', attempts=DEFAULT_CONNECT_ATTEMPTS, detec
674674
chip_magic_value = self.read_reg(ESPLoader.CHIP_DETECT_MAGIC_REG_ADDR)
675675
if chip_magic_value not in self.CHIP_DETECT_MAGIC_VALUE:
676676
actually = None
677-
for cls in [ESP8266ROM, ESP32ROM, ESP32S2ROM, ESP32S3BETA2ROM, ESP32S3ROM, ESP32C3ROM, ESP32H2BETA1ROM, ESP32C2ROM, ESP32H2BETA2ROM]:
677+
for cls in [ESP8266ROM, ESP32ROM, ESP32S2ROM, ESP32S3BETA2ROM, ESP32S3ROM,
678+
ESP32C3ROM, ESP32H2BETA1ROM, ESP32H2BETA2ROM, ESP32C2ROM, ESP32C6BETAROM]:
678679
if chip_magic_value in cls.CHIP_DETECT_MAGIC_VALUE:
679680
actually = cls
680681
break

tools/platformio-build-esp32.py

+20-15
Large diffs are not rendered by default.

tools/platformio-build-esp32c3.py

+51-43
Large diffs are not rendered by default.

tools/platformio-build-esp32s2.py

+25-12
Large diffs are not rendered by default.

tools/platformio-build-esp32s3.py

+25-12
Large diffs are not rendered by default.
0 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.
16 Bytes
Binary file not shown.

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

+17-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ typedef struct {
7878
*
7979
*/
8080
typedef struct {
81-
int mck_io_num; /*!< MCK in out pin*/
81+
int mck_io_num; /*!< MCK in out pin. Note that ESP32 supports setting MCK on GPIO0/GPIO1/GPIO3 only*/
8282
int bck_io_num; /*!< BCK in out pin*/
8383
int ws_io_num; /*!< WS in out pin*/
8484
int data_out_num; /*!< DATA out pin*/
@@ -97,8 +97,22 @@ typedef struct {
9797
i2s_channel_fmt_t channel_format; /*!< I2S channel format.*/
9898
i2s_comm_format_t communication_format; /*!< I2S communication format */
9999
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 */
100+
int dma_buf_count; /**< The total number of DMA buffers to receive/transmit data.
101+
* A descriptor includes some information such as buffer address,
102+
* the address of the next descriptor, and the buffer length.
103+
* Since one descriptor points to one buffer, therefore, 'dma_desc_num' can be interpreted as the total number of DMA buffers used to store data from DMA interrupt.
104+
* Notice that these buffers are internal to'i2s_read' and descriptors are created automatically inside of the I2S driver.
105+
* Users only need to set the buffer number while the length is derived from the parameter described below.
106+
*/
107+
int dma_buf_len; /**< Number of frames in a DMA buffer.
108+
* A frame means the data of all channels in a WS cycle.
109+
* The real_dma_buf_size = dma_buf_len * chan_num * bits_per_chan / 8.
110+
* For example, if two channels in stereo mode (i.e., 'channel_format' is set to 'I2S_CHANNEL_FMT_RIGHT_LEFT') are active,
111+
* and each channel transfers 32 bits (i.e., 'bits_per_sample' is set to 'I2S_BITS_PER_CHAN_32BIT'),
112+
* then the total number of bytes of a frame is 'channel_format' * 'bits_per_sample' = 2 * 32 / 8 = 8 bytes.
113+
* We assume that the current 'dma_buf_len' is 100, then the real length of the DMA buffer is 8 * 100 = 800 bytes.
114+
* Note that the length of an internal real DMA buffer shouldn't be greater than 4092.
115+
*/
102116
bool use_apll; /*!< I2S using APLL as main I2S clock, enable it to get accurate clock */
103117
bool tx_desc_auto_clear; /*!< I2S auto clear tx descriptor if there is underflow condition (helps in avoiding noise in case of data unavailability) */
104118
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 */

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ esp_err_t ledc_timer_config(const ledc_timer_config_t* timer_conf);
8585
* @brief LEDC update channel parameters
8686
* @note Call this function to activate the LEDC updated parameters.
8787
* After ledc_set_duty, we need to call this function to update the settings.
88+
* And the new LEDC parameters don't take effect until the next PWM cycle.
8889
* @note ledc_set_duty, ledc_set_duty_with_hpoint and ledc_update_duty are not thread-safe, do not call these functions to
8990
* control one LEDC channel in different tasks at the same time.
9091
* A thread-safe version of API is ledc_set_duty_and_update
@@ -203,6 +204,9 @@ esp_err_t ledc_set_duty(ledc_mode_t speed_mode, ledc_channel_t channel, uint32_t
203204

204205
/**
205206
* @brief LEDC get duty
207+
* This function returns the duty at the present PWM cycle.
208+
* You shouldn't expect the function to return the new duty in the same cycle of calling ledc_update_duty,
209+
* because duty update doesn't take effect until the next cycle.
206210
*
207211
* @param speed_mode Select the LEDC channel group with specified speed mode. Note that not all targets support high speed mode.
208212
* @param channel LEDC channel (0 - LEDC_CHANNEL_MAX-1), select from ledc_channel_t
@@ -385,7 +389,8 @@ void ledc_fade_func_uninstall(void);
385389
* Other duty operations will have to wait until the fade operation has finished.
386390
* @param speed_mode Select the LEDC channel group with specified speed mode. Note that not all targets support high speed mode.
387391
* @param channel LEDC channel number
388-
* @param fade_mode Whether to block until fading done.
392+
* @param fade_mode Whether to block until fading done. See ledc_types.h ledc_fade_mode_t for more info.
393+
* Note that this function will not return until fading to the target duty if LEDC_FADE_WAIT_DONE mode is selected.
389394
*
390395
* @return
391396
* - ESP_OK Success

tools/sdk/esp32/include/esp-dsp/modules/common/include/dsp_common.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
#include <stdbool.h>
1919
#include "dsp_err.h"
2020
#include "esp_idf_version.h"
21+
22+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
23+
#include "esp_cpu.h"
24+
#else
2125
#include "soc/cpu.h"
26+
#endif
2227

2328
#ifdef __cplusplus
2429
extern "C"
@@ -58,4 +63,4 @@ int dsp_power_of_two(int x);
5863
#define dsp_get_cpu_cycle_count xthal_get_ccount
5964
#endif
6065

61-
#endif // _dsp_common_H_
66+
#endif // _dsp_common_H_

tools/sdk/esp32/include/esp-dsp/modules/common/include/dsp_platform.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@
1515

1616
#ifndef dsp_platform_h_
1717
#define dsp_platform_h_
18+
#include "esp_idf_version.h"
19+
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 0)
20+
#include "esp_cpu.h"
21+
#else
1822
#include "soc/cpu.h"
23+
#endif
1924

2025
#include "freertos/FreeRTOS.h"
2126
#include "freertos/portable.h"
2227
#include "freertos/task.h"
2328
#include "freertos/semphr.h"
2429

25-
#endif // dsp_platform_h_
30+
#endif // dsp_platform_h_

tools/sdk/esp32/include/esp-dsp/modules/conv/include/dsps_conv.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern "C"
4343
*/
4444
esp_err_t dsps_conv_f32_ae32(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *convout);
4545
esp_err_t dsps_conv_f32_ansi(const float *Signal, const int siglen, const float *Kernel, const int kernlen, float *convout);
46-
/**}@*/
46+
/**@}*/
4747

4848
#ifdef __cplusplus
4949
}

tools/sdk/esp32/include/esp-dsp/modules/conv/include/dsps_corr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ extern "C"
4343
*/
4444
esp_err_t dsps_corr_f32_ansi(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *dest);
4545
esp_err_t dsps_corr_f32_ae32(const float *Signal, const int siglen, const float *Pattern, const int patlen, float *dest);
46-
/**}@*/
46+
/**@}*/
4747

4848
#ifdef __cplusplus
4949
}

tools/sdk/esp32/include/esp-dsp/modules/fft/include/dsps_fft2r.h

+2-4
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,6 @@ esp_err_t dsps_fft2r_init_sc16(int16_t *fft_table_buff, int table_size);
6969
* Free resources of Complex FFT. This function delete coefficients table if it was allocated by dsps_fft2r_init_fc32.
7070
* The implementation use ANSI C and could be compiled and run on any platform
7171
*
72-
*
73-
* @return
7472
*/
7573
void dsps_fft2r_deinit_fc32(void);
7674
void dsps_fft2r_deinit_sc16(void);
@@ -128,13 +126,13 @@ esp_err_t dsps_fft2r_sc16_aes3_(int16_t *data, int N, int16_t *w);
128126
esp_err_t dsps_bit_rev_fc32_ansi(float *data, int N);
129127
esp_err_t dsps_bit_rev_sc16_ansi(int16_t *data, int N);
130128
esp_err_t dsps_bit_rev2r_fc32(float *data, int N);
131-
132-
/**@{*/
129+
/**@}*/
133130

134131
esp_err_t dsps_bit_rev_lookup_fc32_ansi(float *data, int reverse_size, uint16_t *reverse_tab);
135132
esp_err_t dsps_bit_rev_lookup_fc32_ae32(float *data, int reverse_size, uint16_t *reverse_tab);
136133
esp_err_t dsps_bit_rev_lookup_fc32_aes3(float *data, int reverse_size, uint16_t *reverse_tab);
137134

135+
/**@{*/
138136
/**
139137
* @brief Generate coefficients table for the FFT radix 2
140138
*

tools/sdk/esp32/include/esp-dsp/modules/fft/include/dsps_fft2r_platform.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#if CONFIG_IDF_TARGET_ESP32S3
3131
#define dsps_fft2r_fc32_aes3_enabled 1
3232
#define dsps_fft2r_sc16_aes3_enabled 1
33-
#endif
33+
#endif
3434

3535

3636
#endif // _dsps_fft2r_platform_H_

tools/sdk/esp32/include/esp-dsp/modules/fft/include/dsps_fft4r.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ esp_err_t dsps_fft4r_init_fc32(float *fft_table_buff, int max_fft_size);
6565
* The implementation use ANSI C and could be compiled and run on any platform
6666
*
6767
*
68-
* @return
6968
*/
7069
void dsps_fft4r_deinit_fc32(void);
7170
/**@}*/
@@ -115,7 +114,7 @@ esp_err_t dsps_bit_rev4r_fc32(float *data, int N);
115114
esp_err_t dsps_bit_rev4r_fc32_ae32(float *data, int N);
116115
esp_err_t dsps_bit_rev4r_direct_fc32_ansi(float *data, int N);
117116
esp_err_t dsps_bit_rev4r_sc16_ansi(int16_t *data, int N);
118-
117+
/**@}*/
119118

120119
/**@{*/
121120
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
// Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License
14+
#ifndef _ESP_TTS_H_
15+
#define _ESP_TTS_H_
16+
17+
#include "stdlib.h"
18+
#include "stdio.h"
19+
#include "esp_tts_voice.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
typedef enum {
26+
NONE_MODE = 0, //do not play any word before playing a specific number
27+
ALI_PAY_MODE, //play zhi fu bao shou kuan before playing a specific number
28+
WEIXIN_PAY_MODE //play wei xin shou kuan before playing a specific number
29+
} pay_mode_t;
30+
31+
typedef void * esp_tts_handle_t;
32+
33+
34+
/**
35+
* @brief Init an instance of the TTS voice set structure.
36+
*
37+
* @param template The const esp_tts_voice_template.
38+
* @param data The customize voice data
39+
* @return
40+
* - NULL: Init failed
41+
* - Others: The instance of voice set
42+
*/
43+
esp_tts_voice_t *esp_tts_voice_set_init(const esp_tts_voice_t *template, void *data);
44+
45+
/**
46+
* @brief Init an instance of the TTS voice set structure.
47+
*
48+
* @param template The const esp_tts_voice_template.
49+
* @param data The customize voice data
50+
* @return
51+
* - NULL: Init failed
52+
* - Others: The instance of voice set
53+
*/
54+
void esp_tts_voice_set_free(esp_tts_voice_t *voice);
55+
56+
/**
57+
* @brief Creates an instance of the TTS structure.
58+
*
59+
* @param voice Voice set containing all basic phonemes.
60+
* @return
61+
* - NULL: Create failed
62+
* - Others: The instance of TTS structure
63+
*/
64+
esp_tts_handle_t esp_tts_create(esp_tts_voice_t *voice);
65+
66+
/**
67+
* @brief parse money pronuciation.
68+
*
69+
* @param tts_handle Instance of TTS
70+
* @param yuan The number of yuan
71+
* @param jiao The number of jiao
72+
* @param fen The number of fen
73+
* @param mode The pay mode: please refer to pay_mode_t
74+
* @return
75+
* - 0: failed
76+
* - 1: succeeded
77+
*/
78+
int esp_tts_parse_money(esp_tts_handle_t tts_handle, int yuan, int jiao, int fen, pay_mode_t mode);
79+
80+
/**
81+
* @brief parse Chinese PinYin pronuciation.
82+
*
83+
* @param tts_handle Instance of TTS
84+
* @param pinyin PinYin string, like this "da4 jia1 hao3"
85+
* @return
86+
* - 0: failed
87+
* - 1: succeeded
88+
*/
89+
int esp_tts_parse_pinyin(esp_tts_handle_t tts_handle, const char *pinyin);
90+
91+
/**
92+
* @brief parse Chinese string.
93+
*
94+
* @param tts_handle Instance of TTS
95+
* @param str Chinese string, like this "大家好"
96+
* @return
97+
* - 0: failed
98+
* - 1: succeeded
99+
*/
100+
int esp_tts_parse_chinese(esp_tts_handle_t tts_handle, const char *str);
101+
102+
/**
103+
* @brief output TTS voice data by stream.
104+
*
105+
* @Warning The output data should not be freed.
106+
Once the output length is 0, the all voice data has been output.
107+
*
108+
* @param tts_handle Instance of TTS
109+
* @param len The length of output data
110+
* @param speed The speech speed speed of synthesized speech,
111+
range:0~5, 0: the slowest speed, 5: the fastest speech
112+
* @return
113+
* - voice raw data
114+
*/
115+
short* esp_tts_stream_play(esp_tts_handle_t tts_handle, int *len, unsigned int speed);
116+
117+
/**
118+
* @brief reset tts stream and clean all cache of TTS instance.
119+
*
120+
* @param tts_handle Instance of TTS
121+
*/
122+
void esp_tts_stream_reset(esp_tts_handle_t tts_handle);
123+
124+
/**
125+
* @brief Free the TTS instance
126+
*
127+
* @param tts_handle The instance of TTS.
128+
*/
129+
void esp_tts_destroy(esp_tts_handle_t tts_handle);
130+
131+
#ifdef __cplusplus
132+
extern "C" {
133+
#endif
134+
135+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#ifndef _ESP_TTS_PARSER_H_
2+
#define _ESP_TTS_PARSER_H_
3+
4+
#include "stdlib.h"
5+
#include "esp_tts_voice.h"
6+
7+
8+
typedef struct {
9+
int *syll_idx;
10+
int syll_num;
11+
int total_num;
12+
esp_tts_voice_t *voice;
13+
}esp_tts_utt_t;
14+
15+
esp_tts_utt_t* esp_tts_parser_chinese (const char* str, esp_tts_voice_t *voice);
16+
17+
esp_tts_utt_t* esp_tts_parser_money(char *play_tag, int yuan, int jiao, int fen, esp_tts_voice_t *voice);
18+
19+
esp_tts_utt_t* esp_tts_parser_pinyin(char* pinyin, esp_tts_voice_t *voice);
20+
21+
esp_tts_utt_t* esp_tts_utt_alloc(int syll_num, esp_tts_voice_t *voice);
22+
23+
void esp_tts_utt_free(esp_tts_utt_t *utt);
24+
25+
#endif

0 commit comments

Comments
 (0)