diff --git a/esp-box-lite/CMakeLists.txt b/esp-box-lite/CMakeLists.txt index 950aba4f8..a58c1c256 100644 --- a/esp-box-lite/CMakeLists.txt +++ b/esp-box-lite/CMakeLists.txt @@ -1,5 +1,12 @@ +#IDF version is less than IDF5.0 +if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "5.0") + set(SRC_VER "esp-box-lite_idf4.c") +else() + set(SRC_VER "esp-box-lite_idf5.c") +endif() + idf_component_register( - SRCS "esp-box-lite.c" + SRCS "esp-box-lite.c" ${SRC_VER} INCLUDE_DIRS "include" PRIV_INCLUDE_DIRS "priv_include" REQUIRES driver spiffs diff --git a/esp-box-lite/esp-box-lite.c b/esp-box-lite/esp-box-lite.c index 4045ff850..494156363 100644 --- a/esp-box-lite/esp-box-lite.c +++ b/esp-box-lite/esp-box-lite.c @@ -24,11 +24,8 @@ static const char *TAG = "ESP-BOX-LITE"; static lv_indev_t *disp_indev = NULL; /* Input device (buttons) */ -static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ -static i2s_chan_handle_t i2s_tx_chan = NULL; -static i2s_chan_handle_t i2s_rx_chan = NULL; -const button_config_t bsp_button_config[BSP_BUTTON_NUM] = { +static const button_config_t bsp_button_config[BSP_BUTTON_NUM] = { { .type = BUTTON_TYPE_ADC, .adc_button_config.adc_channel = ADC_CHANNEL_0, // ADC1 channel 0 is GPIO1 @@ -116,81 +113,20 @@ esp_err_t bsp_spiffs_unmount(void) return esp_vfs_spiffs_unregister(CONFIG_BSP_SPIFFS_PARTITION_LABEL); } - -esp_err_t bsp_audio_init(const i2s_std_config_t *i2s_config, i2s_chan_handle_t *tx_channel, i2s_chan_handle_t *rx_channel) -{ - if (i2s_tx_chan && i2s_rx_chan && i2s_data_if) { - if (tx_channel) { - *tx_channel = i2s_tx_chan; - } - if (rx_channel) { - *rx_channel = i2s_rx_chan; - } - - /* 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 - BSP_ERROR_CHECK_RETURN_ERR(i2s_new_channel(&chan_cfg, tx_channel, rx_channel)); - - /* 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 (tx_channel != NULL) { - BSP_ERROR_CHECK_RETURN_ERR(i2s_channel_init_std_mode(*tx_channel, p_i2s_cfg)); - BSP_ERROR_CHECK_RETURN_ERR(i2s_channel_enable(*tx_channel)); - } - if (rx_channel != NULL) { - BSP_ERROR_CHECK_RETURN_ERR(i2s_channel_init_std_mode(*rx_channel, p_i2s_cfg)); - BSP_ERROR_CHECK_RETURN_ERR(i2s_channel_enable(*rx_channel)); - } - - audio_codec_i2s_cfg_t i2s_cfg = { - .port = CONFIG_BSP_I2S_NUM, - .rx_handle = i2s_rx_chan, - .tx_handle = i2s_tx_chan, - }; - i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); - BSP_NULL_CHECK(i2s_data_if, NULL); - - /* Setup power amplifier pin */ - const gpio_config_t io_conf = { - .intr_type = GPIO_INTR_DISABLE, - .mode = GPIO_MODE_OUTPUT, - .pin_bit_mask = BIT64(BSP_POWER_AMP_IO), - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .pull_up_en = GPIO_PULLDOWN_DISABLE, - }; - BSP_ERROR_CHECK_RETURN_ERR(gpio_config(&io_conf)); - - return ESP_OK; -} - -esp_err_t bsp_audio_poweramp_enable(bool enable) -{ - BSP_ERROR_CHECK_RETURN_ERR(gpio_set_level(BSP_POWER_AMP_IO, enable ? 1 : 0)); - - return ESP_OK; -} - esp_codec_dev_handle_t bsp_audio_codec_speaker_init(void) { - if (i2s_tx_chan == NULL || i2s_rx_chan == NULL || i2s_data_if == NULL) { + const audio_codec_data_if_t *i2s_data_if = bsp_audio_get_codec_itf(); + if (i2s_data_if == NULL) { /* Initilize I2C */ BSP_ERROR_CHECK_RETURN_ERR(bsp_i2c_init()); /* Configure I2S peripheral and Power Amplifier */ - BSP_ERROR_CHECK_RETURN_ERR(bsp_audio_init(NULL, &i2s_tx_chan, &i2s_rx_chan)); - BSP_ERROR_CHECK_RETURN_ERR(bsp_audio_poweramp_enable(true)); + BSP_ERROR_CHECK_RETURN_ERR(bsp_audio_init(NULL)); + i2s_data_if = bsp_audio_get_codec_itf(); } 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 = ES8156_CODEC_DEFAULT_ADDR, @@ -205,6 +141,7 @@ esp_codec_dev_handle_t bsp_audio_codec_speaker_init(void) es8156_codec_cfg_t es8156_cfg = { .ctrl_if = i2c_ctrl_if, + .gpio_if = gpio_if, .pa_pin = BSP_POWER_AMP_IO, .pa_reverted = false, .hw_gain = gain, @@ -222,12 +159,13 @@ esp_codec_dev_handle_t bsp_audio_codec_speaker_init(void) esp_codec_dev_handle_t bsp_audio_codec_microphone_init(void) { - if (i2s_tx_chan == NULL || i2s_rx_chan == NULL || i2s_data_if == NULL) { + const audio_codec_data_if_t *i2s_data_if = bsp_audio_get_codec_itf(); + if (i2s_data_if == NULL) { /* Initilize I2C */ BSP_ERROR_CHECK_RETURN_ERR(bsp_i2c_init()); /* Configure I2S peripheral and Power Amplifier */ - BSP_ERROR_CHECK_RETURN_ERR(bsp_audio_init(NULL, &i2s_tx_chan, &i2s_rx_chan)); - BSP_ERROR_CHECK_RETURN_ERR(bsp_audio_poweramp_enable(true)); + BSP_ERROR_CHECK_RETURN_ERR(bsp_audio_init(NULL)); + i2s_data_if = bsp_audio_get_codec_itf(); } assert(i2s_data_if); @@ -418,10 +356,18 @@ static lv_indev_t *bsp_display_indev_init(lv_disp_t *disp) } lv_disp_t *bsp_display_start(void) +{ + bsp_display_cfg_t cfg = { + .lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG() + }; + return bsp_display_start_with_config(&cfg); +} + +lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg) { lv_disp_t *disp; - const lvgl_port_cfg_t lvgl_cfg = ESP_LVGL_PORT_INIT_CONFIG(); - BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&lvgl_cfg)); + assert(cfg != NULL); + BSP_ERROR_CHECK_RETURN_NULL(lvgl_port_init(&cfg->lvgl_port_cfg)); BSP_ERROR_CHECK_RETURN_NULL(bsp_display_brightness_init()); diff --git a/esp-box-lite/esp-box-lite_idf4.c b/esp-box-lite/esp-box-lite_idf4.c new file mode 100644 index 000000000..96a7bb5de --- /dev/null +++ b/esp-box-lite/esp-box-lite_idf4.c @@ -0,0 +1,75 @@ +/* + * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_err.h" +#include "bsp/esp-box-lite.h" +#include "bsp_err_check.h" +#include "esp_codec_dev_defaults.h" + +static const char *TAG = "ESP-BOX"; + +/* This configuration is used by default in bsp_audio_init() */ +#define BSP_I2S_DUPLEX_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 \ + } + +static const audio_codec_data_if_t *i2s_data_if = NULL; /* Codec data interface */ + +esp_err_t bsp_audio_init(const i2s_config_t *i2s_config) +{ + esp_err_t ret = ESP_FAIL; + + if (i2s_data_if != NULL) { + /* Audio was initialized before */ + return ESP_OK; + } + + /* Setup I2S peripheral */ + const i2s_pin_config_t i2s_pin_config = { + .mck_io_num = BSP_I2S_MCLK, + .bck_io_num = BSP_I2S_SCLK, + .ws_io_num = BSP_I2S_LCLK, + .data_out_num = BSP_I2S_DOUT, + .data_in_num = BSP_I2S_DSIN + }; + + /* Setup I2S channels */ + const i2s_config_t std_cfg_default = BSP_I2S_DUPLEX_MONO_CFG(22050); + const i2s_config_t *p_i2s_cfg = &std_cfg_default; + if (i2s_config != NULL) { + p_i2s_cfg = i2s_config; + } + + ESP_ERROR_CHECK(i2s_driver_install(CONFIG_BSP_I2S_NUM, p_i2s_cfg, 0, NULL)); + ESP_GOTO_ON_ERROR(i2s_set_pin(CONFIG_BSP_I2S_NUM, &i2s_pin_config), err, TAG, "I2S set pin failed"); + + audio_codec_i2s_cfg_t i2s_cfg = { + .port = CONFIG_BSP_I2S_NUM, + }; + i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); + BSP_NULL_CHECK_GOTO(i2s_data_if, err); + + return ESP_OK; + +err: + i2s_driver_uninstall(CONFIG_BSP_I2S_NUM); + return ret; +} + +const audio_codec_data_if_t *bsp_audio_get_codec_itf(void) +{ + return i2s_data_if; +} diff --git a/esp-box-lite/esp-box-lite_idf5.c b/esp-box-lite/esp-box-lite_idf5.c new file mode 100644 index 000000000..3113aea70 --- /dev/null +++ b/esp-box-lite/esp-box-lite_idf5.c @@ -0,0 +1,95 @@ +/* + * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_err.h" +#include "bsp/esp-box-lite.h" +#include "bsp_err_check.h" +#include "esp_codec_dev_defaults.h" + +static const char *TAG = "ESP-BOX"; + +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 */ + + +/* 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_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, \ + } + +esp_err_t bsp_audio_init(const i2s_std_config_t *i2s_config) +{ + esp_err_t ret = ESP_FAIL; + if (i2s_tx_chan && i2s_rx_chan) { + /* 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 + BSP_ERROR_CHECK_RETURN_ERR(i2s_new_channel(&chan_cfg, &i2s_tx_chan, &i2s_rx_chan)); + + /* 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_GOTO_ON_ERROR(i2s_channel_init_std_mode(i2s_tx_chan, p_i2s_cfg), err, TAG, "I2S channel initialization failed"); + ESP_GOTO_ON_ERROR(i2s_channel_enable(i2s_tx_chan), err, TAG, "I2S enabling failed"); + } + if (i2s_rx_chan != NULL) { + ESP_GOTO_ON_ERROR(i2s_channel_init_std_mode(i2s_rx_chan, p_i2s_cfg), err, TAG, "I2S channel initialization failed"); + ESP_GOTO_ON_ERROR(i2s_channel_enable(i2s_rx_chan), err, TAG, "I2S enabling failed"); + } + + audio_codec_i2s_cfg_t i2s_cfg = { + .port = CONFIG_BSP_I2S_NUM, + .rx_handle = i2s_rx_chan, + .tx_handle = i2s_tx_chan, + }; + i2s_data_if = audio_codec_new_i2s_data(&i2s_cfg); + BSP_NULL_CHECK_GOTO(i2s_data_if, err); + + return ESP_OK; + +err: + if (i2s_tx_chan) { + i2s_del_channel(i2s_tx_chan); + } + if (i2s_rx_chan) { + i2s_del_channel(i2s_rx_chan); + } + + return ret; +} + +const audio_codec_data_if_t *bsp_audio_get_codec_itf(void) +{ + return i2s_data_if; +} diff --git a/esp-box-lite/idf_component.yml b/esp-box-lite/idf_component.yml index 9ca663f0d..52e14b690 100644 --- a/esp-box-lite/idf_component.yml +++ b/esp-box-lite/idf_component.yml @@ -1,4 +1,4 @@ -version: "1.0.2" +version: "2.0.0" description: Board Support Package for ESP32-S3-BOX-Lite url: https://github.com/espressif/esp-bsp/tree/master/esp-box-lite @@ -6,7 +6,7 @@ targets: - esp32s3 dependencies: - idf: ">=5.0" + idf: ">=4.4.5" button: version: "^2" diff --git a/esp-box-lite/include/bsp/esp-box-lite.h b/esp-box-lite/include/bsp/esp-box-lite.h index 1ebc7f13e..9a7abb1ec 100644 --- a/esp-box-lite/include/bsp/esp-box-lite.h +++ b/esp-box-lite/include/bsp/esp-box-lite.h @@ -14,11 +14,17 @@ #include "sdkconfig.h" #include "driver/gpio.h" #include "driver/i2c.h" -#include "driver/i2s_std.h" #include "soc/usb_pins.h" -#include "iot_button.h" #include "lvgl.h" +#include "esp_lvgl_port.h" #include "esp_codec_dev.h" +#include "iot_button.h" + +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) +#include "driver/i2s.h" +#else +#include "driver/i2s_std.h" +#endif /************************************************************************************************** * ESP-BOX-Lite pinout @@ -85,23 +91,11 @@ #define BSP_PMOD2_IO8 GPIO_NUM_14 // Intended for SPI2 WP (Write-protect) + #ifdef __cplusplus extern "C" { #endif -/************************************************************************************************** - * - * Buttons interface - * - * Example configuration: - * \code{.c} - * button_handle_t button[BSP_BUTTON_NUM]; - * for (int i = 0; i < BSP_BUTTON_NUM; i++) { - * button[i] = iot_button_create(&bsp_button_config[i]); - * } - * \endcode - **************************************************************************************************/ - /* Buttons */ typedef enum { BSP_BUTTON_PREV, @@ -110,7 +104,13 @@ typedef enum { BSP_BUTTON_NUM } bsp_button_t; -extern const button_config_t bsp_button_config[BSP_BUTTON_NUM]; +/** + * @brief BSP display configuration structure + * + */ +typedef struct { + lvgl_port_cfg_t lvgl_port_cfg; +} bsp_display_cfg_t; /************************************************************************************************** * @@ -132,41 +132,11 @@ extern const button_config_t bsp_button_config[BSP_BUTTON_NUM]; * \endcode **************************************************************************************************/ -/** - * @brief ESP-BOX-Lite I2S pinout - * - * 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, \ - }, \ - } - -/** - * @brief Mono Duplex I2S configuration structure - * - * This configuration is used by default in bsp_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, \ - } - /** * @brief Init audio * * @note There is no deinit audio function. Users can free audio resources by calling i2s_del_channel() + * @warning The type of i2s_config param is depending on IDF version. * @param[in] i2s_config I2S configuration. Pass NULL to use default values (Mono, duplex, 16bit, 22050 Hz) * @param[out] tx_channel I2S TX channel * @param[out] rx_channel I2S RX channel @@ -178,17 +148,19 @@ extern const button_config_t bsp_button_config[BSP_BUTTON_NUM]; * - ESP_ERR_NO_MEM No memory for storing the channel information * - ESP_ERR_INVALID_STATE This channel has not initialized or already started */ -esp_err_t bsp_audio_init(const i2s_std_config_t *i2s_config, i2s_chan_handle_t *tx_channel, i2s_chan_handle_t *rx_channel); +#if ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5, 0, 0) +esp_err_t bsp_audio_init(const i2s_config_t *i2s_config); +#else +esp_err_t bsp_audio_init(const i2s_std_config_t *i2s_config); +#endif /** - * @brief Enable/disable audio power amplifier + * @brief Get codec I2S interface (initialized in bsp_audio_init) * - * @param[in] enable Enable/disable audio power amplifier * @return - * - ESP_OK On success - * - ESP_ERR_INVALID_ARG Invalid GPIO number + * - Pointer to codec I2S interface handle or NULL when error occured */ -esp_err_t bsp_audio_poweramp_enable(const bool enable); +const audio_codec_data_if_t *bsp_audio_get_codec_itf(void); /** * @brief Initialize speaker codec device @@ -309,6 +281,18 @@ esp_err_t bsp_spiffs_unmount(void); */ lv_disp_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 occured + */ +lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg); + /** * @brief Get pointer to input device (touch, buttons, ...) * diff --git a/esp-box/esp-box.c b/esp-box/esp-box.c index b475ac013..dd96d491c 100644 --- a/esp-box/esp-box.c +++ b/esp-box/esp-box.c @@ -415,7 +415,7 @@ lv_disp_t *bsp_display_start_with_config(const bsp_display_cfg_t *cfg) BSP_NULL_CHECK(disp = bsp_display_lcd_init(), NULL); - BSP_NULL_CHECK(bsp_display_indev_init(disp), NULL); + BSP_NULL_CHECK(disp_indev = bsp_display_indev_init(disp), NULL); return disp; } diff --git a/examples/display_audio_photo/main/app_disp_fs.c b/examples/display_audio_photo/main/app_disp_fs.c index ffb1c772c..2b6fcc442 100644 --- a/examples/display_audio_photo/main/app_disp_fs.c +++ b/examples/display_audio_photo/main/app_disp_fs.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -81,6 +81,7 @@ static void set_tab_group(void); *******************************************************************************/ static lv_obj_t *tabview = NULL; +static lv_obj_t *tab_btns = NULL; static lv_group_t *filesystem_group = NULL; static lv_group_t *recording_group = NULL; static lv_group_t *settings_group = NULL; @@ -118,7 +119,7 @@ void app_disp_lvgl_show(void) lv_obj_add_event_cb(tabview, tab_changed_event, LV_EVENT_VALUE_CHANGED, NULL); /* Tabview buttons style */ - lv_obj_t *tab_btns = lv_tabview_get_tab_btns(tabview); + tab_btns = lv_tabview_get_tab_btns(tabview); lv_obj_set_style_bg_color(tab_btns, lv_palette_darken(LV_PALETTE_GREY, 3), 0); lv_obj_set_style_text_color(tab_btns, lv_palette_lighten(LV_PALETTE_GREEN, 5), 0); lv_obj_set_style_border_side(tab_btns, LV_BORDER_SIDE_BOTTOM, LV_PART_ITEMS | LV_STATE_CHECKED); @@ -135,8 +136,6 @@ void app_disp_lvgl_show(void) recording_group = lv_group_create(); settings_group = lv_group_create(); lv_group_add_obj(filesystem_group, tab_btns); - lv_group_add_obj(recording_group, tab_btns); - lv_group_add_obj(settings_group, tab_btns); lv_indev_set_group(indev, filesystem_group); ESP_LOGI(TAG, "Input device group was set."); } @@ -947,17 +946,23 @@ static void set_tab_group(void) lv_group_set_editing(filesystem_group, false); lv_group_set_editing(recording_group, false); lv_group_set_editing(settings_group, false); + //lv_group_remove_obj(tab_btns); switch (tab) { case 0: + lv_group_add_obj(filesystem_group, tab_btns); lv_indev_set_group(indev, filesystem_group); break; case 1: + lv_group_add_obj(recording_group, tab_btns); lv_indev_set_group(indev, recording_group); break; case 2: + lv_group_add_obj(settings_group, tab_btns); lv_indev_set_group(indev, settings_group); break; } + + lv_tabview_set_act(tabview, tab, false); } } diff --git a/examples/display_audio_photo/main/idf_component.yml b/examples/display_audio_photo/main/idf_component.yml index 1a9a668d5..8dd639e3a 100644 --- a/examples/display_audio_photo/main/idf_component.yml +++ b/examples/display_audio_photo/main/idf_component.yml @@ -1,6 +1,6 @@ description: BSP Display Audio Photo Example dependencies: esp_jpeg: "*" - esp-box: - version: ">=3.0.0" - override_path: "../../../esp-box" + esp-box-lite: + version: ">=2.0.0" + override_path: "../../../esp-box-lite"