diff --git a/example/bilibili_fans/components/bsp_extra/CMakeLists.txt b/example/bilibili_fans/components/bsp_extra/CMakeLists.txt deleted file mode 100644 index 2abe51240a48e4876975235d90038ce15b1d61ba..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/bsp_extra/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -set(SRCS "") -list(APPEND SRCS - "src/bsp_board_extra.c" -) - -set(INCLUDE_DIRS "") -list(APPEND INCLUDE_DIRS "include") - -foreach(SRC_DIR IN LISTS SRC_DIRS) - file(GLOB_RECURSE SRC ${SRC_DIR}/*.c) - list(APPEND SRCS ${SRC}) - list(APPEND INCLUDE_DIRS ${SRC_DIR}/include) -endforeach() - -idf_component_register( - SRCS ${SRCS} - INCLUDE_DIRS ${INCLUDE_DIRS} - REQUIRES driver - PRIV_REQUIRES esp_timer fatfs esp_psram esp_mm -) - -target_compile_options( - ${COMPONENT_LIB} PRIVATE - -Wno-format - -Wno-int-conversion - -Wno-incompatible-pointer-types - -Wunused-function - -Wno-unused-variable - -Wno-unused-function - -Wno-overflow - -Wno-unused-but-set-variable - -Wno-discarded-qualifiers) diff --git a/example/bilibili_fans/components/bsp_extra/Kconfig b/example/bilibili_fans/components/bsp_extra/Kconfig deleted file mode 100644 index ec558673078adf7029bbfaa1fe514a30c460f7a6..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/bsp_extra/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -menu "Board Support Package" - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/bilibili_fans/components/bsp_extra/LICENSE b/example/bilibili_fans/components/bsp_extra/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/bsp_extra/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/bilibili_fans/components/bsp_extra/idf_component.yml b/example/bilibili_fans/components/bsp_extra/idf_component.yml deleted file mode 100644 index 252b36ace2c5cad695c4e36877efb4e1a9060d6c..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/bsp_extra/idf_component.yml +++ /dev/null @@ -1,24 +0,0 @@ -dependencies: - idf: - version: '>=5.2.0' - - espressif/esp_sparkbot_bsp: - version: "*" - path: ../esp_sparkbot_bsp - - esp_codec_dev: - public: true - version: "==1.1.0" - - chmorgan/esp-audio-player: - version: "1.0.*" - public: true - - chmorgan/esp-file-iterator: - version: "1.0.0" - public: true - -description: Board Support Package for ESP32-P4-Function-ev-board -targets: -- esp32s3 -version: 0.0.1 diff --git a/example/bilibili_fans/components/bsp_extra/include/bsp_board_extra.h b/example/bilibili_fans/components/bsp_extra/include/bsp_board_extra.h deleted file mode 100644 index 381a7156b026399f87d6e6254dc8821ed938c725..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/bsp_extra/include/bsp_board_extra.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include -#include "esp_codec_dev.h" -#include "esp_err.h" -#include "driver/gpio.h" -#include "driver/i2s_std.h" -#include "audio_player.h" -#include "file_iterator.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define BSP_I2S_SCLK (GPIO_NUM_39) -#define BSP_I2S_MCLK (GPIO_NUM_45) -#define BSP_I2S_LCLK (GPIO_NUM_41) -#define BSP_I2S_DOUT (GPIO_NUM_42) // To Codec ES8311 -#define BSP_I2S_DSIN (GPIO_NUM_40) // From Codec ES8311 -#define BSP_POWER_AMP_IO (GPIO_NUM_NC) - -#define CODEC_DEFAULT_SAMPLE_RATE (16000) -#define CODEC_DEFAULT_BIT_WIDTH (16) -#define CODEC_DEFAULT_ADC_VOLUME (24.0) -#define CODEC_DEFAULT_CHANNEL (2) -#define CODEC_DEFAULT_VOLUME (60) - -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MAX (95) -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MIN (0) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) - -/************************************************************************************************** - * - * I2S audio interface - * - * There are two devices connected to the I2S peripheral: - * - Codec ES8311 for output (playback) path - * - ADC ES7210 for input (recording) path - * - * For speaker initialization use `bsp_extra_audio_codec_speaker_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * For microphone initialization use `bsp_extra_audio_codec_microphone_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * After speaker or microphone initialization, use functions from esp_codec_dev for play/record audio. - * Example audio play: - * \code{.c} - * esp_codec_dev_set_out_vol(spk_codec_dev, DEFAULT_VOLUME); - * esp_codec_dev_open(spk_codec_dev, &fs); - * esp_codec_dev_write(spk_codec_dev, wav_bytes, bytes_read_from_spiffs); - * esp_codec_dev_close(spk_codec_dev); - * \endcode - **************************************************************************************************/ -/** - * @brief Init audio - * - * @note There is no deinit audio function. Users can free audio resources by calling `i2s_del_channel()`. - * @note This function wiil call `bsp_io_expander_init()` to setup and enable the control pin of audio power amplifier. - * @note This function will be called in `bsp_extra_audio_codec_speaker_init()` and `bsp_extra_audio_codec_microphone_init()`. - * - * @param[in] i2s_config I2S configuration. Pass NULL to use default values (Mono, duplex, 16bit, 22050 Hz) - * @return - * - ESP_OK On success - * - ESP_ERR_NOT_SUPPORTED The communication mode is not supported on the current chip - * - ESP_ERR_INVALID_ARG NULL pointer or invalid configuration - * - ESP_ERR_NOT_FOUND No available I2S channel found - * - ESP_ERR_NO_MEM No memory for storing the channel information - * - ESP_ERR_INVALID_STATE This channel has not initialized or already started - * - other error codes - */ -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config); - -/** - * @brief Initialize speaker codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void); - -/** - * @brief Initialize microphone codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void); - -/************************************************************************************************** - * BSP Extra interface - * Mainly provided some I2S Codec interfaces. - **************************************************************************************************/ -/** - * @brief Player set mute. - * - * @param enable: true or false - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_mute_set(bool enable); - -/** - * @brief Player set volume. - * - * @param volume: volume set - * @param volume_set: volume set response - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set); - -/** - * @brief Player get volume. - * - * @return - * - volume: volume get - */ -int bsp_extra_codec_volume_get(void); - -/** - * @brief Stop I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_stop(void); - -/** - * @brief Resume I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_resume(void); - -/** - * @brief Set I2S format to codec. - * - * @param rate: Sample rate of sample - * @param bits_cfg: Bit lengths of one channel data - * @param ch: Channels of sample - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch); - -/** - * @brief Read data from recoder. - * - * @param audio_buffer: The pointer of receiving data buffer - * @param len: Max data buffer length - * @param bytes_read: Byte number that actually be read, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms); - -/** - * @brief Write data to player. - * - * @param audio_buffer: The pointer of sent data buffer - * @param len: Max data buffer length - * @param bytes_written: Byte number that actually be sent, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms); - - -/** - * @brief Initialize codec play and record handle. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_init(); - -/** - * @brief Initialize audio player task. - * - * @param path file path - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_init(void); - -/** - * @brief Delete audio player task. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_del(void); - -/** - * @brief Initialize a file iterator instance - * - * @param path The file path for the iterator. - * @param ret_instance A pointer to the file iterator instance to be returned. - * @return - * - ESP_OK: Successfully initialized the file iterator instance. - * - ESP_FAIL: Failed to initialize the file iterator instance due to invalid parameters or memory allocation failure. - */ -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance); - -/** - * @brief Play the audio file at the specified index in the file iterator - * - * @param instance The file iterator instance. - * @param index The index of the file to play within the iterator. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to invalid parameters or file access issues. - */ -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index); - -/** - * @brief Play the audio file specified by the file path - * - * @param file_path The path to the audio file to be played. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to file access issues. - */ -esp_err_t bsp_extra_player_play_file(const char *file_path); - -/** - * @brief Register a callback function for the audio player - * - * @param cb The callback function to be registered. - * @param user_data User data to be passed to the callback function. - */ -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data); - -/** - * @brief Check if the specified audio file is currently playing - * - * @param file_path The path to the audio file to check. - * @return - * - true: The specified audio file is currently playing. - * - false: The specified audio file is not currently playing. - */ -bool bsp_extra_player_is_playing_by_path(const char *file_path); - -/** - * @brief Check if the audio file at the specified index is currently playing - * - * @param instance The file iterator instance. - * @param index The index of the file to check. - * @return - * - true: The audio file at the specified index is currently playing. - * - false: The audio file at the specified index is not currently playing. - */ -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index); - -#ifdef __cplusplus -} -#endif diff --git a/example/bilibili_fans/components/bsp_extra/src/bsp_board_extra.c b/example/bilibili_fans/components/bsp_extra/src/bsp_board_extra.c deleted file mode 100644 index c9fb477798b4125fa64e0a3a10301cce16b72b66..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/bsp_extra/src/bsp_board_extra.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include "esp_log.h" -#include "esp_check.h" -#include "esp_codec_dev_defaults.h" -#include "esp_err.h" -#include "esp_log.h" -#include "esp_vfs_fat.h" -#include "driver/i2c.h" -#include "driver/i2s_std.h" -#include "driver/gpio.h" -#include "driver/ledc.h" - -#include "bsp/esp-bsp.h" -#include "bsp_board_extra.h" - -#define BSP_ES7210_CODEC_ADDR (0x82) - -/* Can be used for `i2s_std_gpio_config_t` and/or `i2s_std_config_t` initialization */ -#define BSP_I2S_GPIO_CFG \ - { \ - .mclk = BSP_I2S_MCLK, \ - .bclk = BSP_I2S_SCLK, \ - .ws = BSP_I2S_LCLK, \ - .dout = BSP_I2S_DOUT, \ - .din = BSP_I2S_DSIN, \ - .invert_flags = { \ - .mclk_inv = false, \ - .bclk_inv = false, \ - .ws_inv = false, \ - }, \ - } - -/* This configuration is used by default in `bsp_extra_audio_init()` */ -#define BSP_I2S_DUPLEX_MONO_CFG(_sample_rate) \ - { \ - .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(_sample_rate), \ - .slot_cfg = I2S_STD_PHILIP_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO), \ - .gpio_cfg = BSP_I2S_GPIO_CFG, \ - } - -#define USE_I2S_RX_CHAN (1) - -static const char *TAG = "bsp_extra_board"; - -static esp_codec_dev_handle_t play_dev_handle; -static esp_codec_dev_handle_t record_dev_handle; - -static bool _is_audio_init = false; -static bool _is_player_init = false; -static int _vloume_intensity = CODEC_DEFAULT_VOLUME; - -static audio_player_cb_t audio_idle_callback = NULL; -static void *audio_idle_cb_user_data = NULL; -static char audio_file_path[128]; - -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ -static i2s_chan_handle_t i2s_tx_chan = NULL; -#if USE_I2S_RX_CHAN -static i2s_chan_handle_t i2s_rx_chan = NULL; -#endif - -/************************************************************************************************** - * - * I2S Audio Function - * - **************************************************************************************************/ -#define EXAMPLE_BUFF_SIZE 2048 - -static void i2s_example_write_task(void *args) -{ - uint8_t *w_buf = (uint8_t *)calloc(1, EXAMPLE_BUFF_SIZE); - assert(w_buf); // Check if w_buf allocation success - - /* Assign w_buf */ - for (int i = 0; i < EXAMPLE_BUFF_SIZE; i += 8) { - w_buf[i] = 0x12; - w_buf[i + 1] = 0x34; - w_buf[i + 2] = 0x56; - w_buf[i + 3] = 0x78; - w_buf[i + 4] = 0x9A; - w_buf[i + 5] = 0xBC; - w_buf[i + 6] = 0xDE; - w_buf[i + 7] = 0xF0; - } - - size_t w_bytes = EXAMPLE_BUFF_SIZE; - - // /* (Optional) Preload the data before enabling the TX channel, so that the valid data can be transmitted immediately */ - // while (w_bytes == EXAMPLE_BUFF_SIZE) { - // /* Here we load the target buffer repeatedly, until all the DMA buffers are preloaded */ - // ESP_ERROR_CHECK(i2s_channel_preload_data(tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes)); - // } - - /* Enable the TX channel */ - // ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - while (1) { - /* Write i2s data */ - if (i2s_channel_write(i2s_tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes, 1000) == ESP_OK) { - printf("Write Task: i2s write %d bytes\n", w_bytes); - } else { - printf("Write Task: i2s write failed\n"); - } - vTaskDelay(pdMS_TO_TICKS(200)); - } - free(w_buf); - vTaskDelete(NULL); -} - -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config) -{ - esp_err_t ret = ESP_FAIL; -#if USE_I2S_RX_CHAN - if (i2s_tx_chan && i2s_rx_chan) { -#else - if (i2s_tx_chan) { -#endif - /* Audio was initialized before */ - return ESP_OK; - } - - /* Setup I2S peripheral */ - i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(CONFIG_BSP_I2S_NUM, I2S_ROLE_MASTER); - chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer -#if USE_I2S_RX_CHAN - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, &i2s_rx_chan)); -#else - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, NULL)); -#endif - - /* Setup I2S channels */ - const i2s_std_config_t std_cfg_default = BSP_I2S_DUPLEX_MONO_CFG(22050); - const i2s_std_config_t *p_i2s_cfg = &std_cfg_default; - if (i2s_config != NULL) { - p_i2s_cfg = i2s_config; - } - - if (i2s_tx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_tx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - } -#if USE_I2S_RX_CHAN - if (i2s_rx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_rx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_rx_chan)); - } -#endif - - audio_codec_i2s_cfg_t i2s_cfg = { - .port = CONFIG_BSP_I2S_NUM, - .tx_handle = i2s_tx_chan, -#if USE_I2S_RX_CHAN - .rx_handle = i2s_rx_chan, -#else - .rx_handle = NULL, -#endif - }; - i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); - - return ESP_OK; -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_TYPE_OUT, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN_OUT, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_dev_cfg); -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_WORK_MODE_BOTH, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_es8311_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_es8311_dev_cfg); -} - -static esp_err_t audio_mute_function(AUDIO_PLAYER_MUTE_SETTING setting) -{ - // Volume saved when muting and restored when unmuting. Restoring volume is necessary - // as es8311_set_voice_mute(true) results in voice volume (REG32) being set to zero. - - bsp_extra_codec_mute_set(setting == AUDIO_PLAYER_MUTE ? true : false); - - // restore the voice volume upon unmuting - if (setting == AUDIO_PLAYER_UNMUTE) { - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, _vloume_intensity), TAG, "Set Codec volume failed"); - } - - return ESP_OK; -} - -static void audio_callback(audio_player_cb_ctx_t *ctx) -{ - if (audio_idle_callback) { - ctx->user_ctx = audio_idle_cb_user_data; - audio_idle_callback(ctx); - } -} - -/************************************************************************************************** - * - * Extra Board Function - * - **************************************************************************************************/ - -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len); - *bytes_read = len; - return ret; -} - -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len); - *bytes_written = len; - return ret; -} - -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch) -{ - esp_err_t ret = ESP_OK; - - esp_codec_dev_sample_info_t fs = { - .sample_rate = rate, - .channel = ch, - .bits_per_sample = bits_cfg, - }; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - if (record_dev_handle) { - ret |= esp_codec_dev_close(record_dev_handle); - ret |= esp_codec_dev_set_in_gain(record_dev_handle, CODEC_DEFAULT_ADC_VOLUME); - } - - if (play_dev_handle) { - ret |= esp_codec_dev_open(play_dev_handle, &fs); - } - if (record_dev_handle) { - ret |= esp_codec_dev_open(record_dev_handle, &fs); - } - return ret; -} - -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set) -{ - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, volume), TAG, "Set Codec volume failed"); - _vloume_intensity = volume; - - ESP_LOGI(TAG, "Setting volume: %d", volume); - - return ESP_OK; -} - -int bsp_extra_codec_volume_get(void) -{ - return _vloume_intensity; -} - -esp_err_t bsp_extra_codec_mute_set(bool enable) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_set_out_mute(play_dev_handle, enable); - return ret; -} - -esp_err_t bsp_extra_codec_dev_stop(void) -{ - esp_err_t ret = ESP_OK; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - - if (record_dev_handle) { - ret = esp_codec_dev_close(record_dev_handle); - } - return ret; -} - -esp_err_t bsp_extra_codec_dev_resume(void) -{ - return bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); -} - -esp_err_t bsp_extra_codec_init() -{ - if (_is_audio_init) { - return ESP_OK; - } - - play_dev_handle = bsp_extra_audio_codec_speaker_init(); - assert((play_dev_handle) && "play_dev_handle not initialized"); - - record_dev_handle = bsp_extra_audio_codec_microphone_init(); - assert((record_dev_handle) && "record_dev_handle not initialized"); - - bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); - - _is_audio_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_init(void) -{ - if (_is_player_init) { - return ESP_OK; - } - - audio_player_config_t config = { .mute_fn = audio_mute_function, - .write_fn = bsp_extra_i2s_write, - .clk_set_fn = bsp_extra_codec_set_fs, - .priority = 5 - }; - ESP_RETURN_ON_ERROR(audio_player_new(config), TAG, "audio_player_init failed"); - audio_player_callback_register(audio_callback, NULL); - - _is_player_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_del(void) -{ - _is_player_init = false; - - ESP_RETURN_ON_ERROR(audio_player_delete(), TAG, "audio_player_delete failed"); - - return ESP_OK; -} - -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance) -{ - ESP_RETURN_ON_FALSE(path, ESP_FAIL, TAG, "path is NULL"); - ESP_RETURN_ON_FALSE(ret_instance, ESP_FAIL, TAG, "ret_instance is NULL"); - - file_iterator_instance_t *file_iterator = file_iterator_new(path); - ESP_RETURN_ON_FALSE(file_iterator, ESP_FAIL, TAG, "file_iterator_new failed, %s", path); - - *ret_instance = file_iterator; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index) -{ - ESP_RETURN_ON_FALSE(instance, ESP_FAIL, TAG, "instance is NULL"); - - ESP_LOGI(TAG, "play_index(%d)", index); - char filename[128]; - int retval = file_iterator_get_full_path_from_index(instance, index, filename, sizeof(filename)); - ESP_RETURN_ON_FALSE(retval != 0, ESP_FAIL, TAG, "file_iterator_get_full_path_from_index failed"); - - ESP_LOGI(TAG, "opening file '%s'", filename); - FILE *fp = fopen(filename, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", filename); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, filename, sizeof(audio_file_path)); - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_file(const char *file_path) -{ - ESP_LOGI(TAG, "opening file '%s'", file_path); - FILE *fp = fopen(file_path, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", file_path); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, file_path, sizeof(audio_file_path)); - - return ESP_OK; -} - -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data) -{ - audio_idle_callback = cb; - audio_idle_cb_user_data = user_data; -} - -bool bsp_extra_player_is_playing_by_path(const char *file_path) -{ - return (strcmp(audio_file_path, file_path) == 0); -} - -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index) -{ - return (index == file_iterator_get_index(instance)); -} \ No newline at end of file diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/CMakeLists.txt b/example/bilibili_fans/components/esp_sparkbot_bsp/CMakeLists.txt deleted file mode 100644 index d276876a85bab2519a9e0b3b709a42cf6d826688..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -#IDF version is less than IDF5.0 -if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "5.0") - set(SRC_VER "esp_sparkbot_bsp_idf4.c") -else() - set(SRC_VER "esp_sparkbot_bsp_idf5.c") -endif() - -idf_component_register( - SRCS "esp_sparkbot_bsp.c" ${SRC_VER} - INCLUDE_DIRS "include" "include/bsp" - PRIV_INCLUDE_DIRS "priv_include" - REQUIRES driver spiffs touch_element - PRIV_REQUIRES fatfs esp_lcd -) diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/Kconfig b/example/bilibili_fans/components/esp_sparkbot_bsp/Kconfig deleted file mode 100644 index 9306c9c9c46b8c187959c1fec008862337618d9d..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/Kconfig +++ /dev/null @@ -1,105 +0,0 @@ -menu "Board Support Package" - - config BSP_ERROR_CHECK - bool "Enable error check in BSP" - default y - help - Error check assert the application before returning the error code. - - menu "I2C" - config BSP_I2C_NUM - int "I2C peripheral index" - default 1 - range 0 1 - help - ESP32-S2 has two I2C peripherals, pick the one you want to use. - - config BSP_I2C_FAST_MODE - bool "Enable I2C fast mode" - default y - help - I2C has two speed modes: normal (100kHz) and fast (400kHz). - - config BSP_I2C_CLK_SPEED_HZ - int - default 400000 if BSP_I2C_FAST_MODE - default 100000 - endmenu - - menu "SPIFFS - Virtual File System" - config BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - bool "Format SPIFFS if mounting fails" - default n - help - Format SPIFFS if it fails to mount the filesystem. - - config BSP_SPIFFS_MOUNT_POINT - string "SPIFFS mount point" - default "/spiffs" - help - Mount point of SPIFFS in the Virtual File System. - - config BSP_SPIFFS_PARTITION_LABEL - string "Partition label of SPIFFS" - default "storage" - help - Partition label which stores SPIFFS. - - config BSP_SPIFFS_MAX_FILES - int "Maximum files that could be open at the same time" - default 2 - help - Supported max files for SPIFFS in the Virtual File System. - endmenu - - menu "uSD card - Virtual File System" - config BSP_SD_FORMAT_ON_MOUNT_FAIL - bool "Format uSD card if mounting fails" - default n - help - The SDMMC host will format (FAT) the uSD card if it fails to mount the filesystem. - - config BSP_SD_MOUNT_POINT - string "uSD card mount point" - default "/sdcard" - help - Mount point of the uSD card in the Virtual File System - - endmenu - menu "Display" - config BSP_DISPLAY_LVGL_TASK_PRIORITY - int "LVGL task priority" - default 2 - help - The Board Support Package will create a task that will periodically handle LVGL operation in lv_timer_handler(). - - config BSP_DISPLAY_LVGL_TICK - int "LVGL tick period" - default 5 - range 1 100 - help - Period of LVGL tick timer. - - config BSP_DISPLAY_LVGL_MAX_SLEEP - int "LVGL maximum sleep time in ms" - default 1 - range 1 500 - help - Maximum time for task sleep in ms. - - config BSP_DISPLAY_BRIGHTNESS_LEDC_CH - int "LEDC channel index" - default 1 - range 0 7 - help - LEDC channel is used to generate PWM signal that controls display brightness. - Set LEDC index that should be used. - endmenu - - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/LICENSE b/example/bilibili_fans/components/esp_sparkbot_bsp/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/README.md b/example/bilibili_fans/components/esp_sparkbot_bsp/README.md deleted file mode 100644 index 029d9371f5b7eb2753ade93ab4e7e79de973a312..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# BSP: ESP-SparkBot - -[![Component Registry](https://components.espressif.com/components/espressif/esp32_s3_eye/badge.svg)](https://components.espressif.com/components/espressif/esp32_s3_eye) - -### Overview - -The ESP32-S3-EYE board consists of two parts: the main board (ESP32-S3-EYE-MB) that integrates the ESP32-S3-WROOM-1 module, camera, uSD card slot, digital microphone, USB port, and function buttons; and the sub board (ESP32-S3-EYE-SUB) that contains an LCD display. The main board and sub board are connected through pin headers. - -* [Hardware Reference](https://www.espressif.com/en/products/devkits/esp-eye/overview.) - -![](https://raw.githubusercontent.com/espressif/esp-who/master/docs/_static/get-started/ESP32-S3-EYE_MB-annotated-photo.png) - -**The development board has the following features:** -* ESP32-S3 module with built-in 8 MB flash and 8 MB octal RAM -* 1.3-inch 240x240 LCD color screen -* Onboard uSD card slot -* Digital microphone -* Accelerometer -* OV2640 camera - - -### Capabilities and dependencies -| Capability | Available | Component | Version | -|-------------|------------------|----------------------------------------------------------------------------------------------|----------| -| DISPLAY |:heavy_check_mark:| idf | >=4.4.5 | -| LVGL_PORT |:heavy_check_mark:|[espressif/esp_lvgl_port](https://components.espressif.com/components/espressif/esp_lvgl_port)| ^2 | -| TOUCH | :x: | | | -| BUTTONS |:heavy_check_mark:| [espressif/button](https://components.espressif.com/components/espressif/button) |>=2.5,<4.0| -| AUDIO |:heavy_check_mark:|[espressif/esp_codec_dev](https://components.espressif.com/components/espressif/esp_codec_dev)| ^1,<1.2 | -|AUDIO_SPEAKER| :x: | | | -| AUDIO_MIC |:heavy_check_mark:| | | -| SDCARD |:heavy_check_mark:| idf | >=4.4.5 | -| IMU |:heavy_check_mark:| [qma6100p](https://components.espressif.com/components/qma6100p) | 1.* | -| CAMERA |:heavy_check_mark:| [espressif/esp32-camera](https://components.espressif.com/components/espressif/esp32-camera) | ^2.0.2 | - diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c b/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c deleted file mode 100644 index 330cb6b073844b0c504f5142820b0abc7b1b0a63..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c +++ /dev/null @@ -1,469 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "esp_vfs_fat.h" -#include "esp_lcd_panel_io.h" -#include "esp_lcd_panel_vendor.h" -#include "esp_lcd_panel_ops.h" -#include "esp_log.h" -#include "esp_check.h" -#include "esp_vfs_fat.h" -#include "esp_spiffs.h" - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" - -#include "driver/spi_master.h" -#include "driver/ledc.h" -#include "driver/i2c.h" - -#include "touch_element/touch_button.h" - -#include "esp_codec_dev_defaults.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "bsp/display.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - - -// Touch Button -// #define CONFIG_TOUCH_ELEM_EVENT 1 -#define CONFIG_TOUCH_ELEM_CALLBACK 1 -#define TOUCH_BUTTON_NUM 3 -/* Touch buttons handle */ -static touch_button_handle_t button_handle[TOUCH_BUTTON_NUM]; - -/* Touch buttons channel array */ -static const touch_pad_t channel_array[TOUCH_BUTTON_NUM] = { - TOUCH_PAD_NUM1, - TOUCH_PAD_NUM2, - TOUCH_PAD_NUM3, -}; - -/* Touch buttons channel sensitivity array */ -static const float channel_sens_array[TOUCH_BUTTON_NUM] = { - 0.035F, - 0.08F, - 0.08F, -}; - -static bool i2c_initialized = false; -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; -#endif - -static const button_config_t bsp_button_config[BSP_BUTTON_NUM] = { - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_MENU, - .adc_button_config.min = 2310, // middle is 2410mV - .adc_button_config.max = 2510 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_PLAY, - .adc_button_config.min = 1880, // middle is 1980mV - .adc_button_config.max = 2080 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_DOWN, - .adc_button_config.min = 720, // middle is 820mV - .adc_button_config.max = 920 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_UP, - .adc_button_config.min = 280, // middle is 380mV - .adc_button_config.max = 480 - }, - { - .type = BUTTON_TYPE_GPIO, - .gpio_button_config.active_level = 0, - .gpio_button_config.gpio_num = BSP_BUTTON_BOOT_IO - } -}; - -esp_err_t bsp_i2c_init(void) -{ - /* I2C was initialized before */ - if (i2c_initialized) { - return ESP_OK; - } - - const i2c_config_t i2c_conf = { - .mode = I2C_MODE_MASTER, - .sda_io_num = BSP_I2C_SDA, - .sda_pullup_en = GPIO_PULLUP_ENABLE, - .scl_io_num = BSP_I2C_SCL, - .scl_pullup_en = GPIO_PULLUP_ENABLE, - .master.clk_speed = 400000 - }; - BSP_ERROR_CHECK_RETURN_ERR(i2c_param_config(BSP_I2C_NUM, &i2c_conf)); - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_install(BSP_I2C_NUM, i2c_conf.mode, 0, 0, 0)); - - i2c_initialized = true; - - return ESP_OK; -} - -esp_err_t bsp_i2c_deinit(void) -{ - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_delete(BSP_I2C_NUM)); - i2c_initialized = false; - return ESP_OK; -} - -esp_err_t bsp_spiffs_mount(void) -{ - esp_vfs_spiffs_conf_t conf = { - .base_path = CONFIG_BSP_SPIFFS_MOUNT_POINT, - .partition_label = CONFIG_BSP_SPIFFS_PARTITION_LABEL, - .max_files = CONFIG_BSP_SPIFFS_MAX_FILES, -#ifdef CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - .format_if_mount_failed = true, -#else - .format_if_mount_failed = false, -#endif - }; - - esp_err_t ret_val = esp_vfs_spiffs_register(&conf); - - BSP_ERROR_CHECK_RETURN_ERR(ret_val); - - size_t total = 0, used = 0; - ret_val = esp_spiffs_info(conf.partition_label, &total, &used); - if (ret_val != ESP_OK) { - ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret_val)); - } else { - ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used); - } - - return ret_val; -} - -esp_err_t bsp_spiffs_unmount(void) -{ - return esp_vfs_spiffs_unregister(CONFIG_BSP_SPIFFS_PARTITION_LABEL); -} - - -#define LCD_CMD_BITS (8) -#define LCD_PARAM_BITS (8) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) -#define LVGL_TICK_PERIOD_MS (CONFIG_BSP_DISPLAY_LVGL_TICK) -#define LVGL_MAX_SLEEP_MS (CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP) - -esp_err_t bsp_display_brightness_init(void) -{ - gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << BSP_LCD_BACKLIGHT), - .mode = GPIO_MODE_OUTPUT, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .pull_up_en = GPIO_PULLUP_DISABLE, - .intr_type = GPIO_INTR_DISABLE - }; - gpio_config(&io_conf); - - return ESP_OK; -} - -esp_err_t bsp_display_backlight_off(void) -{ - ESP_LOGI(TAG, "Backlight off"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 0); -} - -esp_err_t bsp_display_backlight_on(void) -{ - ESP_LOGI(TAG, "Backlight on"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 1); -} - -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io) -{ - esp_err_t ret = ESP_OK; - assert(config != NULL && config->max_transfer_sz > 0); - - ESP_RETURN_ON_ERROR(bsp_display_brightness_init(), TAG, "Brightness init failed"); - - ESP_LOGD(TAG, "Initialize SPI bus"); - const spi_bus_config_t buscfg = { - .sclk_io_num = BSP_LCD_SPI_CLK, - .mosi_io_num = BSP_LCD_SPI_MOSI, - .miso_io_num = GPIO_NUM_NC, - .quadwp_io_num = GPIO_NUM_NC, - .quadhd_io_num = GPIO_NUM_NC, - .max_transfer_sz = config->max_transfer_sz, - }; - ESP_RETURN_ON_ERROR(spi_bus_initialize(BSP_LCD_SPI_NUM, &buscfg, SPI_DMA_CH_AUTO), TAG, "SPI init failed"); - - ESP_LOGD(TAG, "Install panel IO"); - const esp_lcd_panel_io_spi_config_t io_config = { - .dc_gpio_num = BSP_LCD_DC, - .cs_gpio_num = BSP_LCD_SPI_CS, - .pclk_hz = BSP_LCD_PIXEL_CLOCK_HZ, - .lcd_cmd_bits = LCD_CMD_BITS, - .lcd_param_bits = LCD_PARAM_BITS, - .spi_mode = 2, - .trans_queue_depth = 10, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)BSP_LCD_SPI_NUM, &io_config, ret_io), err, TAG, "New panel IO failed"); - - ESP_LOGD(TAG, "Install LCD driver"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = BSP_LCD_RST, - .color_space = BSP_LCD_COLOR_SPACE, - .bits_per_pixel = BSP_LCD_BITS_PER_PIXEL, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_st7789(*ret_io, &panel_config, ret_panel), err, TAG, "New panel failed"); - - - esp_lcd_panel_reset(*ret_panel); - esp_lcd_panel_init(*ret_panel); - esp_lcd_panel_invert_color(*ret_panel, true); - return ret; - -err: - if (*ret_panel) { - esp_lcd_panel_del(*ret_panel); - } - if (*ret_io) { - esp_lcd_panel_io_del(*ret_io); - } - spi_bus_free(BSP_LCD_SPI_NUM); - return ret; -} - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg) -{ - assert(cfg != NULL); - esp_lcd_panel_io_handle_t io_handle = NULL; - esp_lcd_panel_handle_t panel_handle = NULL; - const bsp_display_config_t bsp_disp_cfg = { - .max_transfer_sz = cfg->trans_size ? (cfg->trans_size * sizeof(uint16_t)): (BSP_LCD_DRAW_BUFF_SIZE * sizeof(uint16_t)), - }; - BSP_ERROR_CHECK_RETURN_NULL(bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle)); - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - esp_lcd_panel_disp_off(panel_handle, false); -#else - esp_lcd_panel_disp_on_off(panel_handle, true); -#endif - - /* Add LCD screen */ - ESP_LOGD(TAG, "Add LCD screen"); - const lvgl_port_display_cfg_t disp_cfg = { - .io_handle = io_handle, - .panel_handle = panel_handle, - .buffer_size = cfg->buffer_size, - .trans_size = cfg->trans_size, - .double_buffer = cfg->double_buffer, - .hres = BSP_LCD_H_RES, - .vres = BSP_LCD_V_RES, - .monochrome = false, - /* Rotation values must be same as used in esp_lcd for initial settings of the screen */ - .rotation = { - .swap_xy = false, - .mirror_x = false, - .mirror_y = false, - }, - .flags = { - .buff_dma = cfg->flags.buff_dma, - .buff_spiram = cfg->flags.buff_spiram, -#if LVGL_VERSION_MAJOR >= 9 - .swap_bytes = (BSP_LCD_BIGENDIAN ? true : false), -#endif - } - }; - - return lvgl_port_add_disp(&disp_cfg); -} - -lv_display_t *bsp_display_start(void) -{ - bsp_display_cfg_t cfg = { - .lvgl_port_cfg = { - .task_priority = CONFIG_BSP_DISPLAY_LVGL_TASK_PRIORITY, - .task_stack = 6144, - .task_affinity = 1, - .timer_period_ms = LVGL_TICK_PERIOD_MS, - .task_max_sleep_ms = LVGL_MAX_SLEEP_MS, - }, - .buffer_size = BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE, - .flags = { - .buff_dma = true, - .buff_spiram = false, - } - }; - return bsp_display_start_with_config(&cfg); -} - -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg) -{ - lv_display_t *disp; - assert(cfg != NULL); - BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg)); - BSP_NULL_CHECK(disp = bsp_display_lcd_init(cfg), NULL); - - return disp; -} - -lv_indev_t *bsp_display_get_input_dev(void) -{ - return NULL; -} - -bool bsp_display_lock(uint32_t timeout_ms) -{ - return lvgl_port_lock(timeout_ms); -} - -void bsp_display_unlock(void) -{ - lvgl_port_unlock(); -} - -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation) -{ - lv_disp_set_rotation(disp, rotation); -} -#endif // (BSP_CONFIG_NO_GRAPHIC_LIB == 0) - - - - -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size) -{ - esp_err_t ret = ESP_OK; - if ((btn_array_size < BSP_BUTTON_NUM) || - (btn_array == NULL)) { - return ESP_ERR_INVALID_ARG; - } -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - /* Initialize ADC and get ADC handle */ - BSP_ERROR_CHECK_RETURN_NULL(bsp_adc_initialize()); - bsp_adc_handle = bsp_adc_get_handle(); -#endif - - if (btn_cnt) { - *btn_cnt = 0; - } - for (int i = 0; i < BSP_BUTTON_NUM; i++) { - btn_array[i] = iot_button_create(&bsp_button_config[i]); - if (btn_array[i] == NULL) { - ret = ESP_FAIL; - break; - } - if (btn_cnt) { - (*btn_cnt)++; - } - } - return ret; -} - - -#ifdef CONFIG_TOUCH_ELEM_EVENT -/* Button event handler task */ -static void button_handler_task(void *arg) -{ - (void) arg; //Unused - touch_elem_message_t element_message; - while (1) { - /* Waiting for touch element messages */ - touch_element_message_receive(&element_message, portMAX_DELAY); - if (element_message.element_type != TOUCH_ELEM_TYPE_BUTTON) { - continue; - } - /* Decode message */ - const touch_button_message_t *button_message = touch_button_get_message(&element_message); - if (button_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { - ESP_LOGI(TAG, "Button[%d] Press", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { - ESP_LOGI(TAG, "Button[%d] Release", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { - ESP_LOGI(TAG, "Button[%d] LongPress", (int)element_message.arg); - } - } -} -#elif CONFIG_TOUCH_ELEM_CALLBACK -/* Button callback routine */ -// static void button_handler(touch_button_handle_t out_handle, touch_button_message_t *out_message, void *arg) -// { -// (void) out_handle; //Unused -// if (out_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { -// ESP_LOGI(TAG, "Button[%d] Press", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { -// ESP_LOGI(TAG, "Button[%d] Release", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { -// ESP_LOGI(TAG, "Button[%d] LongPress", (int)arg); -// } -// } -#endif - -void bsp_touch_button_create(touch_button_callback_t button_callback) -{ - /* Initialize Touch Element library */ - touch_elem_global_config_t global_config = TOUCH_ELEM_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_element_install(&global_config)); - ESP_LOGI(TAG, "Touch element library installed"); - - touch_button_global_config_t button_global_config = TOUCH_BUTTON_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_button_install(&button_global_config)); - ESP_LOGI(TAG, "Touch button installed"); - for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { - touch_button_config_t button_config = { - .channel_num = channel_array[i], - .channel_sens = channel_sens_array[i] - }; - /* Create Touch buttons */ - ESP_ERROR_CHECK(touch_button_create(&button_config, &button_handle[i])); - /* Subscribe touch button events (On Press, On Release, On LongPress) */ - ESP_ERROR_CHECK(touch_button_subscribe_event(button_handle[i], - TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE | TOUCH_ELEM_EVENT_ON_LONGPRESS, - (void *)channel_array[i])); -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_EVENT)); -#elif CONFIG_TOUCH_ELEM_CALLBACK - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_CALLBACK)); - /* Register a handler function to handle event messages */ - ESP_ERROR_CHECK(touch_button_set_callback(button_handle[i], button_callback)); -#endif - /* Set LongPress event trigger threshold time */ - ESP_ERROR_CHECK(touch_button_set_longpress(button_handle[i], 2000)); - } - ESP_LOGI(TAG, "Touch buttons created"); - -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Create a handler task to handle event messages */ - xTaskCreate(&button_handler_task, "button_handler_task", 4 * 1024, NULL, 5, NULL); -#endif - - touch_element_start(); - ESP_LOGI(TAG, "Touch element library start"); -} diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c b/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c deleted file mode 100644 index 68e421ba5df12babe7159c7324b0a5711d49ff5d..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -/* Sample rate of MSM261S4030H0 */ -#define BSP_MIC_SAMPLE_RATE (48000u) - -/* This configuration is used by default in bsp_audio_init() */ -#define BSP_I2S_SIMPLEX_MONO_CFG(_sample_rate) \ - { \ - .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ - .sample_rate = _sample_rate, \ - .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ - .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, \ - .communication_format = I2S_COMM_FORMAT_STAND_I2S, \ - .dma_buf_count = 3, \ - .dma_buf_len = 1024, \ - .use_apll = true, \ - .tx_desc_auto_clear = true, \ - .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM \ - } - - -esp_err_t bsp_adc_initialize(void) -{ - return ESP_OK; -} diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c b/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c deleted file mode 100644 index 33351f550828b1ddaade522898160a1e9418f683..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; - -esp_err_t bsp_adc_initialize(void) -{ - /* ADC was initialized before */ - if (bsp_adc_handle != NULL) { - return ESP_OK; - } - - /* Initialize ADC */ - const adc_oneshot_unit_init_cfg_t init_config1 = { - .unit_id = BSP_ADC_UNIT, - }; - BSP_ERROR_CHECK_RETURN_ERR(adc_oneshot_new_unit(&init_config1, &bsp_adc_handle)); - - return ESP_OK; -} - -adc_oneshot_unit_handle_t bsp_adc_get_handle(void) -{ - return bsp_adc_handle; -} diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/idf_component.yml b/example/bilibili_fans/components/esp_sparkbot_bsp/idf_component.yml deleted file mode 100644 index fbc0e4ed14dee549e55ab3b86920ffa296aead72..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/idf_component.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "3.1.0~1" -description: Board Support Package (BSP) for ESP32-SparkBot - -targets: - - esp32s3 - -tags: - - bsp - -dependencies: - idf: ">=4.4.5" - - espressif/esp_lvgl_port: - version: "2.4.1" - public: true - - button: - version: ">=2.5,<4.0" - public: true - - esp_codec_dev: - version: "==1.1.0" - public: true - diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/config.h b/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/config.h deleted file mode 100644 index f3cb5ebe7389d59cea35c3444aaadb3c0c94b6cc..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -/************************************************************************************************** - * BSP configuration - **************************************************************************************************/ -// By default, this BSP is shipped with LVGL graphical library. Enabling this option will exclude it. -// If you want to use BSP without LVGL, select BSP version with 'noglib' suffix. -#if !defined(BSP_CONFIG_NO_GRAPHIC_LIB) // Check if the symbol is not coming from compiler definitions (-D...) -#define BSP_CONFIG_NO_GRAPHIC_LIB (0) -#endif diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/display.h b/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/display.h deleted file mode 100644 index 213b4720ad7e19686aa029e4ee6b7680824ac761..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/display.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief BSP LCD - * - * This file offers API for basic LCD control. - * It is useful for users who want to use the LCD without the default Graphical Library LVGL. - * - * For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start(). - */ - -#pragma once -#include "esp_lcd_types.h" - -/* LCD color formats */ -#define ESP_LCD_COLOR_FORMAT_RGB565 (1) -#define ESP_LCD_COLOR_FORMAT_RGB888 (2) - -/* LCD display color format */ -#define BSP_LCD_COLOR_FORMAT (ESP_LCD_COLOR_FORMAT_RGB565) -/* LCD display color bytes endianess */ -#define BSP_LCD_BIGENDIAN (1) -/* LCD display color bits */ -#define BSP_LCD_BITS_PER_PIXEL (16) -/* LCD display color space */ -#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_RGB) -/* LCD display definition */ -#define BSP_LCD_H_RES (240) -#define BSP_LCD_V_RES (240) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief BSP display configuration structure - * - */ -typedef struct { - int max_transfer_sz; /*!< Maximum transfer size, in bytes. */ -} bsp_display_config_t; - -/** - * @brief Create new display panel - * - * For maximum flexibility, this function performs only reset and initialization of the display. - * You must turn on the display explicitly by calling esp_lcd_panel_disp_on_off(). - * The display's backlight is not turned on either. You can use bsp_display_backlight_on/off(), - * bsp_display_brightness_set() (on supported boards) or implement your own backlight control. - * - * If you want to free resources allocated by this function, you can use esp_lcd API, ie.: - * - * \code{.c} - * esp_lcd_panel_del(panel); - * esp_lcd_panel_io_del(io); - * spi_bus_free(spi_num_from_configuration); - * \endcode - * - * @param[in] config display configuration - * @param[out] ret_panel esp_lcd panel handle - * @param[out] ret_io esp_lcd IO handle - * @return - * - ESP_OK On success - * - Else esp_lcd failure - */ -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io); - -/** - * @brief Initialize display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_init(void); - -/** - * @brief Set display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @param[in] brightness_percent Brightness in [%] - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_set(int brightness_percent); - -/** - * @brief Turn on display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_on(void); - -/** - * @brief Turn off display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_off(void); - -#ifdef __cplusplus -} -#endif diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h b/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h deleted file mode 100644 index ac223966e45efc7116ec6792a43e6203b8e5cee2..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "bsp/esp_sparkbot_bsp.h" diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h b/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h deleted file mode 100644 index 125b5817aa4e6cd6811df8ccf12fd6759ec607d5..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief ESP BSP: ESP-SparkBot - */ - -#pragma once - -#include "sdkconfig.h" -#include "driver/gpio.h" -#include "driver/sdmmc_host.h" -#include "esp_codec_dev.h" -#include "iot_button.h" -#include "touch_element/touch_button.h" -#include "bsp/config.h" -#include "bsp/display.h" - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "driver/i2s.h" -#else -// #include "driver/i2c_master.h" -#include "driver/i2s_std.h" -#endif - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#include "lvgl.h" -#include "esp_lvgl_port.h" -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - -/************************************************************************************************** - * BSP Capabilities - **************************************************************************************************/ - -#define BSP_CAPS_DISPLAY 1 -#define BSP_CAPS_TOUCH 0 -#define BSP_CAPS_BUTTONS 1 -#define BSP_CAPS_AUDIO 1 -#define BSP_CAPS_AUDIO_SPEAKER 0 -#define BSP_CAPS_AUDIO_MIC 1 -#define BSP_CAPS_SDCARD 1 -#define BSP_CAPS_IMU 1 -#define BSP_CAPS_CAMERA 1 - -/************************************************************************************************** - * ESP-SparkBot-BSP pinout - **************************************************************************************************/ - -/* I2C */ -#define BSP_I2C_SCL (GPIO_NUM_5) -#define BSP_I2C_SDA (GPIO_NUM_4) - -/* Display */ -#define BSP_LCD_SPI_MOSI (GPIO_NUM_47) -#define BSP_LCD_SPI_CLK (GPIO_NUM_21) -#define BSP_LCD_SPI_CS (GPIO_NUM_44) -#define BSP_LCD_DC (GPIO_NUM_43) -#define BSP_LCD_RST (GPIO_NUM_NC) -#define BSP_LCD_BACKLIGHT (GPIO_NUM_46) - -/* Camera */ -#define BSP_CAMERA_XCLK (GPIO_NUM_15) -#define BSP_CAMERA_PCLK (GPIO_NUM_13) -#define BSP_CAMERA_VSYNC (GPIO_NUM_6) -#define BSP_CAMERA_HSYNC (GPIO_NUM_7) -#define BSP_CAMERA_D0 (GPIO_NUM_11) -#define BSP_CAMERA_D1 (GPIO_NUM_9) -#define BSP_CAMERA_D2 (GPIO_NUM_8) -#define BSP_CAMERA_D3 (GPIO_NUM_10) -#define BSP_CAMERA_D4 (GPIO_NUM_12) -#define BSP_CAMERA_D5 (GPIO_NUM_18) -#define BSP_CAMERA_D6 (GPIO_NUM_17) -#define BSP_CAMERA_D7 (GPIO_NUM_16) - -/* Buttons */ -#define BSP_BUTTON_BOOT_IO (GPIO_NUM_0) -#define BSP_BUTTONS_IO (GPIO_NUM_1) // All 4 buttons mapped to this GPIO -typedef enum bsp_led_t { - BSP_LED_GREEN = GPIO_NUM_3, -} bsp_led_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - * - * Buttons interface - * - * Example configuration: - * \code{.c} - * button_handle_t btns[BSP_BUTTON_NUM]; - * bsp_iot_button_create(btns, NULL, BSP_BUTTON_NUM); - * iot_button_register_cb(btns[0], ... - * \endcode - **************************************************************************************************/ -typedef enum { - BSP_BUTTON_MENU = 0, - BSP_BUTTON_PLAY, - BSP_BUTTON_DOWN, - BSP_BUTTON_UP, - BSP_BUTTON_BOOT, - BSP_BUTTON_NUM -} bsp_button_t; - -/** - * @brief Initialize all buttons - * - * Returned button handlers must be used with espressif/button component API - * - * @note For LCD panel button which is defined as BSP_BUTTON_MAIN, bsp_display_start should - * be called before call this function. - * - * @param[out] btn_array Output button array - * @param[out] btn_cnt Number of button handlers saved to btn_array, can be NULL - * @param[in] btn_array_size Size of output button array. Must be at least BSP_BUTTON_NUM - * @return - * - ESP_OK All buttons initialized - * - ESP_ERR_INVALID_ARG btn_array is too small or NULL - * - ESP_FAIL Underlaying iot_button_create failed - */ -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size); - - -void bsp_touch_button_create(touch_button_callback_t button_callback); - -/************************************************************************************************** - * - * I2C interface - * - * There are two devices connected to I2C peripheral: - * - QMA7981 Inertial measurement unit - * - OV2640 Camera module - **************************************************************************************************/ -#define BSP_I2C_NUM CONFIG_BSP_I2C_NUM - -/** - * @brief Init I2C driver - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - ESP_FAIL I2C driver installation error - * - */ -esp_err_t bsp_i2c_init(void); - -/** - * @brief Deinit I2C driver and free its resources - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - */ -esp_err_t bsp_i2c_deinit(void); - -/************************************************************************************************** - * - * Camera interface - * - * ESP-SparkBot-BSP is shipped with OV2640 camera module. - * As a camera driver, esp32-camera component is used. - * - * Example configuration: - * \code{.c} - * const camera_config_t camera_config = BSP_CAMERA_DEFAULT_CONFIG; - * esp_err_t err = esp_camera_init(&camera_config); - * \endcode - **************************************************************************************************/ -/** - * @brief ESP-SparkBot-BSP camera default configuration - * - * In this configuration we select RGB565 color format and 240x240 image size - matching the display. - * We use double-buffering for the best performance. - * Since we don't want to waste internal SRAM, we allocate the framebuffers in external PSRAM. - * By setting XCLK to 16MHz, we configure the esp32-camera driver to use EDMA when accessing the PSRAM. - * - * @attention I2C must be enabled by bsp_i2c_init(), before camera is initialized - */ -#define BSP_CAMERA_DEFAULT_CONFIG \ - { \ - .pin_pwdn = GPIO_NUM_NC, \ - .pin_reset = GPIO_NUM_NC, \ - .pin_xclk = BSP_CAMERA_XCLK, \ - .pin_sccb_sda = GPIO_NUM_NC, \ - .pin_sccb_scl = GPIO_NUM_NC, \ - .pin_d7 = BSP_CAMERA_D7, \ - .pin_d6 = BSP_CAMERA_D6, \ - .pin_d5 = BSP_CAMERA_D5, \ - .pin_d4 = BSP_CAMERA_D4, \ - .pin_d3 = BSP_CAMERA_D3, \ - .pin_d2 = BSP_CAMERA_D2, \ - .pin_d1 = BSP_CAMERA_D1, \ - .pin_d0 = BSP_CAMERA_D0, \ - .pin_vsync = BSP_CAMERA_VSYNC, \ - .pin_href = BSP_CAMERA_HSYNC, \ - .pin_pclk = BSP_CAMERA_PCLK, \ - .xclk_freq_hz = 16000000, \ - .ledc_timer = LEDC_TIMER_0, \ - .ledc_channel = LEDC_CHANNEL_0, \ - .pixel_format = PIXFORMAT_RGB565, \ - .frame_size = FRAMESIZE_240X240, \ - .jpeg_quality = 12, \ - .fb_count = 2, \ - .fb_location = CAMERA_FB_IN_PSRAM,\ - .sccb_i2c_port = BSP_I2C_NUM, \ - } - -#define BSP_CAMERA_VFLIP 1 -#define BSP_CAMERA_HMIRROR 0 - -/************************************************************************************************** - * - * SPIFFS - * - * After mounting the SPIFFS, it can be accessed with stdio functions ie.: - * \code{.c} - * FILE* f = fopen(BSP_SPIFFS_MOUNT_POINT"/hello.txt", "w"); - * fprintf(f, "Hello World!\n"); - * fclose(f); - * \endcode - **************************************************************************************************/ -#define BSP_SPIFFS_MOUNT_POINT CONFIG_BSP_SPIFFS_MOUNT_POINT - -/** - * @brief Mount SPIFFS to virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_spiffs_register was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes - */ -esp_err_t bsp_spiffs_mount(void); - -/** - * @brief Unmount SPIFFS from virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if already unmounted - */ -esp_err_t bsp_spiffs_unmount(void); - - -/************************************************************************************************** - * - * LCD interface - * - * ESP-SparkBot-BSP is shipped with 1.3inch ST7789 display controller. - * It features 16-bit colors and 240x240 resolution. - * - * LVGL is used as graphics library. LVGL is NOT thread safe, therefore the user must take LVGL mutex - * by calling bsp_display_lock() before calling any LVGL API (lv_...) and then give the mutex with - * bsp_display_unlock(). - * - * If you want to use the display without LVGL, see bsp/display.h API and use BSP version with 'noglib' suffix. - **************************************************************************************************/ -#define BSP_LCD_PIXEL_CLOCK_HZ (80 * 1000 * 1000) -#define BSP_LCD_SPI_NUM (SPI3_HOST) - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * BSP_LCD_V_RES) -#define BSP_LCD_DRAW_BUFF_DOUBLE (0) - -/** - * @brief BSP display configuration structure - */ -typedef struct { - lvgl_port_cfg_t lvgl_port_cfg; /*!< LVGL port configuration */ - uint32_t buffer_size; /*!< Size of the buffer for the screen in pixels */ - uint32_t trans_size; - bool double_buffer; /*!< True, if should be allocated two buffers */ - struct { - unsigned int buff_dma: 1; /*!< Allocated LVGL buffer will be DMA capable */ - unsigned int buff_spiram: 1; /*!< Allocated LVGL buffer will be in PSRAM */ - } flags; -} bsp_display_cfg_t; - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start(void); - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * LCD backlight must be enabled separately by calling bsp_display_brightness_set() - * - * @param cfg display configuration - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg); - -/** - * @brief Get pointer to input device (touch, buttons, ...) - * - * @note The LVGL input device is initialized in bsp_display_start() function. - * - * @return Pointer to LVGL input device or NULL when not initialized - */ -lv_indev_t *bsp_display_get_input_dev(void); - -/** - * @brief Take LVGL mutex - * - * @param timeout_ms Timeout in [ms]. 0 will block indefinitely. - * @return true Mutex was taken - * @return false Mutex was NOT taken - */ -bool bsp_display_lock(uint32_t timeout_ms); - -/** - * @brief Give LVGL mutex - * - */ -void bsp_display_unlock(void); - -/** - * @brief Rotate screen - * - * Display must be already initialized by calling bsp_display_start() - * - * @param[in] disp Pointer to LVGL display - * @param[in] rotation Angle of the display rotation - */ -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation); -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - - - -/************************************************************************************************** - * - * ADC interface - * - * There are multiple devices connected to ADC peripheral: - * - Buttons - * - * After initialization of ADC, use adc_handle when using ADC driver. - **************************************************************************************************/ - -#define BSP_ADC_UNIT ADC_UNIT_1 - -/** - * @brief Initialize ADC - * - * The ADC can be initialized inside BSP, when needed. - * - * @param[out] adc_handle Returned ADC handle - */ -esp_err_t bsp_adc_initialize(void); - - -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -/** - * @brief Get ADC handle - * - * @note This function is available only in IDF5 and higher - * - * @return ADC handle - */ -adc_oneshot_unit_handle_t bsp_adc_get_handle(void); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/bilibili_fans/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h b/example/bilibili_fans/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h deleted file mode 100644 index e00199943eef4e1c31fbc46b8a2ee91d4cb2cc15..0000000000000000000000000000000000000000 --- a/example/bilibili_fans/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include "esp_check.h" -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Assert on error, if selected in menuconfig. Otherwise return error code. */ -#if CONFIG_BSP_ERROR_CHECK -#define BSP_ERROR_CHECK_RETURN_ERR(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK_RETURN_NULL(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK(x, ret) ESP_ERROR_CHECK(x) -#define BSP_NULL_CHECK(x, ret) assert(x) -#define BSP_NULL_CHECK_GOTO(x, goto_tag) assert(x) -#else -#define BSP_ERROR_CHECK_RETURN_ERR(x) do { \ - esp_err_t err_rc_ = (x); \ - if (unlikely(err_rc_ != ESP_OK)) { \ - return err_rc_; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK_RETURN_NULL(x) do { \ - if (unlikely((x) != ESP_OK)) { \ - return NULL; \ - } \ - } while(0) - -#define BSP_NULL_CHECK(x, ret) do { \ - if ((x) == NULL) { \ - return ret; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK(x, ret) do { \ - if (unlikely((x) != ESP_OK)) { \ - return ret; \ - } \ - } while(0) - -#define BSP_NULL_CHECK_GOTO(x, goto_tag) do { \ - if ((x) == NULL) { \ - goto goto_tag; \ - } \ - } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/bilibili_fans/main/app_wifi.c b/example/bilibili_fans/main/app_wifi.c index f5a6f2b5cdf41c8bfeee36cdcf3a221622e741e5..0a16c31cdc464f111875b30ba0ad1576d6c31d59 100644 --- a/example/bilibili_fans/main/app_wifi.c +++ b/example/bilibili_fans/main/app_wifi.c @@ -75,7 +75,7 @@ static int cJSON_parse_follower(const char *json_data) cJSON* root = cJSON_Parse(json_data); if (root == NULL) { printf("Error parsing JSON data.\n"); - return NULL; + return 0; } cJSON* data = cJSON_GetObjectItem(root, "data"); if (data != NULL) { @@ -90,7 +90,7 @@ static int cJSON_parse_follower(const char *json_data) printf("Error extracting 'data' object.\n"); } cJSON_Delete(root); - return NULL; + return 0; } #include "esp_sparkbot_bsp.h" #include "iot_button.h" diff --git a/example/bilibili_fans/main/idf_component.yml b/example/bilibili_fans/main/idf_component.yml index d3e182903eaf8d874377d900114edd6d81b34af7..471a80a11cd492eec54f59cfeae7f1a445067e1f 100644 --- a/example/bilibili_fans/main/idf_component.yml +++ b/example/bilibili_fans/main/idf_component.yml @@ -6,4 +6,5 @@ dependencies: lvgl/lvgl: "8.*" espressif/button: version: "3.4.0" - esp_mmap_assets: "1.*" \ No newline at end of file + esp_mmap_assets: "1.*" + espressif2022/esp_sparkbot: "*" \ No newline at end of file diff --git a/example/bilibili_fans/main/main.c b/example/bilibili_fans/main/main.c index fc10ca4f3497714bf137c609326fa138b263b7c9..87af9cf0d94ceb241f5415ce53ec9e4e53046a33 100644 --- a/example/bilibili_fans/main/main.c +++ b/example/bilibili_fans/main/main.c @@ -6,8 +6,7 @@ #include "esp_log.h" #include "nvs_flash.h" -#include "esp_sparkbot_bsp.h" -#include "bsp_board_extra.h" +#include "esp-bsp.h" #include "iot_button.h" #include "mmap_generate_audio.h" #include "lvgl.h" @@ -97,7 +96,7 @@ static void mmap_audio_init() static void audio_play_task(void *arg) { - spk_codec_dev = bsp_extra_audio_codec_speaker_init(); + spk_codec_dev = bsp_audio_codec_speaker_init(); esp_codec_dev_set_out_vol(spk_codec_dev, 100); esp_codec_dev_sample_info_t fs = { @@ -110,9 +109,7 @@ static void audio_play_task(void *arg) audio_data_t audio_data = {0}; while (xQueueReceive(g_queue_audio_play, &audio_data, portMAX_DELAY) == pdTRUE) { - // ESP_LOGW(TAG, "audio_play_task: %d, wav: %p", audio_data.len, audio_data.wav); int res = esp_codec_dev_write(spk_codec_dev, audio_data.wav, audio_data.len); - // ESP_LOGI(TAG, "esp_codec_dev_write %d", res); free(audio_data.wav); } diff --git a/example/bilibili_fans/main/mmap_generate_audio.h b/example/bilibili_fans/main/mmap_generate_audio.h index 154b0f8844552fa8172d2adea78f39f7f2bb0585..3a23335120e420b47752a94d0aad5388f5af44d0 100644 --- a/example/bilibili_fans/main/mmap_generate_audio.h +++ b/example/bilibili_fans/main/mmap_generate_audio.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/example/bilibili_fans/sdkconfig.defaults b/example/bilibili_fans/sdkconfig.defaults index b62c954990d65c12b11f2733d53f1457db7ad2d9..142e292811c5bd36400c5150bc4db9b66325c269 100644 --- a/example/bilibili_fans/sdkconfig.defaults +++ b/example/bilibili_fans/sdkconfig.defaults @@ -17,4 +17,6 @@ CONFIG_FREERTOS_HZ=1000 CONFIG_LV_MEM_CUSTOM=y CONFIG_LV_MEMCPY_MEMSET_STD=y CONFIG_LV_USE_PERF_MONITOR=n -CONFIG_LV_COLOR_16_SWAP=y \ No newline at end of file +CONFIG_LV_COLOR_16_SWAP=y + +CONFIG_I2C_BUS_BACKWARD_CONFIG=y \ No newline at end of file diff --git a/example/factory_demo_v1/components/bsp_extra/CMakeLists.txt b/example/factory_demo_v1/components/bsp_extra/CMakeLists.txt deleted file mode 100644 index 2abe51240a48e4876975235d90038ce15b1d61ba..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/bsp_extra/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -set(SRCS "") -list(APPEND SRCS - "src/bsp_board_extra.c" -) - -set(INCLUDE_DIRS "") -list(APPEND INCLUDE_DIRS "include") - -foreach(SRC_DIR IN LISTS SRC_DIRS) - file(GLOB_RECURSE SRC ${SRC_DIR}/*.c) - list(APPEND SRCS ${SRC}) - list(APPEND INCLUDE_DIRS ${SRC_DIR}/include) -endforeach() - -idf_component_register( - SRCS ${SRCS} - INCLUDE_DIRS ${INCLUDE_DIRS} - REQUIRES driver - PRIV_REQUIRES esp_timer fatfs esp_psram esp_mm -) - -target_compile_options( - ${COMPONENT_LIB} PRIVATE - -Wno-format - -Wno-int-conversion - -Wno-incompatible-pointer-types - -Wunused-function - -Wno-unused-variable - -Wno-unused-function - -Wno-overflow - -Wno-unused-but-set-variable - -Wno-discarded-qualifiers) diff --git a/example/factory_demo_v1/components/bsp_extra/Kconfig b/example/factory_demo_v1/components/bsp_extra/Kconfig deleted file mode 100644 index ec558673078adf7029bbfaa1fe514a30c460f7a6..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/bsp_extra/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -menu "Board Support Package" - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/factory_demo_v1/components/bsp_extra/LICENSE b/example/factory_demo_v1/components/bsp_extra/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/bsp_extra/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/factory_demo_v1/components/bsp_extra/idf_component.yml b/example/factory_demo_v1/components/bsp_extra/idf_component.yml deleted file mode 100644 index 252b36ace2c5cad695c4e36877efb4e1a9060d6c..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/bsp_extra/idf_component.yml +++ /dev/null @@ -1,24 +0,0 @@ -dependencies: - idf: - version: '>=5.2.0' - - espressif/esp_sparkbot_bsp: - version: "*" - path: ../esp_sparkbot_bsp - - esp_codec_dev: - public: true - version: "==1.1.0" - - chmorgan/esp-audio-player: - version: "1.0.*" - public: true - - chmorgan/esp-file-iterator: - version: "1.0.0" - public: true - -description: Board Support Package for ESP32-P4-Function-ev-board -targets: -- esp32s3 -version: 0.0.1 diff --git a/example/factory_demo_v1/components/bsp_extra/include/bsp_board_extra.h b/example/factory_demo_v1/components/bsp_extra/include/bsp_board_extra.h deleted file mode 100644 index 381a7156b026399f87d6e6254dc8821ed938c725..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/bsp_extra/include/bsp_board_extra.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include -#include "esp_codec_dev.h" -#include "esp_err.h" -#include "driver/gpio.h" -#include "driver/i2s_std.h" -#include "audio_player.h" -#include "file_iterator.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define BSP_I2S_SCLK (GPIO_NUM_39) -#define BSP_I2S_MCLK (GPIO_NUM_45) -#define BSP_I2S_LCLK (GPIO_NUM_41) -#define BSP_I2S_DOUT (GPIO_NUM_42) // To Codec ES8311 -#define BSP_I2S_DSIN (GPIO_NUM_40) // From Codec ES8311 -#define BSP_POWER_AMP_IO (GPIO_NUM_NC) - -#define CODEC_DEFAULT_SAMPLE_RATE (16000) -#define CODEC_DEFAULT_BIT_WIDTH (16) -#define CODEC_DEFAULT_ADC_VOLUME (24.0) -#define CODEC_DEFAULT_CHANNEL (2) -#define CODEC_DEFAULT_VOLUME (60) - -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MAX (95) -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MIN (0) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) - -/************************************************************************************************** - * - * I2S audio interface - * - * There are two devices connected to the I2S peripheral: - * - Codec ES8311 for output (playback) path - * - ADC ES7210 for input (recording) path - * - * For speaker initialization use `bsp_extra_audio_codec_speaker_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * For microphone initialization use `bsp_extra_audio_codec_microphone_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * After speaker or microphone initialization, use functions from esp_codec_dev for play/record audio. - * Example audio play: - * \code{.c} - * esp_codec_dev_set_out_vol(spk_codec_dev, DEFAULT_VOLUME); - * esp_codec_dev_open(spk_codec_dev, &fs); - * esp_codec_dev_write(spk_codec_dev, wav_bytes, bytes_read_from_spiffs); - * esp_codec_dev_close(spk_codec_dev); - * \endcode - **************************************************************************************************/ -/** - * @brief Init audio - * - * @note There is no deinit audio function. Users can free audio resources by calling `i2s_del_channel()`. - * @note This function wiil call `bsp_io_expander_init()` to setup and enable the control pin of audio power amplifier. - * @note This function will be called in `bsp_extra_audio_codec_speaker_init()` and `bsp_extra_audio_codec_microphone_init()`. - * - * @param[in] i2s_config I2S configuration. Pass NULL to use default values (Mono, duplex, 16bit, 22050 Hz) - * @return - * - ESP_OK On success - * - ESP_ERR_NOT_SUPPORTED The communication mode is not supported on the current chip - * - ESP_ERR_INVALID_ARG NULL pointer or invalid configuration - * - ESP_ERR_NOT_FOUND No available I2S channel found - * - ESP_ERR_NO_MEM No memory for storing the channel information - * - ESP_ERR_INVALID_STATE This channel has not initialized or already started - * - other error codes - */ -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config); - -/** - * @brief Initialize speaker codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void); - -/** - * @brief Initialize microphone codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void); - -/************************************************************************************************** - * BSP Extra interface - * Mainly provided some I2S Codec interfaces. - **************************************************************************************************/ -/** - * @brief Player set mute. - * - * @param enable: true or false - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_mute_set(bool enable); - -/** - * @brief Player set volume. - * - * @param volume: volume set - * @param volume_set: volume set response - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set); - -/** - * @brief Player get volume. - * - * @return - * - volume: volume get - */ -int bsp_extra_codec_volume_get(void); - -/** - * @brief Stop I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_stop(void); - -/** - * @brief Resume I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_resume(void); - -/** - * @brief Set I2S format to codec. - * - * @param rate: Sample rate of sample - * @param bits_cfg: Bit lengths of one channel data - * @param ch: Channels of sample - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch); - -/** - * @brief Read data from recoder. - * - * @param audio_buffer: The pointer of receiving data buffer - * @param len: Max data buffer length - * @param bytes_read: Byte number that actually be read, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms); - -/** - * @brief Write data to player. - * - * @param audio_buffer: The pointer of sent data buffer - * @param len: Max data buffer length - * @param bytes_written: Byte number that actually be sent, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms); - - -/** - * @brief Initialize codec play and record handle. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_init(); - -/** - * @brief Initialize audio player task. - * - * @param path file path - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_init(void); - -/** - * @brief Delete audio player task. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_del(void); - -/** - * @brief Initialize a file iterator instance - * - * @param path The file path for the iterator. - * @param ret_instance A pointer to the file iterator instance to be returned. - * @return - * - ESP_OK: Successfully initialized the file iterator instance. - * - ESP_FAIL: Failed to initialize the file iterator instance due to invalid parameters or memory allocation failure. - */ -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance); - -/** - * @brief Play the audio file at the specified index in the file iterator - * - * @param instance The file iterator instance. - * @param index The index of the file to play within the iterator. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to invalid parameters or file access issues. - */ -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index); - -/** - * @brief Play the audio file specified by the file path - * - * @param file_path The path to the audio file to be played. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to file access issues. - */ -esp_err_t bsp_extra_player_play_file(const char *file_path); - -/** - * @brief Register a callback function for the audio player - * - * @param cb The callback function to be registered. - * @param user_data User data to be passed to the callback function. - */ -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data); - -/** - * @brief Check if the specified audio file is currently playing - * - * @param file_path The path to the audio file to check. - * @return - * - true: The specified audio file is currently playing. - * - false: The specified audio file is not currently playing. - */ -bool bsp_extra_player_is_playing_by_path(const char *file_path); - -/** - * @brief Check if the audio file at the specified index is currently playing - * - * @param instance The file iterator instance. - * @param index The index of the file to check. - * @return - * - true: The audio file at the specified index is currently playing. - * - false: The audio file at the specified index is not currently playing. - */ -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index); - -#ifdef __cplusplus -} -#endif diff --git a/example/factory_demo_v1/components/bsp_extra/src/bsp_board_extra.c b/example/factory_demo_v1/components/bsp_extra/src/bsp_board_extra.c deleted file mode 100644 index a5dc91f6e8a25824705d4ae34b00bdebc4025e66..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/bsp_extra/src/bsp_board_extra.c +++ /dev/null @@ -1,488 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include "esp_log.h" -#include "esp_check.h" -#include "esp_codec_dev_defaults.h" -#include "esp_err.h" -#include "esp_log.h" -#include "esp_vfs_fat.h" -#include "driver/i2s_std.h" -#include "driver/gpio.h" -#include "driver/ledc.h" - -#include "bsp/esp-bsp.h" -#include "bsp_board_extra.h" - -#define BSP_ES7210_CODEC_ADDR (0x82) - -/* Can be used for `i2s_std_gpio_config_t` and/or `i2s_std_config_t` initialization */ -#define BSP_I2S_GPIO_CFG \ - { \ - .mclk = BSP_I2S_MCLK, \ - .bclk = BSP_I2S_SCLK, \ - .ws = BSP_I2S_LCLK, \ - .dout = BSP_I2S_DOUT, \ - .din = BSP_I2S_DSIN, \ - .invert_flags = { \ - .mclk_inv = false, \ - .bclk_inv = false, \ - .ws_inv = false, \ - }, \ - } - -/* This configuration is used by default in `bsp_extra_audio_init()` */ -#define BSP_I2S_DUPLEX_MONO_CFG(_sample_rate) \ - { \ - .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(_sample_rate), \ - .slot_cfg = I2S_STD_PHILIP_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO), \ - .gpio_cfg = BSP_I2S_GPIO_CFG, \ - } - -#define USE_I2S_RX_CHAN (1) - -static const char *TAG = "bsp_extra_board"; - -static esp_codec_dev_handle_t play_dev_handle; -static esp_codec_dev_handle_t record_dev_handle; - -static bool _is_audio_init = false; -static bool _is_player_init = false; -static int _vloume_intensity = CODEC_DEFAULT_VOLUME; - -static audio_player_cb_t audio_idle_callback = NULL; -static void *audio_idle_cb_user_data = NULL; -static char audio_file_path[128]; - -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ -static i2s_chan_handle_t i2s_tx_chan = NULL; -#if USE_I2S_RX_CHAN -static i2s_chan_handle_t i2s_rx_chan = NULL; -#endif - -/************************************************************************************************** - * - * I2S Audio Function - * - **************************************************************************************************/ -#define EXAMPLE_BUFF_SIZE 2048 - -static void i2s_example_write_task(void *args) -{ - uint8_t *w_buf = (uint8_t *)calloc(1, EXAMPLE_BUFF_SIZE); - assert(w_buf); // Check if w_buf allocation success - - /* Assign w_buf */ - for (int i = 0; i < EXAMPLE_BUFF_SIZE; i += 8) { - w_buf[i] = 0x12; - w_buf[i + 1] = 0x34; - w_buf[i + 2] = 0x56; - w_buf[i + 3] = 0x78; - w_buf[i + 4] = 0x9A; - w_buf[i + 5] = 0xBC; - w_buf[i + 6] = 0xDE; - w_buf[i + 7] = 0xF0; - } - - size_t w_bytes = EXAMPLE_BUFF_SIZE; - - // /* (Optional) Preload the data before enabling the TX channel, so that the valid data can be transmitted immediately */ - // while (w_bytes == EXAMPLE_BUFF_SIZE) { - // /* Here we load the target buffer repeatedly, until all the DMA buffers are preloaded */ - // ESP_ERROR_CHECK(i2s_channel_preload_data(tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes)); - // } - - /* Enable the TX channel */ - // ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - while (1) { - /* Write i2s data */ - if (i2s_channel_write(i2s_tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes, 1000) == ESP_OK) { - printf("Write Task: i2s write %d bytes\n", w_bytes); - } else { - printf("Write Task: i2s write failed\n"); - } - vTaskDelay(pdMS_TO_TICKS(200)); - } - free(w_buf); - vTaskDelete(NULL); -} - -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config) -{ - esp_err_t ret = ESP_FAIL; -#if USE_I2S_RX_CHAN - if (i2s_tx_chan && i2s_rx_chan) { -#else - if (i2s_tx_chan) { -#endif - /* Audio was initialized before */ - return ESP_OK; - } - - /* Setup I2S peripheral */ - i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(CONFIG_BSP_I2S_NUM, I2S_ROLE_MASTER); - chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer -#if USE_I2S_RX_CHAN - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, &i2s_rx_chan)); -#else - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, NULL)); -#endif - - /* Setup I2S channels */ - const i2s_std_config_t std_cfg_default = BSP_I2S_DUPLEX_MONO_CFG(22050); - const i2s_std_config_t *p_i2s_cfg = &std_cfg_default; - if (i2s_config != NULL) { - p_i2s_cfg = i2s_config; - } - - if (i2s_tx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_tx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - } -#if USE_I2S_RX_CHAN - if (i2s_rx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_rx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_rx_chan)); - } -#endif - - audio_codec_i2s_cfg_t i2s_cfg = { - .port = CONFIG_BSP_I2S_NUM, - .tx_handle = i2s_tx_chan, -#if USE_I2S_RX_CHAN - .rx_handle = i2s_rx_chan, -#else - .rx_handle = NULL, -#endif - }; - i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); - - return ESP_OK; -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_TYPE_OUT, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN_OUT, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_dev_cfg); -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_WORK_MODE_BOTH, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_es8311_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_es8311_dev_cfg); -} - -static esp_err_t audio_mute_function(AUDIO_PLAYER_MUTE_SETTING setting) -{ - // Volume saved when muting and restored when unmuting. Restoring volume is necessary - // as es8311_set_voice_mute(true) results in voice volume (REG32) being set to zero. - - bsp_extra_codec_mute_set(setting == AUDIO_PLAYER_MUTE ? true : false); - - // restore the voice volume upon unmuting - if (setting == AUDIO_PLAYER_UNMUTE) { - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, _vloume_intensity), TAG, "Set Codec volume failed"); - } - - return ESP_OK; -} - -static void audio_callback(audio_player_cb_ctx_t *ctx) -{ - if (audio_idle_callback) { - ctx->user_ctx = audio_idle_cb_user_data; - audio_idle_callback(ctx); - } -} - -/************************************************************************************************** - * - * Extra Board Function - * - **************************************************************************************************/ - -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len); - *bytes_read = len; - return ret; -} - -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len); - *bytes_written = len; - return ret; -} - -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch) -{ - esp_err_t ret = ESP_OK; - - esp_codec_dev_sample_info_t fs = { - .sample_rate = rate, - .channel = ch, - .bits_per_sample = bits_cfg, - }; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - if (record_dev_handle) { - ret |= esp_codec_dev_close(record_dev_handle); - ret |= esp_codec_dev_set_in_gain(record_dev_handle, CODEC_DEFAULT_ADC_VOLUME); - } - - if (play_dev_handle) { - ret |= esp_codec_dev_open(play_dev_handle, &fs); - } - if (record_dev_handle) { - ret |= esp_codec_dev_open(record_dev_handle, &fs); - } - return ret; -} - -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set) -{ - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, volume), TAG, "Set Codec volume failed"); - _vloume_intensity = volume; - - ESP_LOGI(TAG, "Setting volume: %d", volume); - - return ESP_OK; -} - -int bsp_extra_codec_volume_get(void) -{ - return _vloume_intensity; -} - -esp_err_t bsp_extra_codec_mute_set(bool enable) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_set_out_mute(play_dev_handle, enable); - return ret; -} - -esp_err_t bsp_extra_codec_dev_stop(void) -{ - esp_err_t ret = ESP_OK; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - - if (record_dev_handle) { - ret = esp_codec_dev_close(record_dev_handle); - } - return ret; -} - -esp_err_t bsp_extra_codec_dev_resume(void) -{ - return bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); -} - -esp_err_t bsp_extra_codec_init() -{ - if (_is_audio_init) { - return ESP_OK; - } - - play_dev_handle = bsp_extra_audio_codec_speaker_init(); - assert((play_dev_handle) && "play_dev_handle not initialized"); - - record_dev_handle = bsp_extra_audio_codec_microphone_init(); - assert((record_dev_handle) && "record_dev_handle not initialized"); - - bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); - - _is_audio_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_init(void) -{ - if (_is_player_init) { - return ESP_OK; - } - - audio_player_config_t config = { .mute_fn = audio_mute_function, - .write_fn = bsp_extra_i2s_write, - .clk_set_fn = bsp_extra_codec_set_fs, - .priority = 5 - }; - ESP_RETURN_ON_ERROR(audio_player_new(config), TAG, "audio_player_init failed"); - audio_player_callback_register(audio_callback, NULL); - - _is_player_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_del(void) -{ - _is_player_init = false; - - ESP_RETURN_ON_ERROR(audio_player_delete(), TAG, "audio_player_delete failed"); - - return ESP_OK; -} - -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance) -{ - ESP_RETURN_ON_FALSE(path, ESP_FAIL, TAG, "path is NULL"); - ESP_RETURN_ON_FALSE(ret_instance, ESP_FAIL, TAG, "ret_instance is NULL"); - - file_iterator_instance_t *file_iterator = file_iterator_new(path); - ESP_RETURN_ON_FALSE(file_iterator, ESP_FAIL, TAG, "file_iterator_new failed, %s", path); - - *ret_instance = file_iterator; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index) -{ - ESP_RETURN_ON_FALSE(instance, ESP_FAIL, TAG, "instance is NULL"); - - ESP_LOGI(TAG, "play_index(%d)", index); - char filename[128]; - int retval = file_iterator_get_full_path_from_index(instance, index, filename, sizeof(filename)); - ESP_RETURN_ON_FALSE(retval != 0, ESP_FAIL, TAG, "file_iterator_get_full_path_from_index failed"); - - ESP_LOGI(TAG, "opening file '%s'", filename); - FILE *fp = fopen(filename, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", filename); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, filename, sizeof(audio_file_path)); - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_file(const char *file_path) -{ - ESP_LOGI(TAG, "opening file '%s'", file_path); - FILE *fp = fopen(file_path, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", file_path); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, file_path, sizeof(audio_file_path)); - - return ESP_OK; -} - -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data) -{ - audio_idle_callback = cb; - audio_idle_cb_user_data = user_data; -} - -bool bsp_extra_player_is_playing_by_path(const char *file_path) -{ - return (strcmp(audio_file_path, file_path) == 0); -} - -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index) -{ - return (index == file_iterator_get_index(instance)); -} \ No newline at end of file diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/CMakeLists.txt b/example/factory_demo_v1/components/esp_sparkbot_bsp/CMakeLists.txt deleted file mode 100644 index d276876a85bab2519a9e0b3b709a42cf6d826688..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -#IDF version is less than IDF5.0 -if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "5.0") - set(SRC_VER "esp_sparkbot_bsp_idf4.c") -else() - set(SRC_VER "esp_sparkbot_bsp_idf5.c") -endif() - -idf_component_register( - SRCS "esp_sparkbot_bsp.c" ${SRC_VER} - INCLUDE_DIRS "include" "include/bsp" - PRIV_INCLUDE_DIRS "priv_include" - REQUIRES driver spiffs touch_element - PRIV_REQUIRES fatfs esp_lcd -) diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/Kconfig b/example/factory_demo_v1/components/esp_sparkbot_bsp/Kconfig deleted file mode 100644 index 9306c9c9c46b8c187959c1fec008862337618d9d..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/Kconfig +++ /dev/null @@ -1,105 +0,0 @@ -menu "Board Support Package" - - config BSP_ERROR_CHECK - bool "Enable error check in BSP" - default y - help - Error check assert the application before returning the error code. - - menu "I2C" - config BSP_I2C_NUM - int "I2C peripheral index" - default 1 - range 0 1 - help - ESP32-S2 has two I2C peripherals, pick the one you want to use. - - config BSP_I2C_FAST_MODE - bool "Enable I2C fast mode" - default y - help - I2C has two speed modes: normal (100kHz) and fast (400kHz). - - config BSP_I2C_CLK_SPEED_HZ - int - default 400000 if BSP_I2C_FAST_MODE - default 100000 - endmenu - - menu "SPIFFS - Virtual File System" - config BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - bool "Format SPIFFS if mounting fails" - default n - help - Format SPIFFS if it fails to mount the filesystem. - - config BSP_SPIFFS_MOUNT_POINT - string "SPIFFS mount point" - default "/spiffs" - help - Mount point of SPIFFS in the Virtual File System. - - config BSP_SPIFFS_PARTITION_LABEL - string "Partition label of SPIFFS" - default "storage" - help - Partition label which stores SPIFFS. - - config BSP_SPIFFS_MAX_FILES - int "Maximum files that could be open at the same time" - default 2 - help - Supported max files for SPIFFS in the Virtual File System. - endmenu - - menu "uSD card - Virtual File System" - config BSP_SD_FORMAT_ON_MOUNT_FAIL - bool "Format uSD card if mounting fails" - default n - help - The SDMMC host will format (FAT) the uSD card if it fails to mount the filesystem. - - config BSP_SD_MOUNT_POINT - string "uSD card mount point" - default "/sdcard" - help - Mount point of the uSD card in the Virtual File System - - endmenu - menu "Display" - config BSP_DISPLAY_LVGL_TASK_PRIORITY - int "LVGL task priority" - default 2 - help - The Board Support Package will create a task that will periodically handle LVGL operation in lv_timer_handler(). - - config BSP_DISPLAY_LVGL_TICK - int "LVGL tick period" - default 5 - range 1 100 - help - Period of LVGL tick timer. - - config BSP_DISPLAY_LVGL_MAX_SLEEP - int "LVGL maximum sleep time in ms" - default 1 - range 1 500 - help - Maximum time for task sleep in ms. - - config BSP_DISPLAY_BRIGHTNESS_LEDC_CH - int "LEDC channel index" - default 1 - range 0 7 - help - LEDC channel is used to generate PWM signal that controls display brightness. - Set LEDC index that should be used. - endmenu - - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/LICENSE b/example/factory_demo_v1/components/esp_sparkbot_bsp/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/README.md b/example/factory_demo_v1/components/esp_sparkbot_bsp/README.md deleted file mode 100644 index 029d9371f5b7eb2753ade93ab4e7e79de973a312..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# BSP: ESP-SparkBot - -[![Component Registry](https://components.espressif.com/components/espressif/esp32_s3_eye/badge.svg)](https://components.espressif.com/components/espressif/esp32_s3_eye) - -### Overview - -The ESP32-S3-EYE board consists of two parts: the main board (ESP32-S3-EYE-MB) that integrates the ESP32-S3-WROOM-1 module, camera, uSD card slot, digital microphone, USB port, and function buttons; and the sub board (ESP32-S3-EYE-SUB) that contains an LCD display. The main board and sub board are connected through pin headers. - -* [Hardware Reference](https://www.espressif.com/en/products/devkits/esp-eye/overview.) - -![](https://raw.githubusercontent.com/espressif/esp-who/master/docs/_static/get-started/ESP32-S3-EYE_MB-annotated-photo.png) - -**The development board has the following features:** -* ESP32-S3 module with built-in 8 MB flash and 8 MB octal RAM -* 1.3-inch 240x240 LCD color screen -* Onboard uSD card slot -* Digital microphone -* Accelerometer -* OV2640 camera - - -### Capabilities and dependencies -| Capability | Available | Component | Version | -|-------------|------------------|----------------------------------------------------------------------------------------------|----------| -| DISPLAY |:heavy_check_mark:| idf | >=4.4.5 | -| LVGL_PORT |:heavy_check_mark:|[espressif/esp_lvgl_port](https://components.espressif.com/components/espressif/esp_lvgl_port)| ^2 | -| TOUCH | :x: | | | -| BUTTONS |:heavy_check_mark:| [espressif/button](https://components.espressif.com/components/espressif/button) |>=2.5,<4.0| -| AUDIO |:heavy_check_mark:|[espressif/esp_codec_dev](https://components.espressif.com/components/espressif/esp_codec_dev)| ^1,<1.2 | -|AUDIO_SPEAKER| :x: | | | -| AUDIO_MIC |:heavy_check_mark:| | | -| SDCARD |:heavy_check_mark:| idf | >=4.4.5 | -| IMU |:heavy_check_mark:| [qma6100p](https://components.espressif.com/components/qma6100p) | 1.* | -| CAMERA |:heavy_check_mark:| [espressif/esp32-camera](https://components.espressif.com/components/espressif/esp32-camera) | ^2.0.2 | - diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c b/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c deleted file mode 100644 index 4f3ae36b06d95e20984c49e496841b7dc3e7a69e..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c +++ /dev/null @@ -1,473 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "esp_vfs_fat.h" -#include "esp_lcd_panel_io.h" -#include "esp_lcd_panel_vendor.h" -#include "esp_lcd_panel_ops.h" -#include "esp_log.h" -#include "esp_check.h" -#include "esp_vfs_fat.h" -#include "esp_spiffs.h" - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" - -#include "driver/spi_master.h" -#include "driver/ledc.h" - -#include "touch_element/touch_button.h" - -#include "esp_codec_dev_defaults.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "bsp/display.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - - -// Touch Button -// #define CONFIG_TOUCH_ELEM_EVENT 1 -#define CONFIG_TOUCH_ELEM_CALLBACK 1 -#define TOUCH_BUTTON_NUM 3 -/* Touch buttons handle */ -static touch_button_handle_t button_handle[TOUCH_BUTTON_NUM]; -static i2c_bus_handle_t i2c_bus_handle = NULL; - -/* Touch buttons channel array */ -static const touch_pad_t channel_array[TOUCH_BUTTON_NUM] = { - TOUCH_PAD_NUM1, - TOUCH_PAD_NUM2, - TOUCH_PAD_NUM3, -}; - -/* Touch buttons channel sensitivity array */ -static const float channel_sens_array[TOUCH_BUTTON_NUM] = { - 0.035F, - 0.08F, - 0.08F, -}; - -static bool i2c_initialized = false; -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; -#endif - -static const button_config_t bsp_button_config[BSP_BUTTON_NUM] = { - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_MENU, - .adc_button_config.min = 2310, // middle is 2410mV - .adc_button_config.max = 2510 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_PLAY, - .adc_button_config.min = 1880, // middle is 1980mV - .adc_button_config.max = 2080 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_DOWN, - .adc_button_config.min = 720, // middle is 820mV - .adc_button_config.max = 920 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_UP, - .adc_button_config.min = 280, // middle is 380mV - .adc_button_config.max = 480 - }, - { - .type = BUTTON_TYPE_GPIO, - .gpio_button_config.active_level = 0, - .gpio_button_config.gpio_num = BSP_BUTTON_BOOT_IO - } -}; - -esp_err_t bsp_i2c_init(void) -{ - /* I2C was initialized before */ - if (i2c_initialized) { - return ESP_OK; - } - - const i2c_config_t i2c_bus_conf = { - .mode = I2C_MODE_MASTER, - .sda_io_num = BSP_I2C_SDA, - .sda_pullup_en = GPIO_PULLUP_ENABLE, - .scl_io_num = BSP_I2C_SCL, - .scl_pullup_en = GPIO_PULLUP_ENABLE, - .master.clk_speed = 400000 - }; - i2c_bus_handle = i2c_bus_create(BSP_I2C_NUM, &i2c_bus_conf); - - i2c_initialized = true; - - return ESP_OK; -} - -esp_err_t bsp_i2c_deinit(void) -{ - i2c_bus_delete(&i2c_bus_handle); - i2c_initialized = false; - return ESP_OK; -} - -i2c_bus_handle_t bsp_i2c_get_handle(void) -{ - return i2c_bus_handle; -} - -esp_err_t bsp_spiffs_mount(void) -{ - esp_vfs_spiffs_conf_t conf = { - .base_path = CONFIG_BSP_SPIFFS_MOUNT_POINT, - .partition_label = CONFIG_BSP_SPIFFS_PARTITION_LABEL, - .max_files = CONFIG_BSP_SPIFFS_MAX_FILES, -#ifdef CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - .format_if_mount_failed = true, -#else - .format_if_mount_failed = false, -#endif - }; - - esp_err_t ret_val = esp_vfs_spiffs_register(&conf); - - BSP_ERROR_CHECK_RETURN_ERR(ret_val); - - size_t total = 0, used = 0; - ret_val = esp_spiffs_info(conf.partition_label, &total, &used); - if (ret_val != ESP_OK) { - ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret_val)); - } else { - ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used); - } - - return ret_val; -} - -esp_err_t bsp_spiffs_unmount(void) -{ - return esp_vfs_spiffs_unregister(CONFIG_BSP_SPIFFS_PARTITION_LABEL); -} - - -#define LCD_CMD_BITS (8) -#define LCD_PARAM_BITS (8) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) -#define LVGL_TICK_PERIOD_MS (CONFIG_BSP_DISPLAY_LVGL_TICK) -#define LVGL_MAX_SLEEP_MS (CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP) - -esp_err_t bsp_display_brightness_init(void) -{ - gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << BSP_LCD_BACKLIGHT), - .mode = GPIO_MODE_OUTPUT, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .pull_up_en = GPIO_PULLUP_DISABLE, - .intr_type = GPIO_INTR_DISABLE - }; - gpio_config(&io_conf); - - return ESP_OK; -} - -esp_err_t bsp_display_backlight_off(void) -{ - ESP_LOGI(TAG, "Backlight off"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 0); -} - -esp_err_t bsp_display_backlight_on(void) -{ - ESP_LOGI(TAG, "Backlight on"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 1); -} - -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io) -{ - esp_err_t ret = ESP_OK; - assert(config != NULL && config->max_transfer_sz > 0); - - ESP_RETURN_ON_ERROR(bsp_display_brightness_init(), TAG, "Brightness init failed"); - - ESP_LOGD(TAG, "Initialize SPI bus"); - const spi_bus_config_t buscfg = { - .sclk_io_num = BSP_LCD_SPI_CLK, - .mosi_io_num = BSP_LCD_SPI_MOSI, - .miso_io_num = GPIO_NUM_NC, - .quadwp_io_num = GPIO_NUM_NC, - .quadhd_io_num = GPIO_NUM_NC, - .max_transfer_sz = config->max_transfer_sz, - }; - ESP_RETURN_ON_ERROR(spi_bus_initialize(BSP_LCD_SPI_NUM, &buscfg, SPI_DMA_CH_AUTO), TAG, "SPI init failed"); - - ESP_LOGD(TAG, "Install panel IO"); - const esp_lcd_panel_io_spi_config_t io_config = { - .dc_gpio_num = BSP_LCD_DC, - .cs_gpio_num = BSP_LCD_SPI_CS, - .pclk_hz = BSP_LCD_PIXEL_CLOCK_HZ, - .lcd_cmd_bits = LCD_CMD_BITS, - .lcd_param_bits = LCD_PARAM_BITS, - .spi_mode = 2, - .trans_queue_depth = 10, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)BSP_LCD_SPI_NUM, &io_config, ret_io), err, TAG, "New panel IO failed"); - - ESP_LOGD(TAG, "Install LCD driver"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = BSP_LCD_RST, - .color_space = BSP_LCD_COLOR_SPACE, - .bits_per_pixel = BSP_LCD_BITS_PER_PIXEL, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_st7789(*ret_io, &panel_config, ret_panel), err, TAG, "New panel failed"); - - - esp_lcd_panel_reset(*ret_panel); - esp_lcd_panel_init(*ret_panel); - esp_lcd_panel_invert_color(*ret_panel, true); - return ret; - -err: - if (*ret_panel) { - esp_lcd_panel_del(*ret_panel); - } - if (*ret_io) { - esp_lcd_panel_io_del(*ret_io); - } - spi_bus_free(BSP_LCD_SPI_NUM); - return ret; -} - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg) -{ - assert(cfg != NULL); - esp_lcd_panel_io_handle_t io_handle = NULL; - esp_lcd_panel_handle_t panel_handle = NULL; - const bsp_display_config_t bsp_disp_cfg = { - .max_transfer_sz = cfg->trans_size ? (cfg->trans_size * sizeof(uint16_t)): (BSP_LCD_DRAW_BUFF_SIZE * sizeof(uint16_t)), - }; - BSP_ERROR_CHECK_RETURN_NULL(bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle)); - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - esp_lcd_panel_disp_off(panel_handle, false); -#else - esp_lcd_panel_disp_on_off(panel_handle, true); -#endif - - /* Add LCD screen */ - ESP_LOGD(TAG, "Add LCD screen"); - const lvgl_port_display_cfg_t disp_cfg = { - .io_handle = io_handle, - .panel_handle = panel_handle, - .buffer_size = cfg->buffer_size, - .trans_size = cfg->trans_size, - .double_buffer = cfg->double_buffer, - .hres = BSP_LCD_H_RES, - .vres = BSP_LCD_V_RES, - .monochrome = false, - /* Rotation values must be same as used in esp_lcd for initial settings of the screen */ - .rotation = { - .swap_xy = false, - .mirror_x = false, - .mirror_y = false, - }, - .flags = { - .buff_dma = cfg->flags.buff_dma, - .buff_spiram = cfg->flags.buff_spiram, -#if LVGL_VERSION_MAJOR >= 9 - .swap_bytes = (BSP_LCD_BIGENDIAN ? true : false), -#endif - } - }; - - return lvgl_port_add_disp(&disp_cfg); -} - -lv_display_t *bsp_display_start(void) -{ - bsp_display_cfg_t cfg = { - .lvgl_port_cfg = { - .task_priority = CONFIG_BSP_DISPLAY_LVGL_TASK_PRIORITY, - .task_stack = 6144, - .task_affinity = 1, - .timer_period_ms = LVGL_TICK_PERIOD_MS, - .task_max_sleep_ms = LVGL_MAX_SLEEP_MS, - }, - .buffer_size = BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE, - .flags = { - .buff_dma = true, - .buff_spiram = false, - } - }; - return bsp_display_start_with_config(&cfg); -} - -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg) -{ - lv_display_t *disp; - assert(cfg != NULL); - BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg)); - BSP_NULL_CHECK(disp = bsp_display_lcd_init(cfg), NULL); - - return disp; -} - -lv_indev_t *bsp_display_get_input_dev(void) -{ - return NULL; -} - -bool bsp_display_lock(uint32_t timeout_ms) -{ - return lvgl_port_lock(timeout_ms); -} - -void bsp_display_unlock(void) -{ - lvgl_port_unlock(); -} - -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation) -{ - lv_disp_set_rotation(disp, rotation); -} -#endif // (BSP_CONFIG_NO_GRAPHIC_LIB == 0) - - - - -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size) -{ - esp_err_t ret = ESP_OK; - if ((btn_array_size < BSP_BUTTON_NUM) || - (btn_array == NULL)) { - return ESP_ERR_INVALID_ARG; - } -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - /* Initialize ADC and get ADC handle */ - BSP_ERROR_CHECK_RETURN_NULL(bsp_adc_initialize()); - bsp_adc_handle = bsp_adc_get_handle(); -#endif - - if (btn_cnt) { - *btn_cnt = 0; - } - for (int i = 0; i < BSP_BUTTON_NUM; i++) { - btn_array[i] = iot_button_create(&bsp_button_config[i]); - if (btn_array[i] == NULL) { - ret = ESP_FAIL; - break; - } - if (btn_cnt) { - (*btn_cnt)++; - } - } - return ret; -} - - -#ifdef CONFIG_TOUCH_ELEM_EVENT -/* Button event handler task */ -static void button_handler_task(void *arg) -{ - (void) arg; //Unused - touch_elem_message_t element_message; - while (1) { - /* Waiting for touch element messages */ - touch_element_message_receive(&element_message, portMAX_DELAY); - if (element_message.element_type != TOUCH_ELEM_TYPE_BUTTON) { - continue; - } - /* Decode message */ - const touch_button_message_t *button_message = touch_button_get_message(&element_message); - if (button_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { - ESP_LOGI(TAG, "Button[%d] Press", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { - ESP_LOGI(TAG, "Button[%d] Release", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { - ESP_LOGI(TAG, "Button[%d] LongPress", (int)element_message.arg); - } - } -} -#elif CONFIG_TOUCH_ELEM_CALLBACK -/* Button callback routine */ -// static void button_handler(touch_button_handle_t out_handle, touch_button_message_t *out_message, void *arg) -// { -// (void) out_handle; //Unused -// if (out_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { -// ESP_LOGI(TAG, "Button[%d] Press", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { -// ESP_LOGI(TAG, "Button[%d] Release", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { -// ESP_LOGI(TAG, "Button[%d] LongPress", (int)arg); -// } -// } -#endif - -void bsp_touch_button_create(touch_button_callback_t button_callback) -{ - /* Initialize Touch Element library */ - touch_elem_global_config_t global_config = TOUCH_ELEM_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_element_install(&global_config)); - ESP_LOGI(TAG, "Touch element library installed"); - - touch_button_global_config_t button_global_config = TOUCH_BUTTON_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_button_install(&button_global_config)); - ESP_LOGI(TAG, "Touch button installed"); - for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { - touch_button_config_t button_config = { - .channel_num = channel_array[i], - .channel_sens = channel_sens_array[i] - }; - /* Create Touch buttons */ - ESP_ERROR_CHECK(touch_button_create(&button_config, &button_handle[i])); - /* Subscribe touch button events (On Press, On Release, On LongPress) */ - ESP_ERROR_CHECK(touch_button_subscribe_event(button_handle[i], - TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE | TOUCH_ELEM_EVENT_ON_LONGPRESS, - (void *)channel_array[i])); -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_EVENT)); -#elif CONFIG_TOUCH_ELEM_CALLBACK - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_CALLBACK)); - /* Register a handler function to handle event messages */ - ESP_ERROR_CHECK(touch_button_set_callback(button_handle[i], button_callback)); -#endif - /* Set LongPress event trigger threshold time */ - ESP_ERROR_CHECK(touch_button_set_longpress(button_handle[i], 2000)); - } - ESP_LOGI(TAG, "Touch buttons created"); - -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Create a handler task to handle event messages */ - xTaskCreate(&button_handler_task, "button_handler_task", 4 * 1024, NULL, 5, NULL); -#endif - - touch_element_start(); - ESP_LOGI(TAG, "Touch element library start"); -} diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c b/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c deleted file mode 100644 index 68e421ba5df12babe7159c7324b0a5711d49ff5d..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c +++ /dev/null @@ -1,34 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -/* Sample rate of MSM261S4030H0 */ -#define BSP_MIC_SAMPLE_RATE (48000u) - -/* This configuration is used by default in bsp_audio_init() */ -#define BSP_I2S_SIMPLEX_MONO_CFG(_sample_rate) \ - { \ - .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ - .sample_rate = _sample_rate, \ - .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ - .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, \ - .communication_format = I2S_COMM_FORMAT_STAND_I2S, \ - .dma_buf_count = 3, \ - .dma_buf_len = 1024, \ - .use_apll = true, \ - .tx_desc_auto_clear = true, \ - .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM \ - } - - -esp_err_t bsp_adc_initialize(void) -{ - return ESP_OK; -} diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c b/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c deleted file mode 100644 index 33351f550828b1ddaade522898160a1e9418f683..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; - -esp_err_t bsp_adc_initialize(void) -{ - /* ADC was initialized before */ - if (bsp_adc_handle != NULL) { - return ESP_OK; - } - - /* Initialize ADC */ - const adc_oneshot_unit_init_cfg_t init_config1 = { - .unit_id = BSP_ADC_UNIT, - }; - BSP_ERROR_CHECK_RETURN_ERR(adc_oneshot_new_unit(&init_config1, &bsp_adc_handle)); - - return ESP_OK; -} - -adc_oneshot_unit_handle_t bsp_adc_get_handle(void) -{ - return bsp_adc_handle; -} diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/idf_component.yml b/example/factory_demo_v1/components/esp_sparkbot_bsp/idf_component.yml deleted file mode 100644 index c6dc48e407d437cafc04bfa6576fa76e25d36291..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/idf_component.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3.1.0~1" -description: Board Support Package (BSP) for ESP32-SparkBot - -targets: - - esp32s3 - -tags: - - bsp - -dependencies: - idf: ">=4.4.5" - - espressif/i2c_bus: - version: "1.1.*" - public: true - - espressif/esp_lvgl_port: - version: "2.4.1" - public: true - - button: - version: ">=2.5,<4.0" - public: true - - esp_codec_dev: - version: "==1.1.0" - public: true - diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/config.h b/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/config.h deleted file mode 100644 index f3cb5ebe7389d59cea35c3444aaadb3c0c94b6cc..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -/************************************************************************************************** - * BSP configuration - **************************************************************************************************/ -// By default, this BSP is shipped with LVGL graphical library. Enabling this option will exclude it. -// If you want to use BSP without LVGL, select BSP version with 'noglib' suffix. -#if !defined(BSP_CONFIG_NO_GRAPHIC_LIB) // Check if the symbol is not coming from compiler definitions (-D...) -#define BSP_CONFIG_NO_GRAPHIC_LIB (0) -#endif diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/display.h b/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/display.h deleted file mode 100644 index 213b4720ad7e19686aa029e4ee6b7680824ac761..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/display.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief BSP LCD - * - * This file offers API for basic LCD control. - * It is useful for users who want to use the LCD without the default Graphical Library LVGL. - * - * For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start(). - */ - -#pragma once -#include "esp_lcd_types.h" - -/* LCD color formats */ -#define ESP_LCD_COLOR_FORMAT_RGB565 (1) -#define ESP_LCD_COLOR_FORMAT_RGB888 (2) - -/* LCD display color format */ -#define BSP_LCD_COLOR_FORMAT (ESP_LCD_COLOR_FORMAT_RGB565) -/* LCD display color bytes endianess */ -#define BSP_LCD_BIGENDIAN (1) -/* LCD display color bits */ -#define BSP_LCD_BITS_PER_PIXEL (16) -/* LCD display color space */ -#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_RGB) -/* LCD display definition */ -#define BSP_LCD_H_RES (240) -#define BSP_LCD_V_RES (240) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief BSP display configuration structure - * - */ -typedef struct { - int max_transfer_sz; /*!< Maximum transfer size, in bytes. */ -} bsp_display_config_t; - -/** - * @brief Create new display panel - * - * For maximum flexibility, this function performs only reset and initialization of the display. - * You must turn on the display explicitly by calling esp_lcd_panel_disp_on_off(). - * The display's backlight is not turned on either. You can use bsp_display_backlight_on/off(), - * bsp_display_brightness_set() (on supported boards) or implement your own backlight control. - * - * If you want to free resources allocated by this function, you can use esp_lcd API, ie.: - * - * \code{.c} - * esp_lcd_panel_del(panel); - * esp_lcd_panel_io_del(io); - * spi_bus_free(spi_num_from_configuration); - * \endcode - * - * @param[in] config display configuration - * @param[out] ret_panel esp_lcd panel handle - * @param[out] ret_io esp_lcd IO handle - * @return - * - ESP_OK On success - * - Else esp_lcd failure - */ -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io); - -/** - * @brief Initialize display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_init(void); - -/** - * @brief Set display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @param[in] brightness_percent Brightness in [%] - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_set(int brightness_percent); - -/** - * @brief Turn on display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_on(void); - -/** - * @brief Turn off display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_off(void); - -#ifdef __cplusplus -} -#endif diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h b/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h deleted file mode 100644 index ac223966e45efc7116ec6792a43e6203b8e5cee2..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "bsp/esp_sparkbot_bsp.h" diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h b/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h deleted file mode 100644 index a114d2a1c78e29c8aa86bd75872e88c4d15e4fe4..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h +++ /dev/null @@ -1,381 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief ESP BSP: ESP-SparkBot - */ - -#pragma once - -#include "sdkconfig.h" -#include "driver/gpio.h" -#include "driver/sdmmc_host.h" -#include "esp_codec_dev.h" -#include "iot_button.h" -#include "touch_element/touch_button.h" -#include "bsp/config.h" -#include "bsp/display.h" -#include "i2c_bus.h" - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "driver/i2s.h" -#else -#include "driver/i2s_std.h" -#endif - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#include "lvgl.h" -#include "esp_lvgl_port.h" -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - -/************************************************************************************************** - * BSP Capabilities - **************************************************************************************************/ - -#define BSP_CAPS_DISPLAY 1 -#define BSP_CAPS_TOUCH 0 -#define BSP_CAPS_BUTTONS 1 -#define BSP_CAPS_AUDIO 1 -#define BSP_CAPS_AUDIO_SPEAKER 0 -#define BSP_CAPS_AUDIO_MIC 1 -#define BSP_CAPS_SDCARD 1 -#define BSP_CAPS_IMU 1 -#define BSP_CAPS_CAMERA 1 - -/************************************************************************************************** - * ESP-SparkBot-BSP pinout - **************************************************************************************************/ - -/* I2C */ -#define BSP_I2C_SCL (GPIO_NUM_5) -#define BSP_I2C_SDA (GPIO_NUM_4) - -/* Display */ -#define BSP_LCD_SPI_MOSI (GPIO_NUM_47) -#define BSP_LCD_SPI_CLK (GPIO_NUM_21) -#define BSP_LCD_SPI_CS (GPIO_NUM_44) -#define BSP_LCD_DC (GPIO_NUM_43) -#define BSP_LCD_RST (GPIO_NUM_NC) -#define BSP_LCD_BACKLIGHT (GPIO_NUM_46) - -/* Camera */ -#define BSP_CAMERA_XCLK (GPIO_NUM_15) -#define BSP_CAMERA_PCLK (GPIO_NUM_13) -#define BSP_CAMERA_VSYNC (GPIO_NUM_6) -#define BSP_CAMERA_HSYNC (GPIO_NUM_7) -#define BSP_CAMERA_D0 (GPIO_NUM_11) -#define BSP_CAMERA_D1 (GPIO_NUM_9) -#define BSP_CAMERA_D2 (GPIO_NUM_8) -#define BSP_CAMERA_D3 (GPIO_NUM_10) -#define BSP_CAMERA_D4 (GPIO_NUM_12) -#define BSP_CAMERA_D5 (GPIO_NUM_18) -#define BSP_CAMERA_D6 (GPIO_NUM_17) -#define BSP_CAMERA_D7 (GPIO_NUM_16) - -/* Buttons */ -#define BSP_BUTTON_BOOT_IO (GPIO_NUM_0) -#define BSP_BUTTONS_IO (GPIO_NUM_1) // All 4 buttons mapped to this GPIO -typedef enum bsp_led_t { - BSP_LED_GREEN = GPIO_NUM_3, -} bsp_led_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - * - * Buttons interface - * - * Example configuration: - * \code{.c} - * button_handle_t btns[BSP_BUTTON_NUM]; - * bsp_iot_button_create(btns, NULL, BSP_BUTTON_NUM); - * iot_button_register_cb(btns[0], ... - * \endcode - **************************************************************************************************/ -typedef enum { - BSP_BUTTON_MENU = 0, - BSP_BUTTON_PLAY, - BSP_BUTTON_DOWN, - BSP_BUTTON_UP, - BSP_BUTTON_BOOT, - BSP_BUTTON_NUM -} bsp_button_t; - -/** - * @brief Initialize all buttons - * - * Returned button handlers must be used with espressif/button component API - * - * @note For LCD panel button which is defined as BSP_BUTTON_MAIN, bsp_display_start should - * be called before call this function. - * - * @param[out] btn_array Output button array - * @param[out] btn_cnt Number of button handlers saved to btn_array, can be NULL - * @param[in] btn_array_size Size of output button array. Must be at least BSP_BUTTON_NUM - * @return - * - ESP_OK All buttons initialized - * - ESP_ERR_INVALID_ARG btn_array is too small or NULL - * - ESP_FAIL Underlaying iot_button_create failed - */ -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size); - - -void bsp_touch_button_create(touch_button_callback_t button_callback); - -/************************************************************************************************** - * - * I2C interface - * - * There are two devices connected to I2C peripheral: - * - QMA7981 Inertial measurement unit - * - OV2640 Camera module - **************************************************************************************************/ -#define BSP_I2C_NUM CONFIG_BSP_I2C_NUM - -/** - * @brief Init I2C driver - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - ESP_FAIL I2C driver installation error - * - */ -esp_err_t bsp_i2c_init(void); - -/** - * @brief Deinit I2C driver and free its resources - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - */ -esp_err_t bsp_i2c_deinit(void); - -i2c_bus_handle_t bsp_i2c_get_handle(void); - -/************************************************************************************************** - * - * Camera interface - * - * ESP-SparkBot-BSP is shipped with OV2640 camera module. - * As a camera driver, esp32-camera component is used. - * - * Example configuration: - * \code{.c} - * const camera_config_t camera_config = BSP_CAMERA_DEFAULT_CONFIG; - * esp_err_t err = esp_camera_init(&camera_config); - * \endcode - **************************************************************************************************/ -/** - * @brief ESP-SparkBot-BSP camera default configuration - * - * In this configuration we select RGB565 color format and 240x240 image size - matching the display. - * We use double-buffering for the best performance. - * Since we don't want to waste internal SRAM, we allocate the framebuffers in external PSRAM. - * By setting XCLK to 16MHz, we configure the esp32-camera driver to use EDMA when accessing the PSRAM. - * - * @attention I2C must be enabled by bsp_i2c_init(), before camera is initialized - */ -#define BSP_CAMERA_DEFAULT_CONFIG \ - { \ - .pin_pwdn = GPIO_NUM_NC, \ - .pin_reset = GPIO_NUM_NC, \ - .pin_xclk = BSP_CAMERA_XCLK, \ - .pin_sccb_sda = GPIO_NUM_NC, \ - .pin_sccb_scl = GPIO_NUM_NC, \ - .pin_d7 = BSP_CAMERA_D7, \ - .pin_d6 = BSP_CAMERA_D6, \ - .pin_d5 = BSP_CAMERA_D5, \ - .pin_d4 = BSP_CAMERA_D4, \ - .pin_d3 = BSP_CAMERA_D3, \ - .pin_d2 = BSP_CAMERA_D2, \ - .pin_d1 = BSP_CAMERA_D1, \ - .pin_d0 = BSP_CAMERA_D0, \ - .pin_vsync = BSP_CAMERA_VSYNC, \ - .pin_href = BSP_CAMERA_HSYNC, \ - .pin_pclk = BSP_CAMERA_PCLK, \ - .xclk_freq_hz = 16000000, \ - .ledc_timer = LEDC_TIMER_0, \ - .ledc_channel = LEDC_CHANNEL_0, \ - .pixel_format = PIXFORMAT_RGB565, \ - .frame_size = FRAMESIZE_240X240, \ - .jpeg_quality = 12, \ - .fb_count = 2, \ - .fb_location = CAMERA_FB_IN_PSRAM,\ - .sccb_i2c_port = BSP_I2C_NUM, \ - } - -#define BSP_CAMERA_VFLIP 1 -#define BSP_CAMERA_HMIRROR 0 - -/************************************************************************************************** - * - * SPIFFS - * - * After mounting the SPIFFS, it can be accessed with stdio functions ie.: - * \code{.c} - * FILE* f = fopen(BSP_SPIFFS_MOUNT_POINT"/hello.txt", "w"); - * fprintf(f, "Hello World!\n"); - * fclose(f); - * \endcode - **************************************************************************************************/ -#define BSP_SPIFFS_MOUNT_POINT CONFIG_BSP_SPIFFS_MOUNT_POINT - -/** - * @brief Mount SPIFFS to virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_spiffs_register was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes - */ -esp_err_t bsp_spiffs_mount(void); - -/** - * @brief Unmount SPIFFS from virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if already unmounted - */ -esp_err_t bsp_spiffs_unmount(void); - - -/************************************************************************************************** - * - * LCD interface - * - * ESP-SparkBot-BSP is shipped with 1.3inch ST7789 display controller. - * It features 16-bit colors and 240x240 resolution. - * - * LVGL is used as graphics library. LVGL is NOT thread safe, therefore the user must take LVGL mutex - * by calling bsp_display_lock() before calling any LVGL API (lv_...) and then give the mutex with - * bsp_display_unlock(). - * - * If you want to use the display without LVGL, see bsp/display.h API and use BSP version with 'noglib' suffix. - **************************************************************************************************/ -#define BSP_LCD_PIXEL_CLOCK_HZ (80 * 1000 * 1000) -#define BSP_LCD_SPI_NUM (SPI3_HOST) - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * BSP_LCD_V_RES) -#define BSP_LCD_DRAW_BUFF_DOUBLE (0) - -/** - * @brief BSP display configuration structure - */ -typedef struct { - lvgl_port_cfg_t lvgl_port_cfg; /*!< LVGL port configuration */ - uint32_t buffer_size; /*!< Size of the buffer for the screen in pixels */ - uint32_t trans_size; - bool double_buffer; /*!< True, if should be allocated two buffers */ - struct { - unsigned int buff_dma: 1; /*!< Allocated LVGL buffer will be DMA capable */ - unsigned int buff_spiram: 1; /*!< Allocated LVGL buffer will be in PSRAM */ - } flags; -} bsp_display_cfg_t; - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start(void); - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * LCD backlight must be enabled separately by calling bsp_display_brightness_set() - * - * @param cfg display configuration - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg); - -/** - * @brief Get pointer to input device (touch, buttons, ...) - * - * @note The LVGL input device is initialized in bsp_display_start() function. - * - * @return Pointer to LVGL input device or NULL when not initialized - */ -lv_indev_t *bsp_display_get_input_dev(void); - -/** - * @brief Take LVGL mutex - * - * @param timeout_ms Timeout in [ms]. 0 will block indefinitely. - * @return true Mutex was taken - * @return false Mutex was NOT taken - */ -bool bsp_display_lock(uint32_t timeout_ms); - -/** - * @brief Give LVGL mutex - * - */ -void bsp_display_unlock(void); - -/** - * @brief Rotate screen - * - * Display must be already initialized by calling bsp_display_start() - * - * @param[in] disp Pointer to LVGL display - * @param[in] rotation Angle of the display rotation - */ -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation); -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - - - -/************************************************************************************************** - * - * ADC interface - * - * There are multiple devices connected to ADC peripheral: - * - Buttons - * - * After initialization of ADC, use adc_handle when using ADC driver. - **************************************************************************************************/ - -#define BSP_ADC_UNIT ADC_UNIT_1 - -/** - * @brief Initialize ADC - * - * The ADC can be initialized inside BSP, when needed. - * - * @param[out] adc_handle Returned ADC handle - */ -esp_err_t bsp_adc_initialize(void); - - -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -/** - * @brief Get ADC handle - * - * @note This function is available only in IDF5 and higher - * - * @return ADC handle - */ -adc_oneshot_unit_handle_t bsp_adc_get_handle(void); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/factory_demo_v1/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h b/example/factory_demo_v1/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h deleted file mode 100644 index e00199943eef4e1c31fbc46b8a2ee91d4cb2cc15..0000000000000000000000000000000000000000 --- a/example/factory_demo_v1/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include "esp_check.h" -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Assert on error, if selected in menuconfig. Otherwise return error code. */ -#if CONFIG_BSP_ERROR_CHECK -#define BSP_ERROR_CHECK_RETURN_ERR(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK_RETURN_NULL(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK(x, ret) ESP_ERROR_CHECK(x) -#define BSP_NULL_CHECK(x, ret) assert(x) -#define BSP_NULL_CHECK_GOTO(x, goto_tag) assert(x) -#else -#define BSP_ERROR_CHECK_RETURN_ERR(x) do { \ - esp_err_t err_rc_ = (x); \ - if (unlikely(err_rc_ != ESP_OK)) { \ - return err_rc_; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK_RETURN_NULL(x) do { \ - if (unlikely((x) != ESP_OK)) { \ - return NULL; \ - } \ - } while(0) - -#define BSP_NULL_CHECK(x, ret) do { \ - if ((x) == NULL) { \ - return ret; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK(x, ret) do { \ - if (unlikely((x) != ESP_OK)) { \ - return ret; \ - } \ - } while(0) - -#define BSP_NULL_CHECK_GOTO(x, goto_tag) do { \ - if ((x) == NULL) { \ - goto goto_tag; \ - } \ - } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/factory_demo_v1/main/app/app_audio_record.c b/example/factory_demo_v1/main/app/app_audio_record.c index 0bb1b322cf66e32e3c5a7b4273fc0313a5b8a18c..d674601fa81cab60f647f35399424b5babba2d0f 100644 --- a/example/factory_demo_v1/main/app/app_audio_record.c +++ b/example/factory_demo_v1/main/app/app_audio_record.c @@ -20,10 +20,7 @@ #include "model_path.h" #include "esp_vad.h" #include "esp_process_sdkconfig.h" -// #include "bsp/esp-bsp.h" -// #include "file_iterator.h" -#include "esp_sparkbot_bsp.h" -#include "bsp_board_extra.h" +#include "bsp/esp-bsp.h" #include "baidu.h" #include "app_audio_record.h" @@ -62,7 +59,7 @@ static QueueHandle_t g_result_que = NULL; static srmodel_list_t *models = NULL; static esp_codec_dev_handle_t spk_codec_dev = NULL; -// static file_iterator_instance_t *file_iterator = NULL; +static esp_codec_dev_handle_t mic_codec_dev = NULL; static TaskHandle_t xFeedHandle; static TaskHandle_t xDetectHandle; @@ -76,22 +73,10 @@ static int16_t *g_audio_record_buf = NULL; static void audio_play_task(void *arg) { - spk_codec_dev = bsp_extra_audio_codec_speaker_init(); - esp_codec_dev_set_out_vol(spk_codec_dev, 100); - - esp_codec_dev_sample_info_t fs = { - .sample_rate = 16000, - .channel = 1, - .bits_per_sample = 16, - }; - - esp_codec_dev_open(spk_codec_dev, &fs); audio_data_t audio_data = {0}; while (xQueueReceive(g_queue_audio_play, &audio_data, portMAX_DELAY) == pdTRUE) { - // ESP_LOGW(TAG, "audio_play_task: %d, wav: %p", audio_data.len, audio_data.wav); int res = esp_codec_dev_write(spk_codec_dev, audio_data.wav, audio_data.len); - // ESP_LOGI(TAG, "esp_codec_dev_write %d", res); free(audio_data.wav); } @@ -128,18 +113,6 @@ static void audio_feed_task(void *pvParam) esp_system_abort("No mem for audio buffer"); } - /* Set the input gain of the microphone, increase the gain if the input volume is too low */ - esp_codec_dev_handle_t mic_codec_dev = bsp_extra_audio_codec_microphone_init(); - - esp_codec_dev_sample_info_t fs = { - .sample_rate = 16000, - .channel = 1, - .bits_per_sample = 16, - }; - esp_codec_dev_open(mic_codec_dev, &fs); - /* Set the input gain of the microphone, increase the gain if the input volume is too low */ - esp_codec_dev_set_in_gain(mic_codec_dev, 35.0); - while (true) { /* Read audio data from I2S bus */ esp_codec_dev_read(mic_codec_dev, audio_buffer, audio_chunksize * I2S_CHANNEL_NUM * sizeof(int16_t)); @@ -217,13 +190,13 @@ static void audio_detect_task(void *pvParam) } if (res->wakeup_state == WAKENET_DETECTED) { - ESP_LOGI(TAG, LOG_BOLD(LOG_COLOR_GREEN) "Wakeword detected"); + ESP_LOGI(TAG, "Wakeword detected"); audio_record_state_t result = AUDIO_WAKENET_START; xQueueSend(g_result_que, &result, 10); /* Update face UI */ ui_send_sys_event(ui_face, LV_EVENT_FACE_ASK, NULL); } else if (res->wakeup_state == WAKENET_CHANNEL_VERIFIED) { - ESP_LOGI(TAG, LOG_BOLD(LOG_COLOR_GREEN) "Channel verified"); + ESP_LOGI(TAG, "Channel verified"); afe_handle->disable_wakenet(afe_data); wait_speech_flag = true; } @@ -502,6 +475,23 @@ esp_err_t app_sr_start(void) // bsp_spiffs_mount(); app_sr_mmap_audio(); + esp_codec_dev_sample_info_t fs = { + .sample_rate = 16000, + .channel = 1, + .bits_per_sample = 16, + }; + /* Set the input gain of the microphone, increase the gain if the input volume is too low */ + mic_codec_dev = bsp_audio_codec_microphone_init(); + + esp_codec_dev_open(mic_codec_dev, &fs); + /* Set the input gain of the microphone, increase the gain if the input volume is too low */ + esp_codec_dev_set_in_gain(mic_codec_dev, 35.0); + + spk_codec_dev = bsp_audio_codec_speaker_init(); + esp_codec_dev_open(spk_codec_dev, &fs); + + esp_codec_dev_set_out_vol(spk_codec_dev, 100); + /* Audio buffer init */ g_audio_record_buf = heap_caps_malloc(MAX_AUDIO_INPUT_LENGTH + 1, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT); diff --git a/example/factory_demo_v1/main/app_main.c b/example/factory_demo_v1/main/app_main.c index 2074d77ba6f063029156700d0bf1453e9739ddcc..b3fbc25d4c168bbb1470b0834648a4268380c868 100644 --- a/example/factory_demo_v1/main/app_main.c +++ b/example/factory_demo_v1/main/app_main.c @@ -25,8 +25,7 @@ #include "iot_button.h" #include "wifi_sntp.h" -#include "esp_sparkbot_bsp.h" -#include "bsp_board_extra.h" +#include "bsp/esp-bsp.h" #include "baidu.h" diff --git a/example/factory_demo_v1/main/idf_component.yml b/example/factory_demo_v1/main/idf_component.yml index 24b69f585f92f39f27fa91786713c53bcb6c9f32..41ac7f6656d2d02f74c1e408019ecac2a7e36541 100644 --- a/example/factory_demo_v1/main/idf_component.yml +++ b/example/factory_demo_v1/main/idf_component.yml @@ -2,8 +2,9 @@ dependencies: espressif2022/bmi270: '*' espressif2022/tinygl: '*' - espressif/button: - version: 3.4.0 + espressif2022/lottie_player: ^1.0.0 + espressif2022/esp_sparkbot: "*" + espressif/button: 3.4.0 espressif/esp-sr: 1.9.2 espressif/thorvg: 0.* esp_mmap_assets: 1.* @@ -12,8 +13,6 @@ dependencies: lvgl/lvgl: 8.* espressif/zlib: ^1 espressif/esp32-camera: 2.0.4 - esp_sparkbot_bsp: '*' - espressif2022/lottie_player: ^1.0.0 protocol_examples_common: path: ${IDF_PATH}/examples/common_components/protocol_examples_common diff --git a/example/human_face_recognition_no_wakenet/components/bsp_extra/CMakeLists.txt b/example/human_face_recognition_no_wakenet/components/bsp_extra/CMakeLists.txt deleted file mode 100644 index 2abe51240a48e4876975235d90038ce15b1d61ba..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/bsp_extra/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -set(SRCS "") -list(APPEND SRCS - "src/bsp_board_extra.c" -) - -set(INCLUDE_DIRS "") -list(APPEND INCLUDE_DIRS "include") - -foreach(SRC_DIR IN LISTS SRC_DIRS) - file(GLOB_RECURSE SRC ${SRC_DIR}/*.c) - list(APPEND SRCS ${SRC}) - list(APPEND INCLUDE_DIRS ${SRC_DIR}/include) -endforeach() - -idf_component_register( - SRCS ${SRCS} - INCLUDE_DIRS ${INCLUDE_DIRS} - REQUIRES driver - PRIV_REQUIRES esp_timer fatfs esp_psram esp_mm -) - -target_compile_options( - ${COMPONENT_LIB} PRIVATE - -Wno-format - -Wno-int-conversion - -Wno-incompatible-pointer-types - -Wunused-function - -Wno-unused-variable - -Wno-unused-function - -Wno-overflow - -Wno-unused-but-set-variable - -Wno-discarded-qualifiers) diff --git a/example/human_face_recognition_no_wakenet/components/bsp_extra/Kconfig b/example/human_face_recognition_no_wakenet/components/bsp_extra/Kconfig deleted file mode 100644 index ec558673078adf7029bbfaa1fe514a30c460f7a6..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/bsp_extra/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -menu "Board Support Package" - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/human_face_recognition_no_wakenet/components/bsp_extra/LICENSE b/example/human_face_recognition_no_wakenet/components/bsp_extra/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/bsp_extra/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/human_face_recognition_no_wakenet/components/bsp_extra/idf_component.yml b/example/human_face_recognition_no_wakenet/components/bsp_extra/idf_component.yml deleted file mode 100644 index 01ff134595b2f395d0382490e797c1969a3c88be..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/bsp_extra/idf_component.yml +++ /dev/null @@ -1,21 +0,0 @@ -dependencies: - espressif/esp_sparkbot_bsp: - version: "*" - path: ../esp_sparkbot_bsp - - esp_codec_dev: - public: true - version: "==1.1.0" - - chmorgan/esp-audio-player: - version: "1.0.*" - public: true - - chmorgan/esp-file-iterator: - version: "1.0.0" - public: true - -description: Board Support Package for ESP32-P4-Function-ev-board -targets: -- esp32s3 -version: 0.0.1 diff --git a/example/human_face_recognition_no_wakenet/components/bsp_extra/include/bsp_board_extra.h b/example/human_face_recognition_no_wakenet/components/bsp_extra/include/bsp_board_extra.h deleted file mode 100644 index 381a7156b026399f87d6e6254dc8821ed938c725..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/bsp_extra/include/bsp_board_extra.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include -#include "esp_codec_dev.h" -#include "esp_err.h" -#include "driver/gpio.h" -#include "driver/i2s_std.h" -#include "audio_player.h" -#include "file_iterator.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define BSP_I2S_SCLK (GPIO_NUM_39) -#define BSP_I2S_MCLK (GPIO_NUM_45) -#define BSP_I2S_LCLK (GPIO_NUM_41) -#define BSP_I2S_DOUT (GPIO_NUM_42) // To Codec ES8311 -#define BSP_I2S_DSIN (GPIO_NUM_40) // From Codec ES8311 -#define BSP_POWER_AMP_IO (GPIO_NUM_NC) - -#define CODEC_DEFAULT_SAMPLE_RATE (16000) -#define CODEC_DEFAULT_BIT_WIDTH (16) -#define CODEC_DEFAULT_ADC_VOLUME (24.0) -#define CODEC_DEFAULT_CHANNEL (2) -#define CODEC_DEFAULT_VOLUME (60) - -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MAX (95) -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MIN (0) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) - -/************************************************************************************************** - * - * I2S audio interface - * - * There are two devices connected to the I2S peripheral: - * - Codec ES8311 for output (playback) path - * - ADC ES7210 for input (recording) path - * - * For speaker initialization use `bsp_extra_audio_codec_speaker_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * For microphone initialization use `bsp_extra_audio_codec_microphone_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * After speaker or microphone initialization, use functions from esp_codec_dev for play/record audio. - * Example audio play: - * \code{.c} - * esp_codec_dev_set_out_vol(spk_codec_dev, DEFAULT_VOLUME); - * esp_codec_dev_open(spk_codec_dev, &fs); - * esp_codec_dev_write(spk_codec_dev, wav_bytes, bytes_read_from_spiffs); - * esp_codec_dev_close(spk_codec_dev); - * \endcode - **************************************************************************************************/ -/** - * @brief Init audio - * - * @note There is no deinit audio function. Users can free audio resources by calling `i2s_del_channel()`. - * @note This function wiil call `bsp_io_expander_init()` to setup and enable the control pin of audio power amplifier. - * @note This function will be called in `bsp_extra_audio_codec_speaker_init()` and `bsp_extra_audio_codec_microphone_init()`. - * - * @param[in] i2s_config I2S configuration. Pass NULL to use default values (Mono, duplex, 16bit, 22050 Hz) - * @return - * - ESP_OK On success - * - ESP_ERR_NOT_SUPPORTED The communication mode is not supported on the current chip - * - ESP_ERR_INVALID_ARG NULL pointer or invalid configuration - * - ESP_ERR_NOT_FOUND No available I2S channel found - * - ESP_ERR_NO_MEM No memory for storing the channel information - * - ESP_ERR_INVALID_STATE This channel has not initialized or already started - * - other error codes - */ -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config); - -/** - * @brief Initialize speaker codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void); - -/** - * @brief Initialize microphone codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void); - -/************************************************************************************************** - * BSP Extra interface - * Mainly provided some I2S Codec interfaces. - **************************************************************************************************/ -/** - * @brief Player set mute. - * - * @param enable: true or false - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_mute_set(bool enable); - -/** - * @brief Player set volume. - * - * @param volume: volume set - * @param volume_set: volume set response - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set); - -/** - * @brief Player get volume. - * - * @return - * - volume: volume get - */ -int bsp_extra_codec_volume_get(void); - -/** - * @brief Stop I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_stop(void); - -/** - * @brief Resume I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_resume(void); - -/** - * @brief Set I2S format to codec. - * - * @param rate: Sample rate of sample - * @param bits_cfg: Bit lengths of one channel data - * @param ch: Channels of sample - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch); - -/** - * @brief Read data from recoder. - * - * @param audio_buffer: The pointer of receiving data buffer - * @param len: Max data buffer length - * @param bytes_read: Byte number that actually be read, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms); - -/** - * @brief Write data to player. - * - * @param audio_buffer: The pointer of sent data buffer - * @param len: Max data buffer length - * @param bytes_written: Byte number that actually be sent, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms); - - -/** - * @brief Initialize codec play and record handle. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_init(); - -/** - * @brief Initialize audio player task. - * - * @param path file path - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_init(void); - -/** - * @brief Delete audio player task. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_del(void); - -/** - * @brief Initialize a file iterator instance - * - * @param path The file path for the iterator. - * @param ret_instance A pointer to the file iterator instance to be returned. - * @return - * - ESP_OK: Successfully initialized the file iterator instance. - * - ESP_FAIL: Failed to initialize the file iterator instance due to invalid parameters or memory allocation failure. - */ -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance); - -/** - * @brief Play the audio file at the specified index in the file iterator - * - * @param instance The file iterator instance. - * @param index The index of the file to play within the iterator. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to invalid parameters or file access issues. - */ -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index); - -/** - * @brief Play the audio file specified by the file path - * - * @param file_path The path to the audio file to be played. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to file access issues. - */ -esp_err_t bsp_extra_player_play_file(const char *file_path); - -/** - * @brief Register a callback function for the audio player - * - * @param cb The callback function to be registered. - * @param user_data User data to be passed to the callback function. - */ -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data); - -/** - * @brief Check if the specified audio file is currently playing - * - * @param file_path The path to the audio file to check. - * @return - * - true: The specified audio file is currently playing. - * - false: The specified audio file is not currently playing. - */ -bool bsp_extra_player_is_playing_by_path(const char *file_path); - -/** - * @brief Check if the audio file at the specified index is currently playing - * - * @param instance The file iterator instance. - * @param index The index of the file to check. - * @return - * - true: The audio file at the specified index is currently playing. - * - false: The audio file at the specified index is not currently playing. - */ -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index); - -#ifdef __cplusplus -} -#endif diff --git a/example/human_face_recognition_no_wakenet/components/bsp_extra/src/bsp_board_extra.c b/example/human_face_recognition_no_wakenet/components/bsp_extra/src/bsp_board_extra.c deleted file mode 100644 index c9fb477798b4125fa64e0a3a10301cce16b72b66..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/bsp_extra/src/bsp_board_extra.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include "esp_log.h" -#include "esp_check.h" -#include "esp_codec_dev_defaults.h" -#include "esp_err.h" -#include "esp_log.h" -#include "esp_vfs_fat.h" -#include "driver/i2c.h" -#include "driver/i2s_std.h" -#include "driver/gpio.h" -#include "driver/ledc.h" - -#include "bsp/esp-bsp.h" -#include "bsp_board_extra.h" - -#define BSP_ES7210_CODEC_ADDR (0x82) - -/* Can be used for `i2s_std_gpio_config_t` and/or `i2s_std_config_t` initialization */ -#define BSP_I2S_GPIO_CFG \ - { \ - .mclk = BSP_I2S_MCLK, \ - .bclk = BSP_I2S_SCLK, \ - .ws = BSP_I2S_LCLK, \ - .dout = BSP_I2S_DOUT, \ - .din = BSP_I2S_DSIN, \ - .invert_flags = { \ - .mclk_inv = false, \ - .bclk_inv = false, \ - .ws_inv = false, \ - }, \ - } - -/* This configuration is used by default in `bsp_extra_audio_init()` */ -#define BSP_I2S_DUPLEX_MONO_CFG(_sample_rate) \ - { \ - .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(_sample_rate), \ - .slot_cfg = I2S_STD_PHILIP_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO), \ - .gpio_cfg = BSP_I2S_GPIO_CFG, \ - } - -#define USE_I2S_RX_CHAN (1) - -static const char *TAG = "bsp_extra_board"; - -static esp_codec_dev_handle_t play_dev_handle; -static esp_codec_dev_handle_t record_dev_handle; - -static bool _is_audio_init = false; -static bool _is_player_init = false; -static int _vloume_intensity = CODEC_DEFAULT_VOLUME; - -static audio_player_cb_t audio_idle_callback = NULL; -static void *audio_idle_cb_user_data = NULL; -static char audio_file_path[128]; - -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ -static i2s_chan_handle_t i2s_tx_chan = NULL; -#if USE_I2S_RX_CHAN -static i2s_chan_handle_t i2s_rx_chan = NULL; -#endif - -/************************************************************************************************** - * - * I2S Audio Function - * - **************************************************************************************************/ -#define EXAMPLE_BUFF_SIZE 2048 - -static void i2s_example_write_task(void *args) -{ - uint8_t *w_buf = (uint8_t *)calloc(1, EXAMPLE_BUFF_SIZE); - assert(w_buf); // Check if w_buf allocation success - - /* Assign w_buf */ - for (int i = 0; i < EXAMPLE_BUFF_SIZE; i += 8) { - w_buf[i] = 0x12; - w_buf[i + 1] = 0x34; - w_buf[i + 2] = 0x56; - w_buf[i + 3] = 0x78; - w_buf[i + 4] = 0x9A; - w_buf[i + 5] = 0xBC; - w_buf[i + 6] = 0xDE; - w_buf[i + 7] = 0xF0; - } - - size_t w_bytes = EXAMPLE_BUFF_SIZE; - - // /* (Optional) Preload the data before enabling the TX channel, so that the valid data can be transmitted immediately */ - // while (w_bytes == EXAMPLE_BUFF_SIZE) { - // /* Here we load the target buffer repeatedly, until all the DMA buffers are preloaded */ - // ESP_ERROR_CHECK(i2s_channel_preload_data(tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes)); - // } - - /* Enable the TX channel */ - // ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - while (1) { - /* Write i2s data */ - if (i2s_channel_write(i2s_tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes, 1000) == ESP_OK) { - printf("Write Task: i2s write %d bytes\n", w_bytes); - } else { - printf("Write Task: i2s write failed\n"); - } - vTaskDelay(pdMS_TO_TICKS(200)); - } - free(w_buf); - vTaskDelete(NULL); -} - -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config) -{ - esp_err_t ret = ESP_FAIL; -#if USE_I2S_RX_CHAN - if (i2s_tx_chan && i2s_rx_chan) { -#else - if (i2s_tx_chan) { -#endif - /* Audio was initialized before */ - return ESP_OK; - } - - /* Setup I2S peripheral */ - i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(CONFIG_BSP_I2S_NUM, I2S_ROLE_MASTER); - chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer -#if USE_I2S_RX_CHAN - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, &i2s_rx_chan)); -#else - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, NULL)); -#endif - - /* Setup I2S channels */ - const i2s_std_config_t std_cfg_default = BSP_I2S_DUPLEX_MONO_CFG(22050); - const i2s_std_config_t *p_i2s_cfg = &std_cfg_default; - if (i2s_config != NULL) { - p_i2s_cfg = i2s_config; - } - - if (i2s_tx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_tx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - } -#if USE_I2S_RX_CHAN - if (i2s_rx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_rx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_rx_chan)); - } -#endif - - audio_codec_i2s_cfg_t i2s_cfg = { - .port = CONFIG_BSP_I2S_NUM, - .tx_handle = i2s_tx_chan, -#if USE_I2S_RX_CHAN - .rx_handle = i2s_rx_chan, -#else - .rx_handle = NULL, -#endif - }; - i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); - - return ESP_OK; -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_TYPE_OUT, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN_OUT, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_dev_cfg); -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_WORK_MODE_BOTH, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_es8311_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_es8311_dev_cfg); -} - -static esp_err_t audio_mute_function(AUDIO_PLAYER_MUTE_SETTING setting) -{ - // Volume saved when muting and restored when unmuting. Restoring volume is necessary - // as es8311_set_voice_mute(true) results in voice volume (REG32) being set to zero. - - bsp_extra_codec_mute_set(setting == AUDIO_PLAYER_MUTE ? true : false); - - // restore the voice volume upon unmuting - if (setting == AUDIO_PLAYER_UNMUTE) { - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, _vloume_intensity), TAG, "Set Codec volume failed"); - } - - return ESP_OK; -} - -static void audio_callback(audio_player_cb_ctx_t *ctx) -{ - if (audio_idle_callback) { - ctx->user_ctx = audio_idle_cb_user_data; - audio_idle_callback(ctx); - } -} - -/************************************************************************************************** - * - * Extra Board Function - * - **************************************************************************************************/ - -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len); - *bytes_read = len; - return ret; -} - -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len); - *bytes_written = len; - return ret; -} - -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch) -{ - esp_err_t ret = ESP_OK; - - esp_codec_dev_sample_info_t fs = { - .sample_rate = rate, - .channel = ch, - .bits_per_sample = bits_cfg, - }; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - if (record_dev_handle) { - ret |= esp_codec_dev_close(record_dev_handle); - ret |= esp_codec_dev_set_in_gain(record_dev_handle, CODEC_DEFAULT_ADC_VOLUME); - } - - if (play_dev_handle) { - ret |= esp_codec_dev_open(play_dev_handle, &fs); - } - if (record_dev_handle) { - ret |= esp_codec_dev_open(record_dev_handle, &fs); - } - return ret; -} - -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set) -{ - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, volume), TAG, "Set Codec volume failed"); - _vloume_intensity = volume; - - ESP_LOGI(TAG, "Setting volume: %d", volume); - - return ESP_OK; -} - -int bsp_extra_codec_volume_get(void) -{ - return _vloume_intensity; -} - -esp_err_t bsp_extra_codec_mute_set(bool enable) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_set_out_mute(play_dev_handle, enable); - return ret; -} - -esp_err_t bsp_extra_codec_dev_stop(void) -{ - esp_err_t ret = ESP_OK; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - - if (record_dev_handle) { - ret = esp_codec_dev_close(record_dev_handle); - } - return ret; -} - -esp_err_t bsp_extra_codec_dev_resume(void) -{ - return bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); -} - -esp_err_t bsp_extra_codec_init() -{ - if (_is_audio_init) { - return ESP_OK; - } - - play_dev_handle = bsp_extra_audio_codec_speaker_init(); - assert((play_dev_handle) && "play_dev_handle not initialized"); - - record_dev_handle = bsp_extra_audio_codec_microphone_init(); - assert((record_dev_handle) && "record_dev_handle not initialized"); - - bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); - - _is_audio_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_init(void) -{ - if (_is_player_init) { - return ESP_OK; - } - - audio_player_config_t config = { .mute_fn = audio_mute_function, - .write_fn = bsp_extra_i2s_write, - .clk_set_fn = bsp_extra_codec_set_fs, - .priority = 5 - }; - ESP_RETURN_ON_ERROR(audio_player_new(config), TAG, "audio_player_init failed"); - audio_player_callback_register(audio_callback, NULL); - - _is_player_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_del(void) -{ - _is_player_init = false; - - ESP_RETURN_ON_ERROR(audio_player_delete(), TAG, "audio_player_delete failed"); - - return ESP_OK; -} - -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance) -{ - ESP_RETURN_ON_FALSE(path, ESP_FAIL, TAG, "path is NULL"); - ESP_RETURN_ON_FALSE(ret_instance, ESP_FAIL, TAG, "ret_instance is NULL"); - - file_iterator_instance_t *file_iterator = file_iterator_new(path); - ESP_RETURN_ON_FALSE(file_iterator, ESP_FAIL, TAG, "file_iterator_new failed, %s", path); - - *ret_instance = file_iterator; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index) -{ - ESP_RETURN_ON_FALSE(instance, ESP_FAIL, TAG, "instance is NULL"); - - ESP_LOGI(TAG, "play_index(%d)", index); - char filename[128]; - int retval = file_iterator_get_full_path_from_index(instance, index, filename, sizeof(filename)); - ESP_RETURN_ON_FALSE(retval != 0, ESP_FAIL, TAG, "file_iterator_get_full_path_from_index failed"); - - ESP_LOGI(TAG, "opening file '%s'", filename); - FILE *fp = fopen(filename, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", filename); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, filename, sizeof(audio_file_path)); - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_file(const char *file_path) -{ - ESP_LOGI(TAG, "opening file '%s'", file_path); - FILE *fp = fopen(file_path, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", file_path); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, file_path, sizeof(audio_file_path)); - - return ESP_OK; -} - -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data) -{ - audio_idle_callback = cb; - audio_idle_cb_user_data = user_data; -} - -bool bsp_extra_player_is_playing_by_path(const char *file_path) -{ - return (strcmp(audio_file_path, file_path) == 0); -} - -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index) -{ - return (index == file_iterator_get_index(instance)); -} \ No newline at end of file diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/CMakeLists.txt b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/CMakeLists.txt deleted file mode 100644 index d276876a85bab2519a9e0b3b709a42cf6d826688..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -#IDF version is less than IDF5.0 -if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "5.0") - set(SRC_VER "esp_sparkbot_bsp_idf4.c") -else() - set(SRC_VER "esp_sparkbot_bsp_idf5.c") -endif() - -idf_component_register( - SRCS "esp_sparkbot_bsp.c" ${SRC_VER} - INCLUDE_DIRS "include" "include/bsp" - PRIV_INCLUDE_DIRS "priv_include" - REQUIRES driver spiffs touch_element - PRIV_REQUIRES fatfs esp_lcd -) diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/Kconfig b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/Kconfig deleted file mode 100644 index 9306c9c9c46b8c187959c1fec008862337618d9d..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/Kconfig +++ /dev/null @@ -1,105 +0,0 @@ -menu "Board Support Package" - - config BSP_ERROR_CHECK - bool "Enable error check in BSP" - default y - help - Error check assert the application before returning the error code. - - menu "I2C" - config BSP_I2C_NUM - int "I2C peripheral index" - default 1 - range 0 1 - help - ESP32-S2 has two I2C peripherals, pick the one you want to use. - - config BSP_I2C_FAST_MODE - bool "Enable I2C fast mode" - default y - help - I2C has two speed modes: normal (100kHz) and fast (400kHz). - - config BSP_I2C_CLK_SPEED_HZ - int - default 400000 if BSP_I2C_FAST_MODE - default 100000 - endmenu - - menu "SPIFFS - Virtual File System" - config BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - bool "Format SPIFFS if mounting fails" - default n - help - Format SPIFFS if it fails to mount the filesystem. - - config BSP_SPIFFS_MOUNT_POINT - string "SPIFFS mount point" - default "/spiffs" - help - Mount point of SPIFFS in the Virtual File System. - - config BSP_SPIFFS_PARTITION_LABEL - string "Partition label of SPIFFS" - default "storage" - help - Partition label which stores SPIFFS. - - config BSP_SPIFFS_MAX_FILES - int "Maximum files that could be open at the same time" - default 2 - help - Supported max files for SPIFFS in the Virtual File System. - endmenu - - menu "uSD card - Virtual File System" - config BSP_SD_FORMAT_ON_MOUNT_FAIL - bool "Format uSD card if mounting fails" - default n - help - The SDMMC host will format (FAT) the uSD card if it fails to mount the filesystem. - - config BSP_SD_MOUNT_POINT - string "uSD card mount point" - default "/sdcard" - help - Mount point of the uSD card in the Virtual File System - - endmenu - menu "Display" - config BSP_DISPLAY_LVGL_TASK_PRIORITY - int "LVGL task priority" - default 2 - help - The Board Support Package will create a task that will periodically handle LVGL operation in lv_timer_handler(). - - config BSP_DISPLAY_LVGL_TICK - int "LVGL tick period" - default 5 - range 1 100 - help - Period of LVGL tick timer. - - config BSP_DISPLAY_LVGL_MAX_SLEEP - int "LVGL maximum sleep time in ms" - default 1 - range 1 500 - help - Maximum time for task sleep in ms. - - config BSP_DISPLAY_BRIGHTNESS_LEDC_CH - int "LEDC channel index" - default 1 - range 0 7 - help - LEDC channel is used to generate PWM signal that controls display brightness. - Set LEDC index that should be used. - endmenu - - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/LICENSE b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/README.md b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/README.md deleted file mode 100644 index 029d9371f5b7eb2753ade93ab4e7e79de973a312..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# BSP: ESP-SparkBot - -[![Component Registry](https://components.espressif.com/components/espressif/esp32_s3_eye/badge.svg)](https://components.espressif.com/components/espressif/esp32_s3_eye) - -### Overview - -The ESP32-S3-EYE board consists of two parts: the main board (ESP32-S3-EYE-MB) that integrates the ESP32-S3-WROOM-1 module, camera, uSD card slot, digital microphone, USB port, and function buttons; and the sub board (ESP32-S3-EYE-SUB) that contains an LCD display. The main board and sub board are connected through pin headers. - -* [Hardware Reference](https://www.espressif.com/en/products/devkits/esp-eye/overview.) - -![](https://raw.githubusercontent.com/espressif/esp-who/master/docs/_static/get-started/ESP32-S3-EYE_MB-annotated-photo.png) - -**The development board has the following features:** -* ESP32-S3 module with built-in 8 MB flash and 8 MB octal RAM -* 1.3-inch 240x240 LCD color screen -* Onboard uSD card slot -* Digital microphone -* Accelerometer -* OV2640 camera - - -### Capabilities and dependencies -| Capability | Available | Component | Version | -|-------------|------------------|----------------------------------------------------------------------------------------------|----------| -| DISPLAY |:heavy_check_mark:| idf | >=4.4.5 | -| LVGL_PORT |:heavy_check_mark:|[espressif/esp_lvgl_port](https://components.espressif.com/components/espressif/esp_lvgl_port)| ^2 | -| TOUCH | :x: | | | -| BUTTONS |:heavy_check_mark:| [espressif/button](https://components.espressif.com/components/espressif/button) |>=2.5,<4.0| -| AUDIO |:heavy_check_mark:|[espressif/esp_codec_dev](https://components.espressif.com/components/espressif/esp_codec_dev)| ^1,<1.2 | -|AUDIO_SPEAKER| :x: | | | -| AUDIO_MIC |:heavy_check_mark:| | | -| SDCARD |:heavy_check_mark:| idf | >=4.4.5 | -| IMU |:heavy_check_mark:| [qma6100p](https://components.espressif.com/components/qma6100p) | 1.* | -| CAMERA |:heavy_check_mark:| [espressif/esp32-camera](https://components.espressif.com/components/espressif/esp32-camera) | ^2.0.2 | - diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c deleted file mode 100644 index 1a129b10a0996c6a517220bf273fc27955ff1bac..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c +++ /dev/null @@ -1,474 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "esp_vfs_fat.h" -#include "esp_lcd_panel_io.h" -#include "esp_lcd_panel_vendor.h" -#include "esp_lcd_panel_ops.h" -#include "esp_log.h" -#include "esp_check.h" -#include "esp_vfs_fat.h" -#include "esp_spiffs.h" - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" - -#include "driver/spi_master.h" -#include "driver/ledc.h" -#include "driver/i2c.h" - -#include "touch_element/touch_button.h" - -#include "esp_codec_dev_defaults.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "bsp/display.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - - -static i2s_chan_handle_t i2s_tx_chan = NULL; -static i2s_chan_handle_t i2s_rx_chan = NULL; -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ - - -// Touch Button -// #define CONFIG_TOUCH_ELEM_EVENT 1 -#define CONFIG_TOUCH_ELEM_CALLBACK 1 -#define TOUCH_BUTTON_NUM 3 -/* Touch buttons handle */ -static touch_button_handle_t button_handle[TOUCH_BUTTON_NUM]; - -/* Touch buttons channel array */ -static const touch_pad_t channel_array[TOUCH_BUTTON_NUM] = { - TOUCH_PAD_NUM1, - TOUCH_PAD_NUM2, - TOUCH_PAD_NUM3, -}; - -/* Touch buttons channel sensitivity array */ -static const float channel_sens_array[TOUCH_BUTTON_NUM] = { - 0.035F, - 0.08F, - 0.08F, -}; - -static bool i2c_initialized = false; -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; -#endif - -static const button_config_t bsp_button_config[BSP_BUTTON_NUM] = { - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_MENU, - .adc_button_config.min = 2310, // middle is 2410mV - .adc_button_config.max = 2510 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_PLAY, - .adc_button_config.min = 1880, // middle is 1980mV - .adc_button_config.max = 2080 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_DOWN, - .adc_button_config.min = 720, // middle is 820mV - .adc_button_config.max = 920 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_UP, - .adc_button_config.min = 280, // middle is 380mV - .adc_button_config.max = 480 - }, - { - .type = BUTTON_TYPE_GPIO, - .gpio_button_config.active_level = 0, - .gpio_button_config.gpio_num = BSP_BUTTON_BOOT_IO - } -}; - -esp_err_t bsp_i2c_init(void) -{ - /* I2C was initialized before */ - if (i2c_initialized) { - return ESP_OK; - } - - const i2c_config_t i2c_conf = { - .mode = I2C_MODE_MASTER, - .sda_io_num = BSP_I2C_SDA, - .sda_pullup_en = GPIO_PULLUP_ENABLE, - .scl_io_num = BSP_I2C_SCL, - .scl_pullup_en = GPIO_PULLUP_ENABLE, - .master.clk_speed = 400000 - }; - BSP_ERROR_CHECK_RETURN_ERR(i2c_param_config(BSP_I2C_NUM, &i2c_conf)); - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_install(BSP_I2C_NUM, i2c_conf.mode, 0, 0, 0)); - - i2c_initialized = true; - - return ESP_OK; -} - -esp_err_t bsp_i2c_deinit(void) -{ - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_delete(BSP_I2C_NUM)); - i2c_initialized = false; - return ESP_OK; -} - -esp_err_t bsp_spiffs_mount(void) -{ - esp_vfs_spiffs_conf_t conf = { - .base_path = CONFIG_BSP_SPIFFS_MOUNT_POINT, - .partition_label = CONFIG_BSP_SPIFFS_PARTITION_LABEL, - .max_files = CONFIG_BSP_SPIFFS_MAX_FILES, -#ifdef CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - .format_if_mount_failed = true, -#else - .format_if_mount_failed = false, -#endif - }; - - esp_err_t ret_val = esp_vfs_spiffs_register(&conf); - - BSP_ERROR_CHECK_RETURN_ERR(ret_val); - - size_t total = 0, used = 0; - ret_val = esp_spiffs_info(conf.partition_label, &total, &used); - if (ret_val != ESP_OK) { - ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret_val)); - } else { - ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used); - } - - return ret_val; -} - -esp_err_t bsp_spiffs_unmount(void) -{ - return esp_vfs_spiffs_unregister(CONFIG_BSP_SPIFFS_PARTITION_LABEL); -} - - -#define LCD_CMD_BITS (8) -#define LCD_PARAM_BITS (8) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) -#define LVGL_TICK_PERIOD_MS (CONFIG_BSP_DISPLAY_LVGL_TICK) -#define LVGL_MAX_SLEEP_MS (CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP) - -esp_err_t bsp_display_brightness_init(void) -{ - gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << BSP_LCD_BACKLIGHT), - .mode = GPIO_MODE_OUTPUT, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .pull_up_en = GPIO_PULLUP_DISABLE, - .intr_type = GPIO_INTR_DISABLE - }; - gpio_config(&io_conf); - - return ESP_OK; -} - -esp_err_t bsp_display_backlight_off(void) -{ - ESP_LOGI(TAG, "Backlight off"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 0); -} - -esp_err_t bsp_display_backlight_on(void) -{ - ESP_LOGI(TAG, "Backlight on"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 1); -} - -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io) -{ - esp_err_t ret = ESP_OK; - assert(config != NULL && config->max_transfer_sz > 0); - - ESP_RETURN_ON_ERROR(bsp_display_brightness_init(), TAG, "Brightness init failed"); - - ESP_LOGD(TAG, "Initialize SPI bus"); - const spi_bus_config_t buscfg = { - .sclk_io_num = BSP_LCD_SPI_CLK, - .mosi_io_num = BSP_LCD_SPI_MOSI, - .miso_io_num = GPIO_NUM_NC, - .quadwp_io_num = GPIO_NUM_NC, - .quadhd_io_num = GPIO_NUM_NC, - .max_transfer_sz = config->max_transfer_sz, - }; - ESP_RETURN_ON_ERROR(spi_bus_initialize(BSP_LCD_SPI_NUM, &buscfg, SPI_DMA_CH_AUTO), TAG, "SPI init failed"); - - ESP_LOGD(TAG, "Install panel IO"); - const esp_lcd_panel_io_spi_config_t io_config = { - .dc_gpio_num = BSP_LCD_DC, - .cs_gpio_num = BSP_LCD_SPI_CS, - .pclk_hz = BSP_LCD_PIXEL_CLOCK_HZ, - .lcd_cmd_bits = LCD_CMD_BITS, - .lcd_param_bits = LCD_PARAM_BITS, - .spi_mode = 2, - .trans_queue_depth = 10, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)BSP_LCD_SPI_NUM, &io_config, ret_io), err, TAG, "New panel IO failed"); - - ESP_LOGD(TAG, "Install LCD driver"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = BSP_LCD_RST, - .color_space = BSP_LCD_COLOR_SPACE, - .bits_per_pixel = BSP_LCD_BITS_PER_PIXEL, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_st7789(*ret_io, &panel_config, ret_panel), err, TAG, "New panel failed"); - - - esp_lcd_panel_reset(*ret_panel); - esp_lcd_panel_init(*ret_panel); - esp_lcd_panel_invert_color(*ret_panel, true); - return ret; - -err: - if (*ret_panel) { - esp_lcd_panel_del(*ret_panel); - } - if (*ret_io) { - esp_lcd_panel_io_del(*ret_io); - } - spi_bus_free(BSP_LCD_SPI_NUM); - return ret; -} - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg) -{ - assert(cfg != NULL); - esp_lcd_panel_io_handle_t io_handle = NULL; - esp_lcd_panel_handle_t panel_handle = NULL; - const bsp_display_config_t bsp_disp_cfg = { - .max_transfer_sz = cfg->trans_size ? (cfg->trans_size * sizeof(uint16_t)): (BSP_LCD_DRAW_BUFF_SIZE * sizeof(uint16_t)), - }; - BSP_ERROR_CHECK_RETURN_NULL(bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle)); - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - esp_lcd_panel_disp_off(panel_handle, false); -#else - esp_lcd_panel_disp_on_off(panel_handle, true); -#endif - - /* Add LCD screen */ - ESP_LOGD(TAG, "Add LCD screen"); - const lvgl_port_display_cfg_t disp_cfg = { - .io_handle = io_handle, - .panel_handle = panel_handle, - .buffer_size = cfg->buffer_size, - .trans_size = cfg->trans_size, - .double_buffer = cfg->double_buffer, - .hres = BSP_LCD_H_RES, - .vres = BSP_LCD_V_RES, - .monochrome = false, - /* Rotation values must be same as used in esp_lcd for initial settings of the screen */ - .rotation = { - .swap_xy = false, - .mirror_x = false, - .mirror_y = false, - }, - .flags = { - .buff_dma = cfg->flags.buff_dma, - .buff_spiram = cfg->flags.buff_spiram, -#if LVGL_VERSION_MAJOR >= 9 - .swap_bytes = (BSP_LCD_BIGENDIAN ? true : false), -#endif - } - }; - - return lvgl_port_add_disp(&disp_cfg); -} - -lv_display_t *bsp_display_start(void) -{ - bsp_display_cfg_t cfg = { - .lvgl_port_cfg = { - .task_priority = CONFIG_BSP_DISPLAY_LVGL_TASK_PRIORITY, - .task_stack = 6144, - .task_affinity = 1, - .timer_period_ms = LVGL_TICK_PERIOD_MS, - .task_max_sleep_ms = LVGL_MAX_SLEEP_MS, - }, - .buffer_size = BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE, - .flags = { - .buff_dma = true, - .buff_spiram = false, - } - }; - return bsp_display_start_with_config(&cfg); -} - -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg) -{ - lv_display_t *disp; - assert(cfg != NULL); - BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg)); - BSP_NULL_CHECK(disp = bsp_display_lcd_init(cfg), NULL); - - return disp; -} - -lv_indev_t *bsp_display_get_input_dev(void) -{ - return NULL; -} - -bool bsp_display_lock(uint32_t timeout_ms) -{ - return lvgl_port_lock(timeout_ms); -} - -void bsp_display_unlock(void) -{ - lvgl_port_unlock(); -} - -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation) -{ - lv_disp_set_rotation(disp, rotation); -} -#endif // (BSP_CONFIG_NO_GRAPHIC_LIB == 0) - - - - -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size) -{ - esp_err_t ret = ESP_OK; - if ((btn_array_size < BSP_BUTTON_NUM) || - (btn_array == NULL)) { - return ESP_ERR_INVALID_ARG; - } -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - /* Initialize ADC and get ADC handle */ - BSP_ERROR_CHECK_RETURN_NULL(bsp_adc_initialize()); - bsp_adc_handle = bsp_adc_get_handle(); -#endif - - if (btn_cnt) { - *btn_cnt = 0; - } - for (int i = 0; i < BSP_BUTTON_NUM; i++) { - btn_array[i] = iot_button_create(&bsp_button_config[i]); - if (btn_array[i] == NULL) { - ret = ESP_FAIL; - break; - } - if (btn_cnt) { - (*btn_cnt)++; - } - } - return ret; -} - - -#ifdef CONFIG_TOUCH_ELEM_EVENT -/* Button event handler task */ -static void button_handler_task(void *arg) -{ - (void) arg; //Unused - touch_elem_message_t element_message; - while (1) { - /* Waiting for touch element messages */ - touch_element_message_receive(&element_message, portMAX_DELAY); - if (element_message.element_type != TOUCH_ELEM_TYPE_BUTTON) { - continue; - } - /* Decode message */ - const touch_button_message_t *button_message = touch_button_get_message(&element_message); - if (button_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { - ESP_LOGI(TAG, "Button[%d] Press", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { - ESP_LOGI(TAG, "Button[%d] Release", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { - ESP_LOGI(TAG, "Button[%d] LongPress", (int)element_message.arg); - } - } -} -#elif CONFIG_TOUCH_ELEM_CALLBACK -/* Button callback routine */ -// static void button_handler(touch_button_handle_t out_handle, touch_button_message_t *out_message, void *arg) -// { -// (void) out_handle; //Unused -// if (out_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { -// ESP_LOGI(TAG, "Button[%d] Press", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { -// ESP_LOGI(TAG, "Button[%d] Release", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { -// ESP_LOGI(TAG, "Button[%d] LongPress", (int)arg); -// } -// } -#endif - -void bsp_touch_button_create(touch_button_callback_t button_callback) -{ - /* Initialize Touch Element library */ - touch_elem_global_config_t global_config = TOUCH_ELEM_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_element_install(&global_config)); - ESP_LOGI(TAG, "Touch element library installed"); - - touch_button_global_config_t button_global_config = TOUCH_BUTTON_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_button_install(&button_global_config)); - ESP_LOGI(TAG, "Touch button installed"); - for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { - touch_button_config_t button_config = { - .channel_num = channel_array[i], - .channel_sens = channel_sens_array[i] - }; - /* Create Touch buttons */ - ESP_ERROR_CHECK(touch_button_create(&button_config, &button_handle[i])); - /* Subscribe touch button events (On Press, On Release, On LongPress) */ - ESP_ERROR_CHECK(touch_button_subscribe_event(button_handle[i], - TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE | TOUCH_ELEM_EVENT_ON_LONGPRESS, - (void *)channel_array[i])); -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_EVENT)); -#elif CONFIG_TOUCH_ELEM_CALLBACK - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_CALLBACK)); - /* Register a handler function to handle event messages */ - ESP_ERROR_CHECK(touch_button_set_callback(button_handle[i], button_callback)); -#endif - /* Set LongPress event trigger threshold time */ - ESP_ERROR_CHECK(touch_button_set_longpress(button_handle[i], 2000)); - } - ESP_LOGI(TAG, "Touch buttons created"); - -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Create a handler task to handle event messages */ - xTaskCreate(&button_handler_task, "button_handler_task", 4 * 1024, NULL, 5, NULL); -#endif - - touch_element_start(); - ESP_LOGI(TAG, "Touch element library start"); -} diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c deleted file mode 100644 index d0102b9594f27b0a71b946ca26ae8fed4987c7f3..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -/* Sample rate of MSM261S4030H0 */ -#define BSP_MIC_SAMPLE_RATE (48000u) - -/* This configuration is used by default in bsp_audio_init() */ -#define BSP_I2S_SIMPLEX_MONO_CFG(_sample_rate) \ - { \ - .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ - .sample_rate = _sample_rate, \ - .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ - .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, \ - .communication_format = I2S_COMM_FORMAT_STAND_I2S, \ - .dma_buf_count = 3, \ - .dma_buf_len = 1024, \ - .use_apll = true, \ - .tx_desc_auto_clear = true, \ - .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM \ - } - - -esp_err_t bsp_adc_initialize(void) -{ - return ESP_OK; -} diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c deleted file mode 100644 index bbb57ec66f33ea613282b14aa18948e9e482765c..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; - -esp_err_t bsp_adc_initialize(void) -{ - /* ADC was initialized before */ - if (bsp_adc_handle != NULL) { - return ESP_OK; - } - - /* Initialize ADC */ - const adc_oneshot_unit_init_cfg_t init_config1 = { - .unit_id = BSP_ADC_UNIT, - }; - BSP_ERROR_CHECK_RETURN_ERR(adc_oneshot_new_unit(&init_config1, &bsp_adc_handle)); - - return ESP_OK; -} - -adc_oneshot_unit_handle_t bsp_adc_get_handle(void) -{ - return bsp_adc_handle; -} diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/idf_component.yml b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/idf_component.yml deleted file mode 100644 index db418a4c0fef82c6e19219cb9985aecbd5a05b07..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/idf_component.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: "3.1.0~1" -description: Board Support Package (BSP) for ESP32-SparkBot - -targets: - - esp32s3 - -tags: - - bsp - -dependencies: - idf: ">=4.4.5" - - espressif/esp_lvgl_port: - version: "2.4.1" - public: true - - esp32-camera: - version: "^2.0.2" - public: true - - button: - version: ">=2.5,<4.0" - public: true - - esp_codec_dev: - version: "==1.1.0" - public: true - diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/config.h b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/config.h deleted file mode 100644 index f3cb5ebe7389d59cea35c3444aaadb3c0c94b6cc..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -/************************************************************************************************** - * BSP configuration - **************************************************************************************************/ -// By default, this BSP is shipped with LVGL graphical library. Enabling this option will exclude it. -// If you want to use BSP without LVGL, select BSP version with 'noglib' suffix. -#if !defined(BSP_CONFIG_NO_GRAPHIC_LIB) // Check if the symbol is not coming from compiler definitions (-D...) -#define BSP_CONFIG_NO_GRAPHIC_LIB (0) -#endif diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/display.h b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/display.h deleted file mode 100644 index 213b4720ad7e19686aa029e4ee6b7680824ac761..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/display.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief BSP LCD - * - * This file offers API for basic LCD control. - * It is useful for users who want to use the LCD without the default Graphical Library LVGL. - * - * For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start(). - */ - -#pragma once -#include "esp_lcd_types.h" - -/* LCD color formats */ -#define ESP_LCD_COLOR_FORMAT_RGB565 (1) -#define ESP_LCD_COLOR_FORMAT_RGB888 (2) - -/* LCD display color format */ -#define BSP_LCD_COLOR_FORMAT (ESP_LCD_COLOR_FORMAT_RGB565) -/* LCD display color bytes endianess */ -#define BSP_LCD_BIGENDIAN (1) -/* LCD display color bits */ -#define BSP_LCD_BITS_PER_PIXEL (16) -/* LCD display color space */ -#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_RGB) -/* LCD display definition */ -#define BSP_LCD_H_RES (240) -#define BSP_LCD_V_RES (240) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief BSP display configuration structure - * - */ -typedef struct { - int max_transfer_sz; /*!< Maximum transfer size, in bytes. */ -} bsp_display_config_t; - -/** - * @brief Create new display panel - * - * For maximum flexibility, this function performs only reset and initialization of the display. - * You must turn on the display explicitly by calling esp_lcd_panel_disp_on_off(). - * The display's backlight is not turned on either. You can use bsp_display_backlight_on/off(), - * bsp_display_brightness_set() (on supported boards) or implement your own backlight control. - * - * If you want to free resources allocated by this function, you can use esp_lcd API, ie.: - * - * \code{.c} - * esp_lcd_panel_del(panel); - * esp_lcd_panel_io_del(io); - * spi_bus_free(spi_num_from_configuration); - * \endcode - * - * @param[in] config display configuration - * @param[out] ret_panel esp_lcd panel handle - * @param[out] ret_io esp_lcd IO handle - * @return - * - ESP_OK On success - * - Else esp_lcd failure - */ -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io); - -/** - * @brief Initialize display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_init(void); - -/** - * @brief Set display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @param[in] brightness_percent Brightness in [%] - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_set(int brightness_percent); - -/** - * @brief Turn on display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_on(void); - -/** - * @brief Turn off display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_off(void); - -#ifdef __cplusplus -} -#endif diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h deleted file mode 100644 index ac223966e45efc7116ec6792a43e6203b8e5cee2..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "bsp/esp_sparkbot_bsp.h" diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h deleted file mode 100644 index 125b5817aa4e6cd6811df8ccf12fd6759ec607d5..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief ESP BSP: ESP-SparkBot - */ - -#pragma once - -#include "sdkconfig.h" -#include "driver/gpio.h" -#include "driver/sdmmc_host.h" -#include "esp_codec_dev.h" -#include "iot_button.h" -#include "touch_element/touch_button.h" -#include "bsp/config.h" -#include "bsp/display.h" - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "driver/i2s.h" -#else -// #include "driver/i2c_master.h" -#include "driver/i2s_std.h" -#endif - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#include "lvgl.h" -#include "esp_lvgl_port.h" -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - -/************************************************************************************************** - * BSP Capabilities - **************************************************************************************************/ - -#define BSP_CAPS_DISPLAY 1 -#define BSP_CAPS_TOUCH 0 -#define BSP_CAPS_BUTTONS 1 -#define BSP_CAPS_AUDIO 1 -#define BSP_CAPS_AUDIO_SPEAKER 0 -#define BSP_CAPS_AUDIO_MIC 1 -#define BSP_CAPS_SDCARD 1 -#define BSP_CAPS_IMU 1 -#define BSP_CAPS_CAMERA 1 - -/************************************************************************************************** - * ESP-SparkBot-BSP pinout - **************************************************************************************************/ - -/* I2C */ -#define BSP_I2C_SCL (GPIO_NUM_5) -#define BSP_I2C_SDA (GPIO_NUM_4) - -/* Display */ -#define BSP_LCD_SPI_MOSI (GPIO_NUM_47) -#define BSP_LCD_SPI_CLK (GPIO_NUM_21) -#define BSP_LCD_SPI_CS (GPIO_NUM_44) -#define BSP_LCD_DC (GPIO_NUM_43) -#define BSP_LCD_RST (GPIO_NUM_NC) -#define BSP_LCD_BACKLIGHT (GPIO_NUM_46) - -/* Camera */ -#define BSP_CAMERA_XCLK (GPIO_NUM_15) -#define BSP_CAMERA_PCLK (GPIO_NUM_13) -#define BSP_CAMERA_VSYNC (GPIO_NUM_6) -#define BSP_CAMERA_HSYNC (GPIO_NUM_7) -#define BSP_CAMERA_D0 (GPIO_NUM_11) -#define BSP_CAMERA_D1 (GPIO_NUM_9) -#define BSP_CAMERA_D2 (GPIO_NUM_8) -#define BSP_CAMERA_D3 (GPIO_NUM_10) -#define BSP_CAMERA_D4 (GPIO_NUM_12) -#define BSP_CAMERA_D5 (GPIO_NUM_18) -#define BSP_CAMERA_D6 (GPIO_NUM_17) -#define BSP_CAMERA_D7 (GPIO_NUM_16) - -/* Buttons */ -#define BSP_BUTTON_BOOT_IO (GPIO_NUM_0) -#define BSP_BUTTONS_IO (GPIO_NUM_1) // All 4 buttons mapped to this GPIO -typedef enum bsp_led_t { - BSP_LED_GREEN = GPIO_NUM_3, -} bsp_led_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - * - * Buttons interface - * - * Example configuration: - * \code{.c} - * button_handle_t btns[BSP_BUTTON_NUM]; - * bsp_iot_button_create(btns, NULL, BSP_BUTTON_NUM); - * iot_button_register_cb(btns[0], ... - * \endcode - **************************************************************************************************/ -typedef enum { - BSP_BUTTON_MENU = 0, - BSP_BUTTON_PLAY, - BSP_BUTTON_DOWN, - BSP_BUTTON_UP, - BSP_BUTTON_BOOT, - BSP_BUTTON_NUM -} bsp_button_t; - -/** - * @brief Initialize all buttons - * - * Returned button handlers must be used with espressif/button component API - * - * @note For LCD panel button which is defined as BSP_BUTTON_MAIN, bsp_display_start should - * be called before call this function. - * - * @param[out] btn_array Output button array - * @param[out] btn_cnt Number of button handlers saved to btn_array, can be NULL - * @param[in] btn_array_size Size of output button array. Must be at least BSP_BUTTON_NUM - * @return - * - ESP_OK All buttons initialized - * - ESP_ERR_INVALID_ARG btn_array is too small or NULL - * - ESP_FAIL Underlaying iot_button_create failed - */ -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size); - - -void bsp_touch_button_create(touch_button_callback_t button_callback); - -/************************************************************************************************** - * - * I2C interface - * - * There are two devices connected to I2C peripheral: - * - QMA7981 Inertial measurement unit - * - OV2640 Camera module - **************************************************************************************************/ -#define BSP_I2C_NUM CONFIG_BSP_I2C_NUM - -/** - * @brief Init I2C driver - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - ESP_FAIL I2C driver installation error - * - */ -esp_err_t bsp_i2c_init(void); - -/** - * @brief Deinit I2C driver and free its resources - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - */ -esp_err_t bsp_i2c_deinit(void); - -/************************************************************************************************** - * - * Camera interface - * - * ESP-SparkBot-BSP is shipped with OV2640 camera module. - * As a camera driver, esp32-camera component is used. - * - * Example configuration: - * \code{.c} - * const camera_config_t camera_config = BSP_CAMERA_DEFAULT_CONFIG; - * esp_err_t err = esp_camera_init(&camera_config); - * \endcode - **************************************************************************************************/ -/** - * @brief ESP-SparkBot-BSP camera default configuration - * - * In this configuration we select RGB565 color format and 240x240 image size - matching the display. - * We use double-buffering for the best performance. - * Since we don't want to waste internal SRAM, we allocate the framebuffers in external PSRAM. - * By setting XCLK to 16MHz, we configure the esp32-camera driver to use EDMA when accessing the PSRAM. - * - * @attention I2C must be enabled by bsp_i2c_init(), before camera is initialized - */ -#define BSP_CAMERA_DEFAULT_CONFIG \ - { \ - .pin_pwdn = GPIO_NUM_NC, \ - .pin_reset = GPIO_NUM_NC, \ - .pin_xclk = BSP_CAMERA_XCLK, \ - .pin_sccb_sda = GPIO_NUM_NC, \ - .pin_sccb_scl = GPIO_NUM_NC, \ - .pin_d7 = BSP_CAMERA_D7, \ - .pin_d6 = BSP_CAMERA_D6, \ - .pin_d5 = BSP_CAMERA_D5, \ - .pin_d4 = BSP_CAMERA_D4, \ - .pin_d3 = BSP_CAMERA_D3, \ - .pin_d2 = BSP_CAMERA_D2, \ - .pin_d1 = BSP_CAMERA_D1, \ - .pin_d0 = BSP_CAMERA_D0, \ - .pin_vsync = BSP_CAMERA_VSYNC, \ - .pin_href = BSP_CAMERA_HSYNC, \ - .pin_pclk = BSP_CAMERA_PCLK, \ - .xclk_freq_hz = 16000000, \ - .ledc_timer = LEDC_TIMER_0, \ - .ledc_channel = LEDC_CHANNEL_0, \ - .pixel_format = PIXFORMAT_RGB565, \ - .frame_size = FRAMESIZE_240X240, \ - .jpeg_quality = 12, \ - .fb_count = 2, \ - .fb_location = CAMERA_FB_IN_PSRAM,\ - .sccb_i2c_port = BSP_I2C_NUM, \ - } - -#define BSP_CAMERA_VFLIP 1 -#define BSP_CAMERA_HMIRROR 0 - -/************************************************************************************************** - * - * SPIFFS - * - * After mounting the SPIFFS, it can be accessed with stdio functions ie.: - * \code{.c} - * FILE* f = fopen(BSP_SPIFFS_MOUNT_POINT"/hello.txt", "w"); - * fprintf(f, "Hello World!\n"); - * fclose(f); - * \endcode - **************************************************************************************************/ -#define BSP_SPIFFS_MOUNT_POINT CONFIG_BSP_SPIFFS_MOUNT_POINT - -/** - * @brief Mount SPIFFS to virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_spiffs_register was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes - */ -esp_err_t bsp_spiffs_mount(void); - -/** - * @brief Unmount SPIFFS from virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if already unmounted - */ -esp_err_t bsp_spiffs_unmount(void); - - -/************************************************************************************************** - * - * LCD interface - * - * ESP-SparkBot-BSP is shipped with 1.3inch ST7789 display controller. - * It features 16-bit colors and 240x240 resolution. - * - * LVGL is used as graphics library. LVGL is NOT thread safe, therefore the user must take LVGL mutex - * by calling bsp_display_lock() before calling any LVGL API (lv_...) and then give the mutex with - * bsp_display_unlock(). - * - * If you want to use the display without LVGL, see bsp/display.h API and use BSP version with 'noglib' suffix. - **************************************************************************************************/ -#define BSP_LCD_PIXEL_CLOCK_HZ (80 * 1000 * 1000) -#define BSP_LCD_SPI_NUM (SPI3_HOST) - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * BSP_LCD_V_RES) -#define BSP_LCD_DRAW_BUFF_DOUBLE (0) - -/** - * @brief BSP display configuration structure - */ -typedef struct { - lvgl_port_cfg_t lvgl_port_cfg; /*!< LVGL port configuration */ - uint32_t buffer_size; /*!< Size of the buffer for the screen in pixels */ - uint32_t trans_size; - bool double_buffer; /*!< True, if should be allocated two buffers */ - struct { - unsigned int buff_dma: 1; /*!< Allocated LVGL buffer will be DMA capable */ - unsigned int buff_spiram: 1; /*!< Allocated LVGL buffer will be in PSRAM */ - } flags; -} bsp_display_cfg_t; - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start(void); - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * LCD backlight must be enabled separately by calling bsp_display_brightness_set() - * - * @param cfg display configuration - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg); - -/** - * @brief Get pointer to input device (touch, buttons, ...) - * - * @note The LVGL input device is initialized in bsp_display_start() function. - * - * @return Pointer to LVGL input device or NULL when not initialized - */ -lv_indev_t *bsp_display_get_input_dev(void); - -/** - * @brief Take LVGL mutex - * - * @param timeout_ms Timeout in [ms]. 0 will block indefinitely. - * @return true Mutex was taken - * @return false Mutex was NOT taken - */ -bool bsp_display_lock(uint32_t timeout_ms); - -/** - * @brief Give LVGL mutex - * - */ -void bsp_display_unlock(void); - -/** - * @brief Rotate screen - * - * Display must be already initialized by calling bsp_display_start() - * - * @param[in] disp Pointer to LVGL display - * @param[in] rotation Angle of the display rotation - */ -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation); -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - - - -/************************************************************************************************** - * - * ADC interface - * - * There are multiple devices connected to ADC peripheral: - * - Buttons - * - * After initialization of ADC, use adc_handle when using ADC driver. - **************************************************************************************************/ - -#define BSP_ADC_UNIT ADC_UNIT_1 - -/** - * @brief Initialize ADC - * - * The ADC can be initialized inside BSP, when needed. - * - * @param[out] adc_handle Returned ADC handle - */ -esp_err_t bsp_adc_initialize(void); - - -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -/** - * @brief Get ADC handle - * - * @note This function is available only in IDF5 and higher - * - * @return ADC handle - */ -adc_oneshot_unit_handle_t bsp_adc_get_handle(void); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h b/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h deleted file mode 100644 index e00199943eef4e1c31fbc46b8a2ee91d4cb2cc15..0000000000000000000000000000000000000000 --- a/example/human_face_recognition_no_wakenet/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include "esp_check.h" -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Assert on error, if selected in menuconfig. Otherwise return error code. */ -#if CONFIG_BSP_ERROR_CHECK -#define BSP_ERROR_CHECK_RETURN_ERR(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK_RETURN_NULL(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK(x, ret) ESP_ERROR_CHECK(x) -#define BSP_NULL_CHECK(x, ret) assert(x) -#define BSP_NULL_CHECK_GOTO(x, goto_tag) assert(x) -#else -#define BSP_ERROR_CHECK_RETURN_ERR(x) do { \ - esp_err_t err_rc_ = (x); \ - if (unlikely(err_rc_ != ESP_OK)) { \ - return err_rc_; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK_RETURN_NULL(x) do { \ - if (unlikely((x) != ESP_OK)) { \ - return NULL; \ - } \ - } while(0) - -#define BSP_NULL_CHECK(x, ret) do { \ - if ((x) == NULL) { \ - return ret; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK(x, ret) do { \ - if (unlikely((x) != ESP_OK)) { \ - return ret; \ - } \ - } while(0) - -#define BSP_NULL_CHECK_GOTO(x, goto_tag) do { \ - if ((x) == NULL) { \ - goto goto_tag; \ - } \ - } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/human_face_recognition_no_wakenet/components/modules/idf_component.yml b/example/human_face_recognition_no_wakenet/components/modules/idf_component.yml index 969bef01cc40d5e6f77e894934db419f30d38288..478b715b754e0d53497877e5de2903bae46357ff 100644 --- a/example/human_face_recognition_no_wakenet/components/modules/idf_component.yml +++ b/example/human_face_recognition_no_wakenet/components/modules/idf_component.yml @@ -1,13 +1,9 @@ ## IDF Component Manager Manifest File dependencies: - espressif/esp32-camera: - version: "^2" - public: true + # espressif/esp32-camera: + # version: "^2" + # public: true + espressif/esp32-camera: 2.0.4 espressif/mdns: version: "^1" public: true - espressif/esp32_s3_eye_noglib: - version: "~3.0.3" - public: true - rules: - - if: "target in [esp32s3]" diff --git a/example/human_face_recognition_no_wakenet/main/idf_component.yml b/example/human_face_recognition_no_wakenet/main/idf_component.yml index 8c5cac0300b266be672865bdaa7675ad8b11ee87..ef23ec6f23659db89a40ccaa369c63e2d7841d91 100644 --- a/example/human_face_recognition_no_wakenet/main/idf_component.yml +++ b/example/human_face_recognition_no_wakenet/main/idf_component.yml @@ -2,3 +2,4 @@ dependencies: espressif/esp-sr: "~1.9.4" esp_mmap_assets: "1.*" + espressif2022/esp_sparkbot: "*" diff --git a/example/human_face_recognition_no_wakenet/main/mmap_generate_audio.h b/example/human_face_recognition_no_wakenet/main/mmap_generate_audio.h index 15eb5feb8d5898af983aadd6f1abf5b55780701d..4864f5a5b9c031f21e1cec10ff98b82c837337e5 100644 --- a/example/human_face_recognition_no_wakenet/main/mmap_generate_audio.h +++ b/example/human_face_recognition_no_wakenet/main/mmap_generate_audio.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ diff --git a/example/human_face_recognition_no_wakenet/main/src/app_speech.cpp b/example/human_face_recognition_no_wakenet/main/src/app_speech.cpp index 479f7ce5e44d401fe23915614c9ff3ccef315728..3569042df00582c9486ceb17fb9d419a72c8f587 100644 --- a/example/human_face_recognition_no_wakenet/main/src/app_speech.cpp +++ b/example/human_face_recognition_no_wakenet/main/src/app_speech.cpp @@ -13,7 +13,7 @@ #include "esp_afe_sr_models.h" #include "esp_mn_iface.h" #include "esp_mn_models.h" -#include "bsp_board_extra.h" +#include "esp-bsp.h" #include "mmap_generate_audio.h" @@ -38,24 +38,24 @@ static esp_err_t i2s_init(uint8_t i2s_num, uint32_t sample_rate, int channel_for { esp_err_t ret_val = ESP_OK; - spk_hdl = bsp_extra_audio_codec_speaker_init(); + spk_hdl = bsp_audio_codec_speaker_init(); esp_codec_dev_set_out_vol(spk_hdl, 100); esp_codec_dev_sample_info_t fs_spk = { - .bits_per_sample = CODEC_DEFAULT_BIT_WIDTH, + .bits_per_sample = 16, .channel = 1, - .sample_rate = CODEC_DEFAULT_SAMPLE_RATE, + .sample_rate = 16000, }; esp_codec_dev_open(spk_hdl, &fs_spk); - mic_hdl = bsp_extra_audio_codec_microphone_init(); + mic_hdl = bsp_audio_codec_microphone_init(); esp_codec_dev_sample_info_t fs_mic = { - .bits_per_sample = CODEC_DEFAULT_BIT_WIDTH, + .bits_per_sample = 16, .channel = 1, - .sample_rate = CODEC_DEFAULT_SAMPLE_RATE, + .sample_rate = 16000, }; - esp_codec_dev_set_in_gain(mic_hdl, CODEC_DEFAULT_ADC_VOLUME); + esp_codec_dev_set_in_gain(mic_hdl, 24.0); esp_codec_dev_open(mic_hdl, &fs_mic); return ret_val; diff --git a/example/human_face_recognition_no_wakenet/sdkconfig b/example/human_face_recognition_no_wakenet/sdkconfig index cd1ae84efa1cfe0bd7fc368a35a5766f0caa0fec..45d4af6701f625b45ccf155a34ec0bf951292a30 100644 --- a/example/human_face_recognition_no_wakenet/sdkconfig +++ b/example/human_face_recognition_no_wakenet/sdkconfig @@ -1,9 +1,7 @@ # # Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) 5.3.1 Project Configuration +# Espressif IoT Development Framework (ESP-IDF) 5.5.0 Project Configuration # -CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 -CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 CONFIG_SOC_ADC_SUPPORTED=y CONFIG_SOC_UART_SUPPORTED=y CONFIG_SOC_PCNT_SUPPORTED=y @@ -14,6 +12,8 @@ CONFIG_SOC_GDMA_SUPPORTED=y CONFIG_SOC_AHB_GDMA_SUPPORTED=y CONFIG_SOC_GPTIMER_SUPPORTED=y CONFIG_SOC_LCDCAM_SUPPORTED=y +CONFIG_SOC_LCDCAM_I80_LCD_SUPPORTED=y +CONFIG_SOC_LCDCAM_RGB_LCD_SUPPORTED=y CONFIG_SOC_MCPWM_SUPPORTED=y CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y CONFIG_SOC_CACHE_SUPPORT_WRAP=y @@ -119,6 +119,7 @@ CONFIG_SOC_GPIO_OUT_RANGE_MAX=48 CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x0001FFFFFC000000 CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 +CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_GPIO_OUT_AUTO_ENABLE=y @@ -133,6 +134,7 @@ CONFIG_SOC_I2C_SUPPORT_RTC=y CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y +CONFIG_SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE=y CONFIG_SOC_I2S_NUM=2 CONFIG_SOC_I2S_HW_VERSION_2=y CONFIG_SOC_I2S_SUPPORTS_XTAL=y @@ -140,12 +142,15 @@ CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y CONFIG_SOC_I2S_SUPPORTS_PCM=y CONFIG_SOC_I2S_SUPPORTS_PDM=y CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y -CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 +CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4 CONFIG_SOC_I2S_SUPPORTS_TDM=y CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_LEDC_TIMER_NUM=4 CONFIG_SOC_LEDC_CHANNEL_NUM=8 CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=14 CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y @@ -162,6 +167,8 @@ CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=1 CONFIG_SOC_MMU_PERIPH_NUM=1 +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 CONFIG_SOC_PCNT_GROUPS=1 CONFIG_SOC_PCNT_UNITS_PER_GROUP=4 CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 @@ -189,6 +196,10 @@ CONFIG_SOC_LCD_RGB_PANELS=1 CONFIG_SOC_LCD_I80_BUS_WIDTH=16 CONFIG_SOC_LCD_RGB_DATA_WIDTH=16 CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y +CONFIG_SOC_LCDCAM_I80_NUM_BUSES=1 +CONFIG_SOC_LCDCAM_I80_BUS_WIDTH=16 +CONFIG_SOC_LCDCAM_RGB_NUM_PANELS=1 +CONFIG_SOC_LCDCAM_RGB_DATA_WIDTH=16 CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128 CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=549 CONFIG_SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH=128 @@ -217,7 +228,7 @@ CONFIG_SOC_SPI_SCT_SUPPORTED=y CONFIG_SOC_SPI_SCT_REG_NUM=14 CONFIG_SOC_SPI_SCT_BUFFER_NUM_MAX=y CONFIG_SOC_SPI_SCT_CONF_BITLEN_MAX=0x3FFFA -CONFIG_SOC_MEMSPI_SRC_FREQ_120M=y +CONFIG_SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y @@ -241,6 +252,7 @@ CONFIG_SOC_TOUCH_SENSOR_NUM=15 CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y CONFIG_SOC_TOUCH_SUPPORT_WATERPROOF=y CONFIG_SOC_TOUCH_SUPPORT_PROX_SENSING=y +CONFIG_SOC_TOUCH_SUPPORT_DENOISE_CHAN=y CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3 CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 @@ -295,10 +307,12 @@ CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y CONFIG_SOC_PM_CPU_RETENTION_BY_RTCCNTL=y CONFIG_SOC_PM_MODEM_RETENTION_BY_BACKUPDMA=y +CONFIG_SOC_PM_MODEM_PD_BY_SW=y CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D2=y CONFIG_SOC_EFUSE_DIS_DOWNLOAD_ICACHE=y CONFIG_SOC_EFUSE_DIS_DOWNLOAD_DCACHE=y CONFIG_SOC_EFUSE_HARD_DIS_JTAG=y @@ -331,6 +345,7 @@ CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y CONFIG_SOC_SPI_MEM_SUPPORT_WRAP=y CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY=y CONFIG_SOC_MEMSPI_CORE_CLK_SHARED_WITH_PSRAM=y +CONFIG_SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP=y CONFIG_SOC_COEX_HW_PTI=y CONFIG_SOC_EXTERNAL_COEX_LEADER_TX_LINE=y CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y @@ -355,10 +370,11 @@ CONFIG_SOC_ULP_HAS_ADC=y CONFIG_SOC_PHY_COMBO_MODULE=y CONFIG_IDF_CMAKE=y CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TOOLCHAIN_GCC=y CONFIG_IDF_TARGET_ARCH_XTENSA=y CONFIG_IDF_TARGET_ARCH="xtensa" CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_INIT_VERSION="5.2.3" +CONFIG_IDF_INIT_VERSION="5.5.0" CONFIG_IDF_TARGET_ESP32S3=y CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 @@ -385,11 +401,26 @@ CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y CONFIG_BOOTLOADER_PROJECT_VER=1 # end of Bootloader manager +# +# Application Rollback +# +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# end of Application Rollback + +# +# Bootloader Rollback +# +# end of Bootloader Rollback + CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set + +# +# Log +# # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set @@ -398,6 +429,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=3 +# +# Format +# +# CONFIG_BOOTLOADER_LOG_COLORS is not set +CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y +# end of Format +# end of Log + # # Serial Flash Configurations # @@ -412,7 +451,6 @@ CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 -# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set @@ -468,6 +506,7 @@ CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG=y CONFIG_ESP_ROM_HAS_SW_FLOAT=y CONFIG_ESP_ROM_HAS_VERSION=y CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y +CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y # # Boot ROM Behavior @@ -494,7 +533,6 @@ CONFIG_ESPTOOLPY_FLASHMODE="dio" CONFIG_ESPTOOLPY_FLASHFREQ_80M=y # CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y CONFIG_ESPTOOLPY_FLASHFREQ="80m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set @@ -521,6 +559,7 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 # CONFIG_PARTITION_TABLE_SINGLE_APP is not set # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" @@ -765,6 +804,7 @@ CONFIG_COMPILER_OPTIMIZATION_DEBUG=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 # CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set @@ -775,14 +815,18 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y # CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set # CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set # CONFIG_COMPILER_DUMP_RTL_FILES is not set CONFIG_COMPILER_RT_LIB_GCCLIB=y CONFIG_COMPILER_RT_LIB_NAME="gcc" -# CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING is not set -CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y +CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y +# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set +# CONFIG_COMPILER_STATIC_ANALYZER is not set # end of Compiler options # @@ -880,6 +924,12 @@ CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y # # CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set # end of Legacy Temperature Sensor Driver Configurations + +# +# Legacy Touch Sensor Driver Configurations +# +# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy Touch Sensor Driver Configurations # end of Driver Configurations # @@ -917,6 +967,7 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # CONFIG_ESP_COEX_ENABLED=y # CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set +# CONFIG_ESP_COEX_GPIO_DEBUG is not set # end of Wireless Coexistence # @@ -945,6 +996,7 @@ CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y # # CONFIG_I2C_ISR_IRAM_SAFE is not set # CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set # end of ESP-Driver:I2C Configurations # @@ -1062,6 +1114,7 @@ CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y # CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set # CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set # CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set +CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 # end of ESP HTTP client # @@ -1074,6 +1127,7 @@ CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set # CONFIG_HTTPD_WS_SUPPORT is not set # CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 # end of HTTP Server # @@ -1081,12 +1135,15 @@ CONFIG_HTTPD_PURGE_BUF_LEN=32 # # CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set # CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 # end of ESP HTTPS OTA # # ESP HTTPS server # # CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 +# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set # end of ESP HTTPS server # @@ -1107,6 +1164,12 @@ CONFIG_ESP_REV_MIN_FULL=0 # CONFIG_ESP32S3_REV_MAX_FULL=99 CONFIG_ESP_REV_MAX_FULL=99 +CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 +CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=199 + +# +# Maximum Supported ESP32-S3 eFuse Block Revision (eFuse Block Rev v1.99) +# # end of Chip revision # @@ -1159,6 +1222,7 @@ CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y # CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y # CONFIG_GDMA_ISR_IRAM_SAFE is not set +CONFIG_GDMA_OBJ_DRAM_SAFE=y # CONFIG_GDMA_ENABLE_DEBUG_LOG is not set # end of GDMA Configurations @@ -1173,33 +1237,32 @@ CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y # end of Hardware Settings # -# LCD and Touch Panel +# ESP-Driver:LCD Controller Configurations # - -# -# LCD Touch Drivers are maintained in the IDF Component Registry -# - -# -# LCD Peripheral Configuration -# -CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 # CONFIG_LCD_ENABLE_DEBUG_LOG is not set # CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set -# end of LCD Peripheral Configuration -# end of LCD and Touch Panel +# end of ESP-Driver:LCD Controller Configurations + +# +# ESP-MM: Memory Management Configurations +# +# CONFIG_ESP_MM_CACHE_MSYNC_C2M_CHUNKED_OPS is not set +# end of ESP-MM: Memory Management Configurations # # ESP NETIF Adapter # CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set CONFIG_ESP_NETIF_TCPIP_LWIP=y # CONFIG_ESP_NETIF_LOOPBACK is not set CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y # CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set # CONFIG_ESP_NETIF_L2_TAP is not set # CONFIG_ESP_NETIF_BRIDGE_EN is not set +# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set # end of ESP NETIF Adapter # @@ -1223,12 +1286,14 @@ CONFIG_ESP_PHY_RF_CAL_PARTIAL=y # CONFIG_ESP_PHY_RF_CAL_FULL is not set CONFIG_ESP_PHY_CALIBRATION_MODE=0 # CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set +# CONFIG_ESP_PHY_RECORD_USED_TIME is not set # end of PHY # # Power Management # # CONFIG_PM_ENABLE is not set +# CONFIG_PM_SLP_IRAM_OPT is not set CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y CONFIG_PM_RESTORE_CACHE_TAGMEM_AFTER_LIGHT_SLEEP=y # end of Power Management @@ -1245,7 +1310,6 @@ CONFIG_SPIRAM=y CONFIG_SPIRAM_MODE_OCT=y CONFIG_SPIRAM_TYPE_AUTO=y # CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y CONFIG_SPIRAM_CLK_IO=30 CONFIG_SPIRAM_CS_IO=26 # CONFIG_SPIRAM_XIP_FROM_PSRAM is not set @@ -1263,6 +1327,7 @@ CONFIG_SPIRAM_USE_CAPS_ALLOC=y CONFIG_SPIRAM_MEMTEST=y # CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config # end of ESP PSRAM @@ -1272,6 +1337,11 @@ CONFIG_SPIRAM_MEMTEST=y # CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set # end of ESP Ringbuf +# +# ESP Security Specific +# +# end of ESP Security Specific + # # ESP System Settings # @@ -1415,7 +1485,6 @@ CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 # CONFIG_ESP_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=32 CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32 CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y # CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set @@ -1426,7 +1495,6 @@ CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP_WIFI_TX_BA_WIN=6 CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP_WIFI_RX_BA_WIN=6 -# CONFIG_ESP_WIFI_AMSDU_TX_ENABLED is not set CONFIG_ESP_WIFI_NVS_ENABLED=y CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set @@ -1518,6 +1586,9 @@ CONFIG_FATFS_TIMEOUT_MS=10000 CONFIG_FATFS_PER_FILE_CACHE=y CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y # CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_USE_STRFUNC_NONE=y +# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set +# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 # CONFIG_FATFS_IMMEDIATE_FSYNC is not set # CONFIG_FATFS_USE_LABEL is not set @@ -1543,6 +1614,7 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 # CONFIG_FREERTOS_USE_TICK_HOOK is not set CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 # CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set +CONFIG_FREERTOS_USE_TIMERS=y CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" # CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set # CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set @@ -1570,6 +1642,7 @@ CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y CONFIG_FREERTOS_ISR_STACKSIZE=1536 CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y # CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set @@ -1578,6 +1651,12 @@ CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # end of Port +# +# Extra +# +CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y +# end of Extra + CONFIG_FREERTOS_PORT=y CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y @@ -1598,6 +1677,7 @@ CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 CONFIG_HAL_WDT_USE_ROM_IMPL=y CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y +# CONFIG_HAL_ECDSA_GEN_SIG_CM is not set # end of Hardware Abstraction Layer (HAL) and Low Level (LL) # @@ -1616,7 +1696,11 @@ CONFIG_HEAP_TRACING_OFF=y # end of Heap memory debugging # -# Log output +# Log +# + +# +# Log Level # # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set @@ -1629,11 +1713,29 @@ CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set CONFIG_LOG_MAXIMUM_LEVEL=3 + +# +# Level Settings +# # CONFIG_LOG_MASTER_LEVEL is not set -CONFIG_LOG_COLORS=y +CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y +# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set +# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y +# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set +CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 +# end of Level Settings +# end of Log Level + +# +# Format +# +# CONFIG_LOG_COLORS is not set CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set -# end of Log output +# end of Format +# end of Log # # LWIP @@ -1672,6 +1774,8 @@ CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set +# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y # CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set @@ -1686,6 +1790,7 @@ CONFIG_LWIP_DHCPS=y CONFIG_LWIP_DHCPS_LEASE_UNIT=60 CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y +CONFIG_LWIP_DHCPS_ADD_DNS=y # end of DHCP server # CONFIG_LWIP_AUTOIP is not set @@ -1744,9 +1849,12 @@ CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF -# CONFIG_LWIP_PPP_SUPPORT is not set CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 +CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 +CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 +# CONFIG_LWIP_PPP_SUPPORT is not set # CONFIG_LWIP_SLIP_SUPPORT is not set # @@ -1776,8 +1884,11 @@ CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 # # DNS # +CONFIG_LWIP_DNS_MAX_HOST_IP=1 CONFIG_LWIP_DNS_MAX_SERVERS=3 # CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set +# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set # end of DNS CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 @@ -1801,8 +1912,10 @@ CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y -# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_NONE is not set +CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT=y # CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set # end of Hooks @@ -1864,6 +1977,7 @@ CONFIG_MBEDTLS_HAVE_TIME=y # CONFIG_MBEDTLS_HAVE_TIME_DATE is not set CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y CONFIG_MBEDTLS_SHA512_C=y +# CONFIG_MBEDTLS_SHA3_C is not set CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y # CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set # CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set @@ -1917,6 +2031,8 @@ CONFIG_MBEDTLS_X509_CSR_PARSE_C=y # end of Certificates CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y +CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y # CONFIG_MBEDTLS_DHM_C is not set CONFIG_MBEDTLS_ECDH_C=y CONFIG_MBEDTLS_ECDSA_C=y @@ -1934,12 +2050,13 @@ CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y CONFIG_MBEDTLS_ECP_NIST_OPTIM=y -CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM is not set # CONFIG_MBEDTLS_POLY1305_C is not set # CONFIG_MBEDTLS_CHACHA20_C is not set # CONFIG_MBEDTLS_HKDF_C is not set # CONFIG_MBEDTLS_THREADING_C is not set CONFIG_MBEDTLS_ERROR_STRINGS=y +CONFIG_MBEDTLS_FS_IO=y # end of mbedTLS # @@ -1959,20 +2076,21 @@ CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y # end of ESP-MQTT Configurations # -# Newlib +# LibC # -CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set -CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y -# CONFIG_NEWLIB_NANO_FORMAT is not set -CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y -# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set -# end of Newlib +CONFIG_LIBC_NEWLIB=y +CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set +# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set +CONFIG_LIBC_STDIN_LINE_ENDING_CR=y +# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set +CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set +# end of LibC CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y @@ -1982,6 +2100,7 @@ CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y # CONFIG_NVS_ENCRYPTION is not set # CONFIG_NVS_ASSERT_ERROR_CHECK is not set # CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set +# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set # end of NVS # @@ -1990,25 +2109,10 @@ CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y # CONFIG_OPENTHREAD_ENABLED is not set # -# Thread Operational Dataset +# OpenThread Spinel # -CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-ESP" -CONFIG_OPENTHREAD_MESH_LOCAL_PREFIX="fd00:db8:a0:0::/64" -CONFIG_OPENTHREAD_NETWORK_CHANNEL=15 -CONFIG_OPENTHREAD_NETWORK_PANID=0x1234 -CONFIG_OPENTHREAD_NETWORK_EXTPANID="dead00beef00cafe" -CONFIG_OPENTHREAD_NETWORK_MASTERKEY="00112233445566778899aabbccddeeff" -CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53" -# end of Thread Operational Dataset - -CONFIG_OPENTHREAD_XTAL_ACCURACY=130 # CONFIG_OPENTHREAD_SPINEL_ONLY is not set -CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE=y - -# -# Thread Address Query Config -# -# end of Thread Address Query Config +# end of OpenThread Spinel # end of OpenThread # @@ -2064,9 +2168,9 @@ CONFIG_SPI_FLASH_HPM_AUTO=y CONFIG_SPI_FLASH_HPM_ON=y CONFIG_SPI_FLASH_HPM_DC_AUTO=y # CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set -CONFIG_SPI_FLASH_SUSPEND_QVL_SUPPORTED=y # CONFIG_SPI_FLASH_AUTO_SUSPEND is not set CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 +# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set # end of Optional and Experimental Features (READ DOCS FIRST) # end of Main Flash configuration @@ -2192,13 +2296,20 @@ CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y # CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set # -# Root Hub configuration +# Hub Driver Configuration +# + +# +# Root Port configuration # CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 CONFIG_USB_HOST_RESET_HOLD_MS=30 CONFIG_USB_HOST_RESET_RECOVERY_MS=30 CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 -# end of Root Hub configuration +# end of Root Port configuration + +# CONFIG_USB_HOST_HUBS_SUPPORTED is not set +# end of Hub Driver Configuration # CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK is not set CONFIG_USB_OTG_SUPPORTED=y @@ -2220,6 +2331,8 @@ CONFIG_VFS_MAX_COUNT=8 # CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 # end of Host File System I/O (Semihosting) + +CONFIG_VFS_INITIALIZE_DEV_NULL=y # end of Virtual file system # @@ -2235,56 +2348,10 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y # CONFIG_WIFI_PROV_STA_FAST_SCAN is not set # end of Wi-Fi Provisioning Manager -# -# Board Support Package -# -CONFIG_BSP_I2S_NUM=1 -# end of Board Support Package - -# -# Board Support Package -# -CONFIG_BSP_ERROR_CHECK=y - -# -# I2C -# -CONFIG_BSP_I2C_NUM=1 -CONFIG_BSP_I2C_FAST_MODE=y -CONFIG_BSP_I2C_CLK_SPEED_HZ=400000 -# end of I2C - -# -# SPIFFS - Virtual File System -# -# CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL is not set -CONFIG_BSP_SPIFFS_MOUNT_POINT="/spiffs" -CONFIG_BSP_SPIFFS_PARTITION_LABEL="storage" -CONFIG_BSP_SPIFFS_MAX_FILES=2 -# end of SPIFFS - Virtual File System - -# -# uSD card - Virtual File System -# -# CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL is not set -CONFIG_BSP_SD_MOUNT_POINT="/sdcard" -# end of uSD card - Virtual File System - -# -# Display -# -CONFIG_BSP_DISPLAY_LVGL_TASK_PRIORITY=2 -CONFIG_BSP_DISPLAY_LVGL_TICK=5 -CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP=1 -CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH=1 -# end of Display -# end of Board Support Package - # # ESP-WHO Configuration # @@ -2332,12 +2399,45 @@ CONFIG_S8=y # end of ESP-WHO Configuration # -# Audio playback +# Board Support Package +# +CONFIG_BSP_ERROR_CHECK=y + +# +# I2C +# +CONFIG_BSP_I2C_NUM=1 +CONFIG_BSP_I2C_FAST_MODE=y +CONFIG_BSP_I2C_CLK_SPEED_HZ=400000 +# end of I2C + +# +# SPIFFS - Virtual File System +# +# CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL is not set +CONFIG_BSP_SPIFFS_MOUNT_POINT="/spiffs" +CONFIG_BSP_SPIFFS_PARTITION_LABEL="storage" +CONFIG_BSP_SPIFFS_MAX_FILES=2 +# end of SPIFFS - Virtual File System + # -CONFIG_AUDIO_PLAYER_ENABLE_MP3=y -CONFIG_AUDIO_PLAYER_ENABLE_WAV=y -CONFIG_AUDIO_PLAYER_LOG_LEVEL=0 -# end of Audio playback +# uSD card - Virtual File System +# +# CONFIG_BSP_SD_FORMAT_ON_MOUNT_FAIL is not set +CONFIG_BSP_SD_MOUNT_POINT="/sdcard" +# end of uSD card - Virtual File System + +# +# Display +# +CONFIG_BSP_DISPLAY_LVGL_TASK_PRIORITY=2 +CONFIG_BSP_DISPLAY_LVGL_TICK=5 +CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP=1 +CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH=1 +# end of Display + +CONFIG_BSP_I2S_NUM=1 +# end of Board Support Package # # IoT Button @@ -2346,7 +2446,6 @@ CONFIG_BUTTON_PERIOD_TIME_MS=5 CONFIG_BUTTON_DEBOUNCE_TICKS=2 CONFIG_BUTTON_SHORT_PRESS_TIME_MS=180 CONFIG_BUTTON_LONG_PRESS_TIME_MS=1500 -CONFIG_BUTTON_LONG_PRESS_TOLERANCE_MS=20 CONFIG_BUTTON_SERIAL_TIME_MS=20 # CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE is not set CONFIG_ADC_BUTTON_MAX_CHANNEL=3 @@ -2399,7 +2498,6 @@ CONFIG_BF20A6_SUPPORT=y # CONFIG_SC101IOT_SUPPORT is not set CONFIG_SC030IOT_SUPPORT=y # CONFIG_SC031GS_SUPPORT is not set -CONFIG_MEGA_CCM_SUPPORT=y # CONFIG_SCCB_HARDWARE_I2C_PORT0 is not set CONFIG_SCCB_HARDWARE_I2C_PORT1=y CONFIG_SCCB_CLK_FREQ=100000 @@ -2410,37 +2508,9 @@ CONFIG_CAMERA_CORE0=y # CONFIG_CAMERA_CORE1 is not set # CONFIG_CAMERA_NO_AFFINITY is not set CONFIG_CAMERA_DMA_BUFFER_SIZE_MAX=32768 -CONFIG_CAMERA_JPEG_MODE_FRAME_SIZE_AUTO=y -# CONFIG_CAMERA_JPEG_MODE_FRAME_SIZE_CUSTOM is not set # CONFIG_CAMERA_CONVERTER_ENABLED is not set -# CONFIG_LCD_CAM_ISR_IRAM_SAFE is not set # end of Camera configuration -# -# Board Support Package -# - -# -# I2C -# -# end of I2C - -# -# SPIFFS - Virtual File System -# -# end of SPIFFS - Virtual File System - -# -# uSD card - Virtual File System -# -# end of uSD card - Virtual File System - -# -# Display -# -# end of Display -# end of Board Support Package - # # Audio Codec Device Configuration # @@ -2462,6 +2532,19 @@ CONFIG_CODEC_TAS5805M_SUPPORT=y CONFIG_MMAP_FILE_NAME_LENGTH=16 # end of mmap file support format +# +# Bus Options +# + +# +# I2C Bus Options +# +CONFIG_I2C_BUS_DYNAMIC_CONFIG=y +CONFIG_I2C_MS_TO_WAIT=200 +CONFIG_I2C_BUS_BACKWARD_CONFIG=y +# end of I2C Bus Options +# end of Bus Options + # # mDNS # @@ -2474,6 +2557,8 @@ CONFIG_MDNS_TASK_STACK_SIZE=4096 CONFIG_MDNS_TASK_AFFINITY_CPU0=y # CONFIG_MDNS_TASK_AFFINITY_CPU1 is not set CONFIG_MDNS_TASK_AFFINITY=0x0 +# CONFIG_MDNS_TASK_CREATE_FROM_SPIRAM is not set +CONFIG_MDNS_TASK_CREATE_FROM_INTERNAL=y CONFIG_MDNS_SERVICE_ADD_TIMEOUT_MS=2000 CONFIG_MDNS_TIMER_PERIOD_MS=100 # CONFIG_MDNS_NETWORKING_SOCKET is not set @@ -2878,6 +2963,7 @@ CONFIG_LV_BUILD_EXAMPLES=y # Deprecated options for backward compatibility # CONFIG_APP_BUILD_TYPE_ELF_RAM is not set # CONFIG_NO_BLOBS is not set +# CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set @@ -2885,7 +2971,6 @@ CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set CONFIG_LOG_BOOTLOADER_LEVEL=3 -# CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set CONFIG_FLASHMODE_QIO=y # CONFIG_FLASHMODE_QOUT is not set @@ -2987,7 +3072,6 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 # CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 -CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y @@ -2996,7 +3080,6 @@ CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_ESP32_WIFI_RX_BA_WIN=6 -# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set @@ -3025,6 +3108,7 @@ CONFIG_TIMER_TASK_PRIORITY=1 CONFIG_TIMER_TASK_STACK_DEPTH=2048 CONFIG_TIMER_QUEUE_LENGTH=10 # CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y # CONFIG_HAL_ASSERTION_SILIENT is not set # CONFIG_L2_TO_L3_COPY is not set CONFIG_ESP_GRATUITOUS_ARP=y @@ -3048,11 +3132,22 @@ CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_PPP_SUPPORT is not set +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER=y CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_SYSTIMER is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 diff --git a/example/human_face_recognition_no_wakenet/sdkconfig.defaults b/example/human_face_recognition_no_wakenet/sdkconfig.defaults index 460ffe0c195818d756532e40fd260615baa11d01..5736b2cd5ec7a25d22eb323befcf70a8bd97bbfd 100644 --- a/example/human_face_recognition_no_wakenet/sdkconfig.defaults +++ b/example/human_face_recognition_no_wakenet/sdkconfig.defaults @@ -40,3 +40,4 @@ CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG=y CONFIG_ESP_WIFI_GMAC_SUPPORT=n CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=n CONFIG_CAMERA_MODULE_ESP_S3_EYE=y +CONFIG_I2C_BUS_BACKWARD_CONFIG=y diff --git a/example/tank/sparkbot_motion_control/components/bsp_extra/CMakeLists.txt b/example/tank/sparkbot_motion_control/components/bsp_extra/CMakeLists.txt deleted file mode 100644 index 2abe51240a48e4876975235d90038ce15b1d61ba..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/bsp_extra/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -set(SRCS "") -list(APPEND SRCS - "src/bsp_board_extra.c" -) - -set(INCLUDE_DIRS "") -list(APPEND INCLUDE_DIRS "include") - -foreach(SRC_DIR IN LISTS SRC_DIRS) - file(GLOB_RECURSE SRC ${SRC_DIR}/*.c) - list(APPEND SRCS ${SRC}) - list(APPEND INCLUDE_DIRS ${SRC_DIR}/include) -endforeach() - -idf_component_register( - SRCS ${SRCS} - INCLUDE_DIRS ${INCLUDE_DIRS} - REQUIRES driver - PRIV_REQUIRES esp_timer fatfs esp_psram esp_mm -) - -target_compile_options( - ${COMPONENT_LIB} PRIVATE - -Wno-format - -Wno-int-conversion - -Wno-incompatible-pointer-types - -Wunused-function - -Wno-unused-variable - -Wno-unused-function - -Wno-overflow - -Wno-unused-but-set-variable - -Wno-discarded-qualifiers) diff --git a/example/tank/sparkbot_motion_control/components/bsp_extra/Kconfig b/example/tank/sparkbot_motion_control/components/bsp_extra/Kconfig deleted file mode 100644 index ec558673078adf7029bbfaa1fe514a30c460f7a6..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/bsp_extra/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -menu "Board Support Package" - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/tank/sparkbot_motion_control/components/bsp_extra/LICENSE b/example/tank/sparkbot_motion_control/components/bsp_extra/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/bsp_extra/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/tank/sparkbot_motion_control/components/bsp_extra/idf_component.yml b/example/tank/sparkbot_motion_control/components/bsp_extra/idf_component.yml deleted file mode 100644 index eca5daba964c5d6f8e2c446d320d9f4e03aee15e..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/bsp_extra/idf_component.yml +++ /dev/null @@ -1,22 +0,0 @@ -dependencies: - - espressif/esp_sparkbot_bsp: - version: "*" - path: ../esp_sparkbot_bsp - - esp_codec_dev: - public: true - version: "==1.1.0" - - chmorgan/esp-audio-player: - version: "1.0.*" - public: true - - chmorgan/esp-file-iterator: - version: "1.0.0" - public: true - -description: Board Support Package for ESP32-P4-Function-ev-board -targets: -- esp32s3 -version: 0.0.1 diff --git a/example/tank/sparkbot_motion_control/components/bsp_extra/include/bsp_board_extra.h b/example/tank/sparkbot_motion_control/components/bsp_extra/include/bsp_board_extra.h deleted file mode 100644 index 381a7156b026399f87d6e6254dc8821ed938c725..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/bsp_extra/include/bsp_board_extra.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include -#include "esp_codec_dev.h" -#include "esp_err.h" -#include "driver/gpio.h" -#include "driver/i2s_std.h" -#include "audio_player.h" -#include "file_iterator.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define BSP_I2S_SCLK (GPIO_NUM_39) -#define BSP_I2S_MCLK (GPIO_NUM_45) -#define BSP_I2S_LCLK (GPIO_NUM_41) -#define BSP_I2S_DOUT (GPIO_NUM_42) // To Codec ES8311 -#define BSP_I2S_DSIN (GPIO_NUM_40) // From Codec ES8311 -#define BSP_POWER_AMP_IO (GPIO_NUM_NC) - -#define CODEC_DEFAULT_SAMPLE_RATE (16000) -#define CODEC_DEFAULT_BIT_WIDTH (16) -#define CODEC_DEFAULT_ADC_VOLUME (24.0) -#define CODEC_DEFAULT_CHANNEL (2) -#define CODEC_DEFAULT_VOLUME (60) - -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MAX (95) -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MIN (0) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) - -/************************************************************************************************** - * - * I2S audio interface - * - * There are two devices connected to the I2S peripheral: - * - Codec ES8311 for output (playback) path - * - ADC ES7210 for input (recording) path - * - * For speaker initialization use `bsp_extra_audio_codec_speaker_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * For microphone initialization use `bsp_extra_audio_codec_microphone_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * After speaker or microphone initialization, use functions from esp_codec_dev for play/record audio. - * Example audio play: - * \code{.c} - * esp_codec_dev_set_out_vol(spk_codec_dev, DEFAULT_VOLUME); - * esp_codec_dev_open(spk_codec_dev, &fs); - * esp_codec_dev_write(spk_codec_dev, wav_bytes, bytes_read_from_spiffs); - * esp_codec_dev_close(spk_codec_dev); - * \endcode - **************************************************************************************************/ -/** - * @brief Init audio - * - * @note There is no deinit audio function. Users can free audio resources by calling `i2s_del_channel()`. - * @note This function wiil call `bsp_io_expander_init()` to setup and enable the control pin of audio power amplifier. - * @note This function will be called in `bsp_extra_audio_codec_speaker_init()` and `bsp_extra_audio_codec_microphone_init()`. - * - * @param[in] i2s_config I2S configuration. Pass NULL to use default values (Mono, duplex, 16bit, 22050 Hz) - * @return - * - ESP_OK On success - * - ESP_ERR_NOT_SUPPORTED The communication mode is not supported on the current chip - * - ESP_ERR_INVALID_ARG NULL pointer or invalid configuration - * - ESP_ERR_NOT_FOUND No available I2S channel found - * - ESP_ERR_NO_MEM No memory for storing the channel information - * - ESP_ERR_INVALID_STATE This channel has not initialized or already started - * - other error codes - */ -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config); - -/** - * @brief Initialize speaker codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void); - -/** - * @brief Initialize microphone codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void); - -/************************************************************************************************** - * BSP Extra interface - * Mainly provided some I2S Codec interfaces. - **************************************************************************************************/ -/** - * @brief Player set mute. - * - * @param enable: true or false - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_mute_set(bool enable); - -/** - * @brief Player set volume. - * - * @param volume: volume set - * @param volume_set: volume set response - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set); - -/** - * @brief Player get volume. - * - * @return - * - volume: volume get - */ -int bsp_extra_codec_volume_get(void); - -/** - * @brief Stop I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_stop(void); - -/** - * @brief Resume I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_resume(void); - -/** - * @brief Set I2S format to codec. - * - * @param rate: Sample rate of sample - * @param bits_cfg: Bit lengths of one channel data - * @param ch: Channels of sample - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch); - -/** - * @brief Read data from recoder. - * - * @param audio_buffer: The pointer of receiving data buffer - * @param len: Max data buffer length - * @param bytes_read: Byte number that actually be read, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms); - -/** - * @brief Write data to player. - * - * @param audio_buffer: The pointer of sent data buffer - * @param len: Max data buffer length - * @param bytes_written: Byte number that actually be sent, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms); - - -/** - * @brief Initialize codec play and record handle. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_init(); - -/** - * @brief Initialize audio player task. - * - * @param path file path - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_init(void); - -/** - * @brief Delete audio player task. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_del(void); - -/** - * @brief Initialize a file iterator instance - * - * @param path The file path for the iterator. - * @param ret_instance A pointer to the file iterator instance to be returned. - * @return - * - ESP_OK: Successfully initialized the file iterator instance. - * - ESP_FAIL: Failed to initialize the file iterator instance due to invalid parameters or memory allocation failure. - */ -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance); - -/** - * @brief Play the audio file at the specified index in the file iterator - * - * @param instance The file iterator instance. - * @param index The index of the file to play within the iterator. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to invalid parameters or file access issues. - */ -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index); - -/** - * @brief Play the audio file specified by the file path - * - * @param file_path The path to the audio file to be played. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to file access issues. - */ -esp_err_t bsp_extra_player_play_file(const char *file_path); - -/** - * @brief Register a callback function for the audio player - * - * @param cb The callback function to be registered. - * @param user_data User data to be passed to the callback function. - */ -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data); - -/** - * @brief Check if the specified audio file is currently playing - * - * @param file_path The path to the audio file to check. - * @return - * - true: The specified audio file is currently playing. - * - false: The specified audio file is not currently playing. - */ -bool bsp_extra_player_is_playing_by_path(const char *file_path); - -/** - * @brief Check if the audio file at the specified index is currently playing - * - * @param instance The file iterator instance. - * @param index The index of the file to check. - * @return - * - true: The audio file at the specified index is currently playing. - * - false: The audio file at the specified index is not currently playing. - */ -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index); - -#ifdef __cplusplus -} -#endif diff --git a/example/tank/sparkbot_motion_control/components/bsp_extra/src/bsp_board_extra.c b/example/tank/sparkbot_motion_control/components/bsp_extra/src/bsp_board_extra.c deleted file mode 100644 index c9fb477798b4125fa64e0a3a10301cce16b72b66..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/bsp_extra/src/bsp_board_extra.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include "esp_log.h" -#include "esp_check.h" -#include "esp_codec_dev_defaults.h" -#include "esp_err.h" -#include "esp_log.h" -#include "esp_vfs_fat.h" -#include "driver/i2c.h" -#include "driver/i2s_std.h" -#include "driver/gpio.h" -#include "driver/ledc.h" - -#include "bsp/esp-bsp.h" -#include "bsp_board_extra.h" - -#define BSP_ES7210_CODEC_ADDR (0x82) - -/* Can be used for `i2s_std_gpio_config_t` and/or `i2s_std_config_t` initialization */ -#define BSP_I2S_GPIO_CFG \ - { \ - .mclk = BSP_I2S_MCLK, \ - .bclk = BSP_I2S_SCLK, \ - .ws = BSP_I2S_LCLK, \ - .dout = BSP_I2S_DOUT, \ - .din = BSP_I2S_DSIN, \ - .invert_flags = { \ - .mclk_inv = false, \ - .bclk_inv = false, \ - .ws_inv = false, \ - }, \ - } - -/* This configuration is used by default in `bsp_extra_audio_init()` */ -#define BSP_I2S_DUPLEX_MONO_CFG(_sample_rate) \ - { \ - .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(_sample_rate), \ - .slot_cfg = I2S_STD_PHILIP_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO), \ - .gpio_cfg = BSP_I2S_GPIO_CFG, \ - } - -#define USE_I2S_RX_CHAN (1) - -static const char *TAG = "bsp_extra_board"; - -static esp_codec_dev_handle_t play_dev_handle; -static esp_codec_dev_handle_t record_dev_handle; - -static bool _is_audio_init = false; -static bool _is_player_init = false; -static int _vloume_intensity = CODEC_DEFAULT_VOLUME; - -static audio_player_cb_t audio_idle_callback = NULL; -static void *audio_idle_cb_user_data = NULL; -static char audio_file_path[128]; - -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ -static i2s_chan_handle_t i2s_tx_chan = NULL; -#if USE_I2S_RX_CHAN -static i2s_chan_handle_t i2s_rx_chan = NULL; -#endif - -/************************************************************************************************** - * - * I2S Audio Function - * - **************************************************************************************************/ -#define EXAMPLE_BUFF_SIZE 2048 - -static void i2s_example_write_task(void *args) -{ - uint8_t *w_buf = (uint8_t *)calloc(1, EXAMPLE_BUFF_SIZE); - assert(w_buf); // Check if w_buf allocation success - - /* Assign w_buf */ - for (int i = 0; i < EXAMPLE_BUFF_SIZE; i += 8) { - w_buf[i] = 0x12; - w_buf[i + 1] = 0x34; - w_buf[i + 2] = 0x56; - w_buf[i + 3] = 0x78; - w_buf[i + 4] = 0x9A; - w_buf[i + 5] = 0xBC; - w_buf[i + 6] = 0xDE; - w_buf[i + 7] = 0xF0; - } - - size_t w_bytes = EXAMPLE_BUFF_SIZE; - - // /* (Optional) Preload the data before enabling the TX channel, so that the valid data can be transmitted immediately */ - // while (w_bytes == EXAMPLE_BUFF_SIZE) { - // /* Here we load the target buffer repeatedly, until all the DMA buffers are preloaded */ - // ESP_ERROR_CHECK(i2s_channel_preload_data(tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes)); - // } - - /* Enable the TX channel */ - // ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - while (1) { - /* Write i2s data */ - if (i2s_channel_write(i2s_tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes, 1000) == ESP_OK) { - printf("Write Task: i2s write %d bytes\n", w_bytes); - } else { - printf("Write Task: i2s write failed\n"); - } - vTaskDelay(pdMS_TO_TICKS(200)); - } - free(w_buf); - vTaskDelete(NULL); -} - -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config) -{ - esp_err_t ret = ESP_FAIL; -#if USE_I2S_RX_CHAN - if (i2s_tx_chan && i2s_rx_chan) { -#else - if (i2s_tx_chan) { -#endif - /* Audio was initialized before */ - return ESP_OK; - } - - /* Setup I2S peripheral */ - i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(CONFIG_BSP_I2S_NUM, I2S_ROLE_MASTER); - chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer -#if USE_I2S_RX_CHAN - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, &i2s_rx_chan)); -#else - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, NULL)); -#endif - - /* Setup I2S channels */ - const i2s_std_config_t std_cfg_default = BSP_I2S_DUPLEX_MONO_CFG(22050); - const i2s_std_config_t *p_i2s_cfg = &std_cfg_default; - if (i2s_config != NULL) { - p_i2s_cfg = i2s_config; - } - - if (i2s_tx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_tx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - } -#if USE_I2S_RX_CHAN - if (i2s_rx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_rx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_rx_chan)); - } -#endif - - audio_codec_i2s_cfg_t i2s_cfg = { - .port = CONFIG_BSP_I2S_NUM, - .tx_handle = i2s_tx_chan, -#if USE_I2S_RX_CHAN - .rx_handle = i2s_rx_chan, -#else - .rx_handle = NULL, -#endif - }; - i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); - - return ESP_OK; -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_TYPE_OUT, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN_OUT, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_dev_cfg); -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_WORK_MODE_BOTH, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_es8311_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_es8311_dev_cfg); -} - -static esp_err_t audio_mute_function(AUDIO_PLAYER_MUTE_SETTING setting) -{ - // Volume saved when muting and restored when unmuting. Restoring volume is necessary - // as es8311_set_voice_mute(true) results in voice volume (REG32) being set to zero. - - bsp_extra_codec_mute_set(setting == AUDIO_PLAYER_MUTE ? true : false); - - // restore the voice volume upon unmuting - if (setting == AUDIO_PLAYER_UNMUTE) { - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, _vloume_intensity), TAG, "Set Codec volume failed"); - } - - return ESP_OK; -} - -static void audio_callback(audio_player_cb_ctx_t *ctx) -{ - if (audio_idle_callback) { - ctx->user_ctx = audio_idle_cb_user_data; - audio_idle_callback(ctx); - } -} - -/************************************************************************************************** - * - * Extra Board Function - * - **************************************************************************************************/ - -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len); - *bytes_read = len; - return ret; -} - -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len); - *bytes_written = len; - return ret; -} - -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch) -{ - esp_err_t ret = ESP_OK; - - esp_codec_dev_sample_info_t fs = { - .sample_rate = rate, - .channel = ch, - .bits_per_sample = bits_cfg, - }; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - if (record_dev_handle) { - ret |= esp_codec_dev_close(record_dev_handle); - ret |= esp_codec_dev_set_in_gain(record_dev_handle, CODEC_DEFAULT_ADC_VOLUME); - } - - if (play_dev_handle) { - ret |= esp_codec_dev_open(play_dev_handle, &fs); - } - if (record_dev_handle) { - ret |= esp_codec_dev_open(record_dev_handle, &fs); - } - return ret; -} - -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set) -{ - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, volume), TAG, "Set Codec volume failed"); - _vloume_intensity = volume; - - ESP_LOGI(TAG, "Setting volume: %d", volume); - - return ESP_OK; -} - -int bsp_extra_codec_volume_get(void) -{ - return _vloume_intensity; -} - -esp_err_t bsp_extra_codec_mute_set(bool enable) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_set_out_mute(play_dev_handle, enable); - return ret; -} - -esp_err_t bsp_extra_codec_dev_stop(void) -{ - esp_err_t ret = ESP_OK; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - - if (record_dev_handle) { - ret = esp_codec_dev_close(record_dev_handle); - } - return ret; -} - -esp_err_t bsp_extra_codec_dev_resume(void) -{ - return bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); -} - -esp_err_t bsp_extra_codec_init() -{ - if (_is_audio_init) { - return ESP_OK; - } - - play_dev_handle = bsp_extra_audio_codec_speaker_init(); - assert((play_dev_handle) && "play_dev_handle not initialized"); - - record_dev_handle = bsp_extra_audio_codec_microphone_init(); - assert((record_dev_handle) && "record_dev_handle not initialized"); - - bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); - - _is_audio_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_init(void) -{ - if (_is_player_init) { - return ESP_OK; - } - - audio_player_config_t config = { .mute_fn = audio_mute_function, - .write_fn = bsp_extra_i2s_write, - .clk_set_fn = bsp_extra_codec_set_fs, - .priority = 5 - }; - ESP_RETURN_ON_ERROR(audio_player_new(config), TAG, "audio_player_init failed"); - audio_player_callback_register(audio_callback, NULL); - - _is_player_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_del(void) -{ - _is_player_init = false; - - ESP_RETURN_ON_ERROR(audio_player_delete(), TAG, "audio_player_delete failed"); - - return ESP_OK; -} - -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance) -{ - ESP_RETURN_ON_FALSE(path, ESP_FAIL, TAG, "path is NULL"); - ESP_RETURN_ON_FALSE(ret_instance, ESP_FAIL, TAG, "ret_instance is NULL"); - - file_iterator_instance_t *file_iterator = file_iterator_new(path); - ESP_RETURN_ON_FALSE(file_iterator, ESP_FAIL, TAG, "file_iterator_new failed, %s", path); - - *ret_instance = file_iterator; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index) -{ - ESP_RETURN_ON_FALSE(instance, ESP_FAIL, TAG, "instance is NULL"); - - ESP_LOGI(TAG, "play_index(%d)", index); - char filename[128]; - int retval = file_iterator_get_full_path_from_index(instance, index, filename, sizeof(filename)); - ESP_RETURN_ON_FALSE(retval != 0, ESP_FAIL, TAG, "file_iterator_get_full_path_from_index failed"); - - ESP_LOGI(TAG, "opening file '%s'", filename); - FILE *fp = fopen(filename, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", filename); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, filename, sizeof(audio_file_path)); - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_file(const char *file_path) -{ - ESP_LOGI(TAG, "opening file '%s'", file_path); - FILE *fp = fopen(file_path, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", file_path); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, file_path, sizeof(audio_file_path)); - - return ESP_OK; -} - -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data) -{ - audio_idle_callback = cb; - audio_idle_cb_user_data = user_data; -} - -bool bsp_extra_player_is_playing_by_path(const char *file_path) -{ - return (strcmp(audio_file_path, file_path) == 0); -} - -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index) -{ - return (index == file_iterator_get_index(instance)); -} \ No newline at end of file diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/CMakeLists.txt b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/CMakeLists.txt deleted file mode 100644 index d276876a85bab2519a9e0b3b709a42cf6d826688..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -#IDF version is less than IDF5.0 -if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "5.0") - set(SRC_VER "esp_sparkbot_bsp_idf4.c") -else() - set(SRC_VER "esp_sparkbot_bsp_idf5.c") -endif() - -idf_component_register( - SRCS "esp_sparkbot_bsp.c" ${SRC_VER} - INCLUDE_DIRS "include" "include/bsp" - PRIV_INCLUDE_DIRS "priv_include" - REQUIRES driver spiffs touch_element - PRIV_REQUIRES fatfs esp_lcd -) diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/Kconfig b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/Kconfig deleted file mode 100644 index 9306c9c9c46b8c187959c1fec008862337618d9d..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/Kconfig +++ /dev/null @@ -1,105 +0,0 @@ -menu "Board Support Package" - - config BSP_ERROR_CHECK - bool "Enable error check in BSP" - default y - help - Error check assert the application before returning the error code. - - menu "I2C" - config BSP_I2C_NUM - int "I2C peripheral index" - default 1 - range 0 1 - help - ESP32-S2 has two I2C peripherals, pick the one you want to use. - - config BSP_I2C_FAST_MODE - bool "Enable I2C fast mode" - default y - help - I2C has two speed modes: normal (100kHz) and fast (400kHz). - - config BSP_I2C_CLK_SPEED_HZ - int - default 400000 if BSP_I2C_FAST_MODE - default 100000 - endmenu - - menu "SPIFFS - Virtual File System" - config BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - bool "Format SPIFFS if mounting fails" - default n - help - Format SPIFFS if it fails to mount the filesystem. - - config BSP_SPIFFS_MOUNT_POINT - string "SPIFFS mount point" - default "/spiffs" - help - Mount point of SPIFFS in the Virtual File System. - - config BSP_SPIFFS_PARTITION_LABEL - string "Partition label of SPIFFS" - default "storage" - help - Partition label which stores SPIFFS. - - config BSP_SPIFFS_MAX_FILES - int "Maximum files that could be open at the same time" - default 2 - help - Supported max files for SPIFFS in the Virtual File System. - endmenu - - menu "uSD card - Virtual File System" - config BSP_SD_FORMAT_ON_MOUNT_FAIL - bool "Format uSD card if mounting fails" - default n - help - The SDMMC host will format (FAT) the uSD card if it fails to mount the filesystem. - - config BSP_SD_MOUNT_POINT - string "uSD card mount point" - default "/sdcard" - help - Mount point of the uSD card in the Virtual File System - - endmenu - menu "Display" - config BSP_DISPLAY_LVGL_TASK_PRIORITY - int "LVGL task priority" - default 2 - help - The Board Support Package will create a task that will periodically handle LVGL operation in lv_timer_handler(). - - config BSP_DISPLAY_LVGL_TICK - int "LVGL tick period" - default 5 - range 1 100 - help - Period of LVGL tick timer. - - config BSP_DISPLAY_LVGL_MAX_SLEEP - int "LVGL maximum sleep time in ms" - default 1 - range 1 500 - help - Maximum time for task sleep in ms. - - config BSP_DISPLAY_BRIGHTNESS_LEDC_CH - int "LEDC channel index" - default 1 - range 0 7 - help - LEDC channel is used to generate PWM signal that controls display brightness. - Set LEDC index that should be used. - endmenu - - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/LICENSE b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/README.md b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/README.md deleted file mode 100644 index 029d9371f5b7eb2753ade93ab4e7e79de973a312..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# BSP: ESP-SparkBot - -[![Component Registry](https://components.espressif.com/components/espressif/esp32_s3_eye/badge.svg)](https://components.espressif.com/components/espressif/esp32_s3_eye) - -### Overview - -The ESP32-S3-EYE board consists of two parts: the main board (ESP32-S3-EYE-MB) that integrates the ESP32-S3-WROOM-1 module, camera, uSD card slot, digital microphone, USB port, and function buttons; and the sub board (ESP32-S3-EYE-SUB) that contains an LCD display. The main board and sub board are connected through pin headers. - -* [Hardware Reference](https://www.espressif.com/en/products/devkits/esp-eye/overview.) - -![](https://raw.githubusercontent.com/espressif/esp-who/master/docs/_static/get-started/ESP32-S3-EYE_MB-annotated-photo.png) - -**The development board has the following features:** -* ESP32-S3 module with built-in 8 MB flash and 8 MB octal RAM -* 1.3-inch 240x240 LCD color screen -* Onboard uSD card slot -* Digital microphone -* Accelerometer -* OV2640 camera - - -### Capabilities and dependencies -| Capability | Available | Component | Version | -|-------------|------------------|----------------------------------------------------------------------------------------------|----------| -| DISPLAY |:heavy_check_mark:| idf | >=4.4.5 | -| LVGL_PORT |:heavy_check_mark:|[espressif/esp_lvgl_port](https://components.espressif.com/components/espressif/esp_lvgl_port)| ^2 | -| TOUCH | :x: | | | -| BUTTONS |:heavy_check_mark:| [espressif/button](https://components.espressif.com/components/espressif/button) |>=2.5,<4.0| -| AUDIO |:heavy_check_mark:|[espressif/esp_codec_dev](https://components.espressif.com/components/espressif/esp_codec_dev)| ^1,<1.2 | -|AUDIO_SPEAKER| :x: | | | -| AUDIO_MIC |:heavy_check_mark:| | | -| SDCARD |:heavy_check_mark:| idf | >=4.4.5 | -| IMU |:heavy_check_mark:| [qma6100p](https://components.espressif.com/components/qma6100p) | 1.* | -| CAMERA |:heavy_check_mark:| [espressif/esp32-camera](https://components.espressif.com/components/espressif/esp32-camera) | ^2.0.2 | - diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c deleted file mode 100644 index 5590a9e8ed2e9c781c52d9703c56fd24aabf8d92..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "esp_vfs_fat.h" -#include "esp_lcd_panel_io.h" -#include "esp_lcd_panel_vendor.h" -#include "esp_lcd_panel_ops.h" -#include "esp_log.h" -#include "esp_check.h" -#include "esp_vfs_fat.h" -#include "esp_spiffs.h" - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" - -#include "driver/spi_master.h" -#include "driver/ledc.h" -#include "driver/i2c.h" - -#include "touch_element/touch_button.h" - -#include "esp_codec_dev_defaults.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "bsp/display.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -static i2c_master_bus_handle_t i2c_handle = NULL; // I2C Handle - -static i2s_chan_handle_t i2s_tx_chan = NULL; -static i2s_chan_handle_t i2s_rx_chan = NULL; -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ - - -// Touch Button -// #define CONFIG_TOUCH_ELEM_EVENT 1 -#define CONFIG_TOUCH_ELEM_CALLBACK 1 -#define TOUCH_BUTTON_NUM 3 -/* Touch buttons handle */ -static touch_button_handle_t button_handle[TOUCH_BUTTON_NUM]; - -/* Touch buttons channel array */ -static const touch_pad_t channel_array[TOUCH_BUTTON_NUM] = { - TOUCH_PAD_NUM1, - TOUCH_PAD_NUM2, - TOUCH_PAD_NUM3, -}; - -/* Touch buttons channel sensitivity array */ -static const float channel_sens_array[TOUCH_BUTTON_NUM] = { - 0.04F, - 0.1F, - 0.1F, -}; - -static bool i2c_initialized = false; -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; -#endif - -static const button_config_t bsp_button_config[BSP_BUTTON_NUM] = { - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_MENU, - .adc_button_config.min = 2310, // middle is 2410mV - .adc_button_config.max = 2510 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_PLAY, - .adc_button_config.min = 1880, // middle is 1980mV - .adc_button_config.max = 2080 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_DOWN, - .adc_button_config.min = 720, // middle is 820mV - .adc_button_config.max = 920 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_UP, - .adc_button_config.min = 280, // middle is 380mV - .adc_button_config.max = 480 - }, - { - .type = BUTTON_TYPE_GPIO, - .gpio_button_config.active_level = 0, - .gpio_button_config.gpio_num = BSP_BUTTON_BOOT_IO - } -}; - -esp_err_t bsp_i2c_init(void) -{ - /* I2C was initialized before */ - if (i2c_initialized) { - return ESP_OK; - } - - const i2c_config_t i2c_conf = { - .mode = I2C_MODE_MASTER, - .sda_io_num = BSP_I2C_SDA, - .sda_pullup_en = GPIO_PULLUP_ENABLE, - .scl_io_num = BSP_I2C_SCL, - .scl_pullup_en = GPIO_PULLUP_ENABLE, - .master.clk_speed = 400000 - }; - BSP_ERROR_CHECK_RETURN_ERR(i2c_param_config(BSP_I2C_NUM, &i2c_conf)); - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_install(BSP_I2C_NUM, i2c_conf.mode, 0, 0, 0)); - - i2c_initialized = true; - - return ESP_OK; -} - -esp_err_t bsp_i2c_deinit(void) -{ - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_delete(BSP_I2C_NUM)); - i2c_initialized = false; - return ESP_OK; -} - -esp_err_t bsp_spiffs_mount(void) -{ - esp_vfs_spiffs_conf_t conf = { - .base_path = CONFIG_BSP_SPIFFS_MOUNT_POINT, - .partition_label = CONFIG_BSP_SPIFFS_PARTITION_LABEL, - .max_files = CONFIG_BSP_SPIFFS_MAX_FILES, -#ifdef CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - .format_if_mount_failed = true, -#else - .format_if_mount_failed = false, -#endif - }; - - esp_err_t ret_val = esp_vfs_spiffs_register(&conf); - - BSP_ERROR_CHECK_RETURN_ERR(ret_val); - - size_t total = 0, used = 0; - ret_val = esp_spiffs_info(conf.partition_label, &total, &used); - if (ret_val != ESP_OK) { - ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret_val)); - } else { - ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used); - } - - return ret_val; -} - -esp_err_t bsp_spiffs_unmount(void) -{ - return esp_vfs_spiffs_unregister(CONFIG_BSP_SPIFFS_PARTITION_LABEL); -} - - -#define LCD_CMD_BITS (8) -#define LCD_PARAM_BITS (8) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) -#define LVGL_TICK_PERIOD_MS (CONFIG_BSP_DISPLAY_LVGL_TICK) -#define LVGL_MAX_SLEEP_MS (CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP) - -esp_err_t bsp_display_brightness_init(void) -{ - gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << BSP_LCD_BACKLIGHT), - .mode = GPIO_MODE_OUTPUT, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .pull_up_en = GPIO_PULLUP_DISABLE, - .intr_type = GPIO_INTR_DISABLE - }; - gpio_config(&io_conf); - - return ESP_OK; -} - -esp_err_t bsp_display_backlight_off(void) -{ - ESP_LOGI(TAG, "Backlight off"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 0); -} - -esp_err_t bsp_display_backlight_on(void) -{ - ESP_LOGI(TAG, "Backlight on"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 1); -} - -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io) -{ - esp_err_t ret = ESP_OK; - assert(config != NULL && config->max_transfer_sz > 0); - - ESP_RETURN_ON_ERROR(bsp_display_brightness_init(), TAG, "Brightness init failed"); - - ESP_LOGD(TAG, "Initialize SPI bus"); - const spi_bus_config_t buscfg = { - .sclk_io_num = BSP_LCD_SPI_CLK, - .mosi_io_num = BSP_LCD_SPI_MOSI, - .miso_io_num = GPIO_NUM_NC, - .quadwp_io_num = GPIO_NUM_NC, - .quadhd_io_num = GPIO_NUM_NC, - .max_transfer_sz = config->max_transfer_sz, - }; - ESP_RETURN_ON_ERROR(spi_bus_initialize(BSP_LCD_SPI_NUM, &buscfg, SPI_DMA_CH_AUTO), TAG, "SPI init failed"); - - ESP_LOGD(TAG, "Install panel IO"); - const esp_lcd_panel_io_spi_config_t io_config = { - .dc_gpio_num = BSP_LCD_DC, - .cs_gpio_num = BSP_LCD_SPI_CS, - .pclk_hz = BSP_LCD_PIXEL_CLOCK_HZ, - .lcd_cmd_bits = LCD_CMD_BITS, - .lcd_param_bits = LCD_PARAM_BITS, - .spi_mode = 2, - .trans_queue_depth = 10, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)BSP_LCD_SPI_NUM, &io_config, ret_io), err, TAG, "New panel IO failed"); - - ESP_LOGD(TAG, "Install LCD driver"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = BSP_LCD_RST, - .color_space = BSP_LCD_COLOR_SPACE, - .bits_per_pixel = BSP_LCD_BITS_PER_PIXEL, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_st7789(*ret_io, &panel_config, ret_panel), err, TAG, "New panel failed"); - - - esp_lcd_panel_reset(*ret_panel); - esp_lcd_panel_init(*ret_panel); - esp_lcd_panel_invert_color(*ret_panel, true); - return ret; - -err: - if (*ret_panel) { - esp_lcd_panel_del(*ret_panel); - } - if (*ret_io) { - esp_lcd_panel_io_del(*ret_io); - } - spi_bus_free(BSP_LCD_SPI_NUM); - return ret; -} - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg) -{ - assert(cfg != NULL); - esp_lcd_panel_io_handle_t io_handle = NULL; - esp_lcd_panel_handle_t panel_handle = NULL; - const bsp_display_config_t bsp_disp_cfg = { - .max_transfer_sz = cfg->trans_size ? (cfg->trans_size * sizeof(uint16_t)): (BSP_LCD_DRAW_BUFF_SIZE * sizeof(uint16_t)), - }; - BSP_ERROR_CHECK_RETURN_NULL(bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle)); - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - esp_lcd_panel_disp_off(panel_handle, false); -#else - esp_lcd_panel_disp_on_off(panel_handle, true); -#endif - - /* Add LCD screen */ - ESP_LOGD(TAG, "Add LCD screen"); - const lvgl_port_display_cfg_t disp_cfg = { - .io_handle = io_handle, - .panel_handle = panel_handle, - .buffer_size = cfg->buffer_size, - .trans_size = cfg->trans_size, - .double_buffer = cfg->double_buffer, - .hres = BSP_LCD_H_RES, - .vres = BSP_LCD_V_RES, - .monochrome = false, - /* Rotation values must be same as used in esp_lcd for initial settings of the screen */ - .rotation = { - .swap_xy = false, - .mirror_x = false, - .mirror_y = false, - }, - .flags = { - .buff_dma = cfg->flags.buff_dma, - .buff_spiram = cfg->flags.buff_spiram, -#if LVGL_VERSION_MAJOR >= 9 - .swap_bytes = (BSP_LCD_BIGENDIAN ? true : false), -#endif - } - }; - - return lvgl_port_add_disp(&disp_cfg); -} - -lv_display_t *bsp_display_start(void) -{ - bsp_display_cfg_t cfg = { - .lvgl_port_cfg = { - .task_priority = CONFIG_BSP_DISPLAY_LVGL_TASK_PRIORITY, - .task_stack = 6144, - .task_affinity = 1, - .timer_period_ms = LVGL_TICK_PERIOD_MS, - .task_max_sleep_ms = LVGL_MAX_SLEEP_MS, - }, - .buffer_size = BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE, - .flags = { - .buff_dma = true, - .buff_spiram = false, - } - }; - return bsp_display_start_with_config(&cfg); -} - -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg) -{ - lv_display_t *disp; - assert(cfg != NULL); - BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg)); - BSP_NULL_CHECK(disp = bsp_display_lcd_init(cfg), NULL); - - return disp; -} - -lv_indev_t *bsp_display_get_input_dev(void) -{ - return NULL; -} - -bool bsp_display_lock(uint32_t timeout_ms) -{ - return lvgl_port_lock(timeout_ms); -} - -void bsp_display_unlock(void) -{ - lvgl_port_unlock(); -} - -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation) -{ - lv_disp_set_rotation(disp, rotation); -} -#endif // (BSP_CONFIG_NO_GRAPHIC_LIB == 0) - - - - -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size) -{ - esp_err_t ret = ESP_OK; - if ((btn_array_size < BSP_BUTTON_NUM) || - (btn_array == NULL)) { - return ESP_ERR_INVALID_ARG; - } -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - /* Initialize ADC and get ADC handle */ - BSP_ERROR_CHECK_RETURN_NULL(bsp_adc_initialize()); - bsp_adc_handle = bsp_adc_get_handle(); -#endif - - if (btn_cnt) { - *btn_cnt = 0; - } - for (int i = 0; i < BSP_BUTTON_NUM; i++) { - btn_array[i] = iot_button_create(&bsp_button_config[i]); - if (btn_array[i] == NULL) { - ret = ESP_FAIL; - break; - } - if (btn_cnt) { - (*btn_cnt)++; - } - } - return ret; -} - - -#ifdef CONFIG_TOUCH_ELEM_EVENT -/* Button event handler task */ -static void button_handler_task(void *arg) -{ - (void) arg; //Unused - touch_elem_message_t element_message; - while (1) { - /* Waiting for touch element messages */ - touch_element_message_receive(&element_message, portMAX_DELAY); - if (element_message.element_type != TOUCH_ELEM_TYPE_BUTTON) { - continue; - } - /* Decode message */ - const touch_button_message_t *button_message = touch_button_get_message(&element_message); - if (button_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { - ESP_LOGI(TAG, "Button[%d] Press", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { - ESP_LOGI(TAG, "Button[%d] Release", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { - ESP_LOGI(TAG, "Button[%d] LongPress", (int)element_message.arg); - } - } -} -#elif CONFIG_TOUCH_ELEM_CALLBACK -/* Button callback routine */ -// static void button_handler(touch_button_handle_t out_handle, touch_button_message_t *out_message, void *arg) -// { -// (void) out_handle; //Unused -// if (out_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { -// ESP_LOGI(TAG, "Button[%d] Press", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { -// ESP_LOGI(TAG, "Button[%d] Release", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { -// ESP_LOGI(TAG, "Button[%d] LongPress", (int)arg); -// } -// } -#endif - -void bsp_touch_button_create(touch_button_callback_t button_callback) -{ - /* Initialize Touch Element library */ - touch_elem_global_config_t global_config = TOUCH_ELEM_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_element_install(&global_config)); - ESP_LOGI(TAG, "Touch element library installed"); - - touch_button_global_config_t button_global_config = TOUCH_BUTTON_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_button_install(&button_global_config)); - ESP_LOGI(TAG, "Touch button installed"); - for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { - touch_button_config_t button_config = { - .channel_num = channel_array[i], - .channel_sens = channel_sens_array[i] - }; - /* Create Touch buttons */ - ESP_ERROR_CHECK(touch_button_create(&button_config, &button_handle[i])); - /* Subscribe touch button events (On Press, On Release, On LongPress) */ - ESP_ERROR_CHECK(touch_button_subscribe_event(button_handle[i], - TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE | TOUCH_ELEM_EVENT_ON_LONGPRESS, - (void *)channel_array[i])); -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_EVENT)); -#elif CONFIG_TOUCH_ELEM_CALLBACK - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_CALLBACK)); - /* Register a handler function to handle event messages */ - ESP_ERROR_CHECK(touch_button_set_callback(button_handle[i], button_callback)); -#endif - /* Set LongPress event trigger threshold time */ - ESP_ERROR_CHECK(touch_button_set_longpress(button_handle[i], 2000)); - } - ESP_LOGI(TAG, "Touch buttons created"); - -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Create a handler task to handle event messages */ - xTaskCreate(&button_handler_task, "button_handler_task", 4 * 1024, NULL, 5, NULL); -#endif - - touch_element_start(); - ESP_LOGI(TAG, "Touch element library start"); -} diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c deleted file mode 100644 index d0102b9594f27b0a71b946ca26ae8fed4987c7f3..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -/* Sample rate of MSM261S4030H0 */ -#define BSP_MIC_SAMPLE_RATE (48000u) - -/* This configuration is used by default in bsp_audio_init() */ -#define BSP_I2S_SIMPLEX_MONO_CFG(_sample_rate) \ - { \ - .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ - .sample_rate = _sample_rate, \ - .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ - .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, \ - .communication_format = I2S_COMM_FORMAT_STAND_I2S, \ - .dma_buf_count = 3, \ - .dma_buf_len = 1024, \ - .use_apll = true, \ - .tx_desc_auto_clear = true, \ - .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM \ - } - - -esp_err_t bsp_adc_initialize(void) -{ - return ESP_OK; -} diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c deleted file mode 100644 index bbb57ec66f33ea613282b14aa18948e9e482765c..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; - -esp_err_t bsp_adc_initialize(void) -{ - /* ADC was initialized before */ - if (bsp_adc_handle != NULL) { - return ESP_OK; - } - - /* Initialize ADC */ - const adc_oneshot_unit_init_cfg_t init_config1 = { - .unit_id = BSP_ADC_UNIT, - }; - BSP_ERROR_CHECK_RETURN_ERR(adc_oneshot_new_unit(&init_config1, &bsp_adc_handle)); - - return ESP_OK; -} - -adc_oneshot_unit_handle_t bsp_adc_get_handle(void) -{ - return bsp_adc_handle; -} diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/idf_component.yml b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/idf_component.yml deleted file mode 100644 index fbc0e4ed14dee549e55ab3b86920ffa296aead72..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/idf_component.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "3.1.0~1" -description: Board Support Package (BSP) for ESP32-SparkBot - -targets: - - esp32s3 - -tags: - - bsp - -dependencies: - idf: ">=4.4.5" - - espressif/esp_lvgl_port: - version: "2.4.1" - public: true - - button: - version: ">=2.5,<4.0" - public: true - - esp_codec_dev: - version: "==1.1.0" - public: true - diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/config.h b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/config.h deleted file mode 100644 index f3cb5ebe7389d59cea35c3444aaadb3c0c94b6cc..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -/************************************************************************************************** - * BSP configuration - **************************************************************************************************/ -// By default, this BSP is shipped with LVGL graphical library. Enabling this option will exclude it. -// If you want to use BSP without LVGL, select BSP version with 'noglib' suffix. -#if !defined(BSP_CONFIG_NO_GRAPHIC_LIB) // Check if the symbol is not coming from compiler definitions (-D...) -#define BSP_CONFIG_NO_GRAPHIC_LIB (0) -#endif diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/display.h b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/display.h deleted file mode 100644 index 213b4720ad7e19686aa029e4ee6b7680824ac761..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/display.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief BSP LCD - * - * This file offers API for basic LCD control. - * It is useful for users who want to use the LCD without the default Graphical Library LVGL. - * - * For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start(). - */ - -#pragma once -#include "esp_lcd_types.h" - -/* LCD color formats */ -#define ESP_LCD_COLOR_FORMAT_RGB565 (1) -#define ESP_LCD_COLOR_FORMAT_RGB888 (2) - -/* LCD display color format */ -#define BSP_LCD_COLOR_FORMAT (ESP_LCD_COLOR_FORMAT_RGB565) -/* LCD display color bytes endianess */ -#define BSP_LCD_BIGENDIAN (1) -/* LCD display color bits */ -#define BSP_LCD_BITS_PER_PIXEL (16) -/* LCD display color space */ -#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_RGB) -/* LCD display definition */ -#define BSP_LCD_H_RES (240) -#define BSP_LCD_V_RES (240) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief BSP display configuration structure - * - */ -typedef struct { - int max_transfer_sz; /*!< Maximum transfer size, in bytes. */ -} bsp_display_config_t; - -/** - * @brief Create new display panel - * - * For maximum flexibility, this function performs only reset and initialization of the display. - * You must turn on the display explicitly by calling esp_lcd_panel_disp_on_off(). - * The display's backlight is not turned on either. You can use bsp_display_backlight_on/off(), - * bsp_display_brightness_set() (on supported boards) or implement your own backlight control. - * - * If you want to free resources allocated by this function, you can use esp_lcd API, ie.: - * - * \code{.c} - * esp_lcd_panel_del(panel); - * esp_lcd_panel_io_del(io); - * spi_bus_free(spi_num_from_configuration); - * \endcode - * - * @param[in] config display configuration - * @param[out] ret_panel esp_lcd panel handle - * @param[out] ret_io esp_lcd IO handle - * @return - * - ESP_OK On success - * - Else esp_lcd failure - */ -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io); - -/** - * @brief Initialize display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_init(void); - -/** - * @brief Set display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @param[in] brightness_percent Brightness in [%] - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_set(int brightness_percent); - -/** - * @brief Turn on display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_on(void); - -/** - * @brief Turn off display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_off(void); - -#ifdef __cplusplus -} -#endif diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h deleted file mode 100644 index ac223966e45efc7116ec6792a43e6203b8e5cee2..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "bsp/esp_sparkbot_bsp.h" diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h deleted file mode 100644 index 125b5817aa4e6cd6811df8ccf12fd6759ec607d5..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief ESP BSP: ESP-SparkBot - */ - -#pragma once - -#include "sdkconfig.h" -#include "driver/gpio.h" -#include "driver/sdmmc_host.h" -#include "esp_codec_dev.h" -#include "iot_button.h" -#include "touch_element/touch_button.h" -#include "bsp/config.h" -#include "bsp/display.h" - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "driver/i2s.h" -#else -// #include "driver/i2c_master.h" -#include "driver/i2s_std.h" -#endif - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#include "lvgl.h" -#include "esp_lvgl_port.h" -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - -/************************************************************************************************** - * BSP Capabilities - **************************************************************************************************/ - -#define BSP_CAPS_DISPLAY 1 -#define BSP_CAPS_TOUCH 0 -#define BSP_CAPS_BUTTONS 1 -#define BSP_CAPS_AUDIO 1 -#define BSP_CAPS_AUDIO_SPEAKER 0 -#define BSP_CAPS_AUDIO_MIC 1 -#define BSP_CAPS_SDCARD 1 -#define BSP_CAPS_IMU 1 -#define BSP_CAPS_CAMERA 1 - -/************************************************************************************************** - * ESP-SparkBot-BSP pinout - **************************************************************************************************/ - -/* I2C */ -#define BSP_I2C_SCL (GPIO_NUM_5) -#define BSP_I2C_SDA (GPIO_NUM_4) - -/* Display */ -#define BSP_LCD_SPI_MOSI (GPIO_NUM_47) -#define BSP_LCD_SPI_CLK (GPIO_NUM_21) -#define BSP_LCD_SPI_CS (GPIO_NUM_44) -#define BSP_LCD_DC (GPIO_NUM_43) -#define BSP_LCD_RST (GPIO_NUM_NC) -#define BSP_LCD_BACKLIGHT (GPIO_NUM_46) - -/* Camera */ -#define BSP_CAMERA_XCLK (GPIO_NUM_15) -#define BSP_CAMERA_PCLK (GPIO_NUM_13) -#define BSP_CAMERA_VSYNC (GPIO_NUM_6) -#define BSP_CAMERA_HSYNC (GPIO_NUM_7) -#define BSP_CAMERA_D0 (GPIO_NUM_11) -#define BSP_CAMERA_D1 (GPIO_NUM_9) -#define BSP_CAMERA_D2 (GPIO_NUM_8) -#define BSP_CAMERA_D3 (GPIO_NUM_10) -#define BSP_CAMERA_D4 (GPIO_NUM_12) -#define BSP_CAMERA_D5 (GPIO_NUM_18) -#define BSP_CAMERA_D6 (GPIO_NUM_17) -#define BSP_CAMERA_D7 (GPIO_NUM_16) - -/* Buttons */ -#define BSP_BUTTON_BOOT_IO (GPIO_NUM_0) -#define BSP_BUTTONS_IO (GPIO_NUM_1) // All 4 buttons mapped to this GPIO -typedef enum bsp_led_t { - BSP_LED_GREEN = GPIO_NUM_3, -} bsp_led_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - * - * Buttons interface - * - * Example configuration: - * \code{.c} - * button_handle_t btns[BSP_BUTTON_NUM]; - * bsp_iot_button_create(btns, NULL, BSP_BUTTON_NUM); - * iot_button_register_cb(btns[0], ... - * \endcode - **************************************************************************************************/ -typedef enum { - BSP_BUTTON_MENU = 0, - BSP_BUTTON_PLAY, - BSP_BUTTON_DOWN, - BSP_BUTTON_UP, - BSP_BUTTON_BOOT, - BSP_BUTTON_NUM -} bsp_button_t; - -/** - * @brief Initialize all buttons - * - * Returned button handlers must be used with espressif/button component API - * - * @note For LCD panel button which is defined as BSP_BUTTON_MAIN, bsp_display_start should - * be called before call this function. - * - * @param[out] btn_array Output button array - * @param[out] btn_cnt Number of button handlers saved to btn_array, can be NULL - * @param[in] btn_array_size Size of output button array. Must be at least BSP_BUTTON_NUM - * @return - * - ESP_OK All buttons initialized - * - ESP_ERR_INVALID_ARG btn_array is too small or NULL - * - ESP_FAIL Underlaying iot_button_create failed - */ -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size); - - -void bsp_touch_button_create(touch_button_callback_t button_callback); - -/************************************************************************************************** - * - * I2C interface - * - * There are two devices connected to I2C peripheral: - * - QMA7981 Inertial measurement unit - * - OV2640 Camera module - **************************************************************************************************/ -#define BSP_I2C_NUM CONFIG_BSP_I2C_NUM - -/** - * @brief Init I2C driver - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - ESP_FAIL I2C driver installation error - * - */ -esp_err_t bsp_i2c_init(void); - -/** - * @brief Deinit I2C driver and free its resources - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - */ -esp_err_t bsp_i2c_deinit(void); - -/************************************************************************************************** - * - * Camera interface - * - * ESP-SparkBot-BSP is shipped with OV2640 camera module. - * As a camera driver, esp32-camera component is used. - * - * Example configuration: - * \code{.c} - * const camera_config_t camera_config = BSP_CAMERA_DEFAULT_CONFIG; - * esp_err_t err = esp_camera_init(&camera_config); - * \endcode - **************************************************************************************************/ -/** - * @brief ESP-SparkBot-BSP camera default configuration - * - * In this configuration we select RGB565 color format and 240x240 image size - matching the display. - * We use double-buffering for the best performance. - * Since we don't want to waste internal SRAM, we allocate the framebuffers in external PSRAM. - * By setting XCLK to 16MHz, we configure the esp32-camera driver to use EDMA when accessing the PSRAM. - * - * @attention I2C must be enabled by bsp_i2c_init(), before camera is initialized - */ -#define BSP_CAMERA_DEFAULT_CONFIG \ - { \ - .pin_pwdn = GPIO_NUM_NC, \ - .pin_reset = GPIO_NUM_NC, \ - .pin_xclk = BSP_CAMERA_XCLK, \ - .pin_sccb_sda = GPIO_NUM_NC, \ - .pin_sccb_scl = GPIO_NUM_NC, \ - .pin_d7 = BSP_CAMERA_D7, \ - .pin_d6 = BSP_CAMERA_D6, \ - .pin_d5 = BSP_CAMERA_D5, \ - .pin_d4 = BSP_CAMERA_D4, \ - .pin_d3 = BSP_CAMERA_D3, \ - .pin_d2 = BSP_CAMERA_D2, \ - .pin_d1 = BSP_CAMERA_D1, \ - .pin_d0 = BSP_CAMERA_D0, \ - .pin_vsync = BSP_CAMERA_VSYNC, \ - .pin_href = BSP_CAMERA_HSYNC, \ - .pin_pclk = BSP_CAMERA_PCLK, \ - .xclk_freq_hz = 16000000, \ - .ledc_timer = LEDC_TIMER_0, \ - .ledc_channel = LEDC_CHANNEL_0, \ - .pixel_format = PIXFORMAT_RGB565, \ - .frame_size = FRAMESIZE_240X240, \ - .jpeg_quality = 12, \ - .fb_count = 2, \ - .fb_location = CAMERA_FB_IN_PSRAM,\ - .sccb_i2c_port = BSP_I2C_NUM, \ - } - -#define BSP_CAMERA_VFLIP 1 -#define BSP_CAMERA_HMIRROR 0 - -/************************************************************************************************** - * - * SPIFFS - * - * After mounting the SPIFFS, it can be accessed with stdio functions ie.: - * \code{.c} - * FILE* f = fopen(BSP_SPIFFS_MOUNT_POINT"/hello.txt", "w"); - * fprintf(f, "Hello World!\n"); - * fclose(f); - * \endcode - **************************************************************************************************/ -#define BSP_SPIFFS_MOUNT_POINT CONFIG_BSP_SPIFFS_MOUNT_POINT - -/** - * @brief Mount SPIFFS to virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_spiffs_register was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes - */ -esp_err_t bsp_spiffs_mount(void); - -/** - * @brief Unmount SPIFFS from virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if already unmounted - */ -esp_err_t bsp_spiffs_unmount(void); - - -/************************************************************************************************** - * - * LCD interface - * - * ESP-SparkBot-BSP is shipped with 1.3inch ST7789 display controller. - * It features 16-bit colors and 240x240 resolution. - * - * LVGL is used as graphics library. LVGL is NOT thread safe, therefore the user must take LVGL mutex - * by calling bsp_display_lock() before calling any LVGL API (lv_...) and then give the mutex with - * bsp_display_unlock(). - * - * If you want to use the display without LVGL, see bsp/display.h API and use BSP version with 'noglib' suffix. - **************************************************************************************************/ -#define BSP_LCD_PIXEL_CLOCK_HZ (80 * 1000 * 1000) -#define BSP_LCD_SPI_NUM (SPI3_HOST) - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * BSP_LCD_V_RES) -#define BSP_LCD_DRAW_BUFF_DOUBLE (0) - -/** - * @brief BSP display configuration structure - */ -typedef struct { - lvgl_port_cfg_t lvgl_port_cfg; /*!< LVGL port configuration */ - uint32_t buffer_size; /*!< Size of the buffer for the screen in pixels */ - uint32_t trans_size; - bool double_buffer; /*!< True, if should be allocated two buffers */ - struct { - unsigned int buff_dma: 1; /*!< Allocated LVGL buffer will be DMA capable */ - unsigned int buff_spiram: 1; /*!< Allocated LVGL buffer will be in PSRAM */ - } flags; -} bsp_display_cfg_t; - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start(void); - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * LCD backlight must be enabled separately by calling bsp_display_brightness_set() - * - * @param cfg display configuration - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg); - -/** - * @brief Get pointer to input device (touch, buttons, ...) - * - * @note The LVGL input device is initialized in bsp_display_start() function. - * - * @return Pointer to LVGL input device or NULL when not initialized - */ -lv_indev_t *bsp_display_get_input_dev(void); - -/** - * @brief Take LVGL mutex - * - * @param timeout_ms Timeout in [ms]. 0 will block indefinitely. - * @return true Mutex was taken - * @return false Mutex was NOT taken - */ -bool bsp_display_lock(uint32_t timeout_ms); - -/** - * @brief Give LVGL mutex - * - */ -void bsp_display_unlock(void); - -/** - * @brief Rotate screen - * - * Display must be already initialized by calling bsp_display_start() - * - * @param[in] disp Pointer to LVGL display - * @param[in] rotation Angle of the display rotation - */ -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation); -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - - - -/************************************************************************************************** - * - * ADC interface - * - * There are multiple devices connected to ADC peripheral: - * - Buttons - * - * After initialization of ADC, use adc_handle when using ADC driver. - **************************************************************************************************/ - -#define BSP_ADC_UNIT ADC_UNIT_1 - -/** - * @brief Initialize ADC - * - * The ADC can be initialized inside BSP, when needed. - * - * @param[out] adc_handle Returned ADC handle - */ -esp_err_t bsp_adc_initialize(void); - - -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -/** - * @brief Get ADC handle - * - * @note This function is available only in IDF5 and higher - * - * @return ADC handle - */ -adc_oneshot_unit_handle_t bsp_adc_get_handle(void); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h b/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h deleted file mode 100644 index e00199943eef4e1c31fbc46b8a2ee91d4cb2cc15..0000000000000000000000000000000000000000 --- a/example/tank/sparkbot_motion_control/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include "esp_check.h" -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Assert on error, if selected in menuconfig. Otherwise return error code. */ -#if CONFIG_BSP_ERROR_CHECK -#define BSP_ERROR_CHECK_RETURN_ERR(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK_RETURN_NULL(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK(x, ret) ESP_ERROR_CHECK(x) -#define BSP_NULL_CHECK(x, ret) assert(x) -#define BSP_NULL_CHECK_GOTO(x, goto_tag) assert(x) -#else -#define BSP_ERROR_CHECK_RETURN_ERR(x) do { \ - esp_err_t err_rc_ = (x); \ - if (unlikely(err_rc_ != ESP_OK)) { \ - return err_rc_; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK_RETURN_NULL(x) do { \ - if (unlikely((x) != ESP_OK)) { \ - return NULL; \ - } \ - } while(0) - -#define BSP_NULL_CHECK(x, ret) do { \ - if ((x) == NULL) { \ - return ret; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK(x, ret) do { \ - if (unlikely((x) != ESP_OK)) { \ - return ret; \ - } \ - } while(0) - -#define BSP_NULL_CHECK_GOTO(x, goto_tag) do { \ - if ((x) == NULL) { \ - goto goto_tag; \ - } \ - } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/tank/sparkbot_motion_control/main/app/app_sr.c b/example/tank/sparkbot_motion_control/main/app/app_sr.c index 96e5da3a7ba9a2cabae4a4322a1b75509664c3c1..89411f51fd76e35749b00968b1168f049d44d0b5 100644 --- a/example/tank/sparkbot_motion_control/main/app/app_sr.c +++ b/example/tank/sparkbot_motion_control/main/app/app_sr.c @@ -22,7 +22,7 @@ #include "model_path.h" #include "esp_mn_speech_commands.h" #include "esp_process_sdkconfig.h" -#include "bsp_board_extra.h" +#include "esp-bsp.h" #define I2S_CHANNEL_NUM (1) @@ -60,7 +60,7 @@ static void audio_feed_task(void *pvParam) } /* Set the input gain of the microphone, increase the gain if the input volume is too low */ - esp_codec_dev_handle_t mic_codec_dev = bsp_extra_audio_codec_microphone_init(); + esp_codec_dev_handle_t mic_codec_dev = bsp_audio_codec_microphone_init(); esp_codec_dev_sample_info_t fs = { .sample_rate = 16000, diff --git a/example/tank/sparkbot_motion_control/main/idf_component.yml b/example/tank/sparkbot_motion_control/main/idf_component.yml index 201fae1b4bc05344a3ed0687f5f18b4e115bf738..277ed94dd660f4cdf40159729283a7c5a61c5560 100644 --- a/example/tank/sparkbot_motion_control/main/idf_component.yml +++ b/example/tank/sparkbot_motion_control/main/idf_component.yml @@ -4,5 +4,6 @@ dependencies: espressif/esp-sr: "1.8.0" espressif/thorvg: "0.*" espressif2022/lottie_player: ^1.0.0 + espressif2022/esp_sparkbot: "*" esp_mmap_assets: "1.*" espressif/esp32-camera: "2.0.4" diff --git a/example/tank/sparkbot_motion_control/main/sparkbot_motion_control.c b/example/tank/sparkbot_motion_control/main/sparkbot_motion_control.c index cd9a65e497e8e7fbe858e0b614526067005195f6..b9df5a2c2e77c771c0ce2944cb42d3f6d7a9fe3d 100644 --- a/example/tank/sparkbot_motion_control/main/sparkbot_motion_control.c +++ b/example/tank/sparkbot_motion_control/main/sparkbot_motion_control.c @@ -17,8 +17,7 @@ #include "lv_lottie.h" #include "ui.h" -#include "esp_sparkbot_bsp.h" -#include "bsp_board_extra.h" +#include "esp-bsp.h" #include "app_sr.h" diff --git a/example/tank/sparkbot_motion_control/sdkconfig b/example/tank/sparkbot_motion_control/sdkconfig index bf1e52b6f50b769155392a7a54f35d7f227b7d94..9322d2fcc238e82af50335338e9d81a4723596c8 100644 --- a/example/tank/sparkbot_motion_control/sdkconfig +++ b/example/tank/sparkbot_motion_control/sdkconfig @@ -374,7 +374,7 @@ CONFIG_IDF_TOOLCHAIN_GCC=y CONFIG_IDF_TARGET_ARCH_XTENSA=y CONFIG_IDF_TARGET_ARCH="xtensa" CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_INIT_VERSION="5.2.3" +CONFIG_IDF_INIT_VERSION="5.5.0" CONFIG_IDF_TARGET_ESP32S3=y CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 @@ -432,7 +432,7 @@ CONFIG_BOOTLOADER_LOG_LEVEL=3 # # Format # -# CONFIG_BOOTLOADER_LOG_COLORS is not set +CONFIG_BOOTLOADER_LOG_COLORS=y CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y # end of Format # end of Log @@ -647,8 +647,8 @@ CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y # CONFIG_COMPILER_DUMP_RTL_FILES is not set CONFIG_COMPILER_RT_LIB_GCCLIB=y CONFIG_COMPILER_RT_LIB_NAME="gcc" -# CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING is not set -CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y +CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y +# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set # CONFIG_COMPILER_STATIC_ANALYZER is not set # end of Compiler options @@ -1750,8 +1750,8 @@ CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y # CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y -# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_NONE is not set +CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT=y # CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set # end of Hooks @@ -1800,7 +1800,7 @@ CONFIG_MBEDTLS_CMAC_C=y CONFIG_MBEDTLS_HARDWARE_AES=y CONFIG_MBEDTLS_AES_USE_INTERRUPT=y CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0 -# CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER is not set +CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y # CONFIG_MBEDTLS_HARDWARE_MPI is not set CONFIG_MBEDTLS_HARDWARE_SHA=y CONFIG_MBEDTLS_ROM_MD5=y @@ -1883,7 +1883,7 @@ CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y CONFIG_MBEDTLS_ECP_NIST_OPTIM=y -CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM is not set # CONFIG_MBEDTLS_POLY1305_C is not set # CONFIG_MBEDTLS_CHACHA20_C is not set # CONFIG_MBEDTLS_HKDF_C is not set @@ -2187,12 +2187,6 @@ CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y # CONFIG_WIFI_PROV_STA_FAST_SCAN is not set # end of Wi-Fi Provisioning Manager -# -# Board Support Package -# -CONFIG_BSP_I2S_NUM=1 -# end of Board Support Package - # # Board Support Package # @@ -2230,15 +2224,9 @@ CONFIG_BSP_DISPLAY_LVGL_TICK=5 CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP=1 CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH=1 # end of Display -# end of Board Support Package -# -# Audio playback -# -CONFIG_AUDIO_PLAYER_ENABLE_MP3=y -CONFIG_AUDIO_PLAYER_ENABLE_WAV=y -CONFIG_AUDIO_PLAYER_LOG_LEVEL=0 -# end of Audio playback +CONFIG_BSP_I2S_NUM=1 +# end of Board Support Package # # IoT Button @@ -2333,6 +2321,19 @@ CONFIG_CODEC_TAS5805M_SUPPORT=y CONFIG_MMAP_FILE_NAME_LENGTH=16 # end of mmap file support format +# +# Bus Options +# + +# +# I2C Bus Options +# +CONFIG_I2C_BUS_DYNAMIC_CONFIG=y +CONFIG_I2C_MS_TO_WAIT=200 +CONFIG_I2C_BUS_BACKWARD_CONFIG=y +# end of I2C Bus Options +# end of Bus Options + # # ThorVG Support Options # diff --git a/example/tank/sparkbot_motion_control/sdkconfig.defaults b/example/tank/sparkbot_motion_control/sdkconfig.defaults index e77cd806f9d5d386d73e660f3645a3680033bfe8..c503cae36b749cd2af1a6d4c2621bdc2ebe59ee8 100644 --- a/example/tank/sparkbot_motion_control/sdkconfig.defaults +++ b/example/tank/sparkbot_motion_control/sdkconfig.defaults @@ -80,4 +80,8 @@ CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024 CONFIG_HTTPD_MAX_URI_LEN=1024 CONFIG_HTTPD_ERR_RESP_NO_DELAY=y CONFIG_HTTPD_PURGE_BUF_LEN=32 -CONFIG_HTTPD_WS_SUPPORT=y \ No newline at end of file +CONFIG_HTTPD_WS_SUPPORT=y + +CONFIG_I2C_BUS_BACKWARD_CONFIG=y +CONFIG_LOG_COLORS=y +CONFIG_BOOTLOADER_LOG_COLORS=y \ No newline at end of file diff --git a/example/usb_extend_screen_s3/components/bsp_extra/CMakeLists.txt b/example/usb_extend_screen_s3/components/bsp_extra/CMakeLists.txt deleted file mode 100644 index 2abe51240a48e4876975235d90038ce15b1d61ba..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/bsp_extra/CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -set(SRCS "") -list(APPEND SRCS - "src/bsp_board_extra.c" -) - -set(INCLUDE_DIRS "") -list(APPEND INCLUDE_DIRS "include") - -foreach(SRC_DIR IN LISTS SRC_DIRS) - file(GLOB_RECURSE SRC ${SRC_DIR}/*.c) - list(APPEND SRCS ${SRC}) - list(APPEND INCLUDE_DIRS ${SRC_DIR}/include) -endforeach() - -idf_component_register( - SRCS ${SRCS} - INCLUDE_DIRS ${INCLUDE_DIRS} - REQUIRES driver - PRIV_REQUIRES esp_timer fatfs esp_psram esp_mm -) - -target_compile_options( - ${COMPONENT_LIB} PRIVATE - -Wno-format - -Wno-int-conversion - -Wno-incompatible-pointer-types - -Wunused-function - -Wno-unused-variable - -Wno-unused-function - -Wno-overflow - -Wno-unused-but-set-variable - -Wno-discarded-qualifiers) diff --git a/example/usb_extend_screen_s3/components/bsp_extra/Kconfig b/example/usb_extend_screen_s3/components/bsp_extra/Kconfig deleted file mode 100644 index ec558673078adf7029bbfaa1fe514a30c460f7a6..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/bsp_extra/Kconfig +++ /dev/null @@ -1,8 +0,0 @@ -menu "Board Support Package" - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/usb_extend_screen_s3/components/bsp_extra/LICENSE b/example/usb_extend_screen_s3/components/bsp_extra/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/bsp_extra/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/usb_extend_screen_s3/components/bsp_extra/idf_component.yml b/example/usb_extend_screen_s3/components/bsp_extra/idf_component.yml deleted file mode 100644 index eca5daba964c5d6f8e2c446d320d9f4e03aee15e..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/bsp_extra/idf_component.yml +++ /dev/null @@ -1,22 +0,0 @@ -dependencies: - - espressif/esp_sparkbot_bsp: - version: "*" - path: ../esp_sparkbot_bsp - - esp_codec_dev: - public: true - version: "==1.1.0" - - chmorgan/esp-audio-player: - version: "1.0.*" - public: true - - chmorgan/esp-file-iterator: - version: "1.0.0" - public: true - -description: Board Support Package for ESP32-P4-Function-ev-board -targets: -- esp32s3 -version: 0.0.1 diff --git a/example/usb_extend_screen_s3/components/bsp_extra/include/bsp_board_extra.h b/example/usb_extend_screen_s3/components/bsp_extra/include/bsp_board_extra.h deleted file mode 100644 index 381a7156b026399f87d6e6254dc8821ed938c725..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/bsp_extra/include/bsp_board_extra.h +++ /dev/null @@ -1,282 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include -#include -#include "esp_codec_dev.h" -#include "esp_err.h" -#include "driver/gpio.h" -#include "driver/i2s_std.h" -#include "audio_player.h" -#include "file_iterator.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define BSP_I2S_SCLK (GPIO_NUM_39) -#define BSP_I2S_MCLK (GPIO_NUM_45) -#define BSP_I2S_LCLK (GPIO_NUM_41) -#define BSP_I2S_DOUT (GPIO_NUM_42) // To Codec ES8311 -#define BSP_I2S_DSIN (GPIO_NUM_40) // From Codec ES8311 -#define BSP_POWER_AMP_IO (GPIO_NUM_NC) - -#define CODEC_DEFAULT_SAMPLE_RATE (16000) -#define CODEC_DEFAULT_BIT_WIDTH (16) -#define CODEC_DEFAULT_ADC_VOLUME (24.0) -#define CODEC_DEFAULT_CHANNEL (2) -#define CODEC_DEFAULT_VOLUME (60) - -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MAX (95) -#define BSP_LCD_BACKLIGHT_BRIGHTNESS_MIN (0) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) - -/************************************************************************************************** - * - * I2S audio interface - * - * There are two devices connected to the I2S peripheral: - * - Codec ES8311 for output (playback) path - * - ADC ES7210 for input (recording) path - * - * For speaker initialization use `bsp_extra_audio_codec_speaker_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * For microphone initialization use `bsp_extra_audio_codec_microphone_init()` which is inside initialize I2S with `bsp_extra_audio_init()`. - * After speaker or microphone initialization, use functions from esp_codec_dev for play/record audio. - * Example audio play: - * \code{.c} - * esp_codec_dev_set_out_vol(spk_codec_dev, DEFAULT_VOLUME); - * esp_codec_dev_open(spk_codec_dev, &fs); - * esp_codec_dev_write(spk_codec_dev, wav_bytes, bytes_read_from_spiffs); - * esp_codec_dev_close(spk_codec_dev); - * \endcode - **************************************************************************************************/ -/** - * @brief Init audio - * - * @note There is no deinit audio function. Users can free audio resources by calling `i2s_del_channel()`. - * @note This function wiil call `bsp_io_expander_init()` to setup and enable the control pin of audio power amplifier. - * @note This function will be called in `bsp_extra_audio_codec_speaker_init()` and `bsp_extra_audio_codec_microphone_init()`. - * - * @param[in] i2s_config I2S configuration. Pass NULL to use default values (Mono, duplex, 16bit, 22050 Hz) - * @return - * - ESP_OK On success - * - ESP_ERR_NOT_SUPPORTED The communication mode is not supported on the current chip - * - ESP_ERR_INVALID_ARG NULL pointer or invalid configuration - * - ESP_ERR_NOT_FOUND No available I2S channel found - * - ESP_ERR_NO_MEM No memory for storing the channel information - * - ESP_ERR_INVALID_STATE This channel has not initialized or already started - * - other error codes - */ -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config); - -/** - * @brief Initialize speaker codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void); - -/** - * @brief Initialize microphone codec device - * - * @note This function will call `bsp_extra_audio_init()` if it has not been called already. - * - * @return Pointer to codec device handle or NULL when error occured - */ -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void); - -/************************************************************************************************** - * BSP Extra interface - * Mainly provided some I2S Codec interfaces. - **************************************************************************************************/ -/** - * @brief Player set mute. - * - * @param enable: true or false - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_mute_set(bool enable); - -/** - * @brief Player set volume. - * - * @param volume: volume set - * @param volume_set: volume set response - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set); - -/** - * @brief Player get volume. - * - * @return - * - volume: volume get - */ -int bsp_extra_codec_volume_get(void); - -/** - * @brief Stop I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_stop(void); - -/** - * @brief Resume I2S function. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_dev_resume(void); - -/** - * @brief Set I2S format to codec. - * - * @param rate: Sample rate of sample - * @param bits_cfg: Bit lengths of one channel data - * @param ch: Channels of sample - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch); - -/** - * @brief Read data from recoder. - * - * @param audio_buffer: The pointer of receiving data buffer - * @param len: Max data buffer length - * @param bytes_read: Byte number that actually be read, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms); - -/** - * @brief Write data to player. - * - * @param audio_buffer: The pointer of sent data buffer - * @param len: Max data buffer length - * @param bytes_written: Byte number that actually be sent, can be NULL if not needed - * @param timeout_ms: Max block time - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms); - - -/** - * @brief Initialize codec play and record handle. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_codec_init(); - -/** - * @brief Initialize audio player task. - * - * @param path file path - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_init(void); - -/** - * @brief Delete audio player task. - * - * @return - * - ESP_OK: Success - * - Others: Fail - */ -esp_err_t bsp_extra_player_del(void); - -/** - * @brief Initialize a file iterator instance - * - * @param path The file path for the iterator. - * @param ret_instance A pointer to the file iterator instance to be returned. - * @return - * - ESP_OK: Successfully initialized the file iterator instance. - * - ESP_FAIL: Failed to initialize the file iterator instance due to invalid parameters or memory allocation failure. - */ -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance); - -/** - * @brief Play the audio file at the specified index in the file iterator - * - * @param instance The file iterator instance. - * @param index The index of the file to play within the iterator. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to invalid parameters or file access issues. - */ -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index); - -/** - * @brief Play the audio file specified by the file path - * - * @param file_path The path to the audio file to be played. - * @return - * - ESP_OK: Successfully started playing the audio file. - * - ESP_FAIL: Failed to play the audio file due to file access issues. - */ -esp_err_t bsp_extra_player_play_file(const char *file_path); - -/** - * @brief Register a callback function for the audio player - * - * @param cb The callback function to be registered. - * @param user_data User data to be passed to the callback function. - */ -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data); - -/** - * @brief Check if the specified audio file is currently playing - * - * @param file_path The path to the audio file to check. - * @return - * - true: The specified audio file is currently playing. - * - false: The specified audio file is not currently playing. - */ -bool bsp_extra_player_is_playing_by_path(const char *file_path); - -/** - * @brief Check if the audio file at the specified index is currently playing - * - * @param instance The file iterator instance. - * @param index The index of the file to check. - * @return - * - true: The audio file at the specified index is currently playing. - * - false: The audio file at the specified index is not currently playing. - */ -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index); - -#ifdef __cplusplus -} -#endif diff --git a/example/usb_extend_screen_s3/components/bsp_extra/src/bsp_board_extra.c b/example/usb_extend_screen_s3/components/bsp_extra/src/bsp_board_extra.c deleted file mode 100644 index c9fb477798b4125fa64e0a3a10301cce16b72b66..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/bsp_extra/src/bsp_board_extra.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include -#include -#include "esp_log.h" -#include "esp_check.h" -#include "esp_codec_dev_defaults.h" -#include "esp_err.h" -#include "esp_log.h" -#include "esp_vfs_fat.h" -#include "driver/i2c.h" -#include "driver/i2s_std.h" -#include "driver/gpio.h" -#include "driver/ledc.h" - -#include "bsp/esp-bsp.h" -#include "bsp_board_extra.h" - -#define BSP_ES7210_CODEC_ADDR (0x82) - -/* Can be used for `i2s_std_gpio_config_t` and/or `i2s_std_config_t` initialization */ -#define BSP_I2S_GPIO_CFG \ - { \ - .mclk = BSP_I2S_MCLK, \ - .bclk = BSP_I2S_SCLK, \ - .ws = BSP_I2S_LCLK, \ - .dout = BSP_I2S_DOUT, \ - .din = BSP_I2S_DSIN, \ - .invert_flags = { \ - .mclk_inv = false, \ - .bclk_inv = false, \ - .ws_inv = false, \ - }, \ - } - -/* This configuration is used by default in `bsp_extra_audio_init()` */ -#define BSP_I2S_DUPLEX_MONO_CFG(_sample_rate) \ - { \ - .clk_cfg = I2S_STD_CLK_DEFAULT_CONFIG(_sample_rate), \ - .slot_cfg = I2S_STD_PHILIP_SLOT_DEFAULT_CONFIG(I2S_DATA_BIT_WIDTH_16BIT, I2S_SLOT_MODE_MONO), \ - .gpio_cfg = BSP_I2S_GPIO_CFG, \ - } - -#define USE_I2S_RX_CHAN (1) - -static const char *TAG = "bsp_extra_board"; - -static esp_codec_dev_handle_t play_dev_handle; -static esp_codec_dev_handle_t record_dev_handle; - -static bool _is_audio_init = false; -static bool _is_player_init = false; -static int _vloume_intensity = CODEC_DEFAULT_VOLUME; - -static audio_player_cb_t audio_idle_callback = NULL; -static void *audio_idle_cb_user_data = NULL; -static char audio_file_path[128]; - -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ -static i2s_chan_handle_t i2s_tx_chan = NULL; -#if USE_I2S_RX_CHAN -static i2s_chan_handle_t i2s_rx_chan = NULL; -#endif - -/************************************************************************************************** - * - * I2S Audio Function - * - **************************************************************************************************/ -#define EXAMPLE_BUFF_SIZE 2048 - -static void i2s_example_write_task(void *args) -{ - uint8_t *w_buf = (uint8_t *)calloc(1, EXAMPLE_BUFF_SIZE); - assert(w_buf); // Check if w_buf allocation success - - /* Assign w_buf */ - for (int i = 0; i < EXAMPLE_BUFF_SIZE; i += 8) { - w_buf[i] = 0x12; - w_buf[i + 1] = 0x34; - w_buf[i + 2] = 0x56; - w_buf[i + 3] = 0x78; - w_buf[i + 4] = 0x9A; - w_buf[i + 5] = 0xBC; - w_buf[i + 6] = 0xDE; - w_buf[i + 7] = 0xF0; - } - - size_t w_bytes = EXAMPLE_BUFF_SIZE; - - // /* (Optional) Preload the data before enabling the TX channel, so that the valid data can be transmitted immediately */ - // while (w_bytes == EXAMPLE_BUFF_SIZE) { - // /* Here we load the target buffer repeatedly, until all the DMA buffers are preloaded */ - // ESP_ERROR_CHECK(i2s_channel_preload_data(tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes)); - // } - - /* Enable the TX channel */ - // ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - while (1) { - /* Write i2s data */ - if (i2s_channel_write(i2s_tx_chan, w_buf, EXAMPLE_BUFF_SIZE, &w_bytes, 1000) == ESP_OK) { - printf("Write Task: i2s write %d bytes\n", w_bytes); - } else { - printf("Write Task: i2s write failed\n"); - } - vTaskDelay(pdMS_TO_TICKS(200)); - } - free(w_buf); - vTaskDelete(NULL); -} - -esp_err_t bsp_extra_audio_init(const i2s_std_config_t *i2s_config) -{ - esp_err_t ret = ESP_FAIL; -#if USE_I2S_RX_CHAN - if (i2s_tx_chan && i2s_rx_chan) { -#else - if (i2s_tx_chan) { -#endif - /* Audio was initialized before */ - return ESP_OK; - } - - /* Setup I2S peripheral */ - i2s_chan_config_t chan_cfg = I2S_CHANNEL_DEFAULT_CONFIG(CONFIG_BSP_I2S_NUM, I2S_ROLE_MASTER); - chan_cfg.auto_clear = true; // Auto clear the legacy data in the DMA buffer -#if USE_I2S_RX_CHAN - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, &i2s_rx_chan)); -#else - ESP_ERROR_CHECK(i2s_new_channel(&chan_cfg, &i2s_tx_chan, NULL)); -#endif - - /* Setup I2S channels */ - const i2s_std_config_t std_cfg_default = BSP_I2S_DUPLEX_MONO_CFG(22050); - const i2s_std_config_t *p_i2s_cfg = &std_cfg_default; - if (i2s_config != NULL) { - p_i2s_cfg = i2s_config; - } - - if (i2s_tx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_tx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_tx_chan)); - } -#if USE_I2S_RX_CHAN - if (i2s_rx_chan != NULL) { - ESP_ERROR_CHECK(i2s_channel_init_std_mode(i2s_rx_chan, p_i2s_cfg)); - ESP_ERROR_CHECK(i2s_channel_enable(i2s_rx_chan)); - } -#endif - - audio_codec_i2s_cfg_t i2s_cfg = { - .port = CONFIG_BSP_I2S_NUM, - .tx_handle = i2s_tx_chan, -#if USE_I2S_RX_CHAN - .rx_handle = i2s_rx_chan, -#else - .rx_handle = NULL, -#endif - }; - i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); - - return ESP_OK; -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_speaker_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_TYPE_OUT, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN_OUT, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_dev_cfg); -} - -esp_codec_dev_handle_t bsp_extra_audio_codec_microphone_init(void) -{ - if (i2s_data_if == NULL) { - /* Initilize I2C */ - ESP_ERROR_CHECK(bsp_i2c_init()); - /* Configure I2S peripheral and Power Amplifier */ - ESP_ERROR_CHECK(bsp_extra_audio_init(NULL)); - } - assert(i2s_data_if); - - const audio_codec_gpio_if_t *gpio_if = audio_codec_new_gpio(); - - audio_codec_i2c_cfg_t i2c_cfg = { - .port = BSP_I2C_NUM, - .addr = ES8311_CODEC_DEFAULT_ADDR, - }; - const audio_codec_ctrl_if_t *i2c_ctrl_if = audio_codec_new_i2c_ctrl(&i2c_cfg); - assert(i2c_ctrl_if); - - esp_codec_dev_hw_gain_t gain = { - .pa_voltage = 5.0, - .codec_dac_voltage = 3.3, - }; - - es8311_codec_cfg_t es8311_cfg = { - .ctrl_if = i2c_ctrl_if, - .gpio_if = gpio_if, - .codec_mode = ESP_CODEC_DEV_WORK_MODE_BOTH, - .pa_pin = BSP_POWER_AMP_IO, - .pa_reverted = false, - .master_mode = false, - .use_mclk = true, - .digital_mic = false, - .invert_mclk = false, - .invert_sclk = false, - .hw_gain = gain, - }; - - const audio_codec_if_t *es8311_dev = es8311_codec_new(&es8311_cfg); - assert(es8311_dev); - - esp_codec_dev_cfg_t codec_es8311_dev_cfg = { - .dev_type = ESP_CODEC_DEV_TYPE_IN, - .codec_if = es8311_dev, - .data_if = i2s_data_if, - }; - return esp_codec_dev_new(&codec_es8311_dev_cfg); -} - -static esp_err_t audio_mute_function(AUDIO_PLAYER_MUTE_SETTING setting) -{ - // Volume saved when muting and restored when unmuting. Restoring volume is necessary - // as es8311_set_voice_mute(true) results in voice volume (REG32) being set to zero. - - bsp_extra_codec_mute_set(setting == AUDIO_PLAYER_MUTE ? true : false); - - // restore the voice volume upon unmuting - if (setting == AUDIO_PLAYER_UNMUTE) { - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, _vloume_intensity), TAG, "Set Codec volume failed"); - } - - return ESP_OK; -} - -static void audio_callback(audio_player_cb_ctx_t *ctx) -{ - if (audio_idle_callback) { - ctx->user_ctx = audio_idle_cb_user_data; - audio_idle_callback(ctx); - } -} - -/************************************************************************************************** - * - * Extra Board Function - * - **************************************************************************************************/ - -esp_err_t bsp_extra_i2s_read(void *audio_buffer, size_t len, size_t *bytes_read, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_read(record_dev_handle, audio_buffer, len); - *bytes_read = len; - return ret; -} - -esp_err_t bsp_extra_i2s_write(void *audio_buffer, size_t len, size_t *bytes_written, uint32_t timeout_ms) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_write(play_dev_handle, audio_buffer, len); - *bytes_written = len; - return ret; -} - -esp_err_t bsp_extra_codec_set_fs(uint32_t rate, uint32_t bits_cfg, i2s_slot_mode_t ch) -{ - esp_err_t ret = ESP_OK; - - esp_codec_dev_sample_info_t fs = { - .sample_rate = rate, - .channel = ch, - .bits_per_sample = bits_cfg, - }; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - if (record_dev_handle) { - ret |= esp_codec_dev_close(record_dev_handle); - ret |= esp_codec_dev_set_in_gain(record_dev_handle, CODEC_DEFAULT_ADC_VOLUME); - } - - if (play_dev_handle) { - ret |= esp_codec_dev_open(play_dev_handle, &fs); - } - if (record_dev_handle) { - ret |= esp_codec_dev_open(record_dev_handle, &fs); - } - return ret; -} - -esp_err_t bsp_extra_codec_volume_set(int volume, int *volume_set) -{ - ESP_RETURN_ON_ERROR(esp_codec_dev_set_out_vol(play_dev_handle, volume), TAG, "Set Codec volume failed"); - _vloume_intensity = volume; - - ESP_LOGI(TAG, "Setting volume: %d", volume); - - return ESP_OK; -} - -int bsp_extra_codec_volume_get(void) -{ - return _vloume_intensity; -} - -esp_err_t bsp_extra_codec_mute_set(bool enable) -{ - esp_err_t ret = ESP_OK; - ret = esp_codec_dev_set_out_mute(play_dev_handle, enable); - return ret; -} - -esp_err_t bsp_extra_codec_dev_stop(void) -{ - esp_err_t ret = ESP_OK; - - if (play_dev_handle) { - ret = esp_codec_dev_close(play_dev_handle); - } - - if (record_dev_handle) { - ret = esp_codec_dev_close(record_dev_handle); - } - return ret; -} - -esp_err_t bsp_extra_codec_dev_resume(void) -{ - return bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); -} - -esp_err_t bsp_extra_codec_init() -{ - if (_is_audio_init) { - return ESP_OK; - } - - play_dev_handle = bsp_extra_audio_codec_speaker_init(); - assert((play_dev_handle) && "play_dev_handle not initialized"); - - record_dev_handle = bsp_extra_audio_codec_microphone_init(); - assert((record_dev_handle) && "record_dev_handle not initialized"); - - bsp_extra_codec_set_fs(CODEC_DEFAULT_SAMPLE_RATE, CODEC_DEFAULT_BIT_WIDTH, CODEC_DEFAULT_CHANNEL); - - _is_audio_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_init(void) -{ - if (_is_player_init) { - return ESP_OK; - } - - audio_player_config_t config = { .mute_fn = audio_mute_function, - .write_fn = bsp_extra_i2s_write, - .clk_set_fn = bsp_extra_codec_set_fs, - .priority = 5 - }; - ESP_RETURN_ON_ERROR(audio_player_new(config), TAG, "audio_player_init failed"); - audio_player_callback_register(audio_callback, NULL); - - _is_player_init = true; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_del(void) -{ - _is_player_init = false; - - ESP_RETURN_ON_ERROR(audio_player_delete(), TAG, "audio_player_delete failed"); - - return ESP_OK; -} - -esp_err_t bsp_extra_file_instance_init(const char *path, file_iterator_instance_t **ret_instance) -{ - ESP_RETURN_ON_FALSE(path, ESP_FAIL, TAG, "path is NULL"); - ESP_RETURN_ON_FALSE(ret_instance, ESP_FAIL, TAG, "ret_instance is NULL"); - - file_iterator_instance_t *file_iterator = file_iterator_new(path); - ESP_RETURN_ON_FALSE(file_iterator, ESP_FAIL, TAG, "file_iterator_new failed, %s", path); - - *ret_instance = file_iterator; - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_index(file_iterator_instance_t *instance, int index) -{ - ESP_RETURN_ON_FALSE(instance, ESP_FAIL, TAG, "instance is NULL"); - - ESP_LOGI(TAG, "play_index(%d)", index); - char filename[128]; - int retval = file_iterator_get_full_path_from_index(instance, index, filename, sizeof(filename)); - ESP_RETURN_ON_FALSE(retval != 0, ESP_FAIL, TAG, "file_iterator_get_full_path_from_index failed"); - - ESP_LOGI(TAG, "opening file '%s'", filename); - FILE *fp = fopen(filename, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", filename); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, filename, sizeof(audio_file_path)); - - return ESP_OK; -} - -esp_err_t bsp_extra_player_play_file(const char *file_path) -{ - ESP_LOGI(TAG, "opening file '%s'", file_path); - FILE *fp = fopen(file_path, "rb"); - ESP_RETURN_ON_FALSE(fp, ESP_FAIL, TAG, "unable to open file"); - - ESP_LOGI(TAG, "Playing '%s'", file_path); - ESP_RETURN_ON_ERROR(audio_player_play(fp), TAG, "audio_player_play failed"); - - memcpy(audio_file_path, file_path, sizeof(audio_file_path)); - - return ESP_OK; -} - -void bsp_extra_player_register_callback(audio_player_cb_t cb, void *user_data) -{ - audio_idle_callback = cb; - audio_idle_cb_user_data = user_data; -} - -bool bsp_extra_player_is_playing_by_path(const char *file_path) -{ - return (strcmp(audio_file_path, file_path) == 0); -} - -bool bsp_extra_player_is_playing_by_index(file_iterator_instance_t *instance, int index) -{ - return (index == file_iterator_get_index(instance)); -} \ No newline at end of file diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/CMakeLists.txt b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/CMakeLists.txt deleted file mode 100644 index d276876a85bab2519a9e0b3b709a42cf6d826688..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -#IDF version is less than IDF5.0 -if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "5.0") - set(SRC_VER "esp_sparkbot_bsp_idf4.c") -else() - set(SRC_VER "esp_sparkbot_bsp_idf5.c") -endif() - -idf_component_register( - SRCS "esp_sparkbot_bsp.c" ${SRC_VER} - INCLUDE_DIRS "include" "include/bsp" - PRIV_INCLUDE_DIRS "priv_include" - REQUIRES driver spiffs touch_element - PRIV_REQUIRES fatfs esp_lcd -) diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/Kconfig b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/Kconfig deleted file mode 100644 index 9306c9c9c46b8c187959c1fec008862337618d9d..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/Kconfig +++ /dev/null @@ -1,105 +0,0 @@ -menu "Board Support Package" - - config BSP_ERROR_CHECK - bool "Enable error check in BSP" - default y - help - Error check assert the application before returning the error code. - - menu "I2C" - config BSP_I2C_NUM - int "I2C peripheral index" - default 1 - range 0 1 - help - ESP32-S2 has two I2C peripherals, pick the one you want to use. - - config BSP_I2C_FAST_MODE - bool "Enable I2C fast mode" - default y - help - I2C has two speed modes: normal (100kHz) and fast (400kHz). - - config BSP_I2C_CLK_SPEED_HZ - int - default 400000 if BSP_I2C_FAST_MODE - default 100000 - endmenu - - menu "SPIFFS - Virtual File System" - config BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - bool "Format SPIFFS if mounting fails" - default n - help - Format SPIFFS if it fails to mount the filesystem. - - config BSP_SPIFFS_MOUNT_POINT - string "SPIFFS mount point" - default "/spiffs" - help - Mount point of SPIFFS in the Virtual File System. - - config BSP_SPIFFS_PARTITION_LABEL - string "Partition label of SPIFFS" - default "storage" - help - Partition label which stores SPIFFS. - - config BSP_SPIFFS_MAX_FILES - int "Maximum files that could be open at the same time" - default 2 - help - Supported max files for SPIFFS in the Virtual File System. - endmenu - - menu "uSD card - Virtual File System" - config BSP_SD_FORMAT_ON_MOUNT_FAIL - bool "Format uSD card if mounting fails" - default n - help - The SDMMC host will format (FAT) the uSD card if it fails to mount the filesystem. - - config BSP_SD_MOUNT_POINT - string "uSD card mount point" - default "/sdcard" - help - Mount point of the uSD card in the Virtual File System - - endmenu - menu "Display" - config BSP_DISPLAY_LVGL_TASK_PRIORITY - int "LVGL task priority" - default 2 - help - The Board Support Package will create a task that will periodically handle LVGL operation in lv_timer_handler(). - - config BSP_DISPLAY_LVGL_TICK - int "LVGL tick period" - default 5 - range 1 100 - help - Period of LVGL tick timer. - - config BSP_DISPLAY_LVGL_MAX_SLEEP - int "LVGL maximum sleep time in ms" - default 1 - range 1 500 - help - Maximum time for task sleep in ms. - - config BSP_DISPLAY_BRIGHTNESS_LEDC_CH - int "LEDC channel index" - default 1 - range 0 7 - help - LEDC channel is used to generate PWM signal that controls display brightness. - Set LEDC index that should be used. - endmenu - - config BSP_I2S_NUM - int "I2S peripheral index" - default 1 - range 0 1 - help - ESP32S3 has two I2S peripherals, pick the one you want to use. -endmenu diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/LICENSE b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/LICENSE deleted file mode 100644 index d645695673349e3947e8e5ae42332d0ac3164cd7..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/README.md b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/README.md deleted file mode 100644 index 029d9371f5b7eb2753ade93ab4e7e79de973a312..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# BSP: ESP-SparkBot - -[![Component Registry](https://components.espressif.com/components/espressif/esp32_s3_eye/badge.svg)](https://components.espressif.com/components/espressif/esp32_s3_eye) - -### Overview - -The ESP32-S3-EYE board consists of two parts: the main board (ESP32-S3-EYE-MB) that integrates the ESP32-S3-WROOM-1 module, camera, uSD card slot, digital microphone, USB port, and function buttons; and the sub board (ESP32-S3-EYE-SUB) that contains an LCD display. The main board and sub board are connected through pin headers. - -* [Hardware Reference](https://www.espressif.com/en/products/devkits/esp-eye/overview.) - -![](https://raw.githubusercontent.com/espressif/esp-who/master/docs/_static/get-started/ESP32-S3-EYE_MB-annotated-photo.png) - -**The development board has the following features:** -* ESP32-S3 module with built-in 8 MB flash and 8 MB octal RAM -* 1.3-inch 240x240 LCD color screen -* Onboard uSD card slot -* Digital microphone -* Accelerometer -* OV2640 camera - - -### Capabilities and dependencies -| Capability | Available | Component | Version | -|-------------|------------------|----------------------------------------------------------------------------------------------|----------| -| DISPLAY |:heavy_check_mark:| idf | >=4.4.5 | -| LVGL_PORT |:heavy_check_mark:|[espressif/esp_lvgl_port](https://components.espressif.com/components/espressif/esp_lvgl_port)| ^2 | -| TOUCH | :x: | | | -| BUTTONS |:heavy_check_mark:| [espressif/button](https://components.espressif.com/components/espressif/button) |>=2.5,<4.0| -| AUDIO |:heavy_check_mark:|[espressif/esp_codec_dev](https://components.espressif.com/components/espressif/esp_codec_dev)| ^1,<1.2 | -|AUDIO_SPEAKER| :x: | | | -| AUDIO_MIC |:heavy_check_mark:| | | -| SDCARD |:heavy_check_mark:| idf | >=4.4.5 | -| IMU |:heavy_check_mark:| [qma6100p](https://components.espressif.com/components/qma6100p) | 1.* | -| CAMERA |:heavy_check_mark:| [espressif/esp32-camera](https://components.espressif.com/components/espressif/esp32-camera) | ^2.0.2 | - diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c deleted file mode 100644 index 5590a9e8ed2e9c781c52d9703c56fd24aabf8d92..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp.c +++ /dev/null @@ -1,475 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include "esp_vfs_fat.h" -#include "esp_lcd_panel_io.h" -#include "esp_lcd_panel_vendor.h" -#include "esp_lcd_panel_ops.h" -#include "esp_log.h" -#include "esp_check.h" -#include "esp_vfs_fat.h" -#include "esp_spiffs.h" - -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" - -#include "driver/spi_master.h" -#include "driver/ledc.h" -#include "driver/i2c.h" - -#include "touch_element/touch_button.h" - -#include "esp_codec_dev_defaults.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "bsp/display.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -static i2c_master_bus_handle_t i2c_handle = NULL; // I2C Handle - -static i2s_chan_handle_t i2s_tx_chan = NULL; -static i2s_chan_handle_t i2s_rx_chan = NULL; -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ - - -// Touch Button -// #define CONFIG_TOUCH_ELEM_EVENT 1 -#define CONFIG_TOUCH_ELEM_CALLBACK 1 -#define TOUCH_BUTTON_NUM 3 -/* Touch buttons handle */ -static touch_button_handle_t button_handle[TOUCH_BUTTON_NUM]; - -/* Touch buttons channel array */ -static const touch_pad_t channel_array[TOUCH_BUTTON_NUM] = { - TOUCH_PAD_NUM1, - TOUCH_PAD_NUM2, - TOUCH_PAD_NUM3, -}; - -/* Touch buttons channel sensitivity array */ -static const float channel_sens_array[TOUCH_BUTTON_NUM] = { - 0.04F, - 0.1F, - 0.1F, -}; - -static bool i2c_initialized = false; -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; -#endif - -static const button_config_t bsp_button_config[BSP_BUTTON_NUM] = { - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_MENU, - .adc_button_config.min = 2310, // middle is 2410mV - .adc_button_config.max = 2510 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_PLAY, - .adc_button_config.min = 1880, // middle is 1980mV - .adc_button_config.max = 2080 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_DOWN, - .adc_button_config.min = 720, // middle is 820mV - .adc_button_config.max = 920 - }, - { - .type = BUTTON_TYPE_ADC, -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - .adc_button_config.adc_handle = &bsp_adc_handle, -#endif - .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 - .adc_button_config.button_index = BSP_BUTTON_UP, - .adc_button_config.min = 280, // middle is 380mV - .adc_button_config.max = 480 - }, - { - .type = BUTTON_TYPE_GPIO, - .gpio_button_config.active_level = 0, - .gpio_button_config.gpio_num = BSP_BUTTON_BOOT_IO - } -}; - -esp_err_t bsp_i2c_init(void) -{ - /* I2C was initialized before */ - if (i2c_initialized) { - return ESP_OK; - } - - const i2c_config_t i2c_conf = { - .mode = I2C_MODE_MASTER, - .sda_io_num = BSP_I2C_SDA, - .sda_pullup_en = GPIO_PULLUP_ENABLE, - .scl_io_num = BSP_I2C_SCL, - .scl_pullup_en = GPIO_PULLUP_ENABLE, - .master.clk_speed = 400000 - }; - BSP_ERROR_CHECK_RETURN_ERR(i2c_param_config(BSP_I2C_NUM, &i2c_conf)); - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_install(BSP_I2C_NUM, i2c_conf.mode, 0, 0, 0)); - - i2c_initialized = true; - - return ESP_OK; -} - -esp_err_t bsp_i2c_deinit(void) -{ - BSP_ERROR_CHECK_RETURN_ERR(i2c_driver_delete(BSP_I2C_NUM)); - i2c_initialized = false; - return ESP_OK; -} - -esp_err_t bsp_spiffs_mount(void) -{ - esp_vfs_spiffs_conf_t conf = { - .base_path = CONFIG_BSP_SPIFFS_MOUNT_POINT, - .partition_label = CONFIG_BSP_SPIFFS_PARTITION_LABEL, - .max_files = CONFIG_BSP_SPIFFS_MAX_FILES, -#ifdef CONFIG_BSP_SPIFFS_FORMAT_ON_MOUNT_FAIL - .format_if_mount_failed = true, -#else - .format_if_mount_failed = false, -#endif - }; - - esp_err_t ret_val = esp_vfs_spiffs_register(&conf); - - BSP_ERROR_CHECK_RETURN_ERR(ret_val); - - size_t total = 0, used = 0; - ret_val = esp_spiffs_info(conf.partition_label, &total, &used); - if (ret_val != ESP_OK) { - ESP_LOGE(TAG, "Failed to get SPIFFS partition information (%s)", esp_err_to_name(ret_val)); - } else { - ESP_LOGI(TAG, "Partition size: total: %d, used: %d", total, used); - } - - return ret_val; -} - -esp_err_t bsp_spiffs_unmount(void) -{ - return esp_vfs_spiffs_unregister(CONFIG_BSP_SPIFFS_PARTITION_LABEL); -} - - -#define LCD_CMD_BITS (8) -#define LCD_PARAM_BITS (8) -#define LCD_LEDC_CH (CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH) -#define LVGL_TICK_PERIOD_MS (CONFIG_BSP_DISPLAY_LVGL_TICK) -#define LVGL_MAX_SLEEP_MS (CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP) - -esp_err_t bsp_display_brightness_init(void) -{ - gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << BSP_LCD_BACKLIGHT), - .mode = GPIO_MODE_OUTPUT, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .pull_up_en = GPIO_PULLUP_DISABLE, - .intr_type = GPIO_INTR_DISABLE - }; - gpio_config(&io_conf); - - return ESP_OK; -} - -esp_err_t bsp_display_backlight_off(void) -{ - ESP_LOGI(TAG, "Backlight off"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 0); -} - -esp_err_t bsp_display_backlight_on(void) -{ - ESP_LOGI(TAG, "Backlight on"); - return gpio_set_level(BSP_LCD_BACKLIGHT, 1); -} - -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io) -{ - esp_err_t ret = ESP_OK; - assert(config != NULL && config->max_transfer_sz > 0); - - ESP_RETURN_ON_ERROR(bsp_display_brightness_init(), TAG, "Brightness init failed"); - - ESP_LOGD(TAG, "Initialize SPI bus"); - const spi_bus_config_t buscfg = { - .sclk_io_num = BSP_LCD_SPI_CLK, - .mosi_io_num = BSP_LCD_SPI_MOSI, - .miso_io_num = GPIO_NUM_NC, - .quadwp_io_num = GPIO_NUM_NC, - .quadhd_io_num = GPIO_NUM_NC, - .max_transfer_sz = config->max_transfer_sz, - }; - ESP_RETURN_ON_ERROR(spi_bus_initialize(BSP_LCD_SPI_NUM, &buscfg, SPI_DMA_CH_AUTO), TAG, "SPI init failed"); - - ESP_LOGD(TAG, "Install panel IO"); - const esp_lcd_panel_io_spi_config_t io_config = { - .dc_gpio_num = BSP_LCD_DC, - .cs_gpio_num = BSP_LCD_SPI_CS, - .pclk_hz = BSP_LCD_PIXEL_CLOCK_HZ, - .lcd_cmd_bits = LCD_CMD_BITS, - .lcd_param_bits = LCD_PARAM_BITS, - .spi_mode = 2, - .trans_queue_depth = 10, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)BSP_LCD_SPI_NUM, &io_config, ret_io), err, TAG, "New panel IO failed"); - - ESP_LOGD(TAG, "Install LCD driver"); - const esp_lcd_panel_dev_config_t panel_config = { - .reset_gpio_num = BSP_LCD_RST, - .color_space = BSP_LCD_COLOR_SPACE, - .bits_per_pixel = BSP_LCD_BITS_PER_PIXEL, - }; - ESP_GOTO_ON_ERROR(esp_lcd_new_panel_st7789(*ret_io, &panel_config, ret_panel), err, TAG, "New panel failed"); - - - esp_lcd_panel_reset(*ret_panel); - esp_lcd_panel_init(*ret_panel); - esp_lcd_panel_invert_color(*ret_panel, true); - return ret; - -err: - if (*ret_panel) { - esp_lcd_panel_del(*ret_panel); - } - if (*ret_io) { - esp_lcd_panel_io_del(*ret_io); - } - spi_bus_free(BSP_LCD_SPI_NUM); - return ret; -} - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -static lv_display_t *bsp_display_lcd_init(const bsp_display_cfg_t *cfg) -{ - assert(cfg != NULL); - esp_lcd_panel_io_handle_t io_handle = NULL; - esp_lcd_panel_handle_t panel_handle = NULL; - const bsp_display_config_t bsp_disp_cfg = { - .max_transfer_sz = cfg->trans_size ? (cfg->trans_size * sizeof(uint16_t)): (BSP_LCD_DRAW_BUFF_SIZE * sizeof(uint16_t)), - }; - BSP_ERROR_CHECK_RETURN_NULL(bsp_display_new(&bsp_disp_cfg, &panel_handle, &io_handle)); - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) - esp_lcd_panel_disp_off(panel_handle, false); -#else - esp_lcd_panel_disp_on_off(panel_handle, true); -#endif - - /* Add LCD screen */ - ESP_LOGD(TAG, "Add LCD screen"); - const lvgl_port_display_cfg_t disp_cfg = { - .io_handle = io_handle, - .panel_handle = panel_handle, - .buffer_size = cfg->buffer_size, - .trans_size = cfg->trans_size, - .double_buffer = cfg->double_buffer, - .hres = BSP_LCD_H_RES, - .vres = BSP_LCD_V_RES, - .monochrome = false, - /* Rotation values must be same as used in esp_lcd for initial settings of the screen */ - .rotation = { - .swap_xy = false, - .mirror_x = false, - .mirror_y = false, - }, - .flags = { - .buff_dma = cfg->flags.buff_dma, - .buff_spiram = cfg->flags.buff_spiram, -#if LVGL_VERSION_MAJOR >= 9 - .swap_bytes = (BSP_LCD_BIGENDIAN ? true : false), -#endif - } - }; - - return lvgl_port_add_disp(&disp_cfg); -} - -lv_display_t *bsp_display_start(void) -{ - bsp_display_cfg_t cfg = { - .lvgl_port_cfg = { - .task_priority = CONFIG_BSP_DISPLAY_LVGL_TASK_PRIORITY, - .task_stack = 6144, - .task_affinity = 1, - .timer_period_ms = LVGL_TICK_PERIOD_MS, - .task_max_sleep_ms = LVGL_MAX_SLEEP_MS, - }, - .buffer_size = BSP_LCD_DRAW_BUFF_SIZE, - .double_buffer = BSP_LCD_DRAW_BUFF_DOUBLE, - .flags = { - .buff_dma = true, - .buff_spiram = false, - } - }; - return bsp_display_start_with_config(&cfg); -} - -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg) -{ - lv_display_t *disp; - assert(cfg != NULL); - BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg)); - BSP_NULL_CHECK(disp = bsp_display_lcd_init(cfg), NULL); - - return disp; -} - -lv_indev_t *bsp_display_get_input_dev(void) -{ - return NULL; -} - -bool bsp_display_lock(uint32_t timeout_ms) -{ - return lvgl_port_lock(timeout_ms); -} - -void bsp_display_unlock(void) -{ - lvgl_port_unlock(); -} - -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation) -{ - lv_disp_set_rotation(disp, rotation); -} -#endif // (BSP_CONFIG_NO_GRAPHIC_LIB == 0) - - - - -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size) -{ - esp_err_t ret = ESP_OK; - if ((btn_array_size < BSP_BUTTON_NUM) || - (btn_array == NULL)) { - return ESP_ERR_INVALID_ARG; - } -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) - /* Initialize ADC and get ADC handle */ - BSP_ERROR_CHECK_RETURN_NULL(bsp_adc_initialize()); - bsp_adc_handle = bsp_adc_get_handle(); -#endif - - if (btn_cnt) { - *btn_cnt = 0; - } - for (int i = 0; i < BSP_BUTTON_NUM; i++) { - btn_array[i] = iot_button_create(&bsp_button_config[i]); - if (btn_array[i] == NULL) { - ret = ESP_FAIL; - break; - } - if (btn_cnt) { - (*btn_cnt)++; - } - } - return ret; -} - - -#ifdef CONFIG_TOUCH_ELEM_EVENT -/* Button event handler task */ -static void button_handler_task(void *arg) -{ - (void) arg; //Unused - touch_elem_message_t element_message; - while (1) { - /* Waiting for touch element messages */ - touch_element_message_receive(&element_message, portMAX_DELAY); - if (element_message.element_type != TOUCH_ELEM_TYPE_BUTTON) { - continue; - } - /* Decode message */ - const touch_button_message_t *button_message = touch_button_get_message(&element_message); - if (button_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { - ESP_LOGI(TAG, "Button[%d] Press", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { - ESP_LOGI(TAG, "Button[%d] Release", (int)element_message.arg); - } else if (button_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { - ESP_LOGI(TAG, "Button[%d] LongPress", (int)element_message.arg); - } - } -} -#elif CONFIG_TOUCH_ELEM_CALLBACK -/* Button callback routine */ -// static void button_handler(touch_button_handle_t out_handle, touch_button_message_t *out_message, void *arg) -// { -// (void) out_handle; //Unused -// if (out_message->event == TOUCH_BUTTON_EVT_ON_PRESS) { -// ESP_LOGI(TAG, "Button[%d] Press", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_RELEASE) { -// ESP_LOGI(TAG, "Button[%d] Release", (int)arg); -// } else if (out_message->event == TOUCH_BUTTON_EVT_ON_LONGPRESS) { -// ESP_LOGI(TAG, "Button[%d] LongPress", (int)arg); -// } -// } -#endif - -void bsp_touch_button_create(touch_button_callback_t button_callback) -{ - /* Initialize Touch Element library */ - touch_elem_global_config_t global_config = TOUCH_ELEM_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_element_install(&global_config)); - ESP_LOGI(TAG, "Touch element library installed"); - - touch_button_global_config_t button_global_config = TOUCH_BUTTON_GLOBAL_DEFAULT_CONFIG(); - ESP_ERROR_CHECK(touch_button_install(&button_global_config)); - ESP_LOGI(TAG, "Touch button installed"); - for (int i = 0; i < TOUCH_BUTTON_NUM; i++) { - touch_button_config_t button_config = { - .channel_num = channel_array[i], - .channel_sens = channel_sens_array[i] - }; - /* Create Touch buttons */ - ESP_ERROR_CHECK(touch_button_create(&button_config, &button_handle[i])); - /* Subscribe touch button events (On Press, On Release, On LongPress) */ - ESP_ERROR_CHECK(touch_button_subscribe_event(button_handle[i], - TOUCH_ELEM_EVENT_ON_PRESS | TOUCH_ELEM_EVENT_ON_RELEASE | TOUCH_ELEM_EVENT_ON_LONGPRESS, - (void *)channel_array[i])); -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_EVENT)); -#elif CONFIG_TOUCH_ELEM_CALLBACK - /* Set EVENT as the dispatch method */ - ESP_ERROR_CHECK(touch_button_set_dispatch_method(button_handle[i], TOUCH_ELEM_DISP_CALLBACK)); - /* Register a handler function to handle event messages */ - ESP_ERROR_CHECK(touch_button_set_callback(button_handle[i], button_callback)); -#endif - /* Set LongPress event trigger threshold time */ - ESP_ERROR_CHECK(touch_button_set_longpress(button_handle[i], 2000)); - } - ESP_LOGI(TAG, "Touch buttons created"); - -#ifdef CONFIG_TOUCH_ELEM_EVENT - /* Create a handler task to handle event messages */ - xTaskCreate(&button_handler_task, "button_handler_task", 4 * 1024, NULL, 5, NULL); -#endif - - touch_element_start(); - ESP_LOGI(TAG, "Touch element library start"); -} diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c deleted file mode 100644 index d0102b9594f27b0a71b946ca26ae8fed4987c7f3..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf4.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -/* Sample rate of MSM261S4030H0 */ -#define BSP_MIC_SAMPLE_RATE (48000u) - -/* This configuration is used by default in bsp_audio_init() */ -#define BSP_I2S_SIMPLEX_MONO_CFG(_sample_rate) \ - { \ - .mode = I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_RX, \ - .sample_rate = _sample_rate, \ - .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, \ - .channel_format = I2S_CHANNEL_FMT_ONLY_LEFT, \ - .communication_format = I2S_COMM_FORMAT_STAND_I2S, \ - .dma_buf_count = 3, \ - .dma_buf_len = 1024, \ - .use_apll = true, \ - .tx_desc_auto_clear = true, \ - .intr_alloc_flags = ESP_INTR_FLAG_LEVEL2 | ESP_INTR_FLAG_IRAM \ - } - - -esp_err_t bsp_adc_initialize(void) -{ - return ESP_OK; -} diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c deleted file mode 100644 index bbb57ec66f33ea613282b14aa18948e9e482765c..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/esp_sparkbot_bsp_idf5.c +++ /dev/null @@ -1,35 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include "esp_err.h" -#include "bsp/esp_sparkbot_bsp.h" -#include "bsp_err_check.h" -#include "esp_codec_dev_defaults.h" - -static const char *TAG = "ESP-SparkBot-BSP"; - -static adc_oneshot_unit_handle_t bsp_adc_handle = NULL; - -esp_err_t bsp_adc_initialize(void) -{ - /* ADC was initialized before */ - if (bsp_adc_handle != NULL) { - return ESP_OK; - } - - /* Initialize ADC */ - const adc_oneshot_unit_init_cfg_t init_config1 = { - .unit_id = BSP_ADC_UNIT, - }; - BSP_ERROR_CHECK_RETURN_ERR(adc_oneshot_new_unit(&init_config1, &bsp_adc_handle)); - - return ESP_OK; -} - -adc_oneshot_unit_handle_t bsp_adc_get_handle(void) -{ - return bsp_adc_handle; -} diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/idf_component.yml b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/idf_component.yml deleted file mode 100644 index fbc0e4ed14dee549e55ab3b86920ffa296aead72..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/idf_component.yml +++ /dev/null @@ -1,24 +0,0 @@ -version: "3.1.0~1" -description: Board Support Package (BSP) for ESP32-SparkBot - -targets: - - esp32s3 - -tags: - - bsp - -dependencies: - idf: ">=4.4.5" - - espressif/esp_lvgl_port: - version: "2.4.1" - public: true - - button: - version: ">=2.5,<4.0" - public: true - - esp_codec_dev: - version: "==1.1.0" - public: true - diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/config.h b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/config.h deleted file mode 100644 index f3cb5ebe7389d59cea35c3444aaadb3c0c94b6cc..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -/************************************************************************************************** - * BSP configuration - **************************************************************************************************/ -// By default, this BSP is shipped with LVGL graphical library. Enabling this option will exclude it. -// If you want to use BSP without LVGL, select BSP version with 'noglib' suffix. -#if !defined(BSP_CONFIG_NO_GRAPHIC_LIB) // Check if the symbol is not coming from compiler definitions (-D...) -#define BSP_CONFIG_NO_GRAPHIC_LIB (0) -#endif diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/display.h b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/display.h deleted file mode 100644 index 213b4720ad7e19686aa029e4ee6b7680824ac761..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/display.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief BSP LCD - * - * This file offers API for basic LCD control. - * It is useful for users who want to use the LCD without the default Graphical Library LVGL. - * - * For standard LCD initialization with LVGL graphical library, you can call all-in-one function bsp_display_start(). - */ - -#pragma once -#include "esp_lcd_types.h" - -/* LCD color formats */ -#define ESP_LCD_COLOR_FORMAT_RGB565 (1) -#define ESP_LCD_COLOR_FORMAT_RGB888 (2) - -/* LCD display color format */ -#define BSP_LCD_COLOR_FORMAT (ESP_LCD_COLOR_FORMAT_RGB565) -/* LCD display color bytes endianess */ -#define BSP_LCD_BIGENDIAN (1) -/* LCD display color bits */ -#define BSP_LCD_BITS_PER_PIXEL (16) -/* LCD display color space */ -#define BSP_LCD_COLOR_SPACE (ESP_LCD_COLOR_SPACE_RGB) -/* LCD display definition */ -#define BSP_LCD_H_RES (240) -#define BSP_LCD_V_RES (240) - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * @brief BSP display configuration structure - * - */ -typedef struct { - int max_transfer_sz; /*!< Maximum transfer size, in bytes. */ -} bsp_display_config_t; - -/** - * @brief Create new display panel - * - * For maximum flexibility, this function performs only reset and initialization of the display. - * You must turn on the display explicitly by calling esp_lcd_panel_disp_on_off(). - * The display's backlight is not turned on either. You can use bsp_display_backlight_on/off(), - * bsp_display_brightness_set() (on supported boards) or implement your own backlight control. - * - * If you want to free resources allocated by this function, you can use esp_lcd API, ie.: - * - * \code{.c} - * esp_lcd_panel_del(panel); - * esp_lcd_panel_io_del(io); - * spi_bus_free(spi_num_from_configuration); - * \endcode - * - * @param[in] config display configuration - * @param[out] ret_panel esp_lcd panel handle - * @param[out] ret_io esp_lcd IO handle - * @return - * - ESP_OK On success - * - Else esp_lcd failure - */ -esp_err_t bsp_display_new(const bsp_display_config_t *config, esp_lcd_panel_handle_t *ret_panel, esp_lcd_panel_io_handle_t *ret_io); - -/** - * @brief Initialize display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_init(void); - -/** - * @brief Set display's brightness - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @param[in] brightness_percent Brightness in [%] - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_brightness_set(int brightness_percent); - -/** - * @brief Turn on display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_on(void); - -/** - * @brief Turn off display backlight - * - * Brightness is controlled with PWM signal to a pin controlling backlight. - * Brightness must be already initialized by calling bsp_display_brightness_init() or bsp_display_new() - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Parameter error - */ -esp_err_t bsp_display_backlight_off(void); - -#ifdef __cplusplus -} -#endif diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h deleted file mode 100644 index ac223966e45efc7116ec6792a43e6203b8e5cee2..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/esp-bsp.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once -#include "bsp/esp_sparkbot_bsp.h" diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h deleted file mode 100644 index 125b5817aa4e6cd6811df8ccf12fd6759ec607d5..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/include/bsp/esp_sparkbot_bsp.h +++ /dev/null @@ -1,379 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/** - * @file - * @brief ESP BSP: ESP-SparkBot - */ - -#pragma once - -#include "sdkconfig.h" -#include "driver/gpio.h" -#include "driver/sdmmc_host.h" -#include "esp_codec_dev.h" -#include "iot_button.h" -#include "touch_element/touch_button.h" -#include "bsp/config.h" -#include "bsp/display.h" - -#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) -#include "driver/i2s.h" -#else -// #include "driver/i2c_master.h" -#include "driver/i2s_std.h" -#endif - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#include "lvgl.h" -#include "esp_lvgl_port.h" -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - -/************************************************************************************************** - * BSP Capabilities - **************************************************************************************************/ - -#define BSP_CAPS_DISPLAY 1 -#define BSP_CAPS_TOUCH 0 -#define BSP_CAPS_BUTTONS 1 -#define BSP_CAPS_AUDIO 1 -#define BSP_CAPS_AUDIO_SPEAKER 0 -#define BSP_CAPS_AUDIO_MIC 1 -#define BSP_CAPS_SDCARD 1 -#define BSP_CAPS_IMU 1 -#define BSP_CAPS_CAMERA 1 - -/************************************************************************************************** - * ESP-SparkBot-BSP pinout - **************************************************************************************************/ - -/* I2C */ -#define BSP_I2C_SCL (GPIO_NUM_5) -#define BSP_I2C_SDA (GPIO_NUM_4) - -/* Display */ -#define BSP_LCD_SPI_MOSI (GPIO_NUM_47) -#define BSP_LCD_SPI_CLK (GPIO_NUM_21) -#define BSP_LCD_SPI_CS (GPIO_NUM_44) -#define BSP_LCD_DC (GPIO_NUM_43) -#define BSP_LCD_RST (GPIO_NUM_NC) -#define BSP_LCD_BACKLIGHT (GPIO_NUM_46) - -/* Camera */ -#define BSP_CAMERA_XCLK (GPIO_NUM_15) -#define BSP_CAMERA_PCLK (GPIO_NUM_13) -#define BSP_CAMERA_VSYNC (GPIO_NUM_6) -#define BSP_CAMERA_HSYNC (GPIO_NUM_7) -#define BSP_CAMERA_D0 (GPIO_NUM_11) -#define BSP_CAMERA_D1 (GPIO_NUM_9) -#define BSP_CAMERA_D2 (GPIO_NUM_8) -#define BSP_CAMERA_D3 (GPIO_NUM_10) -#define BSP_CAMERA_D4 (GPIO_NUM_12) -#define BSP_CAMERA_D5 (GPIO_NUM_18) -#define BSP_CAMERA_D6 (GPIO_NUM_17) -#define BSP_CAMERA_D7 (GPIO_NUM_16) - -/* Buttons */ -#define BSP_BUTTON_BOOT_IO (GPIO_NUM_0) -#define BSP_BUTTONS_IO (GPIO_NUM_1) // All 4 buttons mapped to this GPIO -typedef enum bsp_led_t { - BSP_LED_GREEN = GPIO_NUM_3, -} bsp_led_t; - -#ifdef __cplusplus -extern "C" { -#endif - -/************************************************************************************************** - * - * Buttons interface - * - * Example configuration: - * \code{.c} - * button_handle_t btns[BSP_BUTTON_NUM]; - * bsp_iot_button_create(btns, NULL, BSP_BUTTON_NUM); - * iot_button_register_cb(btns[0], ... - * \endcode - **************************************************************************************************/ -typedef enum { - BSP_BUTTON_MENU = 0, - BSP_BUTTON_PLAY, - BSP_BUTTON_DOWN, - BSP_BUTTON_UP, - BSP_BUTTON_BOOT, - BSP_BUTTON_NUM -} bsp_button_t; - -/** - * @brief Initialize all buttons - * - * Returned button handlers must be used with espressif/button component API - * - * @note For LCD panel button which is defined as BSP_BUTTON_MAIN, bsp_display_start should - * be called before call this function. - * - * @param[out] btn_array Output button array - * @param[out] btn_cnt Number of button handlers saved to btn_array, can be NULL - * @param[in] btn_array_size Size of output button array. Must be at least BSP_BUTTON_NUM - * @return - * - ESP_OK All buttons initialized - * - ESP_ERR_INVALID_ARG btn_array is too small or NULL - * - ESP_FAIL Underlaying iot_button_create failed - */ -esp_err_t bsp_iot_button_create(button_handle_t btn_array[], int *btn_cnt, int btn_array_size); - - -void bsp_touch_button_create(touch_button_callback_t button_callback); - -/************************************************************************************************** - * - * I2C interface - * - * There are two devices connected to I2C peripheral: - * - QMA7981 Inertial measurement unit - * - OV2640 Camera module - **************************************************************************************************/ -#define BSP_I2C_NUM CONFIG_BSP_I2C_NUM - -/** - * @brief Init I2C driver - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - ESP_FAIL I2C driver installation error - * - */ -esp_err_t bsp_i2c_init(void); - -/** - * @brief Deinit I2C driver and free its resources - * - * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG I2C parameter error - * - */ -esp_err_t bsp_i2c_deinit(void); - -/************************************************************************************************** - * - * Camera interface - * - * ESP-SparkBot-BSP is shipped with OV2640 camera module. - * As a camera driver, esp32-camera component is used. - * - * Example configuration: - * \code{.c} - * const camera_config_t camera_config = BSP_CAMERA_DEFAULT_CONFIG; - * esp_err_t err = esp_camera_init(&camera_config); - * \endcode - **************************************************************************************************/ -/** - * @brief ESP-SparkBot-BSP camera default configuration - * - * In this configuration we select RGB565 color format and 240x240 image size - matching the display. - * We use double-buffering for the best performance. - * Since we don't want to waste internal SRAM, we allocate the framebuffers in external PSRAM. - * By setting XCLK to 16MHz, we configure the esp32-camera driver to use EDMA when accessing the PSRAM. - * - * @attention I2C must be enabled by bsp_i2c_init(), before camera is initialized - */ -#define BSP_CAMERA_DEFAULT_CONFIG \ - { \ - .pin_pwdn = GPIO_NUM_NC, \ - .pin_reset = GPIO_NUM_NC, \ - .pin_xclk = BSP_CAMERA_XCLK, \ - .pin_sccb_sda = GPIO_NUM_NC, \ - .pin_sccb_scl = GPIO_NUM_NC, \ - .pin_d7 = BSP_CAMERA_D7, \ - .pin_d6 = BSP_CAMERA_D6, \ - .pin_d5 = BSP_CAMERA_D5, \ - .pin_d4 = BSP_CAMERA_D4, \ - .pin_d3 = BSP_CAMERA_D3, \ - .pin_d2 = BSP_CAMERA_D2, \ - .pin_d1 = BSP_CAMERA_D1, \ - .pin_d0 = BSP_CAMERA_D0, \ - .pin_vsync = BSP_CAMERA_VSYNC, \ - .pin_href = BSP_CAMERA_HSYNC, \ - .pin_pclk = BSP_CAMERA_PCLK, \ - .xclk_freq_hz = 16000000, \ - .ledc_timer = LEDC_TIMER_0, \ - .ledc_channel = LEDC_CHANNEL_0, \ - .pixel_format = PIXFORMAT_RGB565, \ - .frame_size = FRAMESIZE_240X240, \ - .jpeg_quality = 12, \ - .fb_count = 2, \ - .fb_location = CAMERA_FB_IN_PSRAM,\ - .sccb_i2c_port = BSP_I2C_NUM, \ - } - -#define BSP_CAMERA_VFLIP 1 -#define BSP_CAMERA_HMIRROR 0 - -/************************************************************************************************** - * - * SPIFFS - * - * After mounting the SPIFFS, it can be accessed with stdio functions ie.: - * \code{.c} - * FILE* f = fopen(BSP_SPIFFS_MOUNT_POINT"/hello.txt", "w"); - * fprintf(f, "Hello World!\n"); - * fclose(f); - * \endcode - **************************************************************************************************/ -#define BSP_SPIFFS_MOUNT_POINT CONFIG_BSP_SPIFFS_MOUNT_POINT - -/** - * @brief Mount SPIFFS to virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if esp_vfs_spiffs_register was already called - * - ESP_ERR_NO_MEM if memory can not be allocated - * - ESP_FAIL if partition can not be mounted - * - other error codes - */ -esp_err_t bsp_spiffs_mount(void); - -/** - * @brief Unmount SPIFFS from virtual file system - * - * @return - * - ESP_OK on success - * - ESP_ERR_INVALID_STATE if already unmounted - */ -esp_err_t bsp_spiffs_unmount(void); - - -/************************************************************************************************** - * - * LCD interface - * - * ESP-SparkBot-BSP is shipped with 1.3inch ST7789 display controller. - * It features 16-bit colors and 240x240 resolution. - * - * LVGL is used as graphics library. LVGL is NOT thread safe, therefore the user must take LVGL mutex - * by calling bsp_display_lock() before calling any LVGL API (lv_...) and then give the mutex with - * bsp_display_unlock(). - * - * If you want to use the display without LVGL, see bsp/display.h API and use BSP version with 'noglib' suffix. - **************************************************************************************************/ -#define BSP_LCD_PIXEL_CLOCK_HZ (80 * 1000 * 1000) -#define BSP_LCD_SPI_NUM (SPI3_HOST) - -#if (BSP_CONFIG_NO_GRAPHIC_LIB == 0) -#define BSP_LCD_DRAW_BUFF_SIZE (BSP_LCD_H_RES * BSP_LCD_V_RES) -#define BSP_LCD_DRAW_BUFF_DOUBLE (0) - -/** - * @brief BSP display configuration structure - */ -typedef struct { - lvgl_port_cfg_t lvgl_port_cfg; /*!< LVGL port configuration */ - uint32_t buffer_size; /*!< Size of the buffer for the screen in pixels */ - uint32_t trans_size; - bool double_buffer; /*!< True, if should be allocated two buffers */ - struct { - unsigned int buff_dma: 1; /*!< Allocated LVGL buffer will be DMA capable */ - unsigned int buff_spiram: 1; /*!< Allocated LVGL buffer will be in PSRAM */ - } flags; -} bsp_display_cfg_t; - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start(void); - -/** - * @brief Initialize display - * - * This function initializes SPI, display controller and starts LVGL handling task. - * LCD backlight must be enabled separately by calling bsp_display_brightness_set() - * - * @param cfg display configuration - * - * @return Pointer to LVGL display or NULL when error occurred - */ -lv_display_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg); - -/** - * @brief Get pointer to input device (touch, buttons, ...) - * - * @note The LVGL input device is initialized in bsp_display_start() function. - * - * @return Pointer to LVGL input device or NULL when not initialized - */ -lv_indev_t *bsp_display_get_input_dev(void); - -/** - * @brief Take LVGL mutex - * - * @param timeout_ms Timeout in [ms]. 0 will block indefinitely. - * @return true Mutex was taken - * @return false Mutex was NOT taken - */ -bool bsp_display_lock(uint32_t timeout_ms); - -/** - * @brief Give LVGL mutex - * - */ -void bsp_display_unlock(void); - -/** - * @brief Rotate screen - * - * Display must be already initialized by calling bsp_display_start() - * - * @param[in] disp Pointer to LVGL display - * @param[in] rotation Angle of the display rotation - */ -void bsp_display_rotate(lv_display_t *disp, lv_disp_rotation_t rotation); -#endif // BSP_CONFIG_NO_GRAPHIC_LIB == 0 - - - -/************************************************************************************************** - * - * ADC interface - * - * There are multiple devices connected to ADC peripheral: - * - Buttons - * - * After initialization of ADC, use adc_handle when using ADC driver. - **************************************************************************************************/ - -#define BSP_ADC_UNIT ADC_UNIT_1 - -/** - * @brief Initialize ADC - * - * The ADC can be initialized inside BSP, when needed. - * - * @param[out] adc_handle Returned ADC handle - */ -esp_err_t bsp_adc_initialize(void); - - -#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 0, 0) -/** - * @brief Get ADC handle - * - * @note This function is available only in IDF5 and higher - * - * @return ADC handle - */ -adc_oneshot_unit_handle_t bsp_adc_get_handle(void); -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h b/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h deleted file mode 100644 index e00199943eef4e1c31fbc46b8a2ee91d4cb2cc15..0000000000000000000000000000000000000000 --- a/example/usb_extend_screen_s3/components/esp_sparkbot_bsp/priv_include/bsp_err_check.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#pragma once - -#include "esp_check.h" -#include "sdkconfig.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Assert on error, if selected in menuconfig. Otherwise return error code. */ -#if CONFIG_BSP_ERROR_CHECK -#define BSP_ERROR_CHECK_RETURN_ERR(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK_RETURN_NULL(x) ESP_ERROR_CHECK(x) -#define BSP_ERROR_CHECK(x, ret) ESP_ERROR_CHECK(x) -#define BSP_NULL_CHECK(x, ret) assert(x) -#define BSP_NULL_CHECK_GOTO(x, goto_tag) assert(x) -#else -#define BSP_ERROR_CHECK_RETURN_ERR(x) do { \ - esp_err_t err_rc_ = (x); \ - if (unlikely(err_rc_ != ESP_OK)) { \ - return err_rc_; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK_RETURN_NULL(x) do { \ - if (unlikely((x) != ESP_OK)) { \ - return NULL; \ - } \ - } while(0) - -#define BSP_NULL_CHECK(x, ret) do { \ - if ((x) == NULL) { \ - return ret; \ - } \ - } while(0) - -#define BSP_ERROR_CHECK(x, ret) do { \ - if (unlikely((x) != ESP_OK)) { \ - return ret; \ - } \ - } while(0) - -#define BSP_NULL_CHECK_GOTO(x, goto_tag) do { \ - if ((x) == NULL) { \ - goto goto_tag; \ - } \ - } while(0) -#endif - -#ifdef __cplusplus -} -#endif diff --git a/example/usb_extend_screen_s3/main/app_uac.c b/example/usb_extend_screen_s3/main/app_uac.c index 48b9214901b11d92b0b675486d1178d6aaa1c87d..a27e11cc3b8d56ea91ed496ac6d0cc2d02c6cb34 100644 --- a/example/usb_extend_screen_s3/main/app_uac.c +++ b/example/usb_extend_screen_s3/main/app_uac.c @@ -8,41 +8,71 @@ #include "esp_log.h" #include "usb_device_uac.h" #include "bsp/esp-bsp.h" -#include "bsp_board_extra.h" static const char *TAG = "app_uac"; +static esp_codec_dev_handle_t play_dev_handle; +static esp_codec_dev_handle_t record_dev_handle; + static esp_err_t uac_device_output_cb(uint8_t *buf, size_t len, void *arg) { - size_t bytes_written = 0; - bsp_extra_i2s_write(buf, len, &bytes_written, 0); - return ESP_OK; + esp_err_t ret = ESP_OK; + ret = esp_codec_dev_write(play_dev_handle, buf, len); + return ret; } static esp_err_t uac_device_input_cb(uint8_t *buf, size_t len, size_t *bytes_read, void *arg) { - if (bsp_extra_i2s_read(buf, len, bytes_read, 0) != ESP_OK) { - ESP_LOGE(TAG, "i2s read failed"); - } - return ESP_OK; + esp_err_t ret = ESP_OK; + ret = esp_codec_dev_read(record_dev_handle, buf, len); + *bytes_read = len; + return ret; } static void uac_device_set_mute_cb(uint32_t mute, void *arg) { ESP_LOGD(TAG, "uac_device_set_mute_cb: %"PRIu32"", mute); - bsp_extra_codec_mute_set(mute); + esp_codec_dev_set_out_mute(play_dev_handle, mute); } static void uac_device_set_volume_cb(uint32_t volume, void *arg) { ESP_LOGD(TAG, "uac_device_set_volume_cb: %"PRIu32"", volume); - bsp_extra_codec_volume_set(volume, NULL); + esp_codec_dev_set_out_vol(play_dev_handle, volume); } esp_err_t app_uac_init(void) { - bsp_extra_codec_init(); - bsp_extra_codec_set_fs(CONFIG_UAC_SAMPLE_RATE, 16, CONFIG_UAC_SPEAKER_CHANNEL_NUM); + // bsp_extra_codec_init(); + // bsp_extra_codec_set_fs(CONFIG_UAC_SAMPLE_RATE, 16, CONFIG_UAC_SPEAKER_CHANNEL_NUM); + + play_dev_handle = bsp_audio_codec_speaker_init(); + assert((play_dev_handle) && "play_dev_handle not initialized"); + + record_dev_handle = bsp_audio_codec_microphone_init(); + assert((record_dev_handle) && "record_dev_handle not initialized"); + + + esp_codec_dev_sample_info_t fs = { + .sample_rate = CONFIG_UAC_SAMPLE_RATE, + .channel = CONFIG_UAC_SPEAKER_CHANNEL_NUM, + .bits_per_sample = 16, + }; + + if (play_dev_handle) { + esp_codec_dev_close(play_dev_handle); + } + if (record_dev_handle) { + esp_codec_dev_close(record_dev_handle); + esp_codec_dev_set_in_gain(record_dev_handle, 24.0); + } + + if (play_dev_handle) { + esp_codec_dev_open(play_dev_handle, &fs); + } + if (record_dev_handle) { + esp_codec_dev_open(record_dev_handle, &fs); + } uac_device_config_t config = { .skip_phy_init = true, diff --git a/example/usb_extend_screen_s3/main/idf_component.yml b/example/usb_extend_screen_s3/main/idf_component.yml index 5ba12922a6551d3153547979c5118b7b06c26f85..a2c4b5fc6e8ce0cbab095b8891aa9b47765881d5 100644 --- a/example/usb_extend_screen_s3/main/idf_component.yml +++ b/example/usb_extend_screen_s3/main/idf_component.yml @@ -10,3 +10,4 @@ dependencies: version: "^0.5.0" rules: - if: "target in [esp32s3]" + espressif2022/esp_sparkbot: "*" diff --git a/example/usb_extend_screen_s3/sdkconfig b/example/usb_extend_screen_s3/sdkconfig index d8588077674e4effb80a84c99aa68f798b57cc34..631098f2e904a5bffb6f8f3607c3993e057aed5d 100644 --- a/example/usb_extend_screen_s3/sdkconfig +++ b/example/usb_extend_screen_s3/sdkconfig @@ -1,9 +1,7 @@ # # Automatically generated file. DO NOT EDIT. -# Espressif IoT Development Framework (ESP-IDF) 5.3.1 Project Configuration +# Espressif IoT Development Framework (ESP-IDF) 5.5.0 Project Configuration # -CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 -CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 CONFIG_SOC_ADC_SUPPORTED=y CONFIG_SOC_UART_SUPPORTED=y CONFIG_SOC_PCNT_SUPPORTED=y @@ -14,6 +12,8 @@ CONFIG_SOC_GDMA_SUPPORTED=y CONFIG_SOC_AHB_GDMA_SUPPORTED=y CONFIG_SOC_GPTIMER_SUPPORTED=y CONFIG_SOC_LCDCAM_SUPPORTED=y +CONFIG_SOC_LCDCAM_I80_LCD_SUPPORTED=y +CONFIG_SOC_LCDCAM_RGB_LCD_SUPPORTED=y CONFIG_SOC_MCPWM_SUPPORTED=y CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y CONFIG_SOC_CACHE_SUPPORT_WRAP=y @@ -119,6 +119,7 @@ CONFIG_SOC_GPIO_OUT_RANGE_MAX=48 CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x0001FFFFFC000000 CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 +CONFIG_SOC_GPIO_SUPPORT_HOLD_IO_IN_DSLP=y CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 CONFIG_SOC_DEDIC_GPIO_OUT_AUTO_ENABLE=y @@ -133,6 +134,7 @@ CONFIG_SOC_I2C_SUPPORT_RTC=y CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y +CONFIG_SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE=y CONFIG_SOC_I2S_NUM=2 CONFIG_SOC_I2S_HW_VERSION_2=y CONFIG_SOC_I2S_SUPPORTS_XTAL=y @@ -140,12 +142,15 @@ CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y CONFIG_SOC_I2S_SUPPORTS_PCM=y CONFIG_SOC_I2S_SUPPORTS_PDM=y CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y -CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 +CONFIG_SOC_I2S_SUPPORTS_PCM2PDM=y CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_SUPPORTS_PDM2PCM=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4 CONFIG_SOC_I2S_SUPPORTS_TDM=y CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_LEDC_TIMER_NUM=4 CONFIG_SOC_LEDC_CHANNEL_NUM=8 CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=14 CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y @@ -162,6 +167,8 @@ CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=1 CONFIG_SOC_MMU_PERIPH_NUM=1 +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 CONFIG_SOC_PCNT_GROUPS=1 CONFIG_SOC_PCNT_UNITS_PER_GROUP=4 CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 @@ -189,6 +196,10 @@ CONFIG_SOC_LCD_RGB_PANELS=1 CONFIG_SOC_LCD_I80_BUS_WIDTH=16 CONFIG_SOC_LCD_RGB_DATA_WIDTH=16 CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y +CONFIG_SOC_LCDCAM_I80_NUM_BUSES=1 +CONFIG_SOC_LCDCAM_I80_BUS_WIDTH=16 +CONFIG_SOC_LCDCAM_RGB_NUM_PANELS=1 +CONFIG_SOC_LCDCAM_RGB_DATA_WIDTH=16 CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128 CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=549 CONFIG_SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH=128 @@ -217,7 +228,7 @@ CONFIG_SOC_SPI_SCT_SUPPORTED=y CONFIG_SOC_SPI_SCT_REG_NUM=14 CONFIG_SOC_SPI_SCT_BUFFER_NUM_MAX=y CONFIG_SOC_SPI_SCT_CONF_BITLEN_MAX=0x3FFFA -CONFIG_SOC_MEMSPI_SRC_FREQ_120M=y +CONFIG_SOC_MEMSPI_SRC_FREQ_120M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y @@ -241,6 +252,7 @@ CONFIG_SOC_TOUCH_SENSOR_NUM=15 CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y CONFIG_SOC_TOUCH_SUPPORT_WATERPROOF=y CONFIG_SOC_TOUCH_SUPPORT_PROX_SENSING=y +CONFIG_SOC_TOUCH_SUPPORT_DENOISE_CHAN=y CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3 CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 @@ -295,10 +307,12 @@ CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y CONFIG_SOC_PM_CPU_RETENTION_BY_RTCCNTL=y CONFIG_SOC_PM_MODEM_RETENTION_BY_BACKUPDMA=y +CONFIG_SOC_PM_MODEM_PD_BY_SW=y CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_CLK_LP_FAST_SUPPORT_XTAL_D2=y CONFIG_SOC_EFUSE_DIS_DOWNLOAD_ICACHE=y CONFIG_SOC_EFUSE_DIS_DOWNLOAD_DCACHE=y CONFIG_SOC_EFUSE_HARD_DIS_JTAG=y @@ -331,6 +345,7 @@ CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y CONFIG_SOC_SPI_MEM_SUPPORT_WRAP=y CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY=y CONFIG_SOC_MEMSPI_CORE_CLK_SHARED_WITH_PSRAM=y +CONFIG_SOC_SPI_MEM_SUPPORT_CACHE_32BIT_ADDR_MAP=y CONFIG_SOC_COEX_HW_PTI=y CONFIG_SOC_EXTERNAL_COEX_LEADER_TX_LINE=y CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y @@ -355,10 +370,11 @@ CONFIG_SOC_ULP_HAS_ADC=y CONFIG_SOC_PHY_COMBO_MODULE=y CONFIG_IDF_CMAKE=y CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TOOLCHAIN_GCC=y CONFIG_IDF_TARGET_ARCH_XTENSA=y CONFIG_IDF_TARGET_ARCH="xtensa" CONFIG_IDF_TARGET="esp32s3" -CONFIG_IDF_INIT_VERSION="5.3.1" +CONFIG_IDF_INIT_VERSION="5.5.0" CONFIG_IDF_TARGET_ESP32S3=y CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 @@ -385,11 +401,26 @@ CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y CONFIG_BOOTLOADER_PROJECT_VER=1 # end of Bootloader manager +# +# Application Rollback +# +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# end of Application Rollback + +# +# Bootloader Rollback +# +# end of Bootloader Rollback + CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set # CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set + +# +# Log +# # CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set # CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set # CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set @@ -398,6 +429,14 @@ CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y # CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set CONFIG_BOOTLOADER_LOG_LEVEL=3 +# +# Format +# +# CONFIG_BOOTLOADER_LOG_COLORS is not set +CONFIG_BOOTLOADER_LOG_TIMESTAMP_SOURCE_CPU_TICKS=y +# end of Format +# end of Log + # # Serial Flash Configurations # @@ -413,7 +452,6 @@ CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y CONFIG_BOOTLOADER_WDT_ENABLE=y # CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set CONFIG_BOOTLOADER_WDT_TIME_MS=9000 -# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set # CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set @@ -469,6 +507,7 @@ CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG=y CONFIG_ESP_ROM_HAS_SW_FLOAT=y CONFIG_ESP_ROM_HAS_VERSION=y CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y +CONFIG_ESP_ROM_HAS_OUTPUT_PUTC_FUNC=y # # Boot ROM Behavior @@ -495,7 +534,6 @@ CONFIG_ESPTOOLPY_FLASHFREQ_120M=y # CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set # CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set -CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y CONFIG_ESPTOOLPY_FLASHFREQ="80m" # CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set # CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set @@ -522,6 +560,7 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 CONFIG_PARTITION_TABLE_SINGLE_APP=y # CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set # CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_TWO_OTA_LARGE is not set # CONFIG_PARTITION_TABLE_CUSTOM is not set CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" @@ -578,6 +617,7 @@ CONFIG_COMPILER_OPTIMIZATION_PERF=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set # CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_ASSERT_NDEBUG_EVALUATE=y CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 # CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set @@ -588,14 +628,18 @@ CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y # CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set # CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set # CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_NO_MERGE_CONSTANTS is not set # CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +CONFIG_COMPILER_DISABLE_DEFAULT_ERRORS=y # CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set # CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC14_WARNINGS is not set # CONFIG_COMPILER_DUMP_RTL_FILES is not set CONFIG_COMPILER_RT_LIB_GCCLIB=y CONFIG_COMPILER_RT_LIB_NAME="gcc" -# CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING is not set -CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y +CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING=y +# CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE is not set +# CONFIG_COMPILER_STATIC_ANALYZER is not set # end of Compiler options # @@ -692,6 +736,12 @@ CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y # # CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set # end of Legacy Temperature Sensor Driver Configurations + +# +# Legacy Touch Sensor Driver Configurations +# +# CONFIG_TOUCH_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy Touch Sensor Driver Configurations # end of Driver Configurations # @@ -729,6 +779,7 @@ CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y # CONFIG_ESP_COEX_ENABLED=y # CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set +# CONFIG_ESP_COEX_GPIO_DEBUG is not set # end of Wireless Coexistence # @@ -757,6 +808,7 @@ CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y # # CONFIG_I2C_ISR_IRAM_SAFE is not set # CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# CONFIG_I2C_ENABLE_SLAVE_DRIVER_VERSION_2 is not set # end of ESP-Driver:I2C Configurations # @@ -874,6 +926,7 @@ CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y # CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set # CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set # CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set +CONFIG_ESP_HTTP_CLIENT_EVENT_POST_TIMEOUT=2000 # end of ESP HTTP client # @@ -886,6 +939,7 @@ CONFIG_HTTPD_PURGE_BUF_LEN=32 # CONFIG_HTTPD_LOG_PURGE_DATA is not set # CONFIG_HTTPD_WS_SUPPORT is not set # CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +CONFIG_HTTPD_SERVER_EVENT_POST_TIMEOUT=2000 # end of HTTP Server # @@ -893,12 +947,15 @@ CONFIG_HTTPD_PURGE_BUF_LEN=32 # # CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set # CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +CONFIG_ESP_HTTPS_OTA_EVENT_POST_TIMEOUT=2000 # end of ESP HTTPS OTA # # ESP HTTPS server # # CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +CONFIG_ESP_HTTPS_SERVER_EVENT_POST_TIMEOUT=2000 +# CONFIG_ESP_HTTPS_SERVER_CERT_SELECT_HOOK is not set # end of ESP HTTPS server # @@ -919,6 +976,12 @@ CONFIG_ESP_REV_MIN_FULL=0 # CONFIG_ESP32S3_REV_MAX_FULL=99 CONFIG_ESP_REV_MAX_FULL=99 +CONFIG_ESP_EFUSE_BLOCK_REV_MIN_FULL=0 +CONFIG_ESP_EFUSE_BLOCK_REV_MAX_FULL=199 + +# +# Maximum Supported ESP32-S3 eFuse Block Revision (eFuse Block Rev v1.99) +# # end of Chip revision # @@ -971,6 +1034,7 @@ CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y # CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y # CONFIG_GDMA_ISR_IRAM_SAFE is not set +CONFIG_GDMA_OBJ_DRAM_SAFE=y # CONFIG_GDMA_ENABLE_DEBUG_LOG is not set # end of GDMA Configurations @@ -985,33 +1049,32 @@ CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y # end of Hardware Settings # -# LCD and Touch Panel -# - -# -# LCD Touch Drivers are maintained in the IDF Component Registry -# - -# -# LCD Peripheral Configuration +# ESP-Driver:LCD Controller Configurations # -CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 # CONFIG_LCD_ENABLE_DEBUG_LOG is not set # CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set # CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set -# end of LCD Peripheral Configuration -# end of LCD and Touch Panel +# end of ESP-Driver:LCD Controller Configurations + +# +# ESP-MM: Memory Management Configurations +# +# CONFIG_ESP_MM_CACHE_MSYNC_C2M_CHUNKED_OPS is not set +# end of ESP-MM: Memory Management Configurations # # ESP NETIF Adapter # CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +# CONFIG_ESP_NETIF_PROVIDE_CUSTOM_IMPLEMENTATION is not set CONFIG_ESP_NETIF_TCPIP_LWIP=y # CONFIG_ESP_NETIF_LOOPBACK is not set CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +CONFIG_ESP_NETIF_REPORT_DATA_TRAFFIC=y # CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set # CONFIG_ESP_NETIF_L2_TAP is not set # CONFIG_ESP_NETIF_BRIDGE_EN is not set +# CONFIG_ESP_NETIF_SET_DNS_PER_DEFAULT_NETIF is not set # end of ESP NETIF Adapter # @@ -1035,12 +1098,14 @@ CONFIG_ESP_PHY_RF_CAL_PARTIAL=y # CONFIG_ESP_PHY_RF_CAL_FULL is not set CONFIG_ESP_PHY_CALIBRATION_MODE=0 # CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set +# CONFIG_ESP_PHY_RECORD_USED_TIME is not set # end of PHY # # Power Management # # CONFIG_PM_ENABLE is not set +# CONFIG_PM_SLP_IRAM_OPT is not set CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y CONFIG_PM_RESTORE_CACHE_TAGMEM_AFTER_LIGHT_SLEEP=y # end of Power Management @@ -1057,7 +1122,6 @@ CONFIG_SPIRAM=y CONFIG_SPIRAM_MODE_OCT=y CONFIG_SPIRAM_TYPE_AUTO=y # CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set -CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y CONFIG_SPIRAM_CLK_IO=30 CONFIG_SPIRAM_CS_IO=26 # CONFIG_SPIRAM_XIP_FROM_PSRAM is not set @@ -1066,6 +1130,7 @@ CONFIG_SPIRAM_RODATA=y CONFIG_SPIRAM_SPEED_120M=y # CONFIG_SPIRAM_SPEED_80M is not set # CONFIG_SPIRAM_SPEED_40M is not set +# CONFIG_SPIRAM_TIMING_TUNING_POINT_VIA_TEMPERATURE_SENSOR is not set CONFIG_SPIRAM_SPEED=120 # CONFIG_SPIRAM_ECC_ENABLE is not set CONFIG_SPIRAM_BOOT_INIT=y @@ -1078,6 +1143,7 @@ CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 # CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 # CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY is not set # end of SPI RAM config # end of ESP PSRAM @@ -1087,6 +1153,11 @@ CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 # CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set # end of ESP Ringbuf +# +# ESP Security Specific +# +# end of ESP Security Specific + # # ESP System Settings # @@ -1235,10 +1306,10 @@ CONFIG_ESP_TIMER_IMPL_SYSTIMER=y CONFIG_ESP_WIFI_ENABLED=y CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y -CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=16 -CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP_WIFI_STATIC_TX_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER=y +CONFIG_ESP_WIFI_TX_BUFFER_TYPE=1 +CONFIG_ESP_WIFI_DYNAMIC_TX_BUFFER_NUM=32 CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y # CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 @@ -1248,7 +1319,6 @@ CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP_WIFI_TX_BA_WIN=6 CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP_WIFI_RX_BA_WIN=6 -# CONFIG_ESP_WIFI_AMSDU_TX_ENABLED is not set CONFIG_ESP_WIFI_NVS_ENABLED=y CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set @@ -1342,6 +1412,9 @@ CONFIG_FATFS_TIMEOUT_MS=10000 CONFIG_FATFS_PER_FILE_CACHE=y CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y # CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_USE_STRFUNC_NONE=y +# CONFIG_FATFS_USE_STRFUNC_WITHOUT_CRLF_CONV is not set +# CONFIG_FATFS_USE_STRFUNC_WITH_CRLF_CONV is not set CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 # CONFIG_FATFS_IMMEDIATE_FSYNC is not set # CONFIG_FATFS_USE_LABEL is not set @@ -1367,6 +1440,7 @@ CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 # CONFIG_FREERTOS_USE_TICK_HOOK is not set CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 # CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set +CONFIG_FREERTOS_USE_TIMERS=y CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" # CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set # CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set @@ -1393,6 +1467,7 @@ CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y CONFIG_FREERTOS_ISR_STACKSIZE=1536 CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +# CONFIG_FREERTOS_FPU_IN_ISR is not set CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y # CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set @@ -1401,6 +1476,12 @@ CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # end of Port +# +# Extra +# +CONFIG_FREERTOS_TASK_CREATE_ALLOW_EXT_MEM=y +# end of Extra + CONFIG_FREERTOS_PORT=y CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y @@ -1421,6 +1502,7 @@ CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 CONFIG_HAL_WDT_USE_ROM_IMPL=y CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y +# CONFIG_HAL_ECDSA_GEN_SIG_CM is not set # end of Hardware Abstraction Layer (HAL) and Low Level (LL) # @@ -1439,7 +1521,11 @@ CONFIG_HEAP_TRACING_OFF=y # end of Heap memory debugging # -# Log output +# Log +# + +# +# Log Level # # CONFIG_LOG_DEFAULT_LEVEL_NONE is not set # CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set @@ -1452,11 +1538,29 @@ CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y # CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set # CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set CONFIG_LOG_MAXIMUM_LEVEL=3 + +# +# Level Settings +# # CONFIG_LOG_MASTER_LEVEL is not set -CONFIG_LOG_COLORS=y +CONFIG_LOG_DYNAMIC_LEVEL_CONTROL=y +# CONFIG_LOG_TAG_LEVEL_IMPL_NONE is not set +# CONFIG_LOG_TAG_LEVEL_IMPL_LINKED_LIST is not set +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_AND_LINKED_LIST=y +# CONFIG_LOG_TAG_LEVEL_CACHE_ARRAY is not set +CONFIG_LOG_TAG_LEVEL_CACHE_BINARY_MIN_HEAP=y +CONFIG_LOG_TAG_LEVEL_IMPL_CACHE_SIZE=31 +# end of Level Settings +# end of Log Level + +# +# Format +# +# CONFIG_LOG_COLORS is not set CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y # CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set -# end of Log output +# end of Format +# end of Log # # LWIP @@ -1495,6 +1599,8 @@ CONFIG_LWIP_ESP_MLDV6_REPORT=y CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DOES_ACD_CHECK is not set +# CONFIG_LWIP_DHCP_DOES_NOT_CHECK_OFFERED_IP is not set # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y # CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set @@ -1509,6 +1615,7 @@ CONFIG_LWIP_DHCPS=y CONFIG_LWIP_DHCPS_LEASE_UNIT=60 CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y +CONFIG_LWIP_DHCPS_ADD_DNS=y # end of DHCP server # CONFIG_LWIP_AUTOIP is not set @@ -1567,9 +1674,12 @@ CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set # CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF -# CONFIG_LWIP_PPP_SUPPORT is not set CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +CONFIG_LWIP_IPV6_ND6_NUM_PREFIXES=5 +CONFIG_LWIP_IPV6_ND6_NUM_ROUTERS=3 +CONFIG_LWIP_IPV6_ND6_NUM_DESTINATIONS=10 +# CONFIG_LWIP_PPP_SUPPORT is not set # CONFIG_LWIP_SLIP_SUPPORT is not set # @@ -1599,8 +1709,11 @@ CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 # # DNS # +CONFIG_LWIP_DNS_MAX_HOST_IP=1 CONFIG_LWIP_DNS_MAX_SERVERS=3 # CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# CONFIG_LWIP_DNS_SETSERVER_WITH_NETIF is not set +# CONFIG_LWIP_USE_ESP_GETADDRINFO is not set # end of DNS CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 @@ -1624,8 +1737,10 @@ CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set # CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set -CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y -# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_DNS_EXT_RESOLVE_CUSTOM is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_NONE is not set +CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT=y # CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set # end of Hooks @@ -1687,6 +1802,7 @@ CONFIG_MBEDTLS_HAVE_TIME=y # CONFIG_MBEDTLS_HAVE_TIME_DATE is not set CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y CONFIG_MBEDTLS_SHA512_C=y +# CONFIG_MBEDTLS_SHA3_C is not set CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y # CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set # CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set @@ -1740,6 +1856,8 @@ CONFIG_MBEDTLS_X509_CSR_PARSE_C=y # end of Certificates CONFIG_MBEDTLS_ECP_C=y +CONFIG_MBEDTLS_PK_PARSE_EC_EXTENDED=y +CONFIG_MBEDTLS_PK_PARSE_EC_COMPRESSED=y # CONFIG_MBEDTLS_DHM_C is not set CONFIG_MBEDTLS_ECDH_C=y CONFIG_MBEDTLS_ECDSA_C=y @@ -1757,12 +1875,13 @@ CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y CONFIG_MBEDTLS_ECP_NIST_OPTIM=y -CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM is not set # CONFIG_MBEDTLS_POLY1305_C is not set # CONFIG_MBEDTLS_CHACHA20_C is not set # CONFIG_MBEDTLS_HKDF_C is not set # CONFIG_MBEDTLS_THREADING_C is not set CONFIG_MBEDTLS_ERROR_STRINGS=y +CONFIG_MBEDTLS_FS_IO=y # end of mbedTLS # @@ -1782,20 +1901,22 @@ CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y # end of ESP-MQTT Configurations # -# Newlib +# LibC # -CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set -# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set -# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set -CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y -# CONFIG_NEWLIB_NANO_FORMAT is not set -CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y -# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set -# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set -# end of Newlib +CONFIG_LIBC_NEWLIB=y +# CONFIG_LIBC_PICOLIBC is not set +CONFIG_LIBC_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_LIBC_STDOUT_LINE_ENDING_LF is not set +# CONFIG_LIBC_STDOUT_LINE_ENDING_CR is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_LIBC_STDIN_LINE_ENDING_LF is not set +CONFIG_LIBC_STDIN_LINE_ENDING_CR=y +# CONFIG_LIBC_NEWLIB_NANO_FORMAT is not set +CONFIG_LIBC_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_LIBC_TIME_SYSCALL_USE_RTC is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_HRT is not set +# CONFIG_LIBC_TIME_SYSCALL_USE_NONE is not set +# end of LibC CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y @@ -1805,6 +1926,7 @@ CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y # CONFIG_NVS_ENCRYPTION is not set # CONFIG_NVS_ASSERT_ERROR_CHECK is not set # CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set +# CONFIG_NVS_ALLOCATE_CACHE_IN_SPIRAM is not set # end of NVS # @@ -1813,25 +1935,10 @@ CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y # CONFIG_OPENTHREAD_ENABLED is not set # -# Thread Operational Dataset +# OpenThread Spinel # -CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-ESP" -CONFIG_OPENTHREAD_MESH_LOCAL_PREFIX="fd00:db8:a0:0::/64" -CONFIG_OPENTHREAD_NETWORK_CHANNEL=15 -CONFIG_OPENTHREAD_NETWORK_PANID=0x1234 -CONFIG_OPENTHREAD_NETWORK_EXTPANID="dead00beef00cafe" -CONFIG_OPENTHREAD_NETWORK_MASTERKEY="00112233445566778899aabbccddeeff" -CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53" -# end of Thread Operational Dataset - -CONFIG_OPENTHREAD_XTAL_ACCURACY=130 # CONFIG_OPENTHREAD_SPINEL_ONLY is not set -CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE=y - -# -# Thread Address Query Config -# -# end of Thread Address Query Config +# end of OpenThread Spinel # end of OpenThread # @@ -1888,9 +1995,9 @@ CONFIG_SPI_FLASH_HPM_AUTO=y CONFIG_SPI_FLASH_HPM_ON=y CONFIG_SPI_FLASH_HPM_DC_AUTO=y # CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set -CONFIG_SPI_FLASH_SUSPEND_QVL_SUPPORTED=y # CONFIG_SPI_FLASH_AUTO_SUSPEND is not set CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 +# CONFIG_SPI_FLASH_FORCE_ENABLE_XMC_C_SUSPEND is not set # end of Optional and Experimental Features (READ DOCS FIRST) # end of Main Flash configuration @@ -2016,16 +2123,22 @@ CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y # CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set # -# Root Hub configuration +# Hub Driver Configuration +# + +# +# Root Port configuration # CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 CONFIG_USB_HOST_RESET_HOLD_MS=30 CONFIG_USB_HOST_RESET_RECOVERY_MS=30 CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 -# end of Root Hub configuration +# end of Root Port configuration + +# CONFIG_USB_HOST_HUBS_SUPPORTED is not set +# end of Hub Driver Configuration # CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK is not set -# CONFIG_USB_HOST_EXT_HUB_SUPPORT is not set CONFIG_USB_OTG_SUPPORTED=y # end of USB-OTG @@ -2045,6 +2158,8 @@ CONFIG_VFS_MAX_COUNT=8 # CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 # end of Host File System I/O (Semihosting) + +CONFIG_VFS_INITIALIZE_DEV_NULL=y # end of Virtual file system # @@ -2060,16 +2175,16 @@ CONFIG_WL_SECTOR_SIZE=4096 # CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 -# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y # CONFIG_WIFI_PROV_STA_FAST_SCAN is not set # end of Wi-Fi Provisioning Manager # -# Board Support Package +# ESP LCD TOUCH # -CONFIG_BSP_I2S_NUM=1 -# end of Board Support Package +CONFIG_ESP_LCD_TOUCH_MAX_POINTS=5 +CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS=1 +# end of ESP LCD TOUCH # # Board Support Package @@ -2108,22 +2223,9 @@ CONFIG_BSP_DISPLAY_LVGL_TICK=5 CONFIG_BSP_DISPLAY_LVGL_MAX_SLEEP=1 CONFIG_BSP_DISPLAY_BRIGHTNESS_LEDC_CH=1 # end of Display -# end of Board Support Package - -# -# ESP LCD TOUCH -# -CONFIG_ESP_LCD_TOUCH_MAX_POINTS=5 -CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS=1 -# end of ESP LCD TOUCH -# -# Audio playback -# -CONFIG_AUDIO_PLAYER_ENABLE_MP3=y -CONFIG_AUDIO_PLAYER_ENABLE_WAV=y -CONFIG_AUDIO_PLAYER_LOG_LEVEL=0 -# end of Audio playback +CONFIG_BSP_I2S_NUM=1 +# end of Board Support Package # # IoT Button @@ -2132,7 +2234,6 @@ CONFIG_BUTTON_PERIOD_TIME_MS=5 CONFIG_BUTTON_DEBOUNCE_TICKS=2 CONFIG_BUTTON_SHORT_PRESS_TIME_MS=180 CONFIG_BUTTON_LONG_PRESS_TIME_MS=1500 -CONFIG_BUTTON_LONG_PRESS_TOLERANCE_MS=20 CONFIG_BUTTON_SERIAL_TIME_MS=20 # CONFIG_GPIO_BUTTON_SUPPORT_POWER_SAVE is not set CONFIG_ADC_BUTTON_MAX_CHANNEL=3 @@ -2166,6 +2267,19 @@ CONFIG_CODEC_TAS5805M_SUPPORT=y # CONFIG_CODEC_ZL38063_SUPPORT is not set # end of Audio Codec Device Configuration +# +# Bus Options +# + +# +# I2C Bus Options +# +CONFIG_I2C_BUS_DYNAMIC_CONFIG=y +CONFIG_I2C_MS_TO_WAIT=200 +CONFIG_I2C_BUS_BACKWARD_CONFIG=y +# end of I2C Bus Options +# end of Bus Options + # # TinyUSB soucre # @@ -2559,6 +2673,7 @@ CONFIG_IDF_EXPERIMENTAL_FEATURES=y # Deprecated options for backward compatibility # CONFIG_APP_BUILD_TYPE_ELF_RAM is not set # CONFIG_NO_BLOBS is not set +# CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set # CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set # CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set @@ -2566,7 +2681,6 @@ CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y # CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set # CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set CONFIG_LOG_BOOTLOADER_LEVEL=3 -# CONFIG_APP_ROLLBACK_ENABLE is not set # CONFIG_FLASH_ENCRYPTION_ENABLED is not set CONFIG_FLASHMODE_QIO=y # CONFIG_FLASHMODE_QOUT is not set @@ -2671,10 +2785,10 @@ CONFIG_TIMER_TASK_STACK_SIZE=3584 CONFIG_ESP32_WIFI_ENABLED=y CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y -CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 -CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 -CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1 +CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32 # CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_TX_BA_WIN=6 @@ -2682,7 +2796,6 @@ CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y CONFIG_ESP32_WIFI_RX_BA_WIN=6 CONFIG_ESP32_WIFI_RX_BA_WIN=6 -# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set @@ -2711,6 +2824,7 @@ CONFIG_TIMER_TASK_PRIORITY=1 CONFIG_TIMER_TASK_STACK_DEPTH=2048 CONFIG_TIMER_QUEUE_LENGTH=10 # CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY=y # CONFIG_HAL_ASSERTION_SILIENT is not set # CONFIG_L2_TO_L3_COPY is not set CONFIG_ESP_GRATUITOUS_ARP=y @@ -2734,11 +2848,22 @@ CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y # CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF # CONFIG_PPP_SUPPORT is not set +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER=y CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_SYSTIMER is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set # CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 diff --git a/example/usb_extend_screen_s3/sdkconfig.defaults b/example/usb_extend_screen_s3/sdkconfig.defaults index 7e63af62255ab00b4a9f6b41b242b7b551ec0e76..ce673cc5a0e3f4a365bde63c81b930d570bf2fcb 100644 --- a/example/usb_extend_screen_s3/sdkconfig.defaults +++ b/example/usb_extend_screen_s3/sdkconfig.defaults @@ -18,3 +18,4 @@ CONFIG_ESP_CONSOLE_UART_TX_GPIO=38 CONFIG_ESP_CONSOLE_UART_RX_GPIO=48 CONFIG_FREERTOS_HZ=1000 CONFIG_IDF_EXPERIMENTAL_FEATURES=y +CONFIG_I2C_BUS_BACKWARD_CONFIG=y