Skip to content

Commit bb2d98a

Browse files
authored
IDF release/v3.3 6aaddf972
1 parent 5ee6aac commit bb2d98a

File tree

192 files changed

+1386
-305
lines changed

Some content is hidden

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

192 files changed

+1386
-305
lines changed

platform.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ compiler.S.flags=-c -g3 -x assembler-with-cpp -MMD -mlongcalls
3535

3636
compiler.c.elf.cmd=xtensa-esp32-elf-gcc
3737
compiler.c.elf.flags=-nostdlib "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" -T esp32_out.ld -T esp32.project.ld -T esp32.rom.ld -T esp32.peripherals.ld -T esp32.rom.libgcc.ld -T esp32.rom.spiram_incompatible_fns.ld -u esp_app_desc -u ld_include_panic_highint_hdl -u call_user_start_cpu0 -Wl,--gc-sections -Wl,-static -Wl,--undefined=uxTopUsedPriority -u __cxa_guard_dummy -u __cxx_fatal_exception
38-
compiler.c.elf.libs=-lgcc -lesp_websocket_client -lwpa2 -ldetection -lesp_https_server -lwps -lhal -lconsole -lpe -lsoc -lsdmmc -lpthread -llog -lesp_http_client -ljson -lmesh -lesp32-camera -lnet80211 -lwpa_supplicant -lc -lmqtt -lcxx -lesp_https_ota -lulp -lefuse -lpp -lmdns -lbt -lwpa -lspiffs -lheap -limage_util -lunity -lrtc -lmbedtls -lface_recognition -lnghttp -ljsmn -lopenssl -lcore -lfatfs -lm -lprotocomm -lsmartconfig -lxtensa-debug-module -ldl -lesp_event -lesp-tls -lfd -lespcoredump -lesp_http_server -lfr -lsmartconfig_ack -lwear_levelling -ltcp_transport -llwip -lphy -lvfs -lcoap -lesp32 -llibsodium -lbootloader_support -ldriver -lcoexist -lasio -lod -lmicro-ecc -lesp_ringbuf -ldetection_cat_face -lapp_update -lespnow -lface_detection -lapp_trace -lnewlib -lbtdm_app -lwifi_provisioning -lfreertos -lfreemodbus -lethernet -lnvs_flash -lspi_flash -lc_nano -lexpat -lfb_gfx -lprotobuf-c -lesp_adc_cal -ltcpip_adapter -lstdc++
38+
compiler.c.elf.libs=-lgcc -ldetection_cat_face -lespcoredump -lwpa -lrtc -lvfs -lnewlib -ldetection -lfreemodbus -lprotocomm -lwpa_supplicant -lfatfs -lsmartconfig -lesp_ringbuf -lfd -lesp_adc_cal -lspiffs -lopenssl -lsdmmc -ljsmn -lespnow -lc -lbootloader_support -lesp_https_server -lcore -lspi_flash -lmicro-ecc -lunity -lapp_trace -lexpat -lheap -ltcp_transport -lfr -lfb_gfx -lethernet -lesp_websocket_client -lesp32-camera -lcoexist -lpthread -lmqtt -lface_recognition -llwip -lasio -lefuse -lnvs_flash -lhal -lcxx -lesp_event -lfreertos -llibsodium -lwear_levelling -ljson -lesp32 -lcoap -lbt -lbtdm_app -lmbedtls -lwpa2 -lface_detection -lesp-tls -lwps -lpe -lmdns -lmesh -lesp_http_server -llog -lesp_http_client -lsoc -lc_nano -lnghttp -lprotobuf-c -lphy -lesp_https_ota -lwifi_provisioning -ldl -lulp -limage_util -lnet80211 -lsmartconfig_ack -lapp_update -lm -ltcpip_adapter -lpp -ldriver -lconsole -lod -lxtensa-debug-module -lstdc++
3939

4040
compiler.as.cmd=xtensa-esp32-elf-as
4141

tools/platformio-build.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
],
171171

172172
LIBS=[
173-
"-lgcc", "-lesp_websocket_client", "-lwpa2", "-ldetection", "-lesp_https_server", "-lwps", "-lhal", "-lconsole", "-lpe", "-lsoc", "-lsdmmc", "-lpthread", "-llog", "-lesp_http_client", "-ljson", "-lmesh", "-lesp32-camera", "-lnet80211", "-lwpa_supplicant", "-lc", "-lmqtt", "-lcxx", "-lesp_https_ota", "-lulp", "-lefuse", "-lpp", "-lmdns", "-lbt", "-lwpa", "-lspiffs", "-lheap", "-limage_util", "-lunity", "-lrtc", "-lmbedtls", "-lface_recognition", "-lnghttp", "-ljsmn", "-lopenssl", "-lcore", "-lfatfs", "-lm", "-lprotocomm", "-lsmartconfig", "-lxtensa-debug-module", "-ldl", "-lesp_event", "-lesp-tls", "-lfd", "-lespcoredump", "-lesp_http_server", "-lfr", "-lsmartconfig_ack", "-lwear_levelling", "-ltcp_transport", "-llwip", "-lphy", "-lvfs", "-lcoap", "-lesp32", "-llibsodium", "-lbootloader_support", "-ldriver", "-lcoexist", "-lasio", "-lod", "-lmicro-ecc", "-lesp_ringbuf", "-ldetection_cat_face", "-lapp_update", "-lespnow", "-lface_detection", "-lapp_trace", "-lnewlib", "-lbtdm_app", "-lwifi_provisioning", "-lfreertos", "-lfreemodbus", "-lethernet", "-lnvs_flash", "-lspi_flash", "-lc_nano", "-lexpat", "-lfb_gfx", "-lprotobuf-c", "-lesp_adc_cal", "-ltcpip_adapter", "-lstdc++"
173+
"-lgcc", "-ldetection_cat_face", "-lespcoredump", "-lwpa", "-lrtc", "-lvfs", "-lnewlib", "-ldetection", "-lfreemodbus", "-lprotocomm", "-lwpa_supplicant", "-lfatfs", "-lsmartconfig", "-lesp_ringbuf", "-lfd", "-lesp_adc_cal", "-lspiffs", "-lopenssl", "-lsdmmc", "-ljsmn", "-lespnow", "-lc", "-lbootloader_support", "-lesp_https_server", "-lcore", "-lspi_flash", "-lmicro-ecc", "-lunity", "-lapp_trace", "-lexpat", "-lheap", "-ltcp_transport", "-lfr", "-lfb_gfx", "-lethernet", "-lesp_websocket_client", "-lesp32-camera", "-lcoexist", "-lpthread", "-lmqtt", "-lface_recognition", "-llwip", "-lasio", "-lefuse", "-lnvs_flash", "-lhal", "-lcxx", "-lesp_event", "-lfreertos", "-llibsodium", "-lwear_levelling", "-ljson", "-lesp32", "-lcoap", "-lbt", "-lbtdm_app", "-lmbedtls", "-lwpa2", "-lface_detection", "-lesp-tls", "-lwps", "-lpe", "-lmdns", "-lmesh", "-lesp_http_server", "-llog", "-lesp_http_client", "-lsoc", "-lc_nano", "-lnghttp", "-lprotobuf-c", "-lphy", "-lesp_https_ota", "-lwifi_provisioning", "-ldl", "-lulp", "-limage_util", "-lnet80211", "-lsmartconfig_ack", "-lapp_update", "-lm", "-ltcpip_adapter", "-lpp", "-ldriver", "-lconsole", "-lod", "-lxtensa-debug-module", "-lstdc++"
174174
],
175175

176176
LIBSOURCE_DIRS=[

tools/sdk/bin/bootloader_dio_40m.bin

768 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dio_80m.bin

784 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dout_40m.bin

768 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_dout_80m.bin

784 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qio_40m.bin

768 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qio_80m.bin

768 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qout_40m.bin

768 Bytes
Binary file not shown.

tools/sdk/bin/bootloader_qout_80m.bin

768 Bytes
Binary file not shown.

tools/sdk/include/bootloader_support/esp_secure_boot.h

+13
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,19 @@ typedef struct {
123123

124124
esp_err_t esp_secure_boot_verify_signature_block(const esp_secure_boot_sig_block_t *sig_block, const uint8_t *image_digest);
125125

126+
/** @brief Verify the ECDSA secure boot signature block for Secure Boot.
127+
*
128+
* Calculates Deterministic ECDSA w/ SHA256 based on the SHA256 hash of the image. ECDSA signature
129+
* verification must be enabled in project configuration to use this function.
130+
*
131+
* Similar to esp_secure_boot_verify_signature(), but can be used when the digest is precalculated.
132+
* @param sig_block Pointer to ECDSA signature block data
133+
* @param image_digest Pointer to 32 byte buffer holding SHA-256 hash.
134+
* @param verified_digest Pointer to 32 byte buffer that will receive verified digest if verification completes. (Used during bootloader implementation only, result is invalid otherwise.)
135+
*
136+
*/
137+
esp_err_t esp_secure_boot_verify_ecdsa_signature_block(const esp_secure_boot_sig_block_t *sig_block, const uint8_t *image_digest, uint8_t *verified_digest);
138+
126139
#define FLASH_OFFS_SECURE_BOOT_IV_DIGEST 0
127140

128141
/** @brief Secure boot IV+digest header */

tools/sdk/include/bt/esp_a2dp_api.h

+22-4
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ typedef struct {
4646
} cie; /*!< A2DP codec information element */
4747
} __attribute__((packed)) esp_a2d_mcc_t;
4848

49+
/// Bluetooth A2DP Initiation states
50+
typedef enum {
51+
ESP_A2D_DEINIT_SUCCESS = 0, /*!< A2DP profile deinit successful event */
52+
ESP_A2D_INIT_SUCCESS /*!< A2DP profile init successful event */
53+
} esp_a2d_init_state_t;
54+
4955
/// Bluetooth A2DP connection states
5056
typedef enum {
5157
ESP_A2D_CONNECTION_STATE_DISCONNECTED = 0, /*!< connection released */
@@ -89,6 +95,7 @@ typedef enum {
8995
ESP_A2D_AUDIO_STATE_EVT, /*!< audio stream transmission state changed event */
9096
ESP_A2D_AUDIO_CFG_EVT, /*!< audio codec is configured, only used for A2DP SINK */
9197
ESP_A2D_MEDIA_CTRL_ACK_EVT, /*!< acknowledge event in response to media control commands */
98+
ESP_A2D_PROF_STATE_EVT, /*!< indicate a2dp deinit complete */
9299
} esp_a2d_cb_event_t;
93100

94101
/// A2DP state callback parameters
@@ -125,6 +132,13 @@ typedef union {
125132
esp_a2d_media_ctrl_t cmd; /*!< media control commands to acknowledge */
126133
esp_a2d_media_ctrl_ack_t status; /*!< acknowledgement to media control commands */
127134
} media_ctrl_stat; /*!< status in acknowledgement to media control commands */
135+
136+
/**
137+
* @brief ESP_A2D_PROF_STATE_EVT
138+
*/
139+
struct a2d_prof_stat_param {
140+
esp_a2d_init_state_t init_state; /*!< a2dp profile state param */
141+
} a2d_prof_stat; /*!< status to indicate a2d prof init or deinit */
128142
} esp_a2d_cb_param_t;
129143

130144
/**
@@ -193,7 +207,8 @@ esp_err_t esp_a2d_sink_register_data_callback(esp_a2d_sink_data_cb_t callback);
193207
/**
194208
*
195209
* @brief Initialize the bluetooth A2DP sink module. This function should be called
196-
* after esp_bluedroid_enable() completes successfully
210+
* after esp_bluedroid_enable() completes successfully, and ESP_A2D_PROF_STATE_EVT
211+
* with ESP_A2D_INIT_SUCCESS will reported to the APP layer
197212
*
198213
* @return
199214
* - ESP_OK: if the initialization request is sent successfully
@@ -207,7 +222,8 @@ esp_err_t esp_a2d_sink_init(void);
207222
/**
208223
*
209224
* @brief De-initialize for A2DP sink module. This function
210-
* should be called only after esp_bluedroid_enable() completes successfully
225+
* should be called only after esp_bluedroid_enable() completes successfully,
226+
* and ESP_A2D_PROF_STATE_EVT with ESP_A2D_DEINIT_SUCCESS will reported to APP layer.
211227
*
212228
* @return
213229
* - ESP_OK: success
@@ -264,7 +280,8 @@ esp_err_t esp_a2d_media_ctrl(esp_a2d_media_ctrl_t ctrl);
264280
/**
265281
*
266282
* @brief Initialize the bluetooth A2DP source module. This function should be called
267-
* after esp_bluedroid_enable() completes successfully
283+
* after esp_bluedroid_enable() completes successfully, and ESP_A2D_PROF_STATE_EVT
284+
* with ESP_A2D_INIT_SUCCESS will reported to the APP layer
268285
*
269286
* @return
270287
* - ESP_OK: if the initialization request is sent successfully
@@ -278,7 +295,8 @@ esp_err_t esp_a2d_source_init(void);
278295
/**
279296
*
280297
* @brief De-initialize for A2DP source module. This function
281-
* should be called only after esp_bluedroid_enable() completes successfully
298+
* should be called only after esp_bluedroid_enable() completes successfully,
299+
* and ESP_A2D_PROF_STATE_EVT with ESP_A2D_DEINIT_SUCCESS will reported to APP layer.
282300
*
283301
* @return
284302
* - ESP_OK: success

tools/sdk/include/bt/esp_blufi_api.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ typedef void (* esp_blufi_event_cb_t)(esp_blufi_cb_event_t event, esp_blufi_cb_p
301301
* @param len : length of data from phone
302302
* @param output_data : data want to send to phone
303303
* @param output_len : length of data want to send to phone
304+
* @param need_free : output reporting if memory needs to be freed or not *
304305
*/
305306
typedef void (*esp_blufi_negotiate_data_handler_t)(uint8_t *data, int len, uint8_t **output_data, int *output_len, bool *need_free);
306307

@@ -311,7 +312,7 @@ typedef void (*esp_blufi_negotiate_data_handler_t)(uint8_t *data, int len, uint8
311312
* @param crypt_len : length of plain text
312313
* @return Nonnegative number is encrypted length, if error, return negative number;
313314
*/
314-
typedef int (* esp_blufi_encrypt_func_t)(uint8_t iv8, uint8_t *crypt_data, int cyprt_len);
315+
typedef int (* esp_blufi_encrypt_func_t)(uint8_t iv8, uint8_t *crypt_data, int crypt_len);
315316

316317
/**
317318
* @brief BLUFI decrypt the data after negotiate a share key

tools/sdk/include/bt/esp_bt_defs.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ typedef uint8_t esp_link_key[ESP_BT_OCTET16_LEN]; /* Link Key */
6969

7070
#define ESP_BLE_CONN_INT_MIN 0x0006 /*!< relate to BTM_BLE_CONN_INT_MIN in stack/btm_ble_api.h */
7171
#define ESP_BLE_CONN_INT_MAX 0x0C80 /*!< relate to BTM_BLE_CONN_INT_MAX in stack/btm_ble_api.h */
72-
#define ESP_BLE_CONN_LATENCY_MAX 500 /*!< relate to ESP_BLE_CONN_LATENCY_MAX in stack/btm_ble_api.h */
72+
#define ESP_BLE_CONN_LATENCY_MAX 499 /*!< relate to ESP_BLE_CONN_LATENCY_MAX in stack/btm_ble_api.h */
7373
#define ESP_BLE_CONN_SUP_TOUT_MIN 0x000A /*!< relate to BTM_BLE_CONN_SUP_TOUT_MIN in stack/btm_ble_api.h */
7474
#define ESP_BLE_CONN_SUP_TOUT_MAX 0x0C80 /*!< relate to ESP_BLE_CONN_SUP_TOUT_MAX in stack/btm_ble_api.h */
7575
#define ESP_BLE_CONN_PARAM_UNDEF 0xffff /* use this value when a specific value not to be overwritten */ /* relate to ESP_BLE_CONN_PARAM_UNDEF in stack/btm_ble_api.h */

tools/sdk/include/bt/esp_gattc_api.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ typedef union {
248248
/**
249249
* @brief GATT Client callback function type
250250
* @param event : Event type
251-
* @param gatts_if : GATT client access interface, normally
251+
* @param gattc_if : GATT client access interface, normally
252252
* different gattc_if correspond to different profile
253253
* @param param : Point to callback parameter, currently is union type
254254
*/

tools/sdk/include/bt/esp_hf_client_api.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ typedef void (* esp_hf_client_incoming_data_cb_t)(const uint8_t *buf, uint32_t l
271271
* buffer is allocated inside bluetooth protocol stack and will be released after
272272
* invoke of the callback is finished.
273273
* @param[in] len : size(in bytes) in buf
274-
* @param[out] length of data successfully read
274+
* @return length of data successfully read
275275
*/
276276
typedef uint32_t (* esp_hf_client_outgoing_data_cb_t)(uint8_t *buf, uint32_t len);
277277

tools/sdk/include/bt/esp_spp_api.h

+31-8
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ typedef enum {
2626
ESP_SPP_SUCCESS = 0, /*!< Successful operation. */
2727
ESP_SPP_FAILURE, /*!< Generic failure. */
2828
ESP_SPP_BUSY, /*!< Temporarily can not handle this request. */
29-
ESP_SPP_NO_DATA, /*!< no data. */
29+
ESP_SPP_NO_DATA, /*!< No data. */
3030
ESP_SPP_NO_RESOURCE, /*!< No more resource */
3131
ESP_SPP_NEED_INIT, /*!< SPP module shall init first */
3232
ESP_SPP_NEED_DEINIT, /*!< SPP module shall deinit first */
33-
ESP_SPP_NO_CONNECTION, /*!< connection may have been closed */
33+
ESP_SPP_NO_CONNECTION, /*!< Connection may have been closed */
34+
ESP_SPP_NO_SERVER, /*!< No SPP server */
3435
} esp_spp_status_t;
3536

3637
/* Security Setting Mask, Suggest to use ESP_SPP_SEC_NONE, ESP_SPP_SEC_AUTHORIZE or ESP_SPP_SEC_AUTHENTICATE only.*/
@@ -96,9 +97,11 @@ typedef union {
9697
* @brief SPP_DISCOVERY_COMP_EVT
9798
*/
9899
struct spp_discovery_comp_evt_param {
99-
esp_spp_status_t status; /*!< status */
100-
uint8_t scn_num; /*!< The num of scn_num */
101-
uint8_t scn[ESP_SPP_MAX_SCN]; /*!< channel # */
100+
101+
esp_spp_status_t status; /*!< status */
102+
uint8_t scn_num; /*!< The num of scn_num */
103+
uint8_t scn[ESP_SPP_MAX_SCN]; /*!< channel # */
104+
const char *service_name[ESP_SPP_MAX_SCN]; /*!< service_name */
102105
} disc_comp; /*!< SPP callback param of SPP_DISCOVERY_COMP_EVT */
103106

104107
/**
@@ -138,6 +141,7 @@ typedef union {
138141
esp_spp_status_t status; /*!< status */
139142
uint32_t handle; /*!< The connection handle */
140143
uint8_t sec_id; /*!< security ID used by this server */
144+
uint8_t scn; /*!< Server channel number */
141145
bool use_co; /*!< TRUE to use co_rfc_data */
142146
} start; /*!< SPP callback param of ESP_SPP_START_EVT */
143147

@@ -146,6 +150,7 @@ typedef union {
146150
*/
147151
struct spp_srv_stop_evt_param {
148152
esp_spp_status_t status; /*!< status */
153+
uint8_t scn; /*!< Server channel number */
149154
} srv_stop; /*!< SPP callback param of ESP_SPP_SRV_STOP_EVT */
150155

151156
/**
@@ -294,16 +299,34 @@ esp_err_t esp_spp_start_srv(esp_spp_sec_t sec_mask,
294299
esp_spp_role_t role, uint8_t local_scn, const char *name);
295300

296301
/**
297-
* @brief This function stops a SPP server
298-
* When the server is stopped successfully, the callback is called
299-
* with ESP_SPP_SRV_STOP_EVT.
302+
303+
* @brief This function stops all SPP servers.
304+
* The operation will close all active SPP connection first, then the callback function will be called
305+
* with ESP_SPP_CLOSE_EVT, and the number of ESP_SPP_CLOSE_EVT is equal to the number of connection.
306+
* When the operation is completed, the callback is called with ESP_SPP_SRV_STOP_EVT.
307+
* This funciton must be called after esp_spp_init() successful and before esp_spp_deinit().
300308
*
301309
* @return
302310
* - ESP_OK: success
303311
* - other: failed
304312
*/
305313
esp_err_t esp_spp_stop_srv(void);
306314

315+
/**
316+
* @brief This function stops a specific SPP server.
317+
* The operation will close all active SPP connection first on the specific SPP server, then the callback function will be called
318+
* with ESP_SPP_CLOSE_EVT, and the number of ESP_SPP_CLOSE_EVT is equal to the number of connection.
319+
* When the operation is completed, the callback is called with ESP_SPP_SRV_STOP_EVT.
320+
* This funciton must be called after esp_spp_init() successful and before esp_spp_deinit().
321+
*
322+
* @param[in] scn: Server channel number.
323+
*
324+
* @return
325+
* - ESP_OK: success
326+
* - other: failed
327+
*/
328+
esp_err_t esp_spp_stop_srv_scn(uint8_t scn);
329+
307330
/**
308331
* @brief This function is used to write data, only for ESP_SPP_MODE_CB.
309332
*

tools/sdk/include/config/sdkconfig.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -397,5 +397,5 @@
397397
#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1
398398
#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1
399399
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
400-
#define CONFIG_ARDUINO_IDF_COMMIT "85c43024c"
400+
#define CONFIG_ARDUINO_IDF_COMMIT "6aaddf972"
401401
#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3"

tools/sdk/include/driver/driver/dac.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extern "C" {
2121

2222
#include <stdint.h>
2323
#include "esp_err.h"
24+
#include "driver/gpio.h"
2425
#include "soc/dac_channel.h"
2526

2627
typedef enum {

tools/sdk/include/esp-tls/esp_tls.h

+12
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,16 @@ typedef enum esp_tls_conn_state {
4343
ESP_TLS_DONE,
4444
} esp_tls_conn_state_t;
4545

46+
/**
47+
* @brief Keep alive parameters structure
48+
*/
49+
typedef struct tls_keep_alive_cfg {
50+
bool keep_alive_enable; /*!< Enable keep-alive timeout */
51+
int keep_alive_idle; /*!< Keep-alive idle time (second) */
52+
int keep_alive_interval; /*!< Keep-alive interval time (second) */
53+
int keep_alive_count; /*!< Keep-alive packet retry send count */
54+
} tls_keep_alive_cfg_t;
55+
4656
/**
4757
* @brief ESP-TLS configuration parameters
4858
*/
@@ -93,6 +103,8 @@ typedef struct esp_tls_cfg {
93103
If NULL, server certificate CN must match hostname. */
94104

95105
bool skip_common_name; /*!< Skip any validation of server certificate CN field */
106+
107+
tls_keep_alive_cfg_t *keep_alive_cfg; /*!< Enable TCP keep-alive timeout for SSL connection */
96108
} esp_tls_cfg_t;
97109

98110
/**

tools/sdk/include/esp32-camera/esp_camera.h

+12-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
.pixel_format = PIXFORMAT_JPEG,
3939
.frame_size = FRAMESIZE_SVGA,
4040
.jpeg_quality = 10,
41-
.fb_count = 2
41+
.fb_count = 2,
42+
.grab_mode = CAMERA_GRAB_WHEN_EMPTY
4243
};
4344
4445
esp_err_t camera_example_init(){
@@ -74,6 +75,14 @@
7475
extern "C" {
7576
#endif
7677

78+
/**
79+
* @brief Configuration structure for camera initialization
80+
*/
81+
typedef enum {
82+
CAMERA_GRAB_WHEN_EMPTY, /*!< Fills buffers when they are empty. Less resources but first 'fb_count' frames might be old */
83+
CAMERA_GRAB_LATEST /*!< Except when 1 frame buffer is used, queue will always contain the last 'fb_count' frames */
84+
} camera_grab_mode_t;
85+
7786
/**
7887
* @brief Configuration structure for camera initialization
7988
*/
@@ -95,7 +104,7 @@ typedef struct {
95104
int pin_href; /*!< GPIO pin for camera HREF line */
96105
int pin_pclk; /*!< GPIO pin for camera PCLK line */
97106

98-
int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. Either 20KHz or 10KHz for OV2640 double FPS (Experimental) */
107+
int xclk_freq_hz; /*!< Frequency of XCLK signal, in Hz. EXPERIMENTAL: Set to 16MHz on ESP32-S2 or ESP32-S3 to enable EDMA mode */
99108

100109
ledc_timer_t ledc_timer; /*!< LEDC timer to be used for generating XCLK */
101110
ledc_channel_t ledc_channel; /*!< LEDC channel to be used for generating XCLK */
@@ -105,6 +114,7 @@ typedef struct {
105114

106115
int jpeg_quality; /*!< Quality of JPEG output. 0-63 lower means higher quality */
107116
size_t fb_count; /*!< Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed) */
117+
camera_grab_mode_t grab_mode; /*!< When buffers should be filled */
108118
} camera_config_t;
109119

110120
/**

0 commit comments

Comments
 (0)