diff --git a/.gitignore b/.gitignore index 1a05c1c..03cfb2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,23 +1,23 @@ -.pytest_cache/ -__pycache__/ - -# esp-idf built binaries -build/ -build_*_*/ -#sdkconfig - -# idf-ci build run output -build_summary_*.xml -app_info_*.txt -size_info_*.txt - -# pytest-embedded log folder -pytest_embedded_log/ - -# idf-component-manager output -dependencies.lock - -.devcontainer - -managed_components +.pytest_cache/ +__pycache__/ + +# esp-idf built binaries +build/ +build_*_*/ +#sdkconfig + +# idf-ci build run output +build_summary_*.xml +app_info_*.txt +size_info_*.txt + +# pytest-embedded log folder +pytest_embedded_log/ + +# idf-component-manager output +dependencies.lock + +.devcontainer + +managed_components components \ No newline at end of file diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 5610178..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "configurations": [ - { - "name": "ESP-IDF", - "compilerPath": "${config:idf.toolsPathWin}\\tools\\xtensa-esp-elf\\esp-13.2.0_20240530\\xtensa-esp-elf\\bin\\xtensa-esp32-elf-gcc.exe", - "compileCommands": "${config:idf.buildPath}/compile_commands.json", - "includePath": [ - "${config:idf.espIdfPath}/components/**", - "${config:idf.espIdfPathWin}/components/**", - "${workspaceFolder}/**" - ], - "browse": { - "path": [ - "${config:idf.espIdfPath}/components", - "${config:idf.espIdfPathWin}/components", - "${workspaceFolder}" - ], - "limitSymbolsToIncludedHeaders": true - } - } - ], - "version": 4 -} diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 2511a38..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "type": "gdbtarget", - "request": "attach", - "name": "Eclipse CDT GDB Adapter" - }, - { - "type": "espidf", - "name": "Launch", - "request": "launch" - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index c0d129c..0de0370 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -35,8 +35,7 @@ "semphr.h": "c", "lv_spinbox.h": "c", "lv_slider.h": "c", - "lv_menu.h": "c", - "stream_buffer.h": "c" + "lv_menu.h": "c" }, "git.ignoreLimitWarning": true } diff --git a/CMakeLists.txt b/CMakeLists.txt index e7785b6..d0db1e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ -# The following lines of boilerplate have to be in your project's -# CMakeLists in this exact order for cmake to work correctly -cmake_minimum_required(VERSION 3.16) - -include($ENV{IDF_PATH}/tools/cmake/project.cmake) -project(level-shot) +# The following lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(level-shot) diff --git a/README.md b/README.md index 5025e9c..4ef99ce 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +<<<<<<< HEAD ## 🐳 ESP-IDF Dockerized Development Environment (Windows) This project includes a fully containerized [ESP-IDF](https://docs.espressif.com/projects/esp-idf/en/latest/esp32/index.html) development environment using **Docker** and **Visual Studio Code**. @@ -209,3 +210,95 @@ Features: * If `idf.py` is not found, make sure the container terminal sources `export.sh` +======= +| Supported Targets | ESP32 | +| ----------------- | ----- | + +A2DP-SOURCE EXAMPLE +======================== + +Example of A2DP audio source role + +This is the example of using Advanced Audio Distribution Profile (A2DP) APIs to transmit audio stream. Application can take advantage of this example to implement portable audio players or microphones to transmit audio stream to A2DP sink devices. + +## How to use this example + +### Hardware Required + +This example is able to run on any commonly available ESP32 development board, and is supposed to connect to [A2DP sink example](../a2dp_sink) in ESP-IDF. + +### Configure the project + +``` +idf.py menuconfig +``` + +* Enable Classic Bluetooth and A2DP under Component config --> Bluetooth --> Bluedroid Enable + +### Build and Flash + +Build the project and flash it to the board, then run monitor tool to view serial output. + +``` +idf.py -p PORT flash monitor +``` + +(Replace PORT with the name of the serial port to use.) + +(To exit the serial monitor, type ``Ctrl-]``.) + +See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects. + +## Example Output + +For the first step, this example performs device discovery to search for a target device (A2DP sink) whose device name is "ESP_SPEAKER" and whose "Rendering" bit of its Service Class field is set in its Class of Device (COD). If a candidate target is found, the local device will initiate connection with it. + +After connection with A2DP sink is established, the example performs the following running loop 1-2-3-4-1: +1. audio transmission starts and lasts for a while +2. audio transmission stops +3. disconnect with target device +4. reconnect to target device + +The example implements an event loop triggered by a periodic "heart beat" timer and events from Bluetooth protocol stack callback functions. + +After the local device discovers the target device and initiates connection, there will be logging message like this: + +``` +I (4090) BT_AV: Found a target device, address xx:xx:xx:xx:xx:xx, name ESP_SPEAKER +I (4090) BT_AV: Cancel device discovery ... +I (4100) BT_AV: Device discovery stopped. +I (4100) BT_AV: a2dp connecting to peer: ESP_SPEAKER +``` + +If connection is set up successfully, there will be such message: + +``` +I (5100) BT_AV: a2dp connected +``` + +Starting of audio transmission has the following notification message: + +``` +I (10880) BT_AV: a2dp media ready checking ... +... +I (10880) BT_AV: a2dp media ready, starting ... +... +I (11400) BT_AV: a2dp media start successfully. +``` + +Stop of audio transmission, and disconnection with remote device generate the following notification message: + +``` +I (110880) BT_AV: a2dp media stopping... +... +I (110920) BT_AV: a2dp media stopped successfully, disconnecting... +... +I (111040) BT_AV: a2dp disconnected +``` + +## Troubleshooting +* For current stage, the supported audio codec in ESP32 A2DP is SBC. SBC audio stream is encoded from PCM data normally formatted as 44.1kHz sampling rate, two-channel 16-bit sample data. +* The raw PCM media stream in the example is generated by a sequence of random number, so the sound played on the sink side will be piercing noise. +* As a usage limitation, ESP32 A2DP source can support at most one connection with remote A2DP sink devices. Also, A2DP source cannot be used together with A2DP sink at the same time, but can be used with other profiles such as SPP and HFP. +* Usually, the `ACL_CONN_NUM` is set to `2` but not `1` as one is used for a2dp connection and the other is used for avrcp connection. +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt index e1a7ad9..0fbfeb0 100644 --- a/main/CMakeLists.txt +++ b/main/CMakeLists.txt @@ -1,3 +1,17 @@ +<<<<<<< HEAD +idf_component_register(SRCS "system.c.LOCAL.c" "bt_app.c" "system.c" "bubble.c" "keypad.c" "main.c" + + "gui.c" + "lsm6dsv.c" + INCLUDE_DIRS "." + REQUIRES "driver" + "esp_lcd" + "lvgl" + "esp_lvgl_port" + "esp_timer" + "nvs_flash" + "bt") +======= idf_component_register(SRCS "bt_app.c" "system.c" "bubble.c" "keypad.c" "main.c" "gui.c" @@ -10,3 +24,5 @@ idf_component_register(SRCS "bt_app.c" "system.c" "bubble.c" "keypad.c" "main.c" "esp_timer" "nvs_flash" "bt") +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 + diff --git a/main/Kconfig.projbuild b/main/Kconfig.projbuild index ece7738..0f30792 100644 --- a/main/Kconfig.projbuild +++ b/main/Kconfig.projbuild @@ -1,9 +1,9 @@ -menu "A2DP Example Configuration" - config EXAMPLE_SSP_ENABLED - bool "Secure Simple Pairing" - depends on BT_CLASSIC_ENABLED - default y - help - This enables the Secure Simple Pairing. If disable this option, - Bluedroid will only support Legacy Pairing -endmenu +menu "A2DP Example Configuration" + config EXAMPLE_SSP_ENABLED + bool "Secure Simple Pairing" + depends on BT_CLASSIC_ENABLED + default y + help + This enables the Secure Simple Pairing. If disable this option, + Bluedroid will only support Legacy Pairing +endmenu diff --git a/main/bt_app.c b/main/bt_app.c index 085b26a..6ef3f48 100644 --- a/main/bt_app.c +++ b/main/bt_app.c @@ -1,3 +1,4 @@ +<<<<<<< HEAD /* * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD * @@ -1166,4 +1167,1162 @@ void bt_app_init(void) +======= +/* + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + +#include +#include +#include +#include +#include "freertos/FreeRTOSConfig.h" +#include "freertos/FreeRTOS.h" +#include "freertos/queue.h" +#include "freertos/task.h" +#include "freertos/stream_buffer.h" +#include "esp_log.h" + +#include "bt_app.h" +#include "system.h" + +#include "esp_bt.h" +#include "esp_bt_main.h" +#include "esp_bt_device.h" +#include "esp_gap_bt_api.h" +#include "esp_a2dp_api.h" +#include "esp_avrc_api.h" + +/* log tags */ +#define BT_AV_TAG "BT_AV" +#define BT_RC_CT_TAG "RC_CT" + +/* device name */ +#define TARGET_DEVICE_NAME "ESP_SPEAKER" +#define LOCAL_DEVICE_NAME "ESP_A2DP_SRC" + +/* AVRCP used transaction label */ +#define APP_RC_CT_TL_GET_CAPS (0) +#define APP_RC_CT_TL_RN_VOLUME_CHANGE (1) + +enum { + BT_APP_STACK_UP_EVT = 0x0000, /* event for stack up */ + BT_APP_HEART_BEAT_EVT = 0xff00, /* event for heart beat */ +}; + +/* A2DP global states */ +enum { + APP_AV_STATE_IDLE, + APP_AV_STATE_DISCOVERING, + APP_AV_STATE_DISCOVERED, + APP_AV_STATE_UNCONNECTED, + APP_AV_STATE_CONNECTING, + APP_AV_STATE_CONNECTED, + APP_AV_STATE_DISCONNECTING, +}; + +/* sub states of APP_AV_STATE_CONNECTED */ +enum { + APP_AV_MEDIA_STATE_IDLE, + APP_AV_MEDIA_STATE_STARTING, + APP_AV_MEDIA_STATE_STARTED, + APP_AV_MEDIA_STATE_STOPPING, +}; + +/********************************* + * STATIC FUNCTION DECLARATIONS + ********************************/ + +/* application task handler */ +static void bt_app_task_handler(void *arg); +/* message sender for Work queue */ +static bool bt_app_send_msg(bt_app_msg_t *msg); +/* handler for dispatched message */ +static void bt_app_work_dispatched(bt_app_msg_t *msg); + +/* handler for bluetooth stack enabled events */ +static void bt_av_hdl_stack_evt(uint16_t event, void *p_param); + +/* avrc controller event handler */ +static void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param); + +/* GAP callback function */ +static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param); + +/* callback function for A2DP source */ +static void bt_app_a2d_cb(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param); + +/* callback function for A2DP source audio data stream */ +static int32_t bt_app_a2d_data_cb(uint8_t *data, int32_t len); + +/* callback function for AVRCP controller */ +static void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param); + +/* handler for heart beat timer */ +static void bt_app_a2d_heart_beat(TimerHandle_t arg); + +/* A2DP application state machine */ +static void bt_app_av_sm_hdlr(uint16_t event, void *param); + +/* utils for transfer BLuetooth Deveice Address into string form */ +static char *bda2str(esp_bd_addr_t bda, char *str, size_t size); + +/* A2DP application state machine handler for each state */ +static void bt_app_av_state_unconnected_hdlr(uint16_t event, void *param); +static void bt_app_av_state_connecting_hdlr(uint16_t event, void *param); +static void bt_app_av_state_connected_hdlr(uint16_t event, void *param); +static void bt_app_av_state_disconnecting_hdlr(uint16_t event, void *param); + +/********************************* + * STATIC VARIABLE DEFINITIONS + ********************************/ +static QueueHandle_t s_bt_app_task_queue = NULL; +static TaskHandle_t s_bt_app_task_handle = NULL; + + +static esp_bd_addr_t s_peer_bda = {0}; /* Bluetooth Device Address of peer device*/ +static uint8_t s_peer_bdname[ESP_BT_GAP_MAX_BDNAME_LEN + 1]; /* Bluetooth Device Name of peer device*/ +static int s_a2d_state = APP_AV_STATE_IDLE; /* A2DP global state */ +static int s_media_state = APP_AV_MEDIA_STATE_IDLE; /* sub states of APP_AV_STATE_CONNECTED */ +static int s_intv_cnt = 0; /* count of heart beat intervals */ +static int s_connecting_intv = 0; /* count of heart beat intervals for connecting */ +static uint32_t s_pkt_cnt = 0; /* count of packets */ +static esp_avrc_rn_evt_cap_mask_t s_avrc_peer_rn_cap; /* AVRC target notification event capability bit mask */ +static TimerHandle_t s_tmr; + +/********************************* + * STATIC FUNCTION DEFINITIONS + ********************************/ +static char *bda2str(esp_bd_addr_t bda, char *str, size_t size) +{ + if (bda == NULL || str == NULL || size < 18) { + return NULL; + } + + sprintf(str, "%02x:%02x:%02x:%02x:%02x:%02x", + bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); + return str; +} + +static bool get_name_from_eir(uint8_t *eir, uint8_t *bdname, uint8_t *bdname_len) +{ + uint8_t *rmt_bdname = NULL; + uint8_t rmt_bdname_len = 0; + + if (!eir) { + return false; + } + + /* get complete or short local name from eir data */ + rmt_bdname = esp_bt_gap_resolve_eir_data(eir, ESP_BT_EIR_TYPE_CMPL_LOCAL_NAME, &rmt_bdname_len); + if (!rmt_bdname) { + rmt_bdname = esp_bt_gap_resolve_eir_data(eir, ESP_BT_EIR_TYPE_SHORT_LOCAL_NAME, &rmt_bdname_len); + } + + if (rmt_bdname) { + if (rmt_bdname_len > ESP_BT_GAP_MAX_BDNAME_LEN) { + rmt_bdname_len = ESP_BT_GAP_MAX_BDNAME_LEN; + } + + if (bdname) { + memcpy(bdname, rmt_bdname, rmt_bdname_len); + bdname[rmt_bdname_len] = '\0'; + } + if (bdname_len) { + *bdname_len = rmt_bdname_len; + } + return true; + } + + return false; +} + +static void filter_inquiry_scan_result(esp_bt_gap_cb_param_t *param) +{ + char bda_str[18]; + uint32_t cod = 0; /* class of device */ + int32_t rssi = -129; /* invalid value */ + uint8_t *eir = NULL; + esp_bt_gap_dev_prop_t *p; + + /* handle the discovery results */ + + for (int i = 0; i < param->disc_res.num_prop; i++) { + p = param->disc_res.prop + i; + switch (p->type) { + case ESP_BT_GAP_DEV_PROP_COD: + cod = *(uint32_t *)(p->val); + + break; + case ESP_BT_GAP_DEV_PROP_RSSI: + rssi = *(int8_t *)(p->val); + + break; + case ESP_BT_GAP_DEV_PROP_EIR: + eir = (uint8_t *)(p->val); + break; + case ESP_BT_GAP_DEV_PROP_BDNAME: + default: + break; + } + } + + /* search for device with MAJOR service class as "rendering" in COD */ + if (!esp_bt_gap_is_valid_cod(cod) || + !(esp_bt_gap_get_cod_srvc(cod) & ESP_BT_COD_SRVC_RENDERING)) { + return; + } + + ESP_LOGI(BT_AV_TAG, "Scanned device: %s", bda2str(param->disc_res.bda, bda_str, 18)); + ESP_LOGI(BT_AV_TAG, "--Class of Device: 0x%"PRIx32, cod); + ESP_LOGI(BT_AV_TAG, "--RSSI: %"PRId32, rssi); + + /* search for target device in its Extended Inqury Response */ + if (eir) { + get_name_from_eir(eir, s_peer_bdname, NULL); + //if (strcmp((char *)s_peer_bdname, TARGET_DEVICE_NAME) == 0) + { + ESP_LOGI(BT_AV_TAG, "Found a target device, address %s, name %s", bda_str, s_peer_bdname); + s_a2d_state = APP_AV_STATE_DISCOVERED; + memcpy(s_peer_bda, param->disc_res.bda, ESP_BD_ADDR_LEN); + ESP_LOGI(BT_AV_TAG, "Cancel device discovery ..."); + esp_bt_gap_cancel_discovery(); + } + } +} + +static void bt_app_gap_cb(esp_bt_gap_cb_event_t event, esp_bt_gap_cb_param_t *param) +{ + switch (event) { + /* when device discovered a result, this event comes */ + case ESP_BT_GAP_DISC_RES_EVT: { + if (s_a2d_state == APP_AV_STATE_DISCOVERING) { + filter_inquiry_scan_result(param); + } + break; + } + /* when discovery state changed, this event comes */ + case ESP_BT_GAP_DISC_STATE_CHANGED_EVT: { + if (param->disc_st_chg.state == ESP_BT_GAP_DISCOVERY_STOPPED) { + if (s_a2d_state == APP_AV_STATE_DISCOVERED) { + s_a2d_state = APP_AV_STATE_CONNECTING; + ESP_LOGI(BT_AV_TAG, "Device discovery stopped."); + ESP_LOGI(BT_AV_TAG, "a2dp connecting to peer: %s", s_peer_bdname); + /* connect source to peer device specified by Bluetooth Device Address */ + esp_a2d_source_connect(s_peer_bda); + } else { + /* not discovered, continue to discover */ + ESP_LOGI(BT_AV_TAG, "Device discovery failed, continue to discover..."); + esp_bt_gap_start_discovery(ESP_BT_INQ_MODE_GENERAL_INQUIRY, 10, 0); + } + } else if (param->disc_st_chg.state == ESP_BT_GAP_DISCOVERY_STARTED) { + ESP_LOGI(BT_AV_TAG, "Discovery started."); + } + break; + } + /* when authentication completed, this event comes */ + case ESP_BT_GAP_AUTH_CMPL_EVT: { + if (param->auth_cmpl.stat == ESP_BT_STATUS_SUCCESS) { + ESP_LOGI(BT_AV_TAG, "authentication success: %s", param->auth_cmpl.device_name); + esp_log_buffer_hex(BT_AV_TAG, param->auth_cmpl.bda, ESP_BD_ADDR_LEN); + } else { + ESP_LOGE(BT_AV_TAG, "authentication failed, status: %d", param->auth_cmpl.stat); + } + break; + } + /* when Legacy Pairing pin code requested, this event comes */ + case ESP_BT_GAP_PIN_REQ_EVT: { + ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_PIN_REQ_EVT min_16_digit: %d", param->pin_req.min_16_digit); + if (param->pin_req.min_16_digit) { + ESP_LOGI(BT_AV_TAG, "Input pin code: 0000 0000 0000 0000"); + esp_bt_pin_code_t pin_code = {0}; + esp_bt_gap_pin_reply(param->pin_req.bda, true, 16, pin_code); + } else { + ESP_LOGI(BT_AV_TAG, "Input pin code: 1234"); + esp_bt_pin_code_t pin_code; + pin_code[0] = '1'; + pin_code[1] = '2'; + pin_code[2] = '3'; + pin_code[3] = '4'; + esp_bt_gap_pin_reply(param->pin_req.bda, true, 4, pin_code); + } + break; + } + +#if (CONFIG_EXAMPLE_SSP_ENABLED == true) + /* when Security Simple Pairing user confirmation requested, this event comes */ + case ESP_BT_GAP_CFM_REQ_EVT: + ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_CFM_REQ_EVT Please compare the numeric value: %"PRIu32, param->cfm_req.num_val); + esp_bt_gap_ssp_confirm_reply(param->cfm_req.bda, true); + break; + /* when Security Simple Pairing passkey notified, this event comes */ + case ESP_BT_GAP_KEY_NOTIF_EVT: + ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_KEY_NOTIF_EVT passkey: %"PRIu32, param->key_notif.passkey); + break; + /* when Security Simple Pairing passkey requested, this event comes */ + case ESP_BT_GAP_KEY_REQ_EVT: + ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_KEY_REQ_EVT Please enter passkey!"); + break; +#endif + + /* when GAP mode changed, this event comes */ + case ESP_BT_GAP_MODE_CHG_EVT: + ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_MODE_CHG_EVT mode: %d", param->mode_chg.mode); + break; + case ESP_BT_GAP_GET_DEV_NAME_CMPL_EVT: + if (param->get_dev_name_cmpl.status == ESP_BT_STATUS_SUCCESS) { + ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_GET_DEV_NAME_CMPL_EVT device name: %s", param->get_dev_name_cmpl.name); + } else { + ESP_LOGI(BT_AV_TAG, "ESP_BT_GAP_GET_DEV_NAME_CMPL_EVT failed, state: %d", param->get_dev_name_cmpl.status); + } + break; + /* other */ + default: { + ESP_LOGI(BT_AV_TAG, "event: %d", event); + break; + } + } + + return; +} + +static void bt_av_hdl_stack_evt(uint16_t event, void *p_param) +{ + ESP_LOGD(BT_AV_TAG, "%s event: %d", __func__, event); + + switch (event) { + /* when stack up worked, this event comes */ + case BT_APP_STACK_UP_EVT: { + char *dev_name = LOCAL_DEVICE_NAME; + esp_bt_gap_set_device_name(dev_name); + esp_bt_gap_register_callback(bt_app_gap_cb); + + esp_avrc_ct_init(); + esp_avrc_ct_register_callback(bt_app_rc_ct_cb); + + esp_avrc_rn_evt_cap_mask_t evt_set = {0}; + esp_avrc_rn_evt_bit_mask_operation(ESP_AVRC_BIT_MASK_OP_SET, &evt_set, ESP_AVRC_RN_VOLUME_CHANGE); + ESP_ERROR_CHECK(esp_avrc_tg_set_rn_evt_cap(&evt_set)); + + esp_a2d_source_init(); + esp_a2d_register_callback(&bt_app_a2d_cb); + esp_a2d_source_register_data_callback(bt_app_a2d_data_cb); + + /* Avoid the state error of s_a2d_state caused by the connection initiated by the peer device. */ + esp_bt_gap_set_scan_mode(ESP_BT_NON_CONNECTABLE, ESP_BT_NON_DISCOVERABLE); + esp_bt_gap_get_device_name(); + + ESP_LOGI(BT_AV_TAG, "Starting device discovery..."); + s_a2d_state = APP_AV_STATE_DISCOVERING; + esp_bt_gap_start_discovery(ESP_BT_INQ_MODE_GENERAL_INQUIRY, 10, 0); + + /* create and start heart beat timer */ + do { + int tmr_id = 0; + s_tmr = xTimerCreate("connTmr", (10000 / portTICK_PERIOD_MS), + pdTRUE, (void *) &tmr_id, bt_app_a2d_heart_beat); + xTimerStart(s_tmr, portMAX_DELAY); + } while (0); + break; + } + /* other */ + default: { + ESP_LOGE(BT_AV_TAG, "%s unhandled event: %d", __func__, event); + break; + } + } +} + +static void bt_app_a2d_cb(esp_a2d_cb_event_t event, esp_a2d_cb_param_t *param) +{ + bt_app_work_dispatch(bt_app_av_sm_hdlr, event, param, sizeof(esp_a2d_cb_param_t), NULL); +} + + + +#define SAMPLE_RATE 44100 +#define TONE_FREQ 440.0f // A4 +#define FADE_FREQ 1.0f // 1 Hz fade L->R +#define STREAM_BUF_SIZE (8192) +#define CHUNK_SIZE (512) + +StreamBufferHandle_t audio_stream_buf; + +void generate_synth_pcm(uint8_t *buf, int len) { + static float phase = 0.0f; + static float fade_phase = 0.0f; + + int16_t *samples = (int16_t *)buf; + int samples_needed = len / 4; // 4 bytes per stereo frame (2 bytes L, 2 bytes R) + + for (int i = 0; i < samples_needed; i++) { + // Fade L/R amplitude: 0..1 for L, inverted for R + float fade = (sinf(2 * M_PI * fade_phase) + 1.0f) * 0.5f; + + // Sine wave sample + float sample = sinf(2 * M_PI * phase); + + int16_t left = (int16_t)(sample * fade * 32767); + int16_t right = (int16_t)(sample * (1.0f - fade) * 32767); + + samples[i * 2 + 0] = left; + samples[i * 2 + 1] = right; + + // Advance phases + phase += TONE_FREQ / SAMPLE_RATE; + if (phase >= 1.0f) phase -= 1.0f; + + fade_phase += FADE_FREQ / SAMPLE_RATE; + if (fade_phase >= 1.0f) fade_phase -= 1.0f; + } +} + +#define MIN_RATE_HZ 1.0f +#define MAX_RATE_HZ 440.0f +#define CLICK_AMPLITUDE 32000 // 16-bit + +static float click_timer = 0.0f; + +void generate_synth_clicks(uint8_t *buf, int len, float balance) { + + int16_t *samples = (int16_t *)buf; + int samples_needed = len / 4; + + float abs_balance = fabsf(balance); + float rate_hz = MIN_RATE_HZ * powf(MAX_RATE_HZ / MIN_RATE_HZ, abs_balance); + float samples_per_click = SAMPLE_RATE / rate_hz; + + for (int i = 0; i < samples_needed; i++) { + int16_t left = 0; + int16_t right = 0; + + if (click_timer <= 0.0f) { + // Insert a short pulse: single sample spike + if (balance < 0) { + left = CLICK_AMPLITUDE; + } else if (balance > 0) { + right = CLICK_AMPLITUDE; + } + click_timer += samples_per_click; + } + + click_timer -= 1.0f; + + samples[i * 2 + 0] = left; + samples[i * 2 + 1] = right; + + } +} + +void audio_producer_task(void *pvParameters) { + uint8_t chunk[CHUNK_SIZE]; + + int core_id = xPortGetCoreID(); + + ESP_LOGI("Producer", "Running on core %d", core_id); + + system_subscribe(xTaskGetCurrentTaskHandle()); +#if 0 + + + while (1) { + generate_synth_pcm(chunk, sizeof(chunk)); + + size_t sent = xStreamBufferSend(audio_stream_buf, chunk, sizeof(chunk), portMAX_DELAY); + + if (sent < sizeof(chunk)) { + ESP_LOGW(BT_APP_CORE_TAG, "Dropped %d bytes", sizeof(chunk) - sent); + } + } +#endif + + static float phase = 0.0f; + + float balance = 0.0f; // -1.0 = left, +1.0 = right + + uint32_t raw_value; + uint32_t notifiedBits = 0; + + while (1) { + // Non-blocking check for new notification: + + // clear on entry (first param), wait for any bit, block forever + xTaskNotifyWait( + 0, // clear any old bits on entry + 0, // clear bits on exit + ¬ifiedBits, + 0); + + if (notifiedBits & EM_EVENT_NEW_DATA) + { + ImuData_t d = system_getImuData(); + + if (fabs(d.raw[system_getPrimaryAxis()]) > 45.0f) + { + balance = 0.0f; + } + else + { + balance = -d.angle / MAX_INDICATION_ANGLE; + } + } + + if (balance > 1.0f) + { + balance = 1.0f; + } + else + if (balance < -1.0f) + { + balance = -1.0f; + } + generate_synth_clicks(chunk, sizeof(chunk), balance); + +#if 0 + // Synthesize audio using latest balance + int16_t *samples = (int16_t *)chunk; + int samples_needed = CHUNK_SIZE / 4; + + for (int i = 0; i < samples_needed; i++) { + float sample = sinf(2 * M_PI * phase); + + float left_gain = 0.5f * (1.0f - balance); + float right_gain = 0.5f * (1.0f + balance); + + int16_t left = (int16_t)(sample * left_gain * 32767); + int16_t right = (int16_t)(sample * right_gain * 32767); + + samples[i * 2 + 0] = left; + samples[i * 2 + 1] = right; + + phase += TONE_FREQ / SAMPLE_RATE; + if (phase >= 1.0f) phase -= 1.0f; + } +#endif + + // Push chunk to FIFO + xStreamBufferSend(audio_stream_buf, chunk, sizeof(chunk), portMAX_DELAY); + } +} + +/* generate some random noise to simulate source audio */ +static int32_t bt_app_a2d_data_cb(uint8_t *data, int32_t len) +{ + size_t bytes_read = xStreamBufferReceive(audio_stream_buf, data, len, 0); + + if (bytes_read < len) { + memset(data + bytes_read, 0, len - bytes_read); // fill silence + } + + return len; +#if 0 + if (data == NULL || len < 0) { + return 0; + } + + int16_t *p_buf = (int16_t *)data; + for (int i = 0; i < (len >> 1); i++) { + p_buf[i] = rand() % (1 << 16); + } + + return len; +#endif +} + +#if 0 + +/* Generate a continuous 440Hz sine wave */ +static int32_t bt_app_a2d_data_cb(uint8_t *data, int32_t len) +{ + + if (data == NULL || len < 0) { + return 0; + } + + int16_t *p_buf = (int16_t *)data; + for (int i = 0; i < (len >> 1); i++) { + p_buf[i] = rand() % (1 << 16); + } + + return len; +#if 0 + static double phase = 0.0; + const double frequency = 440.0; // A4 tone (440 Hz) + const double sample_rate = 44100.0; // 44.1 kHz sample rate + const double phase_increment = 2.0 * M_PI * frequency / sample_rate; + const int16_t amplitude = 32767; // Maximum amplitude for 16-bit audio + + //ESP_LOGI(BT_AV_TAG, "len: %d", (int)len); + // Process stereo samples (each sample is 16-bit) + for (int i = 0; i < len / 4; i++) { + // Generate the sample value + int16_t sample = (int16_t)(amplitude * sin(phase)); + + // Write the same sample to both left and right channels + // Left channel + data[4*i] = sample & 0xFF; // Low byte + data[4*i + 1] = (sample >> 8); // High byte + // Right channel + data[4*i + 2] = sample & 0xFF; // Low byte + data[4*i + 3] = (sample >> 8); // High byte + + // Update phase for next sample + phase += phase_increment; + if (phase >= 2.0 * M_PI) { + phase -= 2.0 * M_PI; // Keep phase in [0, 2π) + } + } + return len; +#endif +} +#endif + +static void bt_app_a2d_heart_beat(TimerHandle_t arg) +{ + bt_app_work_dispatch(bt_app_av_sm_hdlr, BT_APP_HEART_BEAT_EVT, NULL, 0, NULL); +} + +static void bt_app_av_sm_hdlr(uint16_t event, void *param) +{ + ESP_LOGI(BT_AV_TAG, "%s state: %d, event: 0x%x", __func__, s_a2d_state, event); + + /* select handler according to different states */ + switch (s_a2d_state) { + case APP_AV_STATE_DISCOVERING: + case APP_AV_STATE_DISCOVERED: + break; + case APP_AV_STATE_UNCONNECTED: + bt_app_av_state_unconnected_hdlr(event, param); + break; + case APP_AV_STATE_CONNECTING: + bt_app_av_state_connecting_hdlr(event, param); + break; + case APP_AV_STATE_CONNECTED: + bt_app_av_state_connected_hdlr(event, param); + break; + case APP_AV_STATE_DISCONNECTING: + bt_app_av_state_disconnecting_hdlr(event, param); + break; + default: + ESP_LOGE(BT_AV_TAG, "%s invalid state: %d", __func__, s_a2d_state); + break; + } +} + +static void bt_app_av_state_unconnected_hdlr(uint16_t event, void *param) +{ + esp_a2d_cb_param_t *a2d = NULL; + /* handle the events of interest in unconnected state */ + switch (event) { + case ESP_A2D_CONNECTION_STATE_EVT: + case ESP_A2D_AUDIO_STATE_EVT: + case ESP_A2D_AUDIO_CFG_EVT: + case ESP_A2D_MEDIA_CTRL_ACK_EVT: + break; + case BT_APP_HEART_BEAT_EVT: { + uint8_t *bda = s_peer_bda; + ESP_LOGI(BT_AV_TAG, "a2dp connecting to peer: %02x:%02x:%02x:%02x:%02x:%02x", + bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); + esp_a2d_source_connect(s_peer_bda); + s_a2d_state = APP_AV_STATE_CONNECTING; + s_connecting_intv = 0; + break; + } + case ESP_A2D_REPORT_SNK_DELAY_VALUE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + ESP_LOGI(BT_AV_TAG, "%s, delay value: %u * 1/10 ms", __func__, a2d->a2d_report_delay_value_stat.delay_value); + break; + } + default: { + ESP_LOGE(BT_AV_TAG, "%s unhandled event: %d", __func__, event); + break; + } + } +} + +static void bt_app_av_state_connecting_hdlr(uint16_t event, void *param) +{ + esp_a2d_cb_param_t *a2d = NULL; + + /* handle the events of interest in connecting state */ + switch (event) { + case ESP_A2D_CONNECTION_STATE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_CONNECTED) { + ESP_LOGI(BT_AV_TAG, "a2dp connected"); + s_a2d_state = APP_AV_STATE_CONNECTED; + s_media_state = APP_AV_MEDIA_STATE_IDLE; + } else if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_DISCONNECTED) { + s_a2d_state = APP_AV_STATE_UNCONNECTED; + } + break; + } + case ESP_A2D_AUDIO_STATE_EVT: + case ESP_A2D_AUDIO_CFG_EVT: + case ESP_A2D_MEDIA_CTRL_ACK_EVT: + break; + case BT_APP_HEART_BEAT_EVT: + /** + * Switch state to APP_AV_STATE_UNCONNECTED + * when connecting lasts more than 2 heart beat intervals. + */ + if (++s_connecting_intv >= 2) { + s_a2d_state = APP_AV_STATE_UNCONNECTED; + s_connecting_intv = 0; + } + break; + case ESP_A2D_REPORT_SNK_DELAY_VALUE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + ESP_LOGI(BT_AV_TAG, "%s, delay value: %u * 1/10 ms", __func__, a2d->a2d_report_delay_value_stat.delay_value); + break; + } + default: + ESP_LOGE(BT_AV_TAG, "%s unhandled event: %d", __func__, event); + break; + } +} + +static void bt_app_av_media_proc(uint16_t event, void *param) +{ + esp_a2d_cb_param_t *a2d = NULL; + + switch (s_media_state) { + case APP_AV_MEDIA_STATE_IDLE: { + if (event == BT_APP_HEART_BEAT_EVT) { + ESP_LOGI(BT_AV_TAG, "a2dp media ready checking ..."); + esp_a2d_media_ctrl(ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY); + } else if (event == ESP_A2D_MEDIA_CTRL_ACK_EVT) { + a2d = (esp_a2d_cb_param_t *)(param); + if (a2d->media_ctrl_stat.cmd == ESP_A2D_MEDIA_CTRL_CHECK_SRC_RDY && + a2d->media_ctrl_stat.status == ESP_A2D_MEDIA_CTRL_ACK_SUCCESS) { + ESP_LOGI(BT_AV_TAG, "a2dp media ready, starting ..."); + esp_a2d_media_ctrl(ESP_A2D_MEDIA_CTRL_START); + s_media_state = APP_AV_MEDIA_STATE_STARTING; + } + } + break; + } + case APP_AV_MEDIA_STATE_STARTING: { + if (event == ESP_A2D_MEDIA_CTRL_ACK_EVT) { + a2d = (esp_a2d_cb_param_t *)(param); + if (a2d->media_ctrl_stat.cmd == ESP_A2D_MEDIA_CTRL_START && + a2d->media_ctrl_stat.status == ESP_A2D_MEDIA_CTRL_ACK_SUCCESS) { + ESP_LOGI(BT_AV_TAG, "a2dp media start successfully."); + s_intv_cnt = 0; + s_media_state = APP_AV_MEDIA_STATE_STARTED; + } else { + /* not started successfully, transfer to idle state */ + ESP_LOGI(BT_AV_TAG, "a2dp media start failed."); + s_media_state = APP_AV_MEDIA_STATE_IDLE; + } + } + break; + } + case APP_AV_MEDIA_STATE_STARTED: { + if (event == BT_APP_HEART_BEAT_EVT) { +#if 0 + /* stop media after 10 heart beat intervals */ + if (++s_intv_cnt >= 10) { + ESP_LOGI(BT_AV_TAG, "a2dp media suspending..."); + esp_a2d_media_ctrl(ESP_A2D_MEDIA_CTRL_SUSPEND); + s_media_state = APP_AV_MEDIA_STATE_STOPPING; + s_intv_cnt = 0; + } +#endif + } + break; + } + case APP_AV_MEDIA_STATE_STOPPING: { + if (event == ESP_A2D_MEDIA_CTRL_ACK_EVT) { + a2d = (esp_a2d_cb_param_t *)(param); + if (a2d->media_ctrl_stat.cmd == ESP_A2D_MEDIA_CTRL_SUSPEND && + a2d->media_ctrl_stat.status == ESP_A2D_MEDIA_CTRL_ACK_SUCCESS) { + ESP_LOGI(BT_AV_TAG, "a2dp media suspend successfully, disconnecting..."); + s_media_state = APP_AV_MEDIA_STATE_IDLE; + esp_a2d_source_disconnect(s_peer_bda); + s_a2d_state = APP_AV_STATE_DISCONNECTING; + } else { + ESP_LOGI(BT_AV_TAG, "a2dp media suspending..."); + esp_a2d_media_ctrl(ESP_A2D_MEDIA_CTRL_SUSPEND); + } + } + break; + } + default: { + break; + } + } +} + +static void bt_app_av_state_connected_hdlr(uint16_t event, void *param) +{ + esp_a2d_cb_param_t *a2d = NULL; + + /* handle the events of interest in connected state */ + switch (event) { + case ESP_A2D_CONNECTION_STATE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_DISCONNECTED) { + ESP_LOGI(BT_AV_TAG, "a2dp disconnected"); + s_a2d_state = APP_AV_STATE_UNCONNECTED; + } + break; + } + case ESP_A2D_AUDIO_STATE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + if (ESP_A2D_AUDIO_STATE_STARTED == a2d->audio_stat.state) { + s_pkt_cnt = 0; + } + break; + } + case ESP_A2D_AUDIO_CFG_EVT: + // not supposed to occur for A2DP source + break; + case ESP_A2D_MEDIA_CTRL_ACK_EVT: + case BT_APP_HEART_BEAT_EVT: { + bt_app_av_media_proc(event, param); + break; + } + case ESP_A2D_REPORT_SNK_DELAY_VALUE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + ESP_LOGI(BT_AV_TAG, "%s, delay value: %u * 1/10 ms", __func__, a2d->a2d_report_delay_value_stat.delay_value); + break; + } + default: { + ESP_LOGE(BT_AV_TAG, "%s unhandled event: %d", __func__, event); + break; + } + } +} + +static void bt_app_av_state_disconnecting_hdlr(uint16_t event, void *param) +{ + esp_a2d_cb_param_t *a2d = NULL; + + /* handle the events of interest in disconnecing state */ + switch (event) { + case ESP_A2D_CONNECTION_STATE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + if (a2d->conn_stat.state == ESP_A2D_CONNECTION_STATE_DISCONNECTED) { + ESP_LOGI(BT_AV_TAG, "a2dp disconnected"); + s_a2d_state = APP_AV_STATE_UNCONNECTED; + } + break; + } + case ESP_A2D_AUDIO_STATE_EVT: + case ESP_A2D_AUDIO_CFG_EVT: + case ESP_A2D_MEDIA_CTRL_ACK_EVT: + case BT_APP_HEART_BEAT_EVT: + break; + case ESP_A2D_REPORT_SNK_DELAY_VALUE_EVT: { + a2d = (esp_a2d_cb_param_t *)(param); + ESP_LOGI(BT_AV_TAG, "%s, delay value: 0x%u * 1/10 ms", __func__, a2d->a2d_report_delay_value_stat.delay_value); + break; + } + default: { + ESP_LOGE(BT_AV_TAG, "%s unhandled event: %d", __func__, event); + break; + } + } +} + +/* callback function for AVRCP controller */ +static void bt_app_rc_ct_cb(esp_avrc_ct_cb_event_t event, esp_avrc_ct_cb_param_t *param) +{ + switch (event) { + case ESP_AVRC_CT_CONNECTION_STATE_EVT: + case ESP_AVRC_CT_PASSTHROUGH_RSP_EVT: + case ESP_AVRC_CT_METADATA_RSP_EVT: + case ESP_AVRC_CT_CHANGE_NOTIFY_EVT: + case ESP_AVRC_CT_REMOTE_FEATURES_EVT: + case ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT: + case ESP_AVRC_CT_SET_ABSOLUTE_VOLUME_RSP_EVT: { + bt_app_work_dispatch(bt_av_hdl_avrc_ct_evt, event, param, sizeof(esp_avrc_ct_cb_param_t), NULL); + break; + } + default: { + ESP_LOGE(BT_RC_CT_TAG, "Invalid AVRC event: %d", event); + break; + } + } +} + +static void bt_av_volume_changed(void) +{ + if (esp_avrc_rn_evt_bit_mask_operation(ESP_AVRC_BIT_MASK_OP_TEST, &s_avrc_peer_rn_cap, + ESP_AVRC_RN_VOLUME_CHANGE)) { + esp_avrc_ct_send_register_notification_cmd(APP_RC_CT_TL_RN_VOLUME_CHANGE, ESP_AVRC_RN_VOLUME_CHANGE, 0); + } +} + +void bt_av_notify_evt_handler(uint8_t event_id, esp_avrc_rn_param_t *event_parameter) +{ + switch (event_id) { + /* when volume changed locally on target, this event comes */ + case ESP_AVRC_RN_VOLUME_CHANGE: { + ESP_LOGI(BT_RC_CT_TAG, "Volume changed: %d", event_parameter->volume); + ESP_LOGI(BT_RC_CT_TAG, "Set absolute volume: volume %d", event_parameter->volume + 5); + esp_avrc_ct_send_set_absolute_volume_cmd(APP_RC_CT_TL_RN_VOLUME_CHANGE, event_parameter->volume + 5); + bt_av_volume_changed(); + break; + } + /* other */ + default: + break; + } +} + +/* AVRC controller event handler */ +static void bt_av_hdl_avrc_ct_evt(uint16_t event, void *p_param) +{ + ESP_LOGD(BT_RC_CT_TAG, "%s evt %d", __func__, event); + esp_avrc_ct_cb_param_t *rc = (esp_avrc_ct_cb_param_t *)(p_param); + + switch (event) { + /* when connection state changed, this event comes */ + case ESP_AVRC_CT_CONNECTION_STATE_EVT: { + uint8_t *bda = rc->conn_stat.remote_bda; + ESP_LOGI(BT_RC_CT_TAG, "AVRC conn_state event: state %d, [%02x:%02x:%02x:%02x:%02x:%02x]", + rc->conn_stat.connected, bda[0], bda[1], bda[2], bda[3], bda[4], bda[5]); + + if (rc->conn_stat.connected) { + esp_avrc_ct_send_get_rn_capabilities_cmd(APP_RC_CT_TL_GET_CAPS); + } else { + s_avrc_peer_rn_cap.bits = 0; + } + break; + } + /* when passthrough responded, this event comes */ + case ESP_AVRC_CT_PASSTHROUGH_RSP_EVT: { + ESP_LOGI(BT_RC_CT_TAG, "AVRC passthrough response: key_code 0x%x, key_state %d, rsp_code %d", rc->psth_rsp.key_code, + rc->psth_rsp.key_state, rc->psth_rsp.rsp_code); + break; + } + /* when metadata responded, this event comes */ + case ESP_AVRC_CT_METADATA_RSP_EVT: { + ESP_LOGI(BT_RC_CT_TAG, "AVRC metadata response: attribute id 0x%x, %s", rc->meta_rsp.attr_id, rc->meta_rsp.attr_text); + free(rc->meta_rsp.attr_text); + break; + } + /* when notification changed, this event comes */ + case ESP_AVRC_CT_CHANGE_NOTIFY_EVT: { + ESP_LOGI(BT_RC_CT_TAG, "AVRC event notification: %d", rc->change_ntf.event_id); + bt_av_notify_evt_handler(rc->change_ntf.event_id, &rc->change_ntf.event_parameter); + break; + } + /* when indicate feature of remote device, this event comes */ + case ESP_AVRC_CT_REMOTE_FEATURES_EVT: { + ESP_LOGI(BT_RC_CT_TAG, "AVRC remote features %"PRIx32", TG features %x", rc->rmt_feats.feat_mask, rc->rmt_feats.tg_feat_flag); + break; + } + /* when get supported notification events capability of peer device, this event comes */ + case ESP_AVRC_CT_GET_RN_CAPABILITIES_RSP_EVT: { + ESP_LOGI(BT_RC_CT_TAG, "remote rn_cap: count %d, bitmask 0x%x", rc->get_rn_caps_rsp.cap_count, + rc->get_rn_caps_rsp.evt_set.bits); + s_avrc_peer_rn_cap.bits = rc->get_rn_caps_rsp.evt_set.bits; + + bt_av_volume_changed(); + break; + } + /* when set absolute volume responded, this event comes */ + case ESP_AVRC_CT_SET_ABSOLUTE_VOLUME_RSP_EVT: { + ESP_LOGI(BT_RC_CT_TAG, "Set absolute volume response: volume %d", rc->set_volume_rsp.volume); + break; + } + /* other */ + default: { + ESP_LOGE(BT_RC_CT_TAG, "%s unhandled event: %d", __func__, event); + break; + } + } +} + +static bool bt_app_send_msg(bt_app_msg_t *msg) +{ + if (msg == NULL) { + return false; + } + + if (pdTRUE != xQueueSend(s_bt_app_task_queue, msg, 10 / portTICK_PERIOD_MS)) { + ESP_LOGE(BT_APP_CORE_TAG, "%s xQueue send failed", __func__); + return false; + } + + return true; +} + +static void bt_app_work_dispatched(bt_app_msg_t *msg) +{ + if (msg->cb) { + msg->cb(msg->event, msg->param); + } +} + +static void bt_app_task_handler(void *arg) +{ + bt_app_msg_t msg; + + int core_id = xPortGetCoreID(); + + ESP_LOGI("MY_TASK", "Running on core %d", core_id); + + for (;;) { + /* receive message from work queue and handle it */ + if (pdTRUE == xQueueReceive(s_bt_app_task_queue, &msg, (TickType_t)portMAX_DELAY)) { + ESP_LOGD(BT_APP_CORE_TAG, "%s, signal: 0x%x, event: 0x%x", __func__, msg.sig, msg.event); + + switch (msg.sig) { + case BT_APP_SIG_WORK_DISPATCH: + bt_app_work_dispatched(&msg); + break; + default: + ESP_LOGW(BT_APP_CORE_TAG, "%s, unhandled signal: %d", __func__, msg.sig); + break; + } + + if (msg.param) { + free(msg.param); + } + } + } +} + +/********************************* + * EXTERN FUNCTION DEFINITIONS + ********************************/ + +bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, int param_len, bt_app_copy_cb_t p_copy_cback) +{ + ESP_LOGD(BT_APP_CORE_TAG, "%s event: 0x%x, param len: %d", __func__, event, param_len); + + bt_app_msg_t msg; + memset(&msg, 0, sizeof(bt_app_msg_t)); + + msg.sig = BT_APP_SIG_WORK_DISPATCH; + msg.event = event; + msg.cb = p_cback; + + if (param_len == 0) { + return bt_app_send_msg(&msg); + } else if (p_params && param_len > 0) { + if ((msg.param = malloc(param_len)) != NULL) { + memcpy(msg.param, p_params, param_len); + /* check if caller has provided a copy callback to do the deep copy */ + if (p_copy_cback) { + p_copy_cback(msg.param, p_params, param_len); + } + return bt_app_send_msg(&msg); + } + } + + return false; +} + +void bt_app_task_start_up(void) +{ + s_bt_app_task_queue = xQueueCreate(10, sizeof(bt_app_msg_t)); + //xTaskCreate(bt_app_task_handler, "BtAppTask", 8192, NULL, 10, &s_bt_app_task_handle); + + xTaskCreatePinnedToCore(bt_app_task_handler, "BtAppTask", 8192, NULL, 10, NULL, 1); +} + +void bt_app_task_shut_down(void) +{ + if (s_bt_app_task_handle) { + vTaskDelete(s_bt_app_task_handle); + s_bt_app_task_handle = NULL; + } + if (s_bt_app_task_queue) { + vQueueDelete(s_bt_app_task_queue); + s_bt_app_task_queue = NULL; + } +} + + +void bt_app_init(void) +{ + esp_err_t ret; + char bda_str[18] = {0}; + + + /* + * This example only uses the functions of Classical Bluetooth. + * So release the controller memory for Bluetooth Low Energy. + */ + ESP_ERROR_CHECK(esp_bt_controller_mem_release(ESP_BT_MODE_BLE)); + + esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); + if (esp_bt_controller_init(&bt_cfg) != ESP_OK) { + ESP_LOGE(BT_AV_TAG, "%s initialize controller failed", __func__); + return; + } + if (esp_bt_controller_enable(ESP_BT_MODE_CLASSIC_BT) != ESP_OK) { + ESP_LOGE(BT_AV_TAG, "%s enable controller failed", __func__); + return; + } + + esp_bluedroid_config_t bluedroid_cfg = BT_BLUEDROID_INIT_CONFIG_DEFAULT(); +#if (CONFIG_EXAMPLE_SSP_ENABLED == false) + bluedroid_cfg.ssp_en = false; +#endif + if ((ret = esp_bluedroid_init_with_cfg(&bluedroid_cfg)) != ESP_OK) { + ESP_LOGE(BT_AV_TAG, "%s initialize bluedroid failed: %s", __func__, esp_err_to_name(ret)); + return; + } + + if (esp_bluedroid_enable() != ESP_OK) { + ESP_LOGE(BT_AV_TAG, "%s enable bluedroid failed", __func__); + return; + } + +#if (CONFIG_EXAMPLE_SSP_ENABLED == true) + /* set default parameters for Secure Simple Pairing */ + esp_bt_sp_param_t param_type = ESP_BT_SP_IOCAP_MODE; + esp_bt_io_cap_t iocap = ESP_BT_IO_CAP_IO; + esp_bt_gap_set_security_param(param_type, &iocap, sizeof(uint8_t)); +#endif + + /* + * Set default parameters for Legacy Pairing + * Use variable pin, input pin code when pairing + */ + esp_bt_pin_type_t pin_type = ESP_BT_PIN_TYPE_VARIABLE; + esp_bt_pin_code_t pin_code; + esp_bt_gap_set_pin(pin_type, 0, pin_code); + + ESP_LOGI(BT_AV_TAG, "Own address:[%s]", bda2str((uint8_t *)esp_bt_dev_get_address(), bda_str, sizeof(bda_str))); + bt_app_task_start_up(); + /* Bluetooth device name, connection mode and profile set up */ + bt_app_work_dispatch(bt_av_hdl_stack_evt, BT_APP_STACK_UP_EVT, NULL, 0, NULL); + + + + audio_stream_buf = xStreamBufferCreate(STREAM_BUF_SIZE, 1); + assert(audio_stream_buf != NULL); + + //xTaskCreate(audio_producer_task, "audio_producer", 4096, NULL, 5, NULL); + xTaskCreatePinnedToCore(audio_producer_task, "audio_producer", 4096, NULL, 5, NULL, 1); + + ESP_LOGI(BT_APP_CORE_TAG, "Audio synth producer started"); + + vTaskDelay(pdMS_TO_TICKS(1000)); + + //esp_err_t esp_bredr_tx_power_get(esp_power_level_t *min_power_level, esp_power_level_t *max_power_level) + esp_power_level_t pmin; + esp_power_level_t pmax; + esp_bredr_tx_power_get(&pmin, &pmax); + + ESP_LOGI(BT_APP_CORE_TAG, "BT Power min = %d\nBT Power max = %d", pmin, pmax); + + pmin = ESP_PWR_LVL_P7; + pmax = ESP_PWR_LVL_P7; + esp_bredr_tx_power_set(pmin, pmax); + + esp_bredr_tx_power_get(&pmin, &pmax); + + ESP_LOGI(BT_APP_CORE_TAG, "BT Power min = %d\nBT Power max = %d", pmin, pmax); + +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 } \ No newline at end of file diff --git a/main/bt_app.h b/main/bt_app.h index c7d10ff..e7d3aeb 100644 --- a/main/bt_app.h +++ b/main/bt_app.h @@ -1,70 +1,70 @@ -/* - * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD - * - * SPDX-License-Identifier: Unlicense OR CC0-1.0 - */ - -#ifndef __BT_APP_CORE_H__ -#define __BT_APP_CORE_H__ - -#include -#include -#include - -/* log tag */ -#define BT_APP_CORE_TAG "BT_APP_CORE" - -/* signal for dispatcher */ -#define BT_APP_SIG_WORK_DISPATCH (0x01) - -/** - * @brief handler for the dispatched work - * - * @param [in] event message event id - * @param [in] param pointer to the parameter - */ -typedef void (* bt_app_cb_t) (uint16_t event, void *param); - -/* message to be sent */ -typedef struct { - uint16_t sig; /*!< signal to bt_app_task */ - uint16_t event; /*!< message event id */ - bt_app_cb_t cb; /*!< context switch callback */ - void *param; /*!< parameter area needs to be last */ -} bt_app_msg_t; - -/** - * @brief parameter deep-copy function to be customized - * - * @param [in] p_dest pointer to the destination - * @param [in] p_src pointer to the source - * @param [in] len data length in byte - */ -typedef void (* bt_app_copy_cb_t) (void *p_dest, void *p_src, int len); - -/** - * @brief work dispatcher for the application task - * - * @param [in] p_cback handler for the dispatched work (event handler) - * @param [in] event message event id - * @param [in] p_params pointer to the parameter - * @param [in] param_len length of the parameter - * @param [in] p_copy_cback parameter deep-copy function - * - * @return true if work dispatch successfully, false otherwise - */ -bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, int param_len, bt_app_copy_cb_t p_copy_cback); - -/** - * @brief start up the application task - */ -void bt_app_task_start_up(void); - -/** - * @brief shut down the application task - */ -void bt_app_task_shut_down(void); - -void bt_app_init(void); - -#endif /* __BT_APP_CORE_H__ */ +/* + * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + +#ifndef __BT_APP_CORE_H__ +#define __BT_APP_CORE_H__ + +#include +#include +#include + +/* log tag */ +#define BT_APP_CORE_TAG "BT_APP_CORE" + +/* signal for dispatcher */ +#define BT_APP_SIG_WORK_DISPATCH (0x01) + +/** + * @brief handler for the dispatched work + * + * @param [in] event message event id + * @param [in] param pointer to the parameter + */ +typedef void (* bt_app_cb_t) (uint16_t event, void *param); + +/* message to be sent */ +typedef struct { + uint16_t sig; /*!< signal to bt_app_task */ + uint16_t event; /*!< message event id */ + bt_app_cb_t cb; /*!< context switch callback */ + void *param; /*!< parameter area needs to be last */ +} bt_app_msg_t; + +/** + * @brief parameter deep-copy function to be customized + * + * @param [in] p_dest pointer to the destination + * @param [in] p_src pointer to the source + * @param [in] len data length in byte + */ +typedef void (* bt_app_copy_cb_t) (void *p_dest, void *p_src, int len); + +/** + * @brief work dispatcher for the application task + * + * @param [in] p_cback handler for the dispatched work (event handler) + * @param [in] event message event id + * @param [in] p_params pointer to the parameter + * @param [in] param_len length of the parameter + * @param [in] p_copy_cback parameter deep-copy function + * + * @return true if work dispatch successfully, false otherwise + */ +bool bt_app_work_dispatch(bt_app_cb_t p_cback, uint16_t event, void *p_params, int param_len, bt_app_copy_cb_t p_copy_cback); + +/** + * @brief start up the application task + */ +void bt_app_task_start_up(void); + +/** + * @brief shut down the application task + */ +void bt_app_task_shut_down(void); + +void bt_app_init(void); + +#endif /* __BT_APP_CORE_H__ */ diff --git a/main/bubble.c b/main/bubble.c index 60fa8c5..926b4eb 100644 --- a/main/bubble.c +++ b/main/bubble.c @@ -1,132 +1,132 @@ -#include "bubble.h" - -typedef struct { - float min_val; - float max_val; - float cur_val; -} bubble_level_dsc_t; - - -static void bubble_draw_cb(lv_event_t * e) -{ - lvgl_port_lock(0); - - lv_obj_t * obj = lv_event_get_target(e); - bubble_level_dsc_t * d = lv_obj_get_user_data(obj); - if(!d) return; - - // 1) Get the LVGL draw layer (clipping is automatic) - lv_layer_t * layer = lv_event_get_layer(e); - - // 2) Figure out the object's inner rectangle - lv_area_t coords; - lv_obj_get_coords(obj, &coords); - lv_area_t inner = { - .x1 = coords.x1 + 2, .y1 = coords.y1 + 2, - .x2 = coords.x2 - 2, .y2 = coords.y2 - 2 - }; - - // 3) Draw the border - lv_draw_rect_dsc_t rect_dsc; - lv_draw_rect_dsc_init(&rect_dsc); - rect_dsc.border_color = lv_color_hex(0xAAAAAA); - rect_dsc.border_width = 2; - rect_dsc.bg_opa = LV_OPA_TRANSP; - lv_draw_rect(layer, &rect_dsc, &inner); - - // 4) Draw guide lines at the center - lv_coord_t mid_x = (inner.x1 + inner.x2) / 2; - lv_coord_t mid_y = (inner.y1 + inner.y2) / 2; - - lv_draw_line_dsc_t line_dsc; - lv_draw_line_dsc_init(&line_dsc); - line_dsc.color = lv_color_hex(0x444444); - line_dsc.width = 1; - - // Set up points and convert to 'precise' type - lv_point_t tl = { inner.x1 + 10, mid_y }; - lv_point_t tr = { inner.x2 - 10, mid_y }; - line_dsc.p1 = lv_point_to_precise(&tl); - line_dsc.p2 = lv_point_to_precise(&tr); - lv_draw_line(layer, &line_dsc); - - lv_point_t tt = { mid_x, inner.y1 + 10 }; - lv_point_t tb = { mid_x, inner.y2 - 10 }; - line_dsc.p1 = lv_point_to_precise(&tt); - line_dsc.p2 = lv_point_to_precise(&tb); - lv_draw_line(layer, &line_dsc); - - // 5) Compute bubble position (normalized between min_val → max_val) - float norm = (d->cur_val - d->min_val) / (d->max_val - d->min_val); - norm = norm < 0 ? 0 : (norm > 1 ? 1 : norm); - - const lv_coord_t bubble_d = 16; - lv_coord_t avail_w = (inner.x2 - inner.x1 + 1) - bubble_d; - lv_coord_t bx = inner.x1 + (lv_coord_t)(norm * avail_w); - lv_coord_t by = mid_y - (bubble_d / 2); - - // 6) Draw the bubble as a filled circle (rounded rect) - lv_draw_rect_dsc_t circ_dsc; - lv_draw_rect_dsc_init(&circ_dsc); - circ_dsc.bg_color = lv_color_hex(0x00CC00); - circ_dsc.bg_opa = LV_OPA_COVER; - circ_dsc.radius = bubble_d / 2; - circ_dsc.border_opa = LV_OPA_TRANSP; - - lv_area_t circ_area = { - .x1 = bx, - .y1 = by, - .x2 = bx + bubble_d - 1, - .y2 = by + bubble_d - 1 - }; - lv_draw_rect(layer, &circ_dsc, &circ_area); - - lvgl_port_unlock(); -} - - -lv_obj_t * bubble_create(lv_obj_t * parent, - lv_coord_t width, lv_coord_t height, - float min_val, float max_val, float initial) -{ - // 1) Create a container object (no special style) - lv_obj_t * obj = lv_obj_create(parent); - lv_obj_set_size(obj, width, height); - - // (Optional) center it or let the caller position it: - // lv_obj_center(obj); - - // 2) Allocate or attach our descriptor - // In LVGL v9 you can use USER_DATA: need to enable LV_USE_USER_DATA = 1 - bubble_level_dsc_t * dsc = lv_malloc(sizeof(bubble_level_dsc_t)); - if(!dsc) return NULL; /* handle out-of-memory */ - dsc->min_val = min_val; - dsc->max_val = max_val; - dsc->cur_val = initial; - lv_obj_set_user_data(obj, dsc); - - // 3) Register our draw callback - lv_obj_add_event_cb(obj, bubble_draw_cb, LV_EVENT_DRAW_MAIN, NULL); - - // 4) Make sure the object does NOT get a default background fill - lv_obj_set_style_bg_opa(obj, LV_OPA_TRANSP, 0); - - return obj; -} - - -void bubble_setValue(lv_obj_t * bubble, float v) -{ - lvgl_port_lock(0); - // 1) Retrieve the descriptor - bubble_level_dsc_t * d = lv_obj_get_user_data(bubble); - if(!d) return; - - // 2) Update the stored value - d->cur_val = v; - - // 3) Tell LVGL that object must be re‐drawn - lv_obj_invalidate(bubble); - - lvgl_port_unlock(); -} +#include "bubble.h" + +typedef struct { + float min_val; + float max_val; + float cur_val; +} bubble_level_dsc_t; + + +static void bubble_draw_cb(lv_event_t * e) +{ + lvgl_port_lock(0); + + lv_obj_t * obj = lv_event_get_target(e); + bubble_level_dsc_t * d = lv_obj_get_user_data(obj); + if(!d) return; + + // 1) Get the LVGL draw layer (clipping is automatic) + lv_layer_t * layer = lv_event_get_layer(e); + + // 2) Figure out the object's inner rectangle + lv_area_t coords; + lv_obj_get_coords(obj, &coords); + lv_area_t inner = { + .x1 = coords.x1 + 2, .y1 = coords.y1 + 2, + .x2 = coords.x2 - 2, .y2 = coords.y2 - 2 + }; + + // 3) Draw the border + lv_draw_rect_dsc_t rect_dsc; + lv_draw_rect_dsc_init(&rect_dsc); + rect_dsc.border_color = lv_color_hex(0xAAAAAA); + rect_dsc.border_width = 2; + rect_dsc.bg_opa = LV_OPA_TRANSP; + lv_draw_rect(layer, &rect_dsc, &inner); + + // 4) Draw guide lines at the center + lv_coord_t mid_x = (inner.x1 + inner.x2) / 2; + lv_coord_t mid_y = (inner.y1 + inner.y2) / 2; + + lv_draw_line_dsc_t line_dsc; + lv_draw_line_dsc_init(&line_dsc); + line_dsc.color = lv_color_hex(0x444444); + line_dsc.width = 1; + + // Set up points and convert to 'precise' type + lv_point_t tl = { inner.x1 + 10, mid_y }; + lv_point_t tr = { inner.x2 - 10, mid_y }; + line_dsc.p1 = lv_point_to_precise(&tl); + line_dsc.p2 = lv_point_to_precise(&tr); + lv_draw_line(layer, &line_dsc); + + lv_point_t tt = { mid_x, inner.y1 + 10 }; + lv_point_t tb = { mid_x, inner.y2 - 10 }; + line_dsc.p1 = lv_point_to_precise(&tt); + line_dsc.p2 = lv_point_to_precise(&tb); + lv_draw_line(layer, &line_dsc); + + // 5) Compute bubble position (normalized between min_val → max_val) + float norm = (d->cur_val - d->min_val) / (d->max_val - d->min_val); + norm = norm < 0 ? 0 : (norm > 1 ? 1 : norm); + + const lv_coord_t bubble_d = 16; + lv_coord_t avail_w = (inner.x2 - inner.x1 + 1) - bubble_d; + lv_coord_t bx = inner.x1 + (lv_coord_t)(norm * avail_w); + lv_coord_t by = mid_y - (bubble_d / 2); + + // 6) Draw the bubble as a filled circle (rounded rect) + lv_draw_rect_dsc_t circ_dsc; + lv_draw_rect_dsc_init(&circ_dsc); + circ_dsc.bg_color = lv_color_hex(0x00CC00); + circ_dsc.bg_opa = LV_OPA_COVER; + circ_dsc.radius = bubble_d / 2; + circ_dsc.border_opa = LV_OPA_TRANSP; + + lv_area_t circ_area = { + .x1 = bx, + .y1 = by, + .x2 = bx + bubble_d - 1, + .y2 = by + bubble_d - 1 + }; + lv_draw_rect(layer, &circ_dsc, &circ_area); + + lvgl_port_unlock(); +} + + +lv_obj_t * bubble_create(lv_obj_t * parent, + lv_coord_t width, lv_coord_t height, + float min_val, float max_val, float initial) +{ + // 1) Create a container object (no special style) + lv_obj_t * obj = lv_obj_create(parent); + lv_obj_set_size(obj, width, height); + + // (Optional) center it or let the caller position it: + // lv_obj_center(obj); + + // 2) Allocate or attach our descriptor + // In LVGL v9 you can use USER_DATA: need to enable LV_USE_USER_DATA = 1 + bubble_level_dsc_t * dsc = lv_malloc(sizeof(bubble_level_dsc_t)); + if(!dsc) return NULL; /* handle out-of-memory */ + dsc->min_val = min_val; + dsc->max_val = max_val; + dsc->cur_val = initial; + lv_obj_set_user_data(obj, dsc); + + // 3) Register our draw callback + lv_obj_add_event_cb(obj, bubble_draw_cb, LV_EVENT_DRAW_MAIN, NULL); + + // 4) Make sure the object does NOT get a default background fill + lv_obj_set_style_bg_opa(obj, LV_OPA_TRANSP, 0); + + return obj; +} + + +void bubble_setValue(lv_obj_t * bubble, float v) +{ + lvgl_port_lock(0); + // 1) Retrieve the descriptor + bubble_level_dsc_t * d = lv_obj_get_user_data(bubble); + if(!d) return; + + // 2) Update the stored value + d->cur_val = v; + + // 3) Tell LVGL that object must be re‐drawn + lv_obj_invalidate(bubble); + + lvgl_port_unlock(); +} diff --git a/main/bubble.h b/main/bubble.h index 72ea35f..fe18ac7 100644 --- a/main/bubble.h +++ b/main/bubble.h @@ -1,13 +1,13 @@ -#ifndef BUBBLE_H -#define BUBBLE_H - -#include "lvgl.h" -#include "esp_lvgl_port.h" - -lv_obj_t * bubble_create(lv_obj_t * parent, - lv_coord_t width, lv_coord_t height, - float min_val, float max_val, float initial); - -void bubble_setValue(lv_obj_t * bubble, float v); - +#ifndef BUBBLE_H +#define BUBBLE_H + +#include "lvgl.h" +#include "esp_lvgl_port.h" + +lv_obj_t * bubble_create(lv_obj_t * parent, + lv_coord_t width, lv_coord_t height, + float min_val, float max_val, float initial); + +void bubble_setValue(lv_obj_t * bubble, float v); + #endif \ No newline at end of file diff --git a/main/gpio.h b/main/gpio.h index 76bd0ba..592327c 100644 --- a/main/gpio.h +++ b/main/gpio.h @@ -1,3 +1,4 @@ +<<<<<<< HEAD #ifndef GPIO_H #define GPIO_H @@ -26,4 +27,34 @@ #define PIN_NUM_BK_LIGHT 5 // Backlight control pin, -1 if not used #endif +======= +#ifndef GPIO_H +#define GPIO_H + +// Define keypad buttons +#define PIN_NUM_BUTTON_0 36 +#define PIN_NUM_BUTTON_1 39 +#define PIN_NUM_LED_1 32 +#define PIN_NUM_LED_2 33 +#define PIN_NUM_nON 26 + + +// Define GPIO pins +#ifdef DEVKIT +#define PIN_NUM_MOSI 23 // SDA pin for LCD +#define PIN_NUM_CLK 18 // SCL pin for LCD +#define PIN_NUM_CS 2 // CS pin +#define PIN_NUM_DC 12 // Data/Command pin (RS) +#define PIN_NUM_RST 13 // Reset pin +#define PIN_NUM_BK_LIGHT -1 // Backlight control pin, -1 if not used +#else +#define PIN_NUM_MOSI 23 // SDA pin for LCD +#define PIN_NUM_CLK 18 // SCL pin for LCD +#define PIN_NUM_CS 12 // CS pin +#define PIN_NUM_DC 15 // Data/Command pin (RS) +#define PIN_NUM_RST 13 // Reset pin +#define PIN_NUM_BK_LIGHT 5 // Backlight control pin, -1 if not used +#endif + +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 #endif \ No newline at end of file diff --git a/main/gui.c b/main/gui.c index 3aaa5a3..66d11ba 100644 --- a/main/gui.c +++ b/main/gui.c @@ -1,3 +1,4 @@ +<<<<<<< HEAD #include #include #include "freertos/FreeRTOS.h" @@ -616,4 +617,624 @@ static void gui_task(void) +======= +#include +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" + +#include "esp_lcd_panel_io.h" +#include "esp_lcd_panel_vendor.h" +#include "esp_lcd_panel_ops.h" +#include "driver/gpio.h" +#include "driver/spi_master.h" +#include "esp_err.h" +#include "esp_log.h" +#include "esp_timer.h" +#include "lvgl.h" +#include "esp_lvgl_port.h" + +#include "gui.h" +#include "gpio.h" +#include "keypad.h" +#include "bubble.h" +#include "system.h" + +#define DEVKIT +#undef DEVKIT + +static const char *TAG = "gui"; + +#define UNLOCK() lvgl_port_unlock() +#define LOCK() lvgl_port_lock(0) + +// LCD Pin Configuration +#define LCD_PIXEL_CLOCK_HZ (5 * 1000 * 1000) +#define LCD_SPI_HOST SPI2_HOST + +#define PIN_NUM_nON 26 + + + +// ST7735S properties +#define LCD_H_RES 160 +#define LCD_V_RES 80 +#define LCD_CMD_BITS 8 +#define LCD_PARAM_BITS 8 +#define LCD_COLOR_SPACE ESP_LCD_COLOR_SPACE_RGB +#define LCD_BITS_PER_PIXEL 16 + +static esp_lcd_panel_handle_t panel_handle = NULL; +esp_lcd_panel_io_handle_t io_handle = NULL; +static lv_disp_t *disp = NULL; +static lv_obj_t *imu_label = NULL; // Label for IMU data + +static lv_style_t style_mono8; + +typedef struct +{ + int selected; + int count; + lv_obj_t *obj; +} menu_context_t; + +static void gui_task(void); +static void createBubble(lv_obj_t * scr); +static void build_scrollable_menu(void); +static void currentFocusIndex(menu_context_t *ctx); + +#define MAX_ITEMS 10 +#define VISIBLE_ITEMS 3 +#define MENU_MAX_STRING_LENGTH 30 + +static const char *menu_items[MAX_ITEMS] = { + "V-Moda Crossfade", "Item 2", "Item 3", "Item 4", + "Item 5", "Item 6", "Item 7", "Item 8", + "Item 9", "Item 10" +}; + +static lv_obj_t *list; +static lv_obj_t *buttons[MAX_ITEMS]; +static int selected_index = 0; +static lv_obj_t *_bubble = NULL; +static lv_obj_t * _menu = NULL; +static lv_obj_t *_currentPage = NULL; + +static GuiMode_t _mode = GUI_BUBBLE; + +/* 1. Prepare a default (unfocused) style */ +static lv_style_t _styleUnfocusedBtn; + + +/* 2. Prepare a focus style */ +static lv_style_t _styleFocusedBtn; + +static menu_context_t _menuContext; + +static bool notify_lvgl_flush_ready(void *user_ctx) { + if (disp) { + lv_display_flush_ready(disp); + } + return true; +} + + +static void create_lvgl_demo(void) +{ + + lvgl_port_lock(0); + // Create a screen with black background + lv_obj_t *scr = lv_scr_act(); + + createBubble(scr); + //build_scrollable_menu(); + + lvgl_port_unlock(); + + +} + +static void lcd_init(void) +{ + ESP_LOGI(TAG, "Initialize SPI bus"); + spi_bus_config_t buscfg = { + .sclk_io_num = PIN_NUM_CLK, + .mosi_io_num = PIN_NUM_MOSI, + .miso_io_num = -1, + .quadwp_io_num = -1, + .quadhd_io_num = -1, + .max_transfer_sz = LCD_H_RES * LCD_V_RES * 2 + }; + + ESP_ERROR_CHECK(spi_bus_initialize(LCD_SPI_HOST, &buscfg, SPI_DMA_CH_AUTO)); + + ESP_LOGI(TAG, "Install panel IO"); + + esp_lcd_panel_io_spi_config_t io_config = { + .dc_gpio_num = PIN_NUM_DC, + .cs_gpio_num = PIN_NUM_CS, + .pclk_hz = LCD_PIXEL_CLOCK_HZ, + .lcd_cmd_bits = LCD_CMD_BITS, + .lcd_param_bits = LCD_PARAM_BITS, + .spi_mode = 3, + .trans_queue_depth = 10, + .user_ctx = NULL, + }; + ESP_ERROR_CHECK(esp_lcd_new_panel_io_spi((esp_lcd_spi_bus_handle_t)LCD_SPI_HOST, &io_config, &io_handle)); + + esp_lcd_panel_dev_config_t panel_config = { + .reset_gpio_num = PIN_NUM_RST, + .rgb_endian = LCD_RGB_ENDIAN_BGR, + .bits_per_pixel = LCD_BITS_PER_PIXEL, + }; + ESP_ERROR_CHECK(esp_lcd_new_panel_st7789(io_handle, &panel_config, &panel_handle)); + ESP_ERROR_CHECK(esp_lcd_panel_reset(panel_handle)); + ESP_ERROR_CHECK(esp_lcd_panel_init(panel_handle)); + ESP_ERROR_CHECK(esp_lcd_panel_invert_color(panel_handle, true)); + + + + ESP_ERROR_CHECK(esp_lcd_panel_set_gap(panel_handle, 1, 26)); // ST7735S typically needs these offsets + + ESP_ERROR_CHECK(esp_lcd_panel_disp_on_off(panel_handle, true)); +} + +static void lvgl_init(void) +{ + lv_init(); + + +#if 1 + const lvgl_port_cfg_t lvgl_cfg = { + .task_priority = 4, // LVGL task priority + .task_stack = 16384, // LVGL task stack size + .task_affinity = 0, // LVGL task can run on any core + .task_max_sleep_ms = 500, // Maximum sleep in LVGL task + .timer_period_ms = 5 // LVGL timer period + }; + + ESP_ERROR_CHECK(lvgl_port_init(&lvgl_cfg)); +#endif + + const lvgl_port_display_cfg_t disp_cfg = { + .io_handle = io_handle, + .panel_handle = panel_handle, + .buffer_size = LCD_H_RES * LCD_V_RES * 2, + .double_buffer = false, + .hres = LCD_H_RES, + .vres = LCD_V_RES, + .monochrome = false, + .rotation = { + .swap_xy = true, + .mirror_x = true, + .mirror_y = false, + }, + .flags = { + //.buff_dma = true, + .swap_bytes = true, + } + }; + + disp = lvgl_port_add_disp(&disp_cfg); + //lv_display_set_color_format(disp, LV_COLOR_FORMAT_RGB565); + + +} + +static void createBubble(lv_obj_t * scr) +{ + + // 2) Create a bubble level of size 200×60, with range [−30°, +30°], initial 0°: + lv_obj_t * level = bubble_create(scr, 150, 40, -10.0f, +10.0f, 0.0f); + lv_obj_align(level, LV_ALIGN_CENTER, 0, 0); + + // 3) … Later, when you read your accelerometer or keypad‐derived angle … + float new_angle = 10.0f; + bubble_setValue(level, new_angle); + + // 4) You can call bubble_level_set_value(level, …) as often as you like. + // Each call invalidates the object and LVGL will call the draw callback + // (usually on the next tick, or immediately if LVGL is idle). + + _bubble = level; +} + + +void gui_start(void) +{ + + // Initialize LCD + lcd_init(); + + // Initialize LVGL + lvgl_init(); + + // Create UI + create_lvgl_demo(); + + keypad_start(); + + gpio_set_level(PIN_NUM_BK_LIGHT, 1); + + xTaskCreate(gui_task, "gui_task", 4096, NULL, 5, NULL); + +} + +static uint32_t waitForKeyPress(void) +{ + QueueHandle_t q = keypad_getQueue(); + uint32_t ev = 0; + + if (xQueueReceive(q, &ev, portMAX_DELAY) == pdTRUE) + { + return ev; + } + + return 0; +} + +static void handleMainMenu(void) +{ + lvgl_port_lock(0); + // Create a screen with black background + lv_obj_t *scr = lv_scr_act(); + + //create_menu(scr); + + lvgl_port_unlock(); +} + + +// ───── MENU CONFIG ───── +#define ROW_H 20 // height of each row +static const char * items[] = { // your menu entries + "VMode Crossmade", + "Second Choice", + "Another Option", + "Yet Another", + "Yet Another", + "Last One" +}; +#define ITEM_COUNT (sizeof(items)/sizeof(items[0])) + +// ───── STATE & HELPERS ───── +static lv_obj_t * btn_array[ITEM_COUNT]; +static int selected_idx = 0; + +// Called whenever a button is “activated” (Enter/Click) +static void btn_click_cb(lv_event_t * e) { + lv_obj_t * btn = lv_event_get_target(e); + const char * txt = lv_label_get_text(lv_obj_get_child(btn, 0)); + ESP_LOGI(TAG, "Activated: %s\n", txt); +} + +// Repaint all rows so only btn_array[selected_idx] is highlighted +static void refresh_highlight(void) { + + return; + lvgl_port_lock(0); + + int index = 0; + + lv_obj_t *page = _currentPage; + + lv_obj_t * child = NULL; + lv_obj_t * next = lv_obj_get_child(page, index); + lv_obj_t * selected = NULL; + while(next) { + child = next; + + ESP_LOGI(TAG, "Child: %p", child); + + + if (lv_obj_has_flag(child, LV_OBJ_FLAG_USER_1)) + { + lv_obj_set_style_bg_color(child, lv_color_hex(0xFF8800), 0); + lv_obj_set_style_text_color(lv_obj_get_child(child,0), + lv_color_white(), 0); + + selected = child; + ESP_LOGI(TAG, "Selected"); + } + else + { + lv_obj_set_style_bg_color(child, lv_color_white(), 0); + lv_obj_set_style_text_color(lv_obj_get_child(child,0), + lv_color_black(), 0); + } + + index++; + next = lv_obj_get_child(page, index); + } + + if (selected) + { + lv_obj_scroll_to_view(selected, LV_ANIM_ON); + } + + lvgl_port_unlock(); +} + + +static void menuInc(int inc) +{ + LOCK(); + + currentFocusIndex(&_menuContext); + + ESP_LOGI(TAG, "Current Index: %d", _menuContext.selected); + + lv_obj_t *next = NULL; + + // check if we are at the first or last in the page + lv_obj_t *test = lv_obj_get_child(_currentPage, (inc > 0 ? -1 : 0)); + + if (_menuContext.obj != test) + { + next = lv_obj_get_child(_currentPage, _menuContext.selected + inc); + lv_obj_add_state(next, LV_STATE_FOCUSED); + lv_obj_clear_state(_menuContext.obj, LV_STATE_FOCUSED); + lv_obj_scroll_to_view(next, LV_ANIM_ON); + + _menuContext.obj = next; + _menuContext.selected += inc; + } + + UNLOCK(); +} + +static void menuNext(void) +{ + menuInc(1); +} + + +static void menuPrevious(void) +{ + menuInc(-1); +} + +// Fire the “clicked” event on the selected row +static void activate_selected(void) +{ + LOCK(); + lv_obj_send_event(_menuContext.obj, LV_EVENT_CLICKED, NULL); + UNLOCK(); +} + +static lv_obj_t * addMenuItem(lv_obj_t *page, const char *text) +{ + lv_obj_t * btn = lv_btn_create(page); + lv_obj_set_size(btn, LV_PCT(100), ROW_H); + + + lv_obj_add_style(btn, &_styleUnfocusedBtn, LV_PART_MAIN | LV_STATE_DEFAULT); + lv_obj_add_style(btn, &_styleFocusedBtn, LV_PART_MAIN | LV_STATE_FOCUSED); + + lv_obj_add_state(btn, LV_STATE_DEFAULT); + + + // style it just like your old list +// lv_obj_set_style_bg_color(btn, lv_color_white(), 0); + lv_obj_set_style_radius(btn, 0, LV_PART_MAIN); + lv_obj_set_style_border_width(btn, 0, LV_PART_MAIN); + lv_obj_clear_flag(btn, LV_OBJ_FLAG_SCROLLABLE); + + // label & center + lv_obj_t * lbl = lv_label_create(btn); + lv_label_set_text(lbl, text); + lv_obj_set_style_radius(lbl, 0, LV_PART_MAIN | LV_STATE_ANY); + lv_obj_set_style_border_width(lbl, 0, LV_PART_MAIN | LV_STATE_ANY); + + // click callback + lv_obj_add_event_cb(btn, btn_click_cb, LV_EVENT_CLICKED, NULL); + + return btn; +} + +static int getSelectedIndex(lv_obj_t *page) +{ + return -1; +} + + + +static void currentFocusIndex(menu_context_t *ctx) +{ + ctx->count = lv_obj_get_child_cnt(_currentPage); + ctx->obj = NULL; + ctx->selected = -1; + + // return the index of the currently focused object + for(int i = 0; i < ctx->count; i++) { + lv_obj_t * child = lv_obj_get_child(_currentPage, i); + + if (lv_obj_has_state(child, LV_STATE_FOCUSED)) + { + ctx->obj = child; + ctx->selected = i; + + return; + } + } + + + +} +// ───── BUILD THE MENU ───── +static void build_scrollable_menu(void) { + + + lv_style_init(&_styleFocusedBtn); + lv_style_init(&_styleUnfocusedBtn); + + lv_style_set_bg_color(&_styleUnfocusedBtn, lv_color_make(0xff,0xff,0xff)); // gray bg + lv_style_set_text_color(&_styleUnfocusedBtn, lv_color_hex(0xFF8800)); + + lv_style_set_bg_color(&_styleFocusedBtn, lv_color_make(0x33,0x99,0xFF)); // blue bg + lv_style_set_text_color(&_styleUnfocusedBtn,lv_color_black()); + + + // 2) Inside it, create the lv_menu and hide its sidebar/header + lv_obj_t *menu = lv_menu_create(lv_scr_act()); + _menu = menu; + + lv_obj_set_style_radius(menu, 0, LV_PART_MAIN | LV_STATE_ANY); + lv_obj_set_style_border_width(menu, 0, LV_PART_MAIN | LV_STATE_ANY); + lv_obj_set_size(menu, lv_pct(100), lv_pct(100)); + lv_obj_center(menu); + + lv_obj_set_scrollbar_mode(menu, LV_SCROLLBAR_MODE_AUTO); + + + lv_obj_t * main = lv_menu_page_create(menu, NULL); + lv_obj_set_style_radius(main, 0, LV_PART_MAIN | LV_STATE_ANY); + lv_obj_set_style_border_width(main, 0, LV_PART_MAIN | LV_STATE_ANY); + lv_obj_set_scrollbar_mode(main, LV_SCROLLBAR_MODE_AUTO); + lv_obj_set_size(main, lv_pct(100), lv_pct(100)); + + lv_menu_set_page(menu, main); + + lv_obj_t * tmpObj; + + + + lv_obj_t * calMenu = lv_menu_page_create(menu, NULL); + lv_obj_set_style_radius(calMenu, 0, LV_PART_MAIN | LV_STATE_ANY); + lv_obj_set_style_border_width(calMenu, 0, LV_PART_MAIN | LV_STATE_ANY); + lv_obj_set_scrollbar_mode(calMenu, LV_SCROLLBAR_MODE_AUTO); + + tmpObj = addMenuItem(main, "Bluetooth"); + lv_obj_add_state(tmpObj, LV_STATE_FOCUSED); + //lv_obj_add_flag(tmpObj, LV_OBJ_FLAG_USER_1); + + tmpObj = addMenuItem(main, "Calibration"); + lv_menu_set_load_page_event(menu, tmpObj, calMenu); + + + tmpObj = addMenuItem(main, "Volume"); + + addMenuItem(main, "About"); + addMenuItem(main, "Exit"); + + + addMenuItem(calMenu, "Calibrate Level"); + addMenuItem(calMenu, "Reset Calibration"); + addMenuItem(calMenu, "Exit"); + + _currentPage = main; + + // 6) Initial highlight + selected_idx = 0; + refresh_highlight(); + + + +} + + +static void gui_task(void) +{ + system_subscribe(xTaskGetCurrentTaskHandle()); + + // Grab queue handle + QueueHandle_t q = keypad_getQueue(); + uint32_t ev = 0; + + LOCK(); + // _mode = GUI_MENU; + // lv_obj_remove_flag(_menu, LV_OBJ_FLAG_HIDDEN); + lv_obj_remove_flag(_bubble, LV_OBJ_FLAG_HIDDEN); + //lv_obj_add_flag(_menu, LV_OBJ_FLAG_HIDDEN); + UNLOCK(); + + while (1) + { + + + if (xQueueReceive(q, &ev, pdMS_TO_TICKS(10)) == pdTRUE) + { + switch (ev) { + + case (KEY_UP << KEY_LONG_PRESS): + { + system_setZeroAngle(); + break; + } + + case (KEY_DOWN << KEY_LONG_PRESS): + { + system_clearZeroAngle(); + break; + } +#if 0 + case (KEY0 << KEY_SHORT_PRESS): + + if (_mode == GUI_MENU) + { + menuNext(); + } + ESP_LOGI(TAG, "MAIN: Button 1 SHORT"); + break; + case (KEY0 << KEY_LONG_PRESS): + { + + + if (_mode != GUI_MENU) + { + _mode = GUI_MENU; + lv_obj_remove_flag(_menu, LV_OBJ_FLAG_HIDDEN); + lv_obj_add_flag(_bubble, LV_OBJ_FLAG_HIDDEN); + } + else + if (_mode == GUI_MENU) + { + activate_selected(); + _mode = GUI_BUBBLE; + // lv_obj_remove_flag(_bubble, LV_OBJ_FLAG_HIDDEN); + // lv_obj_add_flag(_menu, LV_OBJ_FLAG_HIDDEN); + } + break; + } + case (KEY1 << KEY_SHORT_PRESS): + { + if (_mode == GUI_MENU) + { + menuPrevious(); + } + break; + } + case (KEY1 << KEY_LONG_PRESS): + ESP_LOGI(TAG, "MAIN: Button 2 LONG"); + gpio_set_level(PIN_NUM_nON, 0); + break; +#endif + default: + break; + } + } + + + if (_mode == GUI_BUBBLE) + { + uint32_t notifiedBits = 0; + // clear on entry (first param), wait for any bit, block forever + xTaskNotifyWait( + 0xFFFFFFFF, // clear any old bits on entry + 0xFFFFFFFF, // clear bits on exit + ¬ifiedBits, + pdMS_TO_TICKS(100)); + + if (notifiedBits & EM_EVENT_NEW_DATA) + { + ImuData_t d = system_getImuData(); + bubble_setValue(_bubble, -d.angle); + } + } + + } + + + +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 } \ No newline at end of file diff --git a/main/gui.h b/main/gui.h index a04e31d..8418024 100644 --- a/main/gui.h +++ b/main/gui.h @@ -1,13 +1,13 @@ -#ifndef GUI_H -#define GUI_H - -typedef enum -{ - GUI_MAIN = 0, - GUI_MENU, - GUI_BUBBLE -} GuiMode_t; - -void gui_start(void); - -#endif +#ifndef GUI_H +#define GUI_H + +typedef enum +{ + GUI_MAIN = 0, + GUI_MENU, + GUI_BUBBLE +} GuiMode_t; + +void gui_start(void); + +#endif diff --git a/main/idf_component.yml b/main/idf_component.yml index 9de8ba9..0fbbd56 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,4 +1,4 @@ -dependencies: - lvgl/lvgl: - version: "^9.2.0" - espressif/esp_lvgl_port: "^2.6.0" +dependencies: + lvgl/lvgl: + version: "^9.2.0" + espressif/esp_lvgl_port: "^2.6.0" diff --git a/main/keypad.c b/main/keypad.c index b55a9a3..c5e7536 100644 --- a/main/keypad.c +++ b/main/keypad.c @@ -1,200 +1,200 @@ -#include -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/queue.h" -#include "driver/gpio.h" -#include "esp_log.h" -#include "keypad.h" - -// ───────────── CONFIGURATION ───────────── - -typedef enum { - BUTTON1_GPIO = GPIO_NUM_36, - BUTTON2_GPIO = GPIO_NUM_39, -} button_gpio_t; - -#define BUTTON_COUNT 2 - -// If your buttons are active‐low, set this to 0. If active‐high, set it to 1. -#define KEYPAD_INACTIVE 1 -#define KEYPAD_ACTIVE 0 - -// Now we run the task every 50 ms and assume that is enough to debounce: -#define DEBOUNCE_INTERVAL_MS 50 // Poll once every 50 ms -// No more stable‐count logic—one sample/50 ms is considered “debounced.” - -// Short vs. long press threshold (in ms): -#define LONG_PRESS_MS 1000 // ≥1000 ms = “long press” - -// Queue length for pending button events: -#define BTN_EVT_QUEUE_LEN 10 - -// ───────────── EVENT ENUM & QUEUE HANDLE ───────────── - -typedef struct -{ - keycode_t key; - gpio_num_t gpio; - int prevState; - int currentState; - TickType_t activeTime; - uint32_t event; -} button_t; - -static button_t _buttons[2]; - -// The queue handle that the debounce task will push events into: -static QueueHandle_t s_btn_evt_queue = NULL; - -// Call this to get the queue, so the main task can xQueueReceive(): -QueueHandle_t keypad_getQueue(void) { - return s_btn_evt_queue; -} - -// ───────────── INTERNAL STATE ───────────── - -// Current debounced state: 0 = released, 1 = pressed -static int s_debounced[2] = { 0, 0 }; - -// Tick count when each button was debounced to “pressed” -static TickType_t s_press_tick[2] = { 0, 0 }; - -// If we suppress an individual‐button event (because it was part of a “both” press), this is true -static bool s_suppress_event[2] = { false, false }; - -// Tracks if we are currently in “both buttons pressed” phase: -static bool s_was_both = false; - -// Tick count when “both buttons” first became debounced‐pressed: -static TickType_t s_both_press_tick = 0; - -// ───────────── TAG FOR LOGGING ───────────── - -static const char *TAG = "btn_debounce"; - -// ───────────── GPIO SETUP ───────────── - -static void init_button_gpio(void) -{ - // Configure both as inputs with pull‐up (assuming active‐low buttons) - gpio_config_t io_conf = { - .pin_bit_mask = (1ULL << BUTTON1_GPIO) | (1ULL << BUTTON2_GPIO), - .mode = GPIO_MODE_INPUT, - .pull_up_en = GPIO_PULLUP_ENABLE, - .pull_down_en = GPIO_PULLDOWN_DISABLE, - .intr_type = GPIO_INTR_DISABLE - }; - ESP_ERROR_CHECK(gpio_config(&io_conf)); - - _buttons[0].activeTime = 0; - _buttons[0].gpio = BUTTON1_GPIO; - _buttons[0].key = KEY0; - _buttons[0].prevState = KEYPAD_INACTIVE; - _buttons[0].currentState = KEYPAD_INACTIVE; - - _buttons[1].activeTime = 0; - _buttons[1].gpio = BUTTON2_GPIO; - _buttons[1].key = KEY1; - _buttons[1].prevState = KEYPAD_INACTIVE; - _buttons[1].currentState = KEYPAD_INACTIVE; - -} - -// ───────────── BUTTON DEBOUNCE & PRESS‐TYPE TASK ───────────── - -static void vButtonDebounceTask(void *arg) -{ - (void)arg; - - TickType_t now = xTaskGetTickCount(); - TickType_t xLastWake = now; - const TickType_t long_press_thresh = pdMS_TO_TICKS(LONG_PRESS_MS); - - while (1) { - - now = xTaskGetTickCount(); - - for (int i=0; i < BUTTON_COUNT; ++i) - { - button_t *button = &_buttons[i]; - - button->currentState = gpio_get_level(button->gpio); - - if (button->currentState == KEYPAD_ACTIVE) - { - // just pressed - if (button->prevState == KEYPAD_INACTIVE) - { - button->activeTime = now; - } - else - { - if ((now - button->activeTime) >= long_press_thresh) - { - if (button->event == 0) - { - ESP_LOGI(TAG, "%d LONG", button->key); - button->event = (button->key << KEY_LONG_PRESS); - xQueueSend(s_btn_evt_queue, &button->event, 0); - } - } - } - } - else - if (button->currentState == KEYPAD_INACTIVE) - { - // just released - if (button->prevState == KEYPAD_ACTIVE) - { - if (button->event == 0) - { - ESP_LOGI(TAG, "%d SHORT", button->key); - button->event = (button->key << KEY_SHORT_PRESS); - xQueueSend(s_btn_evt_queue, &button->event, 0); - } - else - { - ESP_LOGI(TAG, "%d LONG RELEASE", button->key); - } - button->event = 0; - - } - button->activeTime = 0; - } - - button->prevState = button->currentState; - } - - - - - // 7) Wait 50 ms and repeat - vTaskDelayUntil(&xLastWake, pdMS_TO_TICKS(DEBOUNCE_INTERVAL_MS)); - xLastWake = now; - } -} - -// ───────────── PUBLIC “START” FUNCTION ───────────── - -void keypad_start(void) -{ - // 1) Create the queue for button events - s_btn_evt_queue = xQueueCreate(BTN_EVT_QUEUE_LEN, sizeof(uint32_t)); - if (s_btn_evt_queue == NULL) { - ESP_LOGE(TAG, "Failed to create button event queue"); - return; - } - - // 2) Initialize GPIOs & initial state - init_button_gpio(); - - // 3) Launch the FreeRTOS task (low priority) - xTaskCreate(vButtonDebounceTask, - "btn_debounce", - 2048, - NULL, - tskIDLE_PRIORITY + 1, - NULL); - -} - +#include +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/queue.h" +#include "driver/gpio.h" +#include "esp_log.h" +#include "keypad.h" + +// ───────────── CONFIGURATION ───────────── + +typedef enum { + BUTTON1_GPIO = GPIO_NUM_36, + BUTTON2_GPIO = GPIO_NUM_39, +} button_gpio_t; + +#define BUTTON_COUNT 2 + +// If your buttons are active‐low, set this to 0. If active‐high, set it to 1. +#define KEYPAD_INACTIVE 1 +#define KEYPAD_ACTIVE 0 + +// Now we run the task every 50 ms and assume that is enough to debounce: +#define DEBOUNCE_INTERVAL_MS 50 // Poll once every 50 ms +// No more stable‐count logic—one sample/50 ms is considered “debounced.” + +// Short vs. long press threshold (in ms): +#define LONG_PRESS_MS 1000 // ≥1000 ms = “long press” + +// Queue length for pending button events: +#define BTN_EVT_QUEUE_LEN 10 + +// ───────────── EVENT ENUM & QUEUE HANDLE ───────────── + +typedef struct +{ + keycode_t key; + gpio_num_t gpio; + int prevState; + int currentState; + TickType_t activeTime; + uint32_t event; +} button_t; + +static button_t _buttons[2]; + +// The queue handle that the debounce task will push events into: +static QueueHandle_t s_btn_evt_queue = NULL; + +// Call this to get the queue, so the main task can xQueueReceive(): +QueueHandle_t keypad_getQueue(void) { + return s_btn_evt_queue; +} + +// ───────────── INTERNAL STATE ───────────── + +// Current debounced state: 0 = released, 1 = pressed +static int s_debounced[2] = { 0, 0 }; + +// Tick count when each button was debounced to “pressed” +static TickType_t s_press_tick[2] = { 0, 0 }; + +// If we suppress an individual‐button event (because it was part of a “both” press), this is true +static bool s_suppress_event[2] = { false, false }; + +// Tracks if we are currently in “both buttons pressed” phase: +static bool s_was_both = false; + +// Tick count when “both buttons” first became debounced‐pressed: +static TickType_t s_both_press_tick = 0; + +// ───────────── TAG FOR LOGGING ───────────── + +static const char *TAG = "btn_debounce"; + +// ───────────── GPIO SETUP ───────────── + +static void init_button_gpio(void) +{ + // Configure both as inputs with pull‐up (assuming active‐low buttons) + gpio_config_t io_conf = { + .pin_bit_mask = (1ULL << BUTTON1_GPIO) | (1ULL << BUTTON2_GPIO), + .mode = GPIO_MODE_INPUT, + .pull_up_en = GPIO_PULLUP_ENABLE, + .pull_down_en = GPIO_PULLDOWN_DISABLE, + .intr_type = GPIO_INTR_DISABLE + }; + ESP_ERROR_CHECK(gpio_config(&io_conf)); + + _buttons[0].activeTime = 0; + _buttons[0].gpio = BUTTON1_GPIO; + _buttons[0].key = KEY0; + _buttons[0].prevState = KEYPAD_INACTIVE; + _buttons[0].currentState = KEYPAD_INACTIVE; + + _buttons[1].activeTime = 0; + _buttons[1].gpio = BUTTON2_GPIO; + _buttons[1].key = KEY1; + _buttons[1].prevState = KEYPAD_INACTIVE; + _buttons[1].currentState = KEYPAD_INACTIVE; + +} + +// ───────────── BUTTON DEBOUNCE & PRESS‐TYPE TASK ───────────── + +static void vButtonDebounceTask(void *arg) +{ + (void)arg; + + TickType_t now = xTaskGetTickCount(); + TickType_t xLastWake = now; + const TickType_t long_press_thresh = pdMS_TO_TICKS(LONG_PRESS_MS); + + while (1) { + + now = xTaskGetTickCount(); + + for (int i=0; i < BUTTON_COUNT; ++i) + { + button_t *button = &_buttons[i]; + + button->currentState = gpio_get_level(button->gpio); + + if (button->currentState == KEYPAD_ACTIVE) + { + // just pressed + if (button->prevState == KEYPAD_INACTIVE) + { + button->activeTime = now; + } + else + { + if ((now - button->activeTime) >= long_press_thresh) + { + if (button->event == 0) + { + ESP_LOGI(TAG, "%d LONG", button->key); + button->event = (button->key << KEY_LONG_PRESS); + xQueueSend(s_btn_evt_queue, &button->event, 0); + } + } + } + } + else + if (button->currentState == KEYPAD_INACTIVE) + { + // just released + if (button->prevState == KEYPAD_ACTIVE) + { + if (button->event == 0) + { + ESP_LOGI(TAG, "%d SHORT", button->key); + button->event = (button->key << KEY_SHORT_PRESS); + xQueueSend(s_btn_evt_queue, &button->event, 0); + } + else + { + ESP_LOGI(TAG, "%d LONG RELEASE", button->key); + } + button->event = 0; + + } + button->activeTime = 0; + } + + button->prevState = button->currentState; + } + + + + + // 7) Wait 50 ms and repeat + vTaskDelayUntil(&xLastWake, pdMS_TO_TICKS(DEBOUNCE_INTERVAL_MS)); + xLastWake = now; + } +} + +// ───────────── PUBLIC “START” FUNCTION ───────────── + +void keypad_start(void) +{ + // 1) Create the queue for button events + s_btn_evt_queue = xQueueCreate(BTN_EVT_QUEUE_LEN, sizeof(uint32_t)); + if (s_btn_evt_queue == NULL) { + ESP_LOGE(TAG, "Failed to create button event queue"); + return; + } + + // 2) Initialize GPIOs & initial state + init_button_gpio(); + + // 3) Launch the FreeRTOS task (low priority) + xTaskCreate(vButtonDebounceTask, + "btn_debounce", + 2048, + NULL, + tskIDLE_PRIORITY + 1, + NULL); + +} + diff --git a/main/keypad.h b/main/keypad.h index 4f0df73..fbd1aa3 100644 --- a/main/keypad.h +++ b/main/keypad.h @@ -1,3 +1,4 @@ +<<<<<<< HEAD #ifndef _KEYPAD_H #define _KEYPAD_H @@ -20,4 +21,28 @@ typedef enum void keypad_start(void); QueueHandle_t keypad_getQueue(void); +======= +#ifndef _KEYPAD_H +#define _KEYPAD_H + +#include "freertos/FreeRTOS.h" +#include "freertos/queue.h" + +typedef enum +{ + KEY0 = (1 << 0), + KEY1 = (1 << 1), +} keycode_t; + + +#define KEY_SHORT_PRESS 0 +#define KEY_LONG_PRESS 4 + +#define KEY_UP KEY0 +#define KEY_DOWN KEY1 + +void keypad_start(void); +QueueHandle_t keypad_getQueue(void); + +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 #endif \ No newline at end of file diff --git a/main/lsm6dsv.c b/main/lsm6dsv.c index 854fbb8..b70b73e 100644 --- a/main/lsm6dsv.c +++ b/main/lsm6dsv.c @@ -1,349 +1,349 @@ -#include -#include "lsm6dsv.h" -#include "driver/i2c.h" -#include "esp_log.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "esp_system.h" -#include "esp_log.h" -#include "sdkconfig.h" - -static const char *TAG = "LSM6DSV"; -static const int I2C_PORT = 0; - -// I2C helper functions -static esp_err_t i2c_write_reg(uint8_t reg_addr, uint8_t data) { - uint8_t write_buf[2] = {reg_addr, data}; - return i2c_master_write_to_device(I2C_PORT, LSM6DSV_ADDR, write_buf, sizeof(write_buf), pdMS_TO_TICKS(100)); -} - -static esp_err_t i2c_read_reg(uint8_t reg_addr, uint8_t *data) { - return i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®_addr, 1, data, 1, pdMS_TO_TICKS(100)); -} - -/** - * @brief Converts uint16_t half-precision number into a uint32_t single-precision number. - * @param h half-precision number - * @param f pointer where the result of the conversion is written - * @retval 0 - */ -esp_err_t npy_halfbits_to_floatbits(uint16_t h, uint32_t *f) -{ - uint16_t h_exp, h_sig; - uint32_t f_sgn, f_exp, f_sig; - - h_exp = (h & 0x7c00u); - f_sgn = ((uint32_t)h & 0x8000u) << 16; - switch (h_exp) { - case 0x0000u: /* 0 or subnormal */ - h_sig = (h & 0x03ffu); - /* Signed zero */ - if (h_sig == 0) { - *f = f_sgn; - return ESP_OK; - } - /* Subnormal */ - h_sig <<= 1; - while ((h_sig & 0x0400u) == 0) { - h_sig <<= 1; - h_exp++; - } - f_exp = ((uint32_t)(127 - 15 - h_exp)) << 23; - f_sig = ((uint32_t)(h_sig & 0x03ffu)) << 13; - *f = f_sgn + f_exp + f_sig; - return ESP_OK; - case 0x7c00u: /* inf or NaN */ - /* All-ones exponent and a copy of the significand */ - *f = f_sgn + 0x7f800000u + (((uint32_t)(h & 0x03ffu)) << 13); - return ESP_OK; - default: /* normalized */ - /* Just need to adjust the exponent and shift */ - *f = f_sgn + (((uint32_t)(h & 0x7fffu) + 0x1c000u) << 13); - return ESP_OK; - } -} - -esp_err_t npy_half_to_float(uint16_t h, float *f) -{ - union { - float ret; - uint32_t retbits; - } conv; - npy_halfbits_to_floatbits(h, &conv.retbits); - *f = conv.ret; - return ESP_OK; -} - -/** - * @brief Compute quaternions. - * @param quat results of the computation - * @param sflp raw value of the quaternions - * @retval 0 - */ -esp_err_t sflp2q(float quat[4], uint16_t sflp[3]) -{ - float sumsq = 0; - - npy_half_to_float(sflp[0], &quat[0]); - npy_half_to_float(sflp[1], &quat[1]); - npy_half_to_float(sflp[2], &quat[2]); - - for (uint8_t i = 0; i < 3; i++) { - sumsq += quat[i] * quat[i]; - } - - if (sumsq > 1.0f) { - float n = sqrtf(sumsq); - quat[0] /= n; - quat[1] /= n; - quat[2] /= n; - sumsq = 1.0f; - } - - quat[3] = sqrtf(1.0f - sumsq); - return ESP_OK; -} - -void quaternion_to_euler(float qx, float qy, float qz, float qw, float *roll, float *pitch, float *yaw) { - // Roll (X-axis rotation) - *roll = atan2f(2.0f * (qw * qx + qy * qz), 1.0f - 2.0f * (qx * qx + qy * qy)); - - // Pitch (Y-axis rotation) - *pitch = asinf(2.0f * (qw * qy - qz * qx)); - - // Yaw (Z-axis rotation) - *yaw = atan2f(2.0f * (qw * qz + qx * qy), 1.0f - 2.0f * (qy * qy + qz * qz)); -} - -esp_err_t lsm6dsv_init(int scl_pin, int sda_pin) { - // Configure I2C - i2c_config_t conf = { - .mode = I2C_MODE_MASTER, - .sda_io_num = sda_pin, - .scl_io_num = scl_pin, - .sda_pullup_en = GPIO_PULLUP_ENABLE, - .scl_pullup_en = GPIO_PULLUP_ENABLE, - .master.clk_speed = 400000 // 400 KHz - }; - - esp_err_t ret = i2c_param_config(I2C_PORT, &conf); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "I2C parameter configuration failed"); - return ret; - } - - ret = i2c_driver_install(I2C_PORT, I2C_MODE_MASTER, 0, 0, 0); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "I2C driver installation failed"); - return ret; - } - - // Verify device ID - uint8_t who_am_i; - ret = i2c_read_reg(LSM6DSV_WHO_AM_I, &who_am_i); - if (ret != ESP_OK || who_am_i != 0x70) { // 0x70 is the expected WHO_AM_I value - ESP_LOGE(TAG, "Failed to verify device ID or incorrect device (expected: 0x70, got: 0x%02x)", who_am_i); - return ESP_FAIL; - } - - // Configure accelerometer (±2g, 104 Hz) - ret = i2c_write_reg(LSM6DSV_CTRL1, 0x44); // ODR = 104 Hz (0x04), ±2g (0x40) - if (ret != ESP_OK) { - ESP_LOGE(TAG, "Failed to configure accelerometer"); - return ret; - } - - // Verify accelerometer configuration - uint8_t ctrl1_val; - ret = i2c_read_reg(LSM6DSV_CTRL1, &ctrl1_val); - if (ret == ESP_OK) { - ESP_LOGI(TAG, "CTRL1 value: 0x%02x", ctrl1_val); - } - - // Configure gyroscope (±250 dps, 104 Hz) - ret = i2c_write_reg(LSM6DSV_CTRL2, 0x04); // ODR = 104 Hz (0x04), ±250 dps (0x40) - if (ret != ESP_OK) { - ESP_LOGE(TAG, "Failed to configure gyroscope"); - return ret; - } - - // Verify gyroscope configuration - uint8_t regval, tmp1; - ret = i2c_read_reg(LSM6DSV_CTRL2, ®val); - if (ret == ESP_OK) { - ESP_LOGI(TAG, "CTRL2 value: 0x%02x", regval); - } - - - // ret = i2c_read_reg(LSM6DSV_SFLP_ODR, ®val); - // regval |= SFLP_ODR_15HZ; - // ret = i2c_write_reg(LSM6DSV_SFLP_ODR, regval); - - // // get current value of FUNC_CFG_ACCESS - // ret = i2c_read_reg(LSM6DSV_FUNC_CFG_ACCESS, ®val); - - // // enable embedded function access - // regval |= LSM6DSV_EMB_FUNC_REG_ACCESS; - // ret = i2c_write_reg(LSM6DSV_FUNC_CFG_ACCESS, regval); - - - // // enable game vector FIDO - // ret = i2c_write_reg(LSM6DSV_EMB_FUNC_FIFO_EN_A, SFLP_GAME_FIFO_EN); - - // // enable sensor fusion algorithm - // ret = i2c_write_reg(LSM6DSV_EMB_FUNC_EN_A, SFLP_GAME_EN); - // ret = i2c_write_reg(LSM6DSV_EMB_FUNC_INIT_A, SFLP_GAME_INIT); - - - // // restore FUNC_CFG_ACCESS - // regval &= ~LSM6DSV_EMB_FUNC_REG_ACCESS; - // ret = i2c_write_reg(LSM6DSV_FUNC_CFG_ACCESS, regval); - - - // ret = i2c_write_reg(LSM6DSV_FIFO_CTRL4, 0x06); - - // ret = i2c_read_reg(LSM6DSV_FIFO_CTRL4, ®val); - // if (ret == ESP_OK) { - // ESP_LOGI(TAG, "FIFO_CTRL4 value: 0x%02x", regval); - // } - - // Add a small delay after configuration - vTaskDelay(pdMS_TO_TICKS(200)); - - ESP_LOGI(TAG, "LSM6DSV initialized successfully"); - return ESP_OK; -} - -esp_err_t lsm6dsv_read_data(lsm6dsv_data_t *data) { - if (data == NULL) { - return ESP_ERR_INVALID_ARG; - } - - esp_err_t ret; - uint8_t buffer[12]; - uint8_t reg = LSM6DSV_OUTX_L_A; - - // Check status register - uint8_t status; - ret = i2c_read_reg(LSM6DSV_STATUS, &status); - if (ret == ESP_OK) { - ESP_LOGD(TAG, "Status register: 0x%02x", status); - if (!(status & 0x01)) { // Check if accelerometer data is ready - ESP_LOGW(TAG, "Accelerometer data not ready"); - return ESP_ERR_NOT_FOUND; - } - } - - // Read accelerometer data (6 bytes) - ret = i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®, 1, buffer, 6, pdMS_TO_TICKS(100)); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "Failed to read accelerometer data"); - return ret; - } - - ESP_LOGD(TAG, "ACC raw: x=0x%02x%02x y=0x%02x%02x z=0x%02x%02x", - buffer[1], buffer[0], buffer[3], buffer[2], buffer[5], buffer[4]); - - // Check if gyroscope data is ready - ret = i2c_read_reg(LSM6DSV_STATUS, &status); - if (ret == ESP_OK) { - if (!(status & 0x02)) { // Check if gyroscope data is ready - ESP_LOGW(TAG, "Gyroscope data not ready"); - return ESP_ERR_NOT_FOUND; - } - } - - // Read gyroscope data (6 bytes) - reg = LSM6DSV_OUTX_L_G; - ret = i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®, 1, buffer + 6, 6, pdMS_TO_TICKS(100)); - if (ret != ESP_OK) { - ESP_LOGE(TAG, "Failed to read gyroscope data"); - return ret; - } - - ESP_LOGD(TAG, "GYRO raw: x=0x%02x%02x y=0x%02x%02x z=0x%02x%02x", - buffer[7], buffer[6], buffer[9], buffer[8], buffer[11], buffer[10]); - - // Convert accelerometer data (±2g scale) - const float acc_scale = 2.0f / 32768.0f; // ±2g range - data->acc_x = -(int16_t)(buffer[0] | (buffer[1] << 8)) * acc_scale; - data->acc_y = -(int16_t)(buffer[2] | (buffer[3] << 8)) * acc_scale; - data->acc_z = -(int16_t)(buffer[4] | (buffer[5] << 8)) * acc_scale; - - // Convert gyroscope data (±250 dps scale) - const float gyro_scale = 250.0f / 32768.0f; // ±250 dps range - data->gyro_x = (int16_t)(buffer[6] | (buffer[7] << 8)) * gyro_scale; - data->gyro_y = (int16_t)(buffer[8] | (buffer[9] << 8)) * gyro_scale; - data->gyro_z = (int16_t)(buffer[10] | (buffer[11] << 8)) * gyro_scale; - - return ESP_OK; -} - -uint8_t lsm6dsv_fifo_ready(void) -{ - esp_err_t ret; - uint8_t status; - - // Check if fifo data is ready - ret = i2c_read_reg(LSM6DSV_FIFO_STATUS2, &status); - if (ret == ESP_OK) { - //ESP_LOGI(TAG, "FIFO_STATUS2: %d", status); - } - - ret = i2c_read_reg(LSM6DSV_FIFO_STATUS1, &status); - if (ret == ESP_OK) { - return status; - } - - return 0; -} - - - -esp_err_t lsm6dsv_fifo_read(lsm6dsv_fifo_t *fifo) -{ - esp_err_t ret; - uint8_t data; - uint8_t reg; - ret = i2c_read_reg(LSM6DSV_FIFO_DATA_OUT_TAG, &data); - - reg = LSM6DSV_FIFO_DATA_OUT_X_L; - ret = i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®, 1, fifo->data, 6, pdMS_TO_TICKS(100)); - - if (ret == ESP_OK) - { - fifo->count = (data & 0x06) >> 1; - fifo->tag = (data & 0xf8) >> 3; - - fifo->v[0] = (uint16_t)(fifo->data[0] | (fifo->data[1] << 8)); - fifo->v[1] = (uint16_t)(fifo->data[2] | (fifo->data[3] << 8)); - fifo->v[2] = (uint16_t)(fifo->data[4] | (fifo->data[5] << 8)); - - return ESP_OK; - } - - return ESP_FAIL; -} - -esp_err_t lsm6dsv_getAttitude(lsm6dsv_fifo_t *fifo, float *roll, float *pitch, float *yaw) -{ - float q[4]; - sflp2q(q, fifo->v); - - float w = q[3]; - float x = q[0]; - float y = q[1]; - float z = q[2]; - - // Yaw (z-axis rotation) - *yaw = atan2(2.0f * (x * y + w * z), w * w + x * x - y * y - z * z); - - // Pitch (y-axis rotation) - *pitch = -asin(2.0f * (x * z - w * y)); - - // Roll (x-axis rotation) - *roll = atan2(2.0f * (w * x + y * z), w * w - x * x - y * y + z * z); - - return ESP_OK; - +#include +#include "lsm6dsv.h" +#include "driver/i2c.h" +#include "esp_log.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "esp_system.h" +#include "esp_log.h" +#include "sdkconfig.h" + +static const char *TAG = "LSM6DSV"; +static const int I2C_PORT = 0; + +// I2C helper functions +static esp_err_t i2c_write_reg(uint8_t reg_addr, uint8_t data) { + uint8_t write_buf[2] = {reg_addr, data}; + return i2c_master_write_to_device(I2C_PORT, LSM6DSV_ADDR, write_buf, sizeof(write_buf), pdMS_TO_TICKS(100)); +} + +static esp_err_t i2c_read_reg(uint8_t reg_addr, uint8_t *data) { + return i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®_addr, 1, data, 1, pdMS_TO_TICKS(100)); +} + +/** + * @brief Converts uint16_t half-precision number into a uint32_t single-precision number. + * @param h half-precision number + * @param f pointer where the result of the conversion is written + * @retval 0 + */ +esp_err_t npy_halfbits_to_floatbits(uint16_t h, uint32_t *f) +{ + uint16_t h_exp, h_sig; + uint32_t f_sgn, f_exp, f_sig; + + h_exp = (h & 0x7c00u); + f_sgn = ((uint32_t)h & 0x8000u) << 16; + switch (h_exp) { + case 0x0000u: /* 0 or subnormal */ + h_sig = (h & 0x03ffu); + /* Signed zero */ + if (h_sig == 0) { + *f = f_sgn; + return ESP_OK; + } + /* Subnormal */ + h_sig <<= 1; + while ((h_sig & 0x0400u) == 0) { + h_sig <<= 1; + h_exp++; + } + f_exp = ((uint32_t)(127 - 15 - h_exp)) << 23; + f_sig = ((uint32_t)(h_sig & 0x03ffu)) << 13; + *f = f_sgn + f_exp + f_sig; + return ESP_OK; + case 0x7c00u: /* inf or NaN */ + /* All-ones exponent and a copy of the significand */ + *f = f_sgn + 0x7f800000u + (((uint32_t)(h & 0x03ffu)) << 13); + return ESP_OK; + default: /* normalized */ + /* Just need to adjust the exponent and shift */ + *f = f_sgn + (((uint32_t)(h & 0x7fffu) + 0x1c000u) << 13); + return ESP_OK; + } +} + +esp_err_t npy_half_to_float(uint16_t h, float *f) +{ + union { + float ret; + uint32_t retbits; + } conv; + npy_halfbits_to_floatbits(h, &conv.retbits); + *f = conv.ret; + return ESP_OK; +} + +/** + * @brief Compute quaternions. + * @param quat results of the computation + * @param sflp raw value of the quaternions + * @retval 0 + */ +esp_err_t sflp2q(float quat[4], uint16_t sflp[3]) +{ + float sumsq = 0; + + npy_half_to_float(sflp[0], &quat[0]); + npy_half_to_float(sflp[1], &quat[1]); + npy_half_to_float(sflp[2], &quat[2]); + + for (uint8_t i = 0; i < 3; i++) { + sumsq += quat[i] * quat[i]; + } + + if (sumsq > 1.0f) { + float n = sqrtf(sumsq); + quat[0] /= n; + quat[1] /= n; + quat[2] /= n; + sumsq = 1.0f; + } + + quat[3] = sqrtf(1.0f - sumsq); + return ESP_OK; +} + +void quaternion_to_euler(float qx, float qy, float qz, float qw, float *roll, float *pitch, float *yaw) { + // Roll (X-axis rotation) + *roll = atan2f(2.0f * (qw * qx + qy * qz), 1.0f - 2.0f * (qx * qx + qy * qy)); + + // Pitch (Y-axis rotation) + *pitch = asinf(2.0f * (qw * qy - qz * qx)); + + // Yaw (Z-axis rotation) + *yaw = atan2f(2.0f * (qw * qz + qx * qy), 1.0f - 2.0f * (qy * qy + qz * qz)); +} + +esp_err_t lsm6dsv_init(int scl_pin, int sda_pin) { + // Configure I2C + i2c_config_t conf = { + .mode = I2C_MODE_MASTER, + .sda_io_num = sda_pin, + .scl_io_num = scl_pin, + .sda_pullup_en = GPIO_PULLUP_ENABLE, + .scl_pullup_en = GPIO_PULLUP_ENABLE, + .master.clk_speed = 400000 // 400 KHz + }; + + esp_err_t ret = i2c_param_config(I2C_PORT, &conf); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "I2C parameter configuration failed"); + return ret; + } + + ret = i2c_driver_install(I2C_PORT, I2C_MODE_MASTER, 0, 0, 0); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "I2C driver installation failed"); + return ret; + } + + // Verify device ID + uint8_t who_am_i; + ret = i2c_read_reg(LSM6DSV_WHO_AM_I, &who_am_i); + if (ret != ESP_OK || who_am_i != 0x70) { // 0x70 is the expected WHO_AM_I value + ESP_LOGE(TAG, "Failed to verify device ID or incorrect device (expected: 0x70, got: 0x%02x)", who_am_i); + return ESP_FAIL; + } + + // Configure accelerometer (±2g, 104 Hz) + ret = i2c_write_reg(LSM6DSV_CTRL1, 0x44); // ODR = 104 Hz (0x04), ±2g (0x40) + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to configure accelerometer"); + return ret; + } + + // Verify accelerometer configuration + uint8_t ctrl1_val; + ret = i2c_read_reg(LSM6DSV_CTRL1, &ctrl1_val); + if (ret == ESP_OK) { + ESP_LOGI(TAG, "CTRL1 value: 0x%02x", ctrl1_val); + } + + // Configure gyroscope (±250 dps, 104 Hz) + ret = i2c_write_reg(LSM6DSV_CTRL2, 0x04); // ODR = 104 Hz (0x04), ±250 dps (0x40) + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to configure gyroscope"); + return ret; + } + + // Verify gyroscope configuration + uint8_t regval, tmp1; + ret = i2c_read_reg(LSM6DSV_CTRL2, ®val); + if (ret == ESP_OK) { + ESP_LOGI(TAG, "CTRL2 value: 0x%02x", regval); + } + + + // ret = i2c_read_reg(LSM6DSV_SFLP_ODR, ®val); + // regval |= SFLP_ODR_15HZ; + // ret = i2c_write_reg(LSM6DSV_SFLP_ODR, regval); + + // // get current value of FUNC_CFG_ACCESS + // ret = i2c_read_reg(LSM6DSV_FUNC_CFG_ACCESS, ®val); + + // // enable embedded function access + // regval |= LSM6DSV_EMB_FUNC_REG_ACCESS; + // ret = i2c_write_reg(LSM6DSV_FUNC_CFG_ACCESS, regval); + + + // // enable game vector FIDO + // ret = i2c_write_reg(LSM6DSV_EMB_FUNC_FIFO_EN_A, SFLP_GAME_FIFO_EN); + + // // enable sensor fusion algorithm + // ret = i2c_write_reg(LSM6DSV_EMB_FUNC_EN_A, SFLP_GAME_EN); + // ret = i2c_write_reg(LSM6DSV_EMB_FUNC_INIT_A, SFLP_GAME_INIT); + + + // // restore FUNC_CFG_ACCESS + // regval &= ~LSM6DSV_EMB_FUNC_REG_ACCESS; + // ret = i2c_write_reg(LSM6DSV_FUNC_CFG_ACCESS, regval); + + + // ret = i2c_write_reg(LSM6DSV_FIFO_CTRL4, 0x06); + + // ret = i2c_read_reg(LSM6DSV_FIFO_CTRL4, ®val); + // if (ret == ESP_OK) { + // ESP_LOGI(TAG, "FIFO_CTRL4 value: 0x%02x", regval); + // } + + // Add a small delay after configuration + vTaskDelay(pdMS_TO_TICKS(200)); + + ESP_LOGI(TAG, "LSM6DSV initialized successfully"); + return ESP_OK; +} + +esp_err_t lsm6dsv_read_data(lsm6dsv_data_t *data) { + if (data == NULL) { + return ESP_ERR_INVALID_ARG; + } + + esp_err_t ret; + uint8_t buffer[12]; + uint8_t reg = LSM6DSV_OUTX_L_A; + + // Check status register + uint8_t status; + ret = i2c_read_reg(LSM6DSV_STATUS, &status); + if (ret == ESP_OK) { + ESP_LOGD(TAG, "Status register: 0x%02x", status); + if (!(status & 0x01)) { // Check if accelerometer data is ready + ESP_LOGW(TAG, "Accelerometer data not ready"); + return ESP_ERR_NOT_FOUND; + } + } + + // Read accelerometer data (6 bytes) + ret = i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®, 1, buffer, 6, pdMS_TO_TICKS(100)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to read accelerometer data"); + return ret; + } + + ESP_LOGD(TAG, "ACC raw: x=0x%02x%02x y=0x%02x%02x z=0x%02x%02x", + buffer[1], buffer[0], buffer[3], buffer[2], buffer[5], buffer[4]); + + // Check if gyroscope data is ready + ret = i2c_read_reg(LSM6DSV_STATUS, &status); + if (ret == ESP_OK) { + if (!(status & 0x02)) { // Check if gyroscope data is ready + ESP_LOGW(TAG, "Gyroscope data not ready"); + return ESP_ERR_NOT_FOUND; + } + } + + // Read gyroscope data (6 bytes) + reg = LSM6DSV_OUTX_L_G; + ret = i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®, 1, buffer + 6, 6, pdMS_TO_TICKS(100)); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to read gyroscope data"); + return ret; + } + + ESP_LOGD(TAG, "GYRO raw: x=0x%02x%02x y=0x%02x%02x z=0x%02x%02x", + buffer[7], buffer[6], buffer[9], buffer[8], buffer[11], buffer[10]); + + // Convert accelerometer data (±2g scale) + const float acc_scale = 2.0f / 32768.0f; // ±2g range + data->acc_x = -(int16_t)(buffer[0] | (buffer[1] << 8)) * acc_scale; + data->acc_y = -(int16_t)(buffer[2] | (buffer[3] << 8)) * acc_scale; + data->acc_z = -(int16_t)(buffer[4] | (buffer[5] << 8)) * acc_scale; + + // Convert gyroscope data (±250 dps scale) + const float gyro_scale = 250.0f / 32768.0f; // ±250 dps range + data->gyro_x = (int16_t)(buffer[6] | (buffer[7] << 8)) * gyro_scale; + data->gyro_y = (int16_t)(buffer[8] | (buffer[9] << 8)) * gyro_scale; + data->gyro_z = (int16_t)(buffer[10] | (buffer[11] << 8)) * gyro_scale; + + return ESP_OK; +} + +uint8_t lsm6dsv_fifo_ready(void) +{ + esp_err_t ret; + uint8_t status; + + // Check if fifo data is ready + ret = i2c_read_reg(LSM6DSV_FIFO_STATUS2, &status); + if (ret == ESP_OK) { + //ESP_LOGI(TAG, "FIFO_STATUS2: %d", status); + } + + ret = i2c_read_reg(LSM6DSV_FIFO_STATUS1, &status); + if (ret == ESP_OK) { + return status; + } + + return 0; +} + + + +esp_err_t lsm6dsv_fifo_read(lsm6dsv_fifo_t *fifo) +{ + esp_err_t ret; + uint8_t data; + uint8_t reg; + ret = i2c_read_reg(LSM6DSV_FIFO_DATA_OUT_TAG, &data); + + reg = LSM6DSV_FIFO_DATA_OUT_X_L; + ret = i2c_master_write_read_device(I2C_PORT, LSM6DSV_ADDR, ®, 1, fifo->data, 6, pdMS_TO_TICKS(100)); + + if (ret == ESP_OK) + { + fifo->count = (data & 0x06) >> 1; + fifo->tag = (data & 0xf8) >> 3; + + fifo->v[0] = (uint16_t)(fifo->data[0] | (fifo->data[1] << 8)); + fifo->v[1] = (uint16_t)(fifo->data[2] | (fifo->data[3] << 8)); + fifo->v[2] = (uint16_t)(fifo->data[4] | (fifo->data[5] << 8)); + + return ESP_OK; + } + + return ESP_FAIL; +} + +esp_err_t lsm6dsv_getAttitude(lsm6dsv_fifo_t *fifo, float *roll, float *pitch, float *yaw) +{ + float q[4]; + sflp2q(q, fifo->v); + + float w = q[3]; + float x = q[0]; + float y = q[1]; + float z = q[2]; + + // Yaw (z-axis rotation) + *yaw = atan2(2.0f * (x * y + w * z), w * w + x * x - y * y - z * z); + + // Pitch (y-axis rotation) + *pitch = -asin(2.0f * (x * z - w * y)); + + // Roll (x-axis rotation) + *roll = atan2(2.0f * (w * x + y * z), w * w - x * x - y * y + z * z); + + return ESP_OK; + } \ No newline at end of file diff --git a/main/lsm6dsv.h b/main/lsm6dsv.h index e7ba40c..58bf725 100644 --- a/main/lsm6dsv.h +++ b/main/lsm6dsv.h @@ -1,99 +1,99 @@ -#pragma once - -#include -#include "esp_err.h" - -// LSM6DSV Register Addresses -#define LSM6DSV_ADDR 0x6A // I2C address (SA0=0) - -#define LSM6DSV_EMB_FUNC_EN_A 0x04 -#define SFLP_GAME_EN (1 << 1) - -#define LSM6DSV_FUNC_CFG_ACCESS 0x01 -#define LSM6DSV_EMB_FUNC_REG_ACCESS (1 << 7) - -// FIFO Registers -#define LSM6DSV_FIFO_CTRL1 0x07 // FIFO Control Register 1 -#define LSM6DSV_FIFO_CTRL2 0x08 // FIFO Control Register 2 -#define LSM6DSV_FIFO_CTRL3 0x09 // FIFO Control Register 3 -#define LSM6DSV_FIFO_CTRL4 0x0A // FIFO Control Register 4 - -#define FIFO_MODE_CONTINUOUS 0x06 - -#define LSM6DSV_FIFO_STATUS1 0x1B // FIFO Status Register 1 -#define LSM6DSV_FIFO_STATUS2 0x1C // FIFO Status Register 2 - -#define LSM6DSV_FIFO_DATA_OUT_TAG 0x78 // FIFO Data Output Register -#define LSM6DSV_FIFO_DATA_OUT_X_L 0x79 // FIFO Data Output Register -#define LSM6DSV_FIFO_DATA_OUT_X_H 0x7A // FIFO Data Output Register -#define LSM6DSV_FIFO_DATA_OUT_Y_L 0x7B // FIFO Data Output Register -#define LSM6DSV_FIFO_DATA_OUT_Y_H 0x7C // FIFO Data Output Register -#define LSM6DSV_FIFO_DATA_OUT_Z_L 0x7D // FIFO Data Output Register -#define LSM6DSV_FIFO_DATA_OUT_Z_H 0x7E // FIFO Data Output Register - - - - -#define LSM6DSV_WHO_AM_I 0x0F // Device ID register -#define LSM6DSV_CTRL1 0x10 // Control register 1 -#define LSM6DSV_CTRL2 0x11 // Control register 2 -#define LSM6DSV_FIFO_STATUS1 0x1B -#define LSM6DSV_STATUS 0x1E // Status register -#define LSM6DSV_OUTX_L_A 0x28 // Accelerometer X-axis LSB -#define LSM6DSV_OUTX_H_A 0x29 // Accelerometer X-axis MSB -#define LSM6DSV_OUTY_L_A 0x2A // Accelerometer Y-axis LSB -#define LSM6DSV_OUTY_H_A 0x2B // Accelerometer Y-axis MSB -#define LSM6DSV_OUTZ_L_A 0x2C // Accelerometer Z-axis LSB -#define LSM6DSV_OUTZ_H_A 0x2D // Accelerometer Z-axis MSB -#define LSM6DSV_OUTX_L_G 0x22 // Gyroscope X-axis LSB -#define LSM6DSV_OUTX_H_G 0x23 // Gyroscope X-axis MSB -#define LSM6DSV_OUTY_L_G 0x24 // Gyroscope Y-axis LSB -#define LSM6DSV_OUTY_H_G 0x25 // Gyroscope Y-axis MSB -#define LSM6DSV_OUTZ_L_G 0x26 // Gyroscope Z-axis LSB -#define LSM6DSV_OUTZ_H_G 0x27 // Gyroscope Z-axis MSB - -#define LSM6DSV_SFLP_ODR 0x5E -#define SFLP_ODR_15HZ (0 << 3) -#define SFLP_ODR_30HZ (1 << 3) -#define SFLP_ODR_60HZ (2 << 3) -#define SFLP_ODR_120HZ (3 << 3) -#define SFLP_ODR_240HZ (4 << 3) -#define SFLP_ODR_480HZ (5 << 3) - - -#define LSM6DSV_EMB_FUNC_FIFO_EN_A 0x44 -#define SFLP_GAME_FIFO_EN (1 << 1) - -#define LSM6DSV_EMB_FUNC_INIT_A 0x66 -#define SFLP_GAME_INIT (1 << 1) - - - -typedef struct lsm6dsv_fifo_s -{ - uint8_t tag; - uint8_t count; - uint8_t data[6]; - uint16_t v[3]; - -} lsm6dsv_fifo_t; - -// Sensor data structure -typedef struct { - float acc_x; - float acc_y; - float acc_z; - float gyro_x; - float gyro_y; - float gyro_z; -} lsm6dsv_data_t; - -// Function declarations -esp_err_t lsm6dsv_init(int scl_pin, int sda_pin); -esp_err_t lsm6dsv_read_data(lsm6dsv_data_t *data); - -uint8_t lsm6dsv_fifo_ready(void); - -esp_err_t lsm6dsv_fifo_read(lsm6dsv_fifo_t *fifo); - -esp_err_t lsm6dsv_getAttitude(lsm6dsv_fifo_t *fifo, float *roll, float *pitch, float *yaw); +#pragma once + +#include +#include "esp_err.h" + +// LSM6DSV Register Addresses +#define LSM6DSV_ADDR 0x6A // I2C address (SA0=0) + +#define LSM6DSV_EMB_FUNC_EN_A 0x04 +#define SFLP_GAME_EN (1 << 1) + +#define LSM6DSV_FUNC_CFG_ACCESS 0x01 +#define LSM6DSV_EMB_FUNC_REG_ACCESS (1 << 7) + +// FIFO Registers +#define LSM6DSV_FIFO_CTRL1 0x07 // FIFO Control Register 1 +#define LSM6DSV_FIFO_CTRL2 0x08 // FIFO Control Register 2 +#define LSM6DSV_FIFO_CTRL3 0x09 // FIFO Control Register 3 +#define LSM6DSV_FIFO_CTRL4 0x0A // FIFO Control Register 4 + +#define FIFO_MODE_CONTINUOUS 0x06 + +#define LSM6DSV_FIFO_STATUS1 0x1B // FIFO Status Register 1 +#define LSM6DSV_FIFO_STATUS2 0x1C // FIFO Status Register 2 + +#define LSM6DSV_FIFO_DATA_OUT_TAG 0x78 // FIFO Data Output Register +#define LSM6DSV_FIFO_DATA_OUT_X_L 0x79 // FIFO Data Output Register +#define LSM6DSV_FIFO_DATA_OUT_X_H 0x7A // FIFO Data Output Register +#define LSM6DSV_FIFO_DATA_OUT_Y_L 0x7B // FIFO Data Output Register +#define LSM6DSV_FIFO_DATA_OUT_Y_H 0x7C // FIFO Data Output Register +#define LSM6DSV_FIFO_DATA_OUT_Z_L 0x7D // FIFO Data Output Register +#define LSM6DSV_FIFO_DATA_OUT_Z_H 0x7E // FIFO Data Output Register + + + + +#define LSM6DSV_WHO_AM_I 0x0F // Device ID register +#define LSM6DSV_CTRL1 0x10 // Control register 1 +#define LSM6DSV_CTRL2 0x11 // Control register 2 +#define LSM6DSV_FIFO_STATUS1 0x1B +#define LSM6DSV_STATUS 0x1E // Status register +#define LSM6DSV_OUTX_L_A 0x28 // Accelerometer X-axis LSB +#define LSM6DSV_OUTX_H_A 0x29 // Accelerometer X-axis MSB +#define LSM6DSV_OUTY_L_A 0x2A // Accelerometer Y-axis LSB +#define LSM6DSV_OUTY_H_A 0x2B // Accelerometer Y-axis MSB +#define LSM6DSV_OUTZ_L_A 0x2C // Accelerometer Z-axis LSB +#define LSM6DSV_OUTZ_H_A 0x2D // Accelerometer Z-axis MSB +#define LSM6DSV_OUTX_L_G 0x22 // Gyroscope X-axis LSB +#define LSM6DSV_OUTX_H_G 0x23 // Gyroscope X-axis MSB +#define LSM6DSV_OUTY_L_G 0x24 // Gyroscope Y-axis LSB +#define LSM6DSV_OUTY_H_G 0x25 // Gyroscope Y-axis MSB +#define LSM6DSV_OUTZ_L_G 0x26 // Gyroscope Z-axis LSB +#define LSM6DSV_OUTZ_H_G 0x27 // Gyroscope Z-axis MSB + +#define LSM6DSV_SFLP_ODR 0x5E +#define SFLP_ODR_15HZ (0 << 3) +#define SFLP_ODR_30HZ (1 << 3) +#define SFLP_ODR_60HZ (2 << 3) +#define SFLP_ODR_120HZ (3 << 3) +#define SFLP_ODR_240HZ (4 << 3) +#define SFLP_ODR_480HZ (5 << 3) + + +#define LSM6DSV_EMB_FUNC_FIFO_EN_A 0x44 +#define SFLP_GAME_FIFO_EN (1 << 1) + +#define LSM6DSV_EMB_FUNC_INIT_A 0x66 +#define SFLP_GAME_INIT (1 << 1) + + + +typedef struct lsm6dsv_fifo_s +{ + uint8_t tag; + uint8_t count; + uint8_t data[6]; + uint16_t v[3]; + +} lsm6dsv_fifo_t; + +// Sensor data structure +typedef struct { + float acc_x; + float acc_y; + float acc_z; + float gyro_x; + float gyro_y; + float gyro_z; +} lsm6dsv_data_t; + +// Function declarations +esp_err_t lsm6dsv_init(int scl_pin, int sda_pin); +esp_err_t lsm6dsv_read_data(lsm6dsv_data_t *data); + +uint8_t lsm6dsv_fifo_ready(void); + +esp_err_t lsm6dsv_fifo_read(lsm6dsv_fifo_t *fifo); + +esp_err_t lsm6dsv_getAttitude(lsm6dsv_fifo_t *fifo, float *roll, float *pitch, float *yaw); diff --git a/main/lv_conf.h b/main/lv_conf.h index edd290f..4fb98b2 100644 --- a/main/lv_conf.h +++ b/main/lv_conf.h @@ -1,1128 +1,1128 @@ -/** - * @file lv_conf.h - * Configuration file for v9.2.2 - */ - -/* - * Copy this file as `lv_conf.h` - * 1. simply next to the `lvgl` folder - * 2. or any other places and - * - define `LV_CONF_INCLUDE_SIMPLE` - * - add the path as include path - */ - -/* clang-format off */ -#if 1 /*Set it to "1" to enable content*/ - -#ifndef LV_CONF_H -#define LV_CONF_H - -/*If you need to include anything here, do it inside the `__ASSEMBLY__` guard */ -#if 0 && defined(__ASSEMBLY__) -#include "my_include.h" -#endif - -/*==================== - COLOR SETTINGS - *====================*/ - -/*Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ -#define LV_COLOR_DEPTH 16 - -/*========================= - STDLIB WRAPPER SETTINGS - *=========================*/ - -/* Possible values - * - LV_STDLIB_BUILTIN: LVGL's built in implementation - * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc - * - LV_STDLIB_MICROPYTHON: MicroPython implementation - * - LV_STDLIB_RTTHREAD: RT-Thread implementation - * - LV_STDLIB_CUSTOM: Implement the functions externally - */ -#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN -#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN -#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN - -#define LV_STDINT_INCLUDE -#define LV_STDDEF_INCLUDE -#define LV_STDBOOL_INCLUDE -#define LV_INTTYPES_INCLUDE -#define LV_LIMITS_INCLUDE -#define LV_STDARG_INCLUDE - -#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN - /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ - #define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/ - - /*Size of the memory expand for `lv_malloc()` in bytes*/ - #define LV_MEM_POOL_EXPAND_SIZE 0 - - /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ - #define LV_MEM_ADR 0 /*0: unused*/ - /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ - #if LV_MEM_ADR == 0 - #undef LV_MEM_POOL_INCLUDE - #undef LV_MEM_POOL_ALLOC - #endif -#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ - -/*==================== - HAL SETTINGS - *====================*/ - -/*Default display refresh, input device read and animation step period.*/ -#define LV_DEF_REFR_PERIOD 33 /*[ms]*/ - -/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. - *(Not so important, you can adjust it to modify default sizes and spaces)*/ -#define LV_DPI_DEF 130 /*[px/inch]*/ - -/*================= - * OPERATING SYSTEM - *=================*/ -/*Select an operating system to use. Possible options: - * - LV_OS_NONE - * - LV_OS_PTHREAD - * - LV_OS_FREERTOS - * - LV_OS_CMSIS_RTOS2 - * - LV_OS_RTTHREAD - * - LV_OS_WINDOWS - * - LV_OS_MQX - * - LV_OS_CUSTOM */ -#define LV_USE_OS LV_OS_NONE - -#if LV_USE_OS == LV_OS_CUSTOM - #define LV_OS_CUSTOM_INCLUDE -#endif -#if LV_USE_OS == LV_OS_FREERTOS - /* - * Unblocking an RTOS task with a direct notification is 45% faster and uses less RAM - * than unblocking a task using an intermediary object such as a binary semaphore. - * RTOS task notifications can only be used when there is only one task that can be the recipient of the event. - */ - #define LV_USE_FREERTOS_TASK_NOTIFY 1 -#endif - -/*======================== - * RENDERING CONFIGURATION - *========================*/ - -/*Align the stride of all layers and images to this bytes*/ -#define LV_DRAW_BUF_STRIDE_ALIGN 1 - -/*Align the start address of draw_buf addresses to this bytes*/ -#define LV_DRAW_BUF_ALIGN 4 - -/*Using matrix for transformations. - *Requirements: - `LV_USE_MATRIX = 1`. - The rendering engine needs to support 3x3 matrix transformations.*/ -#define LV_DRAW_TRANSFORM_USE_MATRIX 0 - -/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode - * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. - * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers - * and can't be drawn in chunks. */ - -/*The target buffer size for simple layer chunks.*/ -#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ - -/* The stack size of the drawing thread. - * NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more. - */ -#define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /*[bytes]*/ - -#define LV_USE_DRAW_SW 1 -#if LV_USE_DRAW_SW == 1 - - /* - * Selectively disable color format support in order to reduce code size. - * NOTE: some features use certain color formats internally, e.g. - * - gradients use RGB888 - * - bitmaps with transparency may use ARGB8888 - */ - - #define LV_DRAW_SW_SUPPORT_RGB565 1 - #define LV_DRAW_SW_SUPPORT_RGB565A8 1 - #define LV_DRAW_SW_SUPPORT_RGB888 1 - #define LV_DRAW_SW_SUPPORT_XRGB8888 1 - #define LV_DRAW_SW_SUPPORT_ARGB8888 1 - #define LV_DRAW_SW_SUPPORT_L8 1 - #define LV_DRAW_SW_SUPPORT_AL88 1 - #define LV_DRAW_SW_SUPPORT_A8 1 - #define LV_DRAW_SW_SUPPORT_I1 1 - - /* Set the number of draw unit. - * > 1 requires an operating system enabled in `LV_USE_OS` - * > 1 means multiple threads will render the screen in parallel */ - #define LV_DRAW_SW_DRAW_UNIT_CNT 1 - - /* Use Arm-2D to accelerate the sw render */ - #define LV_USE_DRAW_ARM2D_SYNC 0 - - /* Enable native helium assembly to be compiled */ - #define LV_USE_NATIVE_HELIUM_ASM 0 - - /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only - * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ - #define LV_DRAW_SW_COMPLEX 1 - - #if LV_DRAW_SW_COMPLEX == 1 - /*Allow buffering some shadow calculation. - *LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` - *Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/ - #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 - - /* Set number of maximally cached circle data. - * The circumference of 1/4 circle are saved for anti-aliasing - * radius * 4 bytes are used per circle (the most often used radiuses are saved) - * 0: to disable caching */ - #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 - #endif - - #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE - - #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM - #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" - #endif - - /* Enable drawing complex gradients in software: linear at an angle, radial or conical */ - #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 0 -#endif - -/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ -#define LV_USE_DRAW_VGLITE 0 - -#if LV_USE_DRAW_VGLITE - /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ - #define LV_USE_VGLITE_BLIT_SPLIT 0 - - #if LV_USE_OS - /* Use additional draw thread for VG-Lite processing.*/ - #define LV_USE_VGLITE_DRAW_THREAD 1 - - #if LV_USE_VGLITE_DRAW_THREAD - /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ - #define LV_USE_VGLITE_DRAW_ASYNC 1 - #endif - #endif - - /* Enable VGLite asserts. */ - #define LV_USE_VGLITE_ASSERT 0 -#endif - -/* Use NXP's PXP on iMX RTxxx platforms. */ -#define LV_USE_PXP 0 - -#if LV_USE_PXP - /* Use PXP for drawing.*/ - #define LV_USE_DRAW_PXP 1 - - /* Use PXP to rotate display.*/ - #define LV_USE_ROTATE_PXP 0 - - #if LV_USE_DRAW_PXP && LV_USE_OS - /* Use additional draw thread for PXP processing.*/ - #define LV_USE_PXP_DRAW_THREAD 1 - #endif - - /* Enable PXP asserts. */ - #define LV_USE_PXP_ASSERT 0 -#endif - -/* Use Renesas Dave2D on RA platforms. */ -#define LV_USE_DRAW_DAVE2D 0 - -/* Draw using cached SDL textures*/ -#define LV_USE_DRAW_SDL 0 - -/* Use VG-Lite GPU. */ -#define LV_USE_DRAW_VG_LITE 0 - -#if LV_USE_DRAW_VG_LITE - /* Enable VG-Lite custom external 'gpu_init()' function */ - #define LV_VG_LITE_USE_GPU_INIT 0 - - /* Enable VG-Lite assert. */ - #define LV_VG_LITE_USE_ASSERT 0 - - /* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ - #define LV_VG_LITE_FLUSH_MAX_COUNT 8 - - /* Enable border to simulate shadow - * NOTE: which usually improves performance, - * but does not guarantee the same rendering quality as the software. */ - #define LV_VG_LITE_USE_BOX_SHADOW 0 - - /* VG-Lite gradient maximum cache number. - * NOTE: The memory usage of a single gradient image is 4K bytes. - */ - #define LV_VG_LITE_GRAD_CACHE_CNT 32 - - /* VG-Lite stroke maximum cache number. - */ - #define LV_VG_LITE_STROKE_CACHE_CNT 32 - -#endif - -/*======================= - * FEATURE CONFIGURATION - *=======================*/ - -/*------------- - * Logging - *-----------*/ - -/*Enable the log module*/ -#define LV_USE_LOG 0 -#if LV_USE_LOG - - /*How important log should be added: - *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information - *LV_LOG_LEVEL_INFO Log important events - *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem - *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail - *LV_LOG_LEVEL_USER Only logs added by the user - *LV_LOG_LEVEL_NONE Do not log anything*/ - #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN - - /*1: Print the log with 'printf'; - *0: User need to register a callback with `lv_log_register_print_cb()`*/ - #define LV_LOG_PRINTF 0 - - /*Set callback to print the logs. - *E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)` - *Can be overwritten by `lv_log_register_print_cb`*/ - //#define LV_LOG_PRINT_CB - - /*1: Enable print timestamp; - *0: Disable print timestamp*/ - #define LV_LOG_USE_TIMESTAMP 1 - - /*1: Print file and line number of the log; - *0: Do not print file and line number of the log*/ - #define LV_LOG_USE_FILE_LINE 1 - - - /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ - #define LV_LOG_TRACE_MEM 1 - #define LV_LOG_TRACE_TIMER 1 - #define LV_LOG_TRACE_INDEV 1 - #define LV_LOG_TRACE_DISP_REFR 1 - #define LV_LOG_TRACE_EVENT 1 - #define LV_LOG_TRACE_OBJ_CREATE 1 - #define LV_LOG_TRACE_LAYOUT 1 - #define LV_LOG_TRACE_ANIM 1 - #define LV_LOG_TRACE_CACHE 1 - -#endif /*LV_USE_LOG*/ - -/*------------- - * Asserts - *-----------*/ - -/*Enable asserts if an operation is failed or an invalid data is found. - *If LV_USE_LOG is enabled an error message will be printed on failure*/ -#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ -#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ -#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ -#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ -#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ - -/*Add a custom handler when assert happens e.g. to restart the MCU*/ -#define LV_ASSERT_HANDLER_INCLUDE -#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ - -/*------------- - * Debug - *-----------*/ - -/*1: Draw random colored rectangles over the redrawn areas*/ -#define LV_USE_REFR_DEBUG 0 - -/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ -#define LV_USE_LAYER_DEBUG 0 - -/*1: Draw overlays with different colors for each draw_unit's tasks. - *Also add the index number of the draw unit on white background. - *For layers add the index number of the draw unit on black background.*/ -#define LV_USE_PARALLEL_DRAW_DEBUG 0 - -/*------------- - * Others - *-----------*/ - -#define LV_ENABLE_GLOBAL_CUSTOM 0 -#if LV_ENABLE_GLOBAL_CUSTOM - /*Header to include for the custom 'lv_global' function"*/ - #define LV_GLOBAL_CUSTOM_INCLUDE -#endif - -/*Default cache size in bytes. - *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. - *If size is not set to 0, the decoder will fail to decode when the cache is full. - *If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/ -#define LV_CACHE_DEF_SIZE 0 - -/*Default number of image header cache entries. The cache is used to store the headers of images - *The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/ -#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 - -/*Number of stops allowed per gradient. Increase this to allow more stops. - *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ -#define LV_GRADIENT_MAX_STOPS 2 - -/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. - * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ -#define LV_COLOR_MIX_ROUND_OFS 0 - -/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */ -#define LV_OBJ_STYLE_CACHE 0 - -/* Add `id` field to `lv_obj_t` */ -#define LV_USE_OBJ_ID 0 - -/* Automatically assign an ID when obj is created */ -#define LV_OBJ_ID_AUTO_ASSIGN LV_USE_OBJ_ID - -/*Use the builtin obj ID handler functions: -* - lv_obj_assign_id: Called when a widget is created. Use a separate counter for each widget class as an ID. -* - lv_obj_id_compare: Compare the ID to decide if it matches with a requested value. -* - lv_obj_stringify_id: Return e.g. "button3" -* - lv_obj_free_id: Does nothing, as there is no memory allocation for the ID. -* When disabled these functions needs to be implemented by the user.*/ -#define LV_USE_OBJ_ID_BUILTIN 1 - -/*Use obj property set/get API*/ -#define LV_USE_OBJ_PROPERTY 0 - -/*Enable property name support*/ -#define LV_USE_OBJ_PROPERTY_NAME 1 - -/* VG-Lite Simulator */ -/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ -#define LV_USE_VG_LITE_THORVG 0 - -#if LV_USE_VG_LITE_THORVG - - /*Enable LVGL's blend mode support*/ - #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 - - /*Enable YUV color format support*/ - #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 - - /*Enable Linear gradient extension support*/ - #define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT 0 - - /*Enable 16 pixels alignment*/ - #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 - - /*Buffer address alignment*/ - #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 - - /*Enable multi-thread render*/ - #define LV_VG_LITE_THORVG_THREAD_RENDER 0 - -#endif - -/*===================== - * COMPILER SETTINGS - *====================*/ - -/*For big endian systems set to 1*/ -#define LV_BIG_ENDIAN_SYSTEM 0 - -/*Define a custom attribute to `lv_tick_inc` function*/ -#define LV_ATTRIBUTE_TICK_INC - -/*Define a custom attribute to `lv_timer_handler` function*/ -#define LV_ATTRIBUTE_TIMER_HANDLER - -/*Define a custom attribute to `lv_display_flush_ready` function*/ -#define LV_ATTRIBUTE_FLUSH_READY - -/*Required alignment size for buffers*/ -#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 - -/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). - * E.g. __attribute__((aligned(4)))*/ -#define LV_ATTRIBUTE_MEM_ALIGN - -/*Attribute to mark large constant arrays for example font's bitmaps*/ -#define LV_ATTRIBUTE_LARGE_CONST - -/*Compiler prefix for a big array declaration in RAM*/ -#define LV_ATTRIBUTE_LARGE_RAM_ARRAY - -/*Place performance critical functions into a faster memory (e.g RAM)*/ -#define LV_ATTRIBUTE_FAST_MEM - -/*Export integer constant to binding. This macro is used with constants in the form of LV_ that - *should also appear on LVGL binding API such as MicroPython.*/ -#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ - -/*Prefix all global extern data with this*/ -#define LV_ATTRIBUTE_EXTERN_DATA - -/* Use `float` as `lv_value_precise_t` */ -#define LV_USE_FLOAT 0 - -/*Enable matrix support - *Requires `LV_USE_FLOAT = 1`*/ -#define LV_USE_MATRIX 0 - -/*Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default*/ -#define LV_USE_PRIVATE_API 0 - -/*================== - * FONT USAGE - *===================*/ - -/*Montserrat fonts with ASCII range and some symbols using bpp = 4 - *https://fonts.google.com/specimen/Montserrat*/ -#define LV_FONT_MONTSERRAT_8 0 -#define LV_FONT_MONTSERRAT_10 0 -#define LV_FONT_MONTSERRAT_12 0 -#define LV_FONT_MONTSERRAT_14 1 -#define LV_FONT_MONTSERRAT_16 0 -#define LV_FONT_MONTSERRAT_18 0 -#define LV_FONT_MONTSERRAT_20 0 -#define LV_FONT_MONTSERRAT_22 0 -#define LV_FONT_MONTSERRAT_24 0 -#define LV_FONT_MONTSERRAT_26 0 -#define LV_FONT_MONTSERRAT_28 0 -#define LV_FONT_MONTSERRAT_30 0 -#define LV_FONT_MONTSERRAT_32 0 -#define LV_FONT_MONTSERRAT_34 0 -#define LV_FONT_MONTSERRAT_36 0 -#define LV_FONT_MONTSERRAT_38 0 -#define LV_FONT_MONTSERRAT_40 0 -#define LV_FONT_MONTSERRAT_42 0 -#define LV_FONT_MONTSERRAT_44 0 -#define LV_FONT_MONTSERRAT_46 0 -#define LV_FONT_MONTSERRAT_48 0 - -/*Demonstrate special features*/ -#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ -#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ -#define LV_FONT_SIMSUN_14_CJK 0 /*1000 most common CJK radicals*/ -#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ - -/*Pixel perfect monospace fonts*/ -#define LV_FONT_UNSCII_8 0 -#define LV_FONT_UNSCII_16 0 - -/*Optionally declare custom fonts here. - *You can use these fonts as default font too and they will be available globally. - *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ -#define LV_FONT_CUSTOM_DECLARE - -/*Always set a default font*/ -#define LV_FONT_DEFAULT &lv_font_montserrat_14 - -/*Enable handling large font and/or fonts with a lot of characters. - *The limit depends on the font size, font face and bpp. - *Compiler error will be triggered if a font needs it.*/ -#define LV_FONT_FMT_TXT_LARGE 0 - -/*Enables/disables support for compressed fonts.*/ -#define LV_USE_FONT_COMPRESSED 0 - -/*Enable drawing placeholders when glyph dsc is not found*/ -#define LV_USE_FONT_PLACEHOLDER 1 - -/*================= - * TEXT SETTINGS - *=================*/ - -/** - * Select a character encoding for strings. - * Your IDE or editor should have the same character encoding - * - LV_TXT_ENC_UTF8 - * - LV_TXT_ENC_ASCII - */ -#define LV_TXT_ENC LV_TXT_ENC_UTF8 - -/*Can break (wrap) texts on these chars*/ -#define LV_TXT_BREAK_CHARS " ,.;:-_)]}" - -/*If a word is at least this long, will break wherever "prettiest" - *To disable, set to a value <= 0*/ -#define LV_TXT_LINE_BREAK_LONG_LEN 0 - -/*Minimum number of characters in a long word to put on a line before a break. - *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ -#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 - -/*Minimum number of characters in a long word to put on a line after a break. - *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ -#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 - -/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. - *The direction will be processed according to the Unicode Bidirectional Algorithm: - *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ -#define LV_USE_BIDI 0 -#if LV_USE_BIDI - /*Set the default direction. Supported values: - *`LV_BASE_DIR_LTR` Left-to-Right - *`LV_BASE_DIR_RTL` Right-to-Left - *`LV_BASE_DIR_AUTO` detect texts base direction*/ - #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO -#endif - -/*Enable Arabic/Persian processing - *In these languages characters should be replaced with another form based on their position in the text*/ -#define LV_USE_ARABIC_PERSIAN_CHARS 0 - -/*================== - * WIDGETS - *================*/ - -/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ - -#define LV_WIDGETS_HAS_DEFAULT_VALUE 1 - -#define LV_USE_ANIMIMG 1 - -#define LV_USE_ARC 1 - -#define LV_USE_BAR 1 - -#define LV_USE_BUTTON 1 - -#define LV_USE_BUTTONMATRIX 1 - -#define LV_USE_CALENDAR 1 -#if LV_USE_CALENDAR - #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 - #if LV_CALENDAR_WEEK_STARTS_MONDAY - #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} - #else - #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} - #endif - - #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} - #define LV_USE_CALENDAR_HEADER_ARROW 1 - #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 - #define LV_USE_CALENDAR_CHINESE 0 -#endif /*LV_USE_CALENDAR*/ - -#define LV_USE_CANVAS 1 - -#define LV_USE_CHART 1 - -#define LV_USE_CHECKBOX 1 - -#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ - -#define LV_USE_IMAGE 1 /*Requires: lv_label*/ - -#define LV_USE_IMAGEBUTTON 1 - -#define LV_USE_KEYBOARD 1 - -#define LV_USE_LABEL 1 -#if LV_USE_LABEL - #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ - #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ - #define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/ -#endif - -#define LV_USE_LED 1 - -#define LV_USE_LINE 1 - -#define LV_USE_LIST 1 - -#define LV_USE_LOTTIE 0 /*Requires: lv_canvas, thorvg */ - -#define LV_USE_MENU 1 - -#define LV_USE_MSGBOX 1 - -#define LV_USE_ROLLER 1 /*Requires: lv_label*/ - -#define LV_USE_SCALE 1 - -#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ - -#define LV_USE_SPAN 1 -#if LV_USE_SPAN - /*A line text can contain maximum num of span descriptor */ - #define LV_SPAN_SNIPPET_STACK_SIZE 64 -#endif - -#define LV_USE_SPINBOX 1 - -#define LV_USE_SPINNER 1 - -#define LV_USE_SWITCH 1 - -#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ -#if LV_USE_TEXTAREA != 0 - #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ -#endif - -#define LV_USE_TABLE 1 - -#define LV_USE_TABVIEW 1 - -#define LV_USE_TILEVIEW 1 - -#define LV_USE_WIN 1 - -/*================== - * THEMES - *==================*/ - -/*A simple, impressive and very complete theme*/ -#define LV_USE_THEME_DEFAULT 1 -#if LV_USE_THEME_DEFAULT - - /*0: Light mode; 1: Dark mode*/ - #define LV_THEME_DEFAULT_DARK 0 - - /*1: Enable grow on press*/ - #define LV_THEME_DEFAULT_GROW 1 - - /*Default transition time in [ms]*/ - #define LV_THEME_DEFAULT_TRANSITION_TIME 80 -#endif /*LV_USE_THEME_DEFAULT*/ - -/*A very simple theme that is a good starting point for a custom theme*/ -#define LV_USE_THEME_SIMPLE 1 - -/*A theme designed for monochrome displays*/ -#define LV_USE_THEME_MONO 1 - -/*================== - * LAYOUTS - *==================*/ - -/*A layout similar to Flexbox in CSS.*/ -#define LV_USE_FLEX 1 - -/*A layout similar to Grid in CSS.*/ -#define LV_USE_GRID 1 - -/*==================== - * 3RD PARTS LIBRARIES - *====================*/ - -/*File system interfaces for common APIs */ - -/*Setting a default driver letter allows skipping the driver prefix in filepaths*/ -#define LV_FS_DEFAULT_DRIVE_LETTER '\0' - -/*API for fopen, fread, etc*/ -#define LV_USE_FS_STDIO 0 -#if LV_USE_FS_STDIO - #define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ - #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ - #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ -#endif - -/*API for open, read, etc*/ -#define LV_USE_FS_POSIX 0 -#if LV_USE_FS_POSIX - #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ - #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ - #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ -#endif - -/*API for CreateFile, ReadFile, etc*/ -#define LV_USE_FS_WIN32 0 -#if LV_USE_FS_WIN32 - #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ - #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ - #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ -#endif - -/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ -#define LV_USE_FS_FATFS 0 -#if LV_USE_FS_FATFS - #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ - #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ -#endif - -/*API for memory-mapped file access. */ -#define LV_USE_FS_MEMFS 0 -#if LV_USE_FS_MEMFS - #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ -#endif - -/*API for LittleFs. */ -#define LV_USE_FS_LITTLEFS 0 -#if LV_USE_FS_LITTLEFS - #define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ -#endif - -/*API for Arduino LittleFs. */ -#define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0 -#if LV_USE_FS_ARDUINO_ESP_LITTLEFS - #define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ -#endif - -/*API for Arduino Sd. */ -#define LV_USE_FS_ARDUINO_SD 0 -#if LV_USE_FS_ARDUINO_SD - #define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ -#endif - -/*LODEPNG decoder library*/ -#define LV_USE_LODEPNG 0 - -/*PNG decoder(libpng) library*/ -#define LV_USE_LIBPNG 0 - -/*BMP decoder library*/ -#define LV_USE_BMP 0 - -/* JPG + split JPG decoder library. - * Split JPG is a custom format optimized for embedded systems. */ -#define LV_USE_TJPGD 0 - -/* libjpeg-turbo decoder library. - * Supports complete JPEG specifications and high-performance JPEG decoding. */ -#define LV_USE_LIBJPEG_TURBO 0 - -/*GIF decoder library*/ -#define LV_USE_GIF 0 -#if LV_USE_GIF - /*GIF decoder accelerate*/ - #define LV_GIF_CACHE_DECODE_DATA 0 -#endif - - -/*Decode bin images to RAM*/ -#define LV_BIN_DECODER_RAM_LOAD 0 - -/*RLE decompress library*/ -#define LV_USE_RLE 0 - -/*QR code library*/ -#define LV_USE_QRCODE 0 - -/*Barcode code library*/ -#define LV_USE_BARCODE 0 - -/*FreeType library*/ -#define LV_USE_FREETYPE 0 -#if LV_USE_FREETYPE - /*Let FreeType to use LVGL memory and file porting*/ - #define LV_FREETYPE_USE_LVGL_PORT 0 - - /*Cache count of the glyphs in FreeType. It means the number of glyphs that can be cached. - *The higher the value, the more memory will be used.*/ - #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 -#endif - -/* Built-in TTF decoder */ -#define LV_USE_TINY_TTF 0 -#if LV_USE_TINY_TTF - /* Enable loading TTF data from files */ - #define LV_TINY_TTF_FILE_SUPPORT 0 - #define LV_TINY_TTF_CACHE_GLYPH_CNT 256 -#endif - -/*Rlottie library*/ -#define LV_USE_RLOTTIE 0 - -/*Enable Vector Graphic APIs - *Requires `LV_USE_MATRIX = 1`*/ -#define LV_USE_VECTOR_GRAPHIC 0 - -/* Enable ThorVG (vector graphics library) from the src/libs folder */ -#define LV_USE_THORVG_INTERNAL 0 - -/* Enable ThorVG by assuming that its installed and linked to the project */ -#define LV_USE_THORVG_EXTERNAL 0 - -/*Use lvgl built-in LZ4 lib*/ -#define LV_USE_LZ4_INTERNAL 0 - -/*Use external LZ4 library*/ -#define LV_USE_LZ4_EXTERNAL 0 - -/*FFmpeg library for image decoding and playing videos - *Supports all major image formats so do not enable other image decoder with it*/ -#define LV_USE_FFMPEG 0 -#if LV_USE_FFMPEG - /*Dump input information to stderr*/ - #define LV_FFMPEG_DUMP_FORMAT 0 -#endif - -/*================== - * OTHERS - *==================*/ - -/*1: Enable API to take snapshot for object*/ -#define LV_USE_SNAPSHOT 0 - -/*1: Enable system monitor component*/ -#define LV_USE_SYSMON 0 -#if LV_USE_SYSMON - /*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/ - #define LV_SYSMON_GET_IDLE lv_timer_get_idle - - /*1: Show CPU usage and FPS count - * Requires `LV_USE_SYSMON = 1`*/ - #define LV_USE_PERF_MONITOR 0 - #if LV_USE_PERF_MONITOR - #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT - - /*0: Displays performance data on the screen, 1: Prints performance data using log.*/ - #define LV_USE_PERF_MONITOR_LOG_MODE 0 - #endif - - /*1: Show the used memory and the memory fragmentation - * Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` - * Requires `LV_USE_SYSMON = 1`*/ - #define LV_USE_MEM_MONITOR 0 - #if LV_USE_MEM_MONITOR - #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT - #endif - -#endif /*LV_USE_SYSMON*/ - -/*1: Enable the runtime performance profiler*/ -#define LV_USE_PROFILER 0 -#if LV_USE_PROFILER - /*1: Enable the built-in profiler*/ - #define LV_USE_PROFILER_BUILTIN 1 - #if LV_USE_PROFILER_BUILTIN - /*Default profiler trace buffer size*/ - #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/ - #endif - - /*Header to include for the profiler*/ - #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" - - /*Profiler start point function*/ - #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN - - /*Profiler end point function*/ - #define LV_PROFILER_END LV_PROFILER_BUILTIN_END - - /*Profiler start point function with custom tag*/ - #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG - - /*Profiler end point function with custom tag*/ - #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG -#endif - -/*1: Enable Monkey test*/ -#define LV_USE_MONKEY 0 - -/*1: Enable grid navigation*/ -#define LV_USE_GRIDNAV 0 - -/*1: Enable lv_obj fragment*/ -#define LV_USE_FRAGMENT 0 - -/*1: Support using images as font in label or span widgets */ -#define LV_USE_IMGFONT 0 - -/*1: Enable an observer pattern implementation*/ -#define LV_USE_OBSERVER 1 - -/*1: Enable Pinyin input method*/ -/*Requires: lv_keyboard*/ -#define LV_USE_IME_PINYIN 0 -#if LV_USE_IME_PINYIN - /*1: Use default thesaurus*/ - /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesaurus*/ - #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 - /*Set the maximum number of candidate panels that can be displayed*/ - /*This needs to be adjusted according to the size of the screen*/ - #define LV_IME_PINYIN_CAND_TEXT_NUM 6 - - /*Use 9 key input(k9)*/ - #define LV_IME_PINYIN_USE_K9_MODE 1 - #if LV_IME_PINYIN_USE_K9_MODE == 1 - #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 - #endif /*LV_IME_PINYIN_USE_K9_MODE*/ -#endif - -/*1: Enable file explorer*/ -/*Requires: lv_table*/ -#define LV_USE_FILE_EXPLORER 0 -#if LV_USE_FILE_EXPLORER - /*Maximum length of path*/ - #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) - /*Quick access bar, 1:use, 0:not use*/ - /*Requires: lv_list*/ - #define LV_FILE_EXPLORER_QUICK_ACCESS 1 -#endif - -/*================== - * DEVICES - *==================*/ - -/*Use SDL to open window on PC and handle mouse and keyboard*/ -#define LV_USE_SDL 0 -#if LV_USE_SDL - #define LV_SDL_INCLUDE_PATH - #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/ - #define LV_SDL_BUF_COUNT 1 /*1 or 2*/ - #define LV_SDL_ACCELERATED 1 /*1: Use hardware acceleration*/ - #define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/ - #define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/ - #define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/ -#endif - -/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/ -#define LV_USE_X11 0 -#if LV_USE_X11 - #define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/ - #define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for rendering*/ - /*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/ - #define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/ - #define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/ - #define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/ -#endif - -/*Use Wayland to open a window and handle input on Linux or BSD desktops */ -#define LV_USE_WAYLAND 0 -#if LV_USE_WAYLAND - #define LV_WAYLAND_WINDOW_DECORATIONS 0 /*Draw client side window decorations only necessary on Mutter/GNOME*/ - #define LV_WAYLAND_WL_SHELL 0 /*Use the legacy wl_shell protocol instead of the default XDG shell*/ -#endif - -/*Driver for /dev/fb*/ -#define LV_USE_LINUX_FBDEV 0 -#if LV_USE_LINUX_FBDEV - #define LV_LINUX_FBDEV_BSD 0 - #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL - #define LV_LINUX_FBDEV_BUFFER_COUNT 0 - #define LV_LINUX_FBDEV_BUFFER_SIZE 60 -#endif - -/*Use Nuttx to open window and handle touchscreen*/ -#define LV_USE_NUTTX 0 - -#if LV_USE_NUTTX - #define LV_USE_NUTTX_LIBUV 0 - - /*Use Nuttx custom init API to open window and handle touchscreen*/ - #define LV_USE_NUTTX_CUSTOM_INIT 0 - - /*Driver for /dev/lcd*/ - #define LV_USE_NUTTX_LCD 0 - #if LV_USE_NUTTX_LCD - #define LV_NUTTX_LCD_BUFFER_COUNT 0 - #define LV_NUTTX_LCD_BUFFER_SIZE 60 - #endif - - /*Driver for /dev/input*/ - #define LV_USE_NUTTX_TOUCHSCREEN 0 - -#endif - -/*Driver for /dev/dri/card*/ -#define LV_USE_LINUX_DRM 0 - -/*Interface for TFT_eSPI*/ -#define LV_USE_TFT_ESPI 0 - -/*Driver for evdev input devices*/ -#define LV_USE_EVDEV 0 - -/*Driver for libinput input devices*/ -#define LV_USE_LIBINPUT 0 - -#if LV_USE_LIBINPUT - #define LV_LIBINPUT_BSD 0 - - /*Full keyboard support*/ - #define LV_LIBINPUT_XKB 0 - #if LV_LIBINPUT_XKB - /*"setxkbmap -query" can help find the right values for your keyboard*/ - #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } - #endif -#endif - -/*Drivers for LCD devices connected via SPI/parallel port*/ -#define LV_USE_ST7735 0 -#define LV_USE_ST7789 0 -#define LV_USE_ST7796 0 -#define LV_USE_ILI9341 0 - -#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) - -/*Driver for Renesas GLCD*/ -#define LV_USE_RENESAS_GLCDC 0 - -/* LVGL Windows backend */ -#define LV_USE_WINDOWS 0 - -/* Use OpenGL to open window on PC and handle mouse and keyboard */ -#define LV_USE_OPENGLES 0 -#if LV_USE_OPENGLES - #define LV_USE_OPENGLES_DEBUG 1 /* Enable or disable debug for opengles */ -#endif - -/* QNX Screen display and input drivers */ -#define LV_USE_QNX 0 -#if LV_USE_QNX - #define LV_QNX_BUF_COUNT 1 /*1 or 2*/ -#endif - -/*================== -* EXAMPLES -*==================*/ - -/*Enable the examples to be built with the library*/ -#define LV_BUILD_EXAMPLES 1 - -/*=================== - * DEMO USAGE - ====================*/ - -/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ -#define LV_USE_DEMO_WIDGETS 0 - -/*Demonstrate the usage of encoder and keyboard*/ -#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 - -/*Benchmark your system*/ -#define LV_USE_DEMO_BENCHMARK 0 - -/*Render test for each primitives. Requires at least 480x272 display*/ -#define LV_USE_DEMO_RENDER 0 - -/*Stress test for LVGL*/ -#define LV_USE_DEMO_STRESS 0 - -/*Music player demo*/ -#define LV_USE_DEMO_MUSIC 0 -#if LV_USE_DEMO_MUSIC - #define LV_DEMO_MUSIC_SQUARE 0 - #define LV_DEMO_MUSIC_LANDSCAPE 0 - #define LV_DEMO_MUSIC_ROUND 0 - #define LV_DEMO_MUSIC_LARGE 0 - #define LV_DEMO_MUSIC_AUTO_PLAY 0 -#endif - -/*Flex layout demo*/ -#define LV_USE_DEMO_FLEX_LAYOUT 0 - -/*Smart-phone like multi-language demo*/ -#define LV_USE_DEMO_MULTILANG 0 - -/*Widget transformation demo*/ -#define LV_USE_DEMO_TRANSFORM 0 - -/*Demonstrate scroll settings*/ -#define LV_USE_DEMO_SCROLL 0 - -/*Vector graphic demo*/ -#define LV_USE_DEMO_VECTOR_GRAPHIC 0 - -#define LV_COLOR_16_SWAP 1 -/*--END OF LV_CONF_H--*/ - -#endif /*LV_CONF_H*/ - -#endif /*End of "Content enable"*/ +/** + * @file lv_conf.h + * Configuration file for v9.2.2 + */ + +/* + * Copy this file as `lv_conf.h` + * 1. simply next to the `lvgl` folder + * 2. or any other places and + * - define `LV_CONF_INCLUDE_SIMPLE` + * - add the path as include path + */ + +/* clang-format off */ +#if 1 /*Set it to "1" to enable content*/ + +#ifndef LV_CONF_H +#define LV_CONF_H + +/*If you need to include anything here, do it inside the `__ASSEMBLY__` guard */ +#if 0 && defined(__ASSEMBLY__) +#include "my_include.h" +#endif + +/*==================== + COLOR SETTINGS + *====================*/ + +/*Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ +#define LV_COLOR_DEPTH 16 + +/*========================= + STDLIB WRAPPER SETTINGS + *=========================*/ + +/* Possible values + * - LV_STDLIB_BUILTIN: LVGL's built in implementation + * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc + * - LV_STDLIB_MICROPYTHON: MicroPython implementation + * - LV_STDLIB_RTTHREAD: RT-Thread implementation + * - LV_STDLIB_CUSTOM: Implement the functions externally + */ +#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN +#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN +#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN + +#define LV_STDINT_INCLUDE +#define LV_STDDEF_INCLUDE +#define LV_STDBOOL_INCLUDE +#define LV_INTTYPES_INCLUDE +#define LV_LIMITS_INCLUDE +#define LV_STDARG_INCLUDE + +#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN + /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ + #define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/ + + /*Size of the memory expand for `lv_malloc()` in bytes*/ + #define LV_MEM_POOL_EXPAND_SIZE 0 + + /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ + #define LV_MEM_ADR 0 /*0: unused*/ + /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ + #if LV_MEM_ADR == 0 + #undef LV_MEM_POOL_INCLUDE + #undef LV_MEM_POOL_ALLOC + #endif +#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ + +/*==================== + HAL SETTINGS + *====================*/ + +/*Default display refresh, input device read and animation step period.*/ +#define LV_DEF_REFR_PERIOD 33 /*[ms]*/ + +/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. + *(Not so important, you can adjust it to modify default sizes and spaces)*/ +#define LV_DPI_DEF 130 /*[px/inch]*/ + +/*================= + * OPERATING SYSTEM + *=================*/ +/*Select an operating system to use. Possible options: + * - LV_OS_NONE + * - LV_OS_PTHREAD + * - LV_OS_FREERTOS + * - LV_OS_CMSIS_RTOS2 + * - LV_OS_RTTHREAD + * - LV_OS_WINDOWS + * - LV_OS_MQX + * - LV_OS_CUSTOM */ +#define LV_USE_OS LV_OS_NONE + +#if LV_USE_OS == LV_OS_CUSTOM + #define LV_OS_CUSTOM_INCLUDE +#endif +#if LV_USE_OS == LV_OS_FREERTOS + /* + * Unblocking an RTOS task with a direct notification is 45% faster and uses less RAM + * than unblocking a task using an intermediary object such as a binary semaphore. + * RTOS task notifications can only be used when there is only one task that can be the recipient of the event. + */ + #define LV_USE_FREERTOS_TASK_NOTIFY 1 +#endif + +/*======================== + * RENDERING CONFIGURATION + *========================*/ + +/*Align the stride of all layers and images to this bytes*/ +#define LV_DRAW_BUF_STRIDE_ALIGN 1 + +/*Align the start address of draw_buf addresses to this bytes*/ +#define LV_DRAW_BUF_ALIGN 4 + +/*Using matrix for transformations. + *Requirements: + `LV_USE_MATRIX = 1`. + The rendering engine needs to support 3x3 matrix transformations.*/ +#define LV_DRAW_TRANSFORM_USE_MATRIX 0 + +/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode + * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. + * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers + * and can't be drawn in chunks. */ + +/*The target buffer size for simple layer chunks.*/ +#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + +/* The stack size of the drawing thread. + * NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more. + */ +#define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /*[bytes]*/ + +#define LV_USE_DRAW_SW 1 +#if LV_USE_DRAW_SW == 1 + + /* + * Selectively disable color format support in order to reduce code size. + * NOTE: some features use certain color formats internally, e.g. + * - gradients use RGB888 + * - bitmaps with transparency may use ARGB8888 + */ + + #define LV_DRAW_SW_SUPPORT_RGB565 1 + #define LV_DRAW_SW_SUPPORT_RGB565A8 1 + #define LV_DRAW_SW_SUPPORT_RGB888 1 + #define LV_DRAW_SW_SUPPORT_XRGB8888 1 + #define LV_DRAW_SW_SUPPORT_ARGB8888 1 + #define LV_DRAW_SW_SUPPORT_L8 1 + #define LV_DRAW_SW_SUPPORT_AL88 1 + #define LV_DRAW_SW_SUPPORT_A8 1 + #define LV_DRAW_SW_SUPPORT_I1 1 + + /* Set the number of draw unit. + * > 1 requires an operating system enabled in `LV_USE_OS` + * > 1 means multiple threads will render the screen in parallel */ + #define LV_DRAW_SW_DRAW_UNIT_CNT 1 + + /* Use Arm-2D to accelerate the sw render */ + #define LV_USE_DRAW_ARM2D_SYNC 0 + + /* Enable native helium assembly to be compiled */ + #define LV_USE_NATIVE_HELIUM_ASM 0 + + /* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only + * 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */ + #define LV_DRAW_SW_COMPLEX 1 + + #if LV_DRAW_SW_COMPLEX == 1 + /*Allow buffering some shadow calculation. + *LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` + *Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/ + #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 + + /* Set number of maximally cached circle data. + * The circumference of 1/4 circle are saved for anti-aliasing + * radius * 4 bytes are used per circle (the most often used radiuses are saved) + * 0: to disable caching */ + #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 + #endif + + #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE + + #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM + #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" + #endif + + /* Enable drawing complex gradients in software: linear at an angle, radial or conical */ + #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 0 +#endif + +/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ +#define LV_USE_DRAW_VGLITE 0 + +#if LV_USE_DRAW_VGLITE + /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ + #define LV_USE_VGLITE_BLIT_SPLIT 0 + + #if LV_USE_OS + /* Use additional draw thread for VG-Lite processing.*/ + #define LV_USE_VGLITE_DRAW_THREAD 1 + + #if LV_USE_VGLITE_DRAW_THREAD + /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ + #define LV_USE_VGLITE_DRAW_ASYNC 1 + #endif + #endif + + /* Enable VGLite asserts. */ + #define LV_USE_VGLITE_ASSERT 0 +#endif + +/* Use NXP's PXP on iMX RTxxx platforms. */ +#define LV_USE_PXP 0 + +#if LV_USE_PXP + /* Use PXP for drawing.*/ + #define LV_USE_DRAW_PXP 1 + + /* Use PXP to rotate display.*/ + #define LV_USE_ROTATE_PXP 0 + + #if LV_USE_DRAW_PXP && LV_USE_OS + /* Use additional draw thread for PXP processing.*/ + #define LV_USE_PXP_DRAW_THREAD 1 + #endif + + /* Enable PXP asserts. */ + #define LV_USE_PXP_ASSERT 0 +#endif + +/* Use Renesas Dave2D on RA platforms. */ +#define LV_USE_DRAW_DAVE2D 0 + +/* Draw using cached SDL textures*/ +#define LV_USE_DRAW_SDL 0 + +/* Use VG-Lite GPU. */ +#define LV_USE_DRAW_VG_LITE 0 + +#if LV_USE_DRAW_VG_LITE + /* Enable VG-Lite custom external 'gpu_init()' function */ + #define LV_VG_LITE_USE_GPU_INIT 0 + + /* Enable VG-Lite assert. */ + #define LV_VG_LITE_USE_ASSERT 0 + + /* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ + #define LV_VG_LITE_FLUSH_MAX_COUNT 8 + + /* Enable border to simulate shadow + * NOTE: which usually improves performance, + * but does not guarantee the same rendering quality as the software. */ + #define LV_VG_LITE_USE_BOX_SHADOW 0 + + /* VG-Lite gradient maximum cache number. + * NOTE: The memory usage of a single gradient image is 4K bytes. + */ + #define LV_VG_LITE_GRAD_CACHE_CNT 32 + + /* VG-Lite stroke maximum cache number. + */ + #define LV_VG_LITE_STROKE_CACHE_CNT 32 + +#endif + +/*======================= + * FEATURE CONFIGURATION + *=======================*/ + +/*------------- + * Logging + *-----------*/ + +/*Enable the log module*/ +#define LV_USE_LOG 0 +#if LV_USE_LOG + + /*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN + + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ + #define LV_LOG_PRINTF 0 + + /*Set callback to print the logs. + *E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)` + *Can be overwritten by `lv_log_register_print_cb`*/ + //#define LV_LOG_PRINT_CB + + /*1: Enable print timestamp; + *0: Disable print timestamp*/ + #define LV_LOG_USE_TIMESTAMP 1 + + /*1: Print file and line number of the log; + *0: Do not print file and line number of the log*/ + #define LV_LOG_USE_FILE_LINE 1 + + + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + #define LV_LOG_TRACE_MEM 1 + #define LV_LOG_TRACE_TIMER 1 + #define LV_LOG_TRACE_INDEV 1 + #define LV_LOG_TRACE_DISP_REFR 1 + #define LV_LOG_TRACE_EVENT 1 + #define LV_LOG_TRACE_OBJ_CREATE 1 + #define LV_LOG_TRACE_LAYOUT 1 + #define LV_LOG_TRACE_ANIM 1 + #define LV_LOG_TRACE_CACHE 1 + +#endif /*LV_USE_LOG*/ + +/*------------- + * Asserts + *-----------*/ + +/*Enable asserts if an operation is failed or an invalid data is found. + *If LV_USE_LOG is enabled an error message will be printed on failure*/ +#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ +#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ +#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ + +/*Add a custom handler when assert happens e.g. to restart the MCU*/ +#define LV_ASSERT_HANDLER_INCLUDE +#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ + +/*------------- + * Debug + *-----------*/ + +/*1: Draw random colored rectangles over the redrawn areas*/ +#define LV_USE_REFR_DEBUG 0 + +/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ +#define LV_USE_LAYER_DEBUG 0 + +/*1: Draw overlays with different colors for each draw_unit's tasks. + *Also add the index number of the draw unit on white background. + *For layers add the index number of the draw unit on black background.*/ +#define LV_USE_PARALLEL_DRAW_DEBUG 0 + +/*------------- + * Others + *-----------*/ + +#define LV_ENABLE_GLOBAL_CUSTOM 0 +#if LV_ENABLE_GLOBAL_CUSTOM + /*Header to include for the custom 'lv_global' function"*/ + #define LV_GLOBAL_CUSTOM_INCLUDE +#endif + +/*Default cache size in bytes. + *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. + *If size is not set to 0, the decoder will fail to decode when the cache is full. + *If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/ +#define LV_CACHE_DEF_SIZE 0 + +/*Default number of image header cache entries. The cache is used to store the headers of images + *The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/ +#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 + +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 + +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS 0 + +/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */ +#define LV_OBJ_STYLE_CACHE 0 + +/* Add `id` field to `lv_obj_t` */ +#define LV_USE_OBJ_ID 0 + +/* Automatically assign an ID when obj is created */ +#define LV_OBJ_ID_AUTO_ASSIGN LV_USE_OBJ_ID + +/*Use the builtin obj ID handler functions: +* - lv_obj_assign_id: Called when a widget is created. Use a separate counter for each widget class as an ID. +* - lv_obj_id_compare: Compare the ID to decide if it matches with a requested value. +* - lv_obj_stringify_id: Return e.g. "button3" +* - lv_obj_free_id: Does nothing, as there is no memory allocation for the ID. +* When disabled these functions needs to be implemented by the user.*/ +#define LV_USE_OBJ_ID_BUILTIN 1 + +/*Use obj property set/get API*/ +#define LV_USE_OBJ_PROPERTY 0 + +/*Enable property name support*/ +#define LV_USE_OBJ_PROPERTY_NAME 1 + +/* VG-Lite Simulator */ +/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ +#define LV_USE_VG_LITE_THORVG 0 + +#if LV_USE_VG_LITE_THORVG + + /*Enable LVGL's blend mode support*/ + #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 + + /*Enable YUV color format support*/ + #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 + + /*Enable Linear gradient extension support*/ + #define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT 0 + + /*Enable 16 pixels alignment*/ + #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 + + /*Buffer address alignment*/ + #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 + + /*Enable multi-thread render*/ + #define LV_VG_LITE_THORVG_THREAD_RENDER 0 + +#endif + +/*===================== + * COMPILER SETTINGS + *====================*/ + +/*For big endian systems set to 1*/ +#define LV_BIG_ENDIAN_SYSTEM 0 + +/*Define a custom attribute to `lv_tick_inc` function*/ +#define LV_ATTRIBUTE_TICK_INC + +/*Define a custom attribute to `lv_timer_handler` function*/ +#define LV_ATTRIBUTE_TIMER_HANDLER + +/*Define a custom attribute to `lv_display_flush_ready` function*/ +#define LV_ATTRIBUTE_FLUSH_READY + +/*Required alignment size for buffers*/ +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 + +/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). + * E.g. __attribute__((aligned(4)))*/ +#define LV_ATTRIBUTE_MEM_ALIGN + +/*Attribute to mark large constant arrays for example font's bitmaps*/ +#define LV_ATTRIBUTE_LARGE_CONST + +/*Compiler prefix for a big array declaration in RAM*/ +#define LV_ATTRIBUTE_LARGE_RAM_ARRAY + +/*Place performance critical functions into a faster memory (e.g RAM)*/ +#define LV_ATTRIBUTE_FAST_MEM + +/*Export integer constant to binding. This macro is used with constants in the form of LV_ that + *should also appear on LVGL binding API such as MicroPython.*/ +#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ + +/*Prefix all global extern data with this*/ +#define LV_ATTRIBUTE_EXTERN_DATA + +/* Use `float` as `lv_value_precise_t` */ +#define LV_USE_FLOAT 0 + +/*Enable matrix support + *Requires `LV_USE_FLOAT = 1`*/ +#define LV_USE_MATRIX 0 + +/*Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default*/ +#define LV_USE_PRIVATE_API 0 + +/*================== + * FONT USAGE + *===================*/ + +/*Montserrat fonts with ASCII range and some symbols using bpp = 4 + *https://fonts.google.com/specimen/Montserrat*/ +#define LV_FONT_MONTSERRAT_8 0 +#define LV_FONT_MONTSERRAT_10 0 +#define LV_FONT_MONTSERRAT_12 0 +#define LV_FONT_MONTSERRAT_14 1 +#define LV_FONT_MONTSERRAT_16 0 +#define LV_FONT_MONTSERRAT_18 0 +#define LV_FONT_MONTSERRAT_20 0 +#define LV_FONT_MONTSERRAT_22 0 +#define LV_FONT_MONTSERRAT_24 0 +#define LV_FONT_MONTSERRAT_26 0 +#define LV_FONT_MONTSERRAT_28 0 +#define LV_FONT_MONTSERRAT_30 0 +#define LV_FONT_MONTSERRAT_32 0 +#define LV_FONT_MONTSERRAT_34 0 +#define LV_FONT_MONTSERRAT_36 0 +#define LV_FONT_MONTSERRAT_38 0 +#define LV_FONT_MONTSERRAT_40 0 +#define LV_FONT_MONTSERRAT_42 0 +#define LV_FONT_MONTSERRAT_44 0 +#define LV_FONT_MONTSERRAT_46 0 +#define LV_FONT_MONTSERRAT_48 0 + +/*Demonstrate special features*/ +#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ +#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ +#define LV_FONT_SIMSUN_14_CJK 0 /*1000 most common CJK radicals*/ +#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ + +/*Pixel perfect monospace fonts*/ +#define LV_FONT_UNSCII_8 0 +#define LV_FONT_UNSCII_16 0 + +/*Optionally declare custom fonts here. + *You can use these fonts as default font too and they will be available globally. + *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ +#define LV_FONT_CUSTOM_DECLARE + +/*Always set a default font*/ +#define LV_FONT_DEFAULT &lv_font_montserrat_14 + +/*Enable handling large font and/or fonts with a lot of characters. + *The limit depends on the font size, font face and bpp. + *Compiler error will be triggered if a font needs it.*/ +#define LV_FONT_FMT_TXT_LARGE 0 + +/*Enables/disables support for compressed fonts.*/ +#define LV_USE_FONT_COMPRESSED 0 + +/*Enable drawing placeholders when glyph dsc is not found*/ +#define LV_USE_FONT_PLACEHOLDER 1 + +/*================= + * TEXT SETTINGS + *=================*/ + +/** + * Select a character encoding for strings. + * Your IDE or editor should have the same character encoding + * - LV_TXT_ENC_UTF8 + * - LV_TXT_ENC_ASCII + */ +#define LV_TXT_ENC LV_TXT_ENC_UTF8 + +/*Can break (wrap) texts on these chars*/ +#define LV_TXT_BREAK_CHARS " ,.;:-_)]}" + +/*If a word is at least this long, will break wherever "prettiest" + *To disable, set to a value <= 0*/ +#define LV_TXT_LINE_BREAK_LONG_LEN 0 + +/*Minimum number of characters in a long word to put on a line before a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 + +/*Minimum number of characters in a long word to put on a line after a break. + *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ +#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 + +/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. + *The direction will be processed according to the Unicode Bidirectional Algorithm: + *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ +#define LV_USE_BIDI 0 +#if LV_USE_BIDI + /*Set the default direction. Supported values: + *`LV_BASE_DIR_LTR` Left-to-Right + *`LV_BASE_DIR_RTL` Right-to-Left + *`LV_BASE_DIR_AUTO` detect texts base direction*/ + #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO +#endif + +/*Enable Arabic/Persian processing + *In these languages characters should be replaced with another form based on their position in the text*/ +#define LV_USE_ARABIC_PERSIAN_CHARS 0 + +/*================== + * WIDGETS + *================*/ + +/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ + +#define LV_WIDGETS_HAS_DEFAULT_VALUE 1 + +#define LV_USE_ANIMIMG 1 + +#define LV_USE_ARC 1 + +#define LV_USE_BAR 1 + +#define LV_USE_BUTTON 1 + +#define LV_USE_BUTTONMATRIX 1 + +#define LV_USE_CALENDAR 1 +#if LV_USE_CALENDAR + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif + + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 + #define LV_USE_CALENDAR_CHINESE 0 +#endif /*LV_USE_CALENDAR*/ + +#define LV_USE_CANVAS 1 + +#define LV_USE_CHART 1 + +#define LV_USE_CHECKBOX 1 + +#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ + +#define LV_USE_IMAGE 1 /*Requires: lv_label*/ + +#define LV_USE_IMAGEBUTTON 1 + +#define LV_USE_KEYBOARD 1 + +#define LV_USE_LABEL 1 +#if LV_USE_LABEL + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ + #define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/ +#endif + +#define LV_USE_LED 1 + +#define LV_USE_LINE 1 + +#define LV_USE_LIST 1 + +#define LV_USE_LOTTIE 0 /*Requires: lv_canvas, thorvg */ + +#define LV_USE_MENU 1 + +#define LV_USE_MSGBOX 1 + +#define LV_USE_ROLLER 1 /*Requires: lv_label*/ + +#define LV_USE_SCALE 1 + +#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ + +#define LV_USE_SPAN 1 +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif + +#define LV_USE_SPINBOX 1 + +#define LV_USE_SPINNER 1 + +#define LV_USE_SWITCH 1 + +#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ +#if LV_USE_TEXTAREA != 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ +#endif + +#define LV_USE_TABLE 1 + +#define LV_USE_TABVIEW 1 + +#define LV_USE_TILEVIEW 1 + +#define LV_USE_WIN 1 + +/*================== + * THEMES + *==================*/ + +/*A simple, impressive and very complete theme*/ +#define LV_USE_THEME_DEFAULT 1 +#if LV_USE_THEME_DEFAULT + + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 0 + + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 + + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 80 +#endif /*LV_USE_THEME_DEFAULT*/ + +/*A very simple theme that is a good starting point for a custom theme*/ +#define LV_USE_THEME_SIMPLE 1 + +/*A theme designed for monochrome displays*/ +#define LV_USE_THEME_MONO 1 + +/*================== + * LAYOUTS + *==================*/ + +/*A layout similar to Flexbox in CSS.*/ +#define LV_USE_FLEX 1 + +/*A layout similar to Grid in CSS.*/ +#define LV_USE_GRID 1 + +/*==================== + * 3RD PARTS LIBRARIES + *====================*/ + +/*File system interfaces for common APIs */ + +/*Setting a default driver letter allows skipping the driver prefix in filepaths*/ +#define LV_FS_DEFAULT_DRIVE_LETTER '\0' + +/*API for fopen, fread, etc*/ +#define LV_USE_FS_STDIO 0 +#if LV_USE_FS_STDIO + #define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for open, read, etc*/ +#define LV_USE_FS_POSIX 0 +#if LV_USE_FS_POSIX + #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for CreateFile, ReadFile, etc*/ +#define LV_USE_FS_WIN32 0 +#if LV_USE_FS_WIN32 + #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ + #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ +#define LV_USE_FS_FATFS 0 +#if LV_USE_FS_FATFS + #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ +#endif + +/*API for memory-mapped file access. */ +#define LV_USE_FS_MEMFS 0 +#if LV_USE_FS_MEMFS + #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*API for LittleFs. */ +#define LV_USE_FS_LITTLEFS 0 +#if LV_USE_FS_LITTLEFS + #define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*API for Arduino LittleFs. */ +#define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0 +#if LV_USE_FS_ARDUINO_ESP_LITTLEFS + #define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*API for Arduino Sd. */ +#define LV_USE_FS_ARDUINO_SD 0 +#if LV_USE_FS_ARDUINO_SD + #define LV_FS_ARDUINO_SD_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*LODEPNG decoder library*/ +#define LV_USE_LODEPNG 0 + +/*PNG decoder(libpng) library*/ +#define LV_USE_LIBPNG 0 + +/*BMP decoder library*/ +#define LV_USE_BMP 0 + +/* JPG + split JPG decoder library. + * Split JPG is a custom format optimized for embedded systems. */ +#define LV_USE_TJPGD 0 + +/* libjpeg-turbo decoder library. + * Supports complete JPEG specifications and high-performance JPEG decoding. */ +#define LV_USE_LIBJPEG_TURBO 0 + +/*GIF decoder library*/ +#define LV_USE_GIF 0 +#if LV_USE_GIF + /*GIF decoder accelerate*/ + #define LV_GIF_CACHE_DECODE_DATA 0 +#endif + + +/*Decode bin images to RAM*/ +#define LV_BIN_DECODER_RAM_LOAD 0 + +/*RLE decompress library*/ +#define LV_USE_RLE 0 + +/*QR code library*/ +#define LV_USE_QRCODE 0 + +/*Barcode code library*/ +#define LV_USE_BARCODE 0 + +/*FreeType library*/ +#define LV_USE_FREETYPE 0 +#if LV_USE_FREETYPE + /*Let FreeType to use LVGL memory and file porting*/ + #define LV_FREETYPE_USE_LVGL_PORT 0 + + /*Cache count of the glyphs in FreeType. It means the number of glyphs that can be cached. + *The higher the value, the more memory will be used.*/ + #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 +#endif + +/* Built-in TTF decoder */ +#define LV_USE_TINY_TTF 0 +#if LV_USE_TINY_TTF + /* Enable loading TTF data from files */ + #define LV_TINY_TTF_FILE_SUPPORT 0 + #define LV_TINY_TTF_CACHE_GLYPH_CNT 256 +#endif + +/*Rlottie library*/ +#define LV_USE_RLOTTIE 0 + +/*Enable Vector Graphic APIs + *Requires `LV_USE_MATRIX = 1`*/ +#define LV_USE_VECTOR_GRAPHIC 0 + +/* Enable ThorVG (vector graphics library) from the src/libs folder */ +#define LV_USE_THORVG_INTERNAL 0 + +/* Enable ThorVG by assuming that its installed and linked to the project */ +#define LV_USE_THORVG_EXTERNAL 0 + +/*Use lvgl built-in LZ4 lib*/ +#define LV_USE_LZ4_INTERNAL 0 + +/*Use external LZ4 library*/ +#define LV_USE_LZ4_EXTERNAL 0 + +/*FFmpeg library for image decoding and playing videos + *Supports all major image formats so do not enable other image decoder with it*/ +#define LV_USE_FFMPEG 0 +#if LV_USE_FFMPEG + /*Dump input information to stderr*/ + #define LV_FFMPEG_DUMP_FORMAT 0 +#endif + +/*================== + * OTHERS + *==================*/ + +/*1: Enable API to take snapshot for object*/ +#define LV_USE_SNAPSHOT 0 + +/*1: Enable system monitor component*/ +#define LV_USE_SYSMON 0 +#if LV_USE_SYSMON + /*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/ + #define LV_SYSMON_GET_IDLE lv_timer_get_idle + + /*1: Show CPU usage and FPS count + * Requires `LV_USE_SYSMON = 1`*/ + #define LV_USE_PERF_MONITOR 0 + #if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT + + /*0: Displays performance data on the screen, 1: Prints performance data using log.*/ + #define LV_USE_PERF_MONITOR_LOG_MODE 0 + #endif + + /*1: Show the used memory and the memory fragmentation + * Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` + * Requires `LV_USE_SYSMON = 1`*/ + #define LV_USE_MEM_MONITOR 0 + #if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT + #endif + +#endif /*LV_USE_SYSMON*/ + +/*1: Enable the runtime performance profiler*/ +#define LV_USE_PROFILER 0 +#if LV_USE_PROFILER + /*1: Enable the built-in profiler*/ + #define LV_USE_PROFILER_BUILTIN 1 + #if LV_USE_PROFILER_BUILTIN + /*Default profiler trace buffer size*/ + #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/ + #endif + + /*Header to include for the profiler*/ + #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" + + /*Profiler start point function*/ + #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN + + /*Profiler end point function*/ + #define LV_PROFILER_END LV_PROFILER_BUILTIN_END + + /*Profiler start point function with custom tag*/ + #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG + + /*Profiler end point function with custom tag*/ + #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG +#endif + +/*1: Enable Monkey test*/ +#define LV_USE_MONKEY 0 + +/*1: Enable grid navigation*/ +#define LV_USE_GRIDNAV 0 + +/*1: Enable lv_obj fragment*/ +#define LV_USE_FRAGMENT 0 + +/*1: Support using images as font in label or span widgets */ +#define LV_USE_IMGFONT 0 + +/*1: Enable an observer pattern implementation*/ +#define LV_USE_OBSERVER 1 + +/*1: Enable Pinyin input method*/ +/*Requires: lv_keyboard*/ +#define LV_USE_IME_PINYIN 0 +#if LV_USE_IME_PINYIN + /*1: Use default thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesaurus*/ + #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 + /*Set the maximum number of candidate panels that can be displayed*/ + /*This needs to be adjusted according to the size of the screen*/ + #define LV_IME_PINYIN_CAND_TEXT_NUM 6 + + /*Use 9 key input(k9)*/ + #define LV_IME_PINYIN_USE_K9_MODE 1 + #if LV_IME_PINYIN_USE_K9_MODE == 1 + #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 + #endif /*LV_IME_PINYIN_USE_K9_MODE*/ +#endif + +/*1: Enable file explorer*/ +/*Requires: lv_table*/ +#define LV_USE_FILE_EXPLORER 0 +#if LV_USE_FILE_EXPLORER + /*Maximum length of path*/ + #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) + /*Quick access bar, 1:use, 0:not use*/ + /*Requires: lv_list*/ + #define LV_FILE_EXPLORER_QUICK_ACCESS 1 +#endif + +/*================== + * DEVICES + *==================*/ + +/*Use SDL to open window on PC and handle mouse and keyboard*/ +#define LV_USE_SDL 0 +#if LV_USE_SDL + #define LV_SDL_INCLUDE_PATH + #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/ + #define LV_SDL_BUF_COUNT 1 /*1 or 2*/ + #define LV_SDL_ACCELERATED 1 /*1: Use hardware acceleration*/ + #define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/ + #define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/ + #define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/ +#endif + +/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/ +#define LV_USE_X11 0 +#if LV_USE_X11 + #define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/ + #define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for rendering*/ + /*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/ + #define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/ + #define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/ + #define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/ +#endif + +/*Use Wayland to open a window and handle input on Linux or BSD desktops */ +#define LV_USE_WAYLAND 0 +#if LV_USE_WAYLAND + #define LV_WAYLAND_WINDOW_DECORATIONS 0 /*Draw client side window decorations only necessary on Mutter/GNOME*/ + #define LV_WAYLAND_WL_SHELL 0 /*Use the legacy wl_shell protocol instead of the default XDG shell*/ +#endif + +/*Driver for /dev/fb*/ +#define LV_USE_LINUX_FBDEV 0 +#if LV_USE_LINUX_FBDEV + #define LV_LINUX_FBDEV_BSD 0 + #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL + #define LV_LINUX_FBDEV_BUFFER_COUNT 0 + #define LV_LINUX_FBDEV_BUFFER_SIZE 60 +#endif + +/*Use Nuttx to open window and handle touchscreen*/ +#define LV_USE_NUTTX 0 + +#if LV_USE_NUTTX + #define LV_USE_NUTTX_LIBUV 0 + + /*Use Nuttx custom init API to open window and handle touchscreen*/ + #define LV_USE_NUTTX_CUSTOM_INIT 0 + + /*Driver for /dev/lcd*/ + #define LV_USE_NUTTX_LCD 0 + #if LV_USE_NUTTX_LCD + #define LV_NUTTX_LCD_BUFFER_COUNT 0 + #define LV_NUTTX_LCD_BUFFER_SIZE 60 + #endif + + /*Driver for /dev/input*/ + #define LV_USE_NUTTX_TOUCHSCREEN 0 + +#endif + +/*Driver for /dev/dri/card*/ +#define LV_USE_LINUX_DRM 0 + +/*Interface for TFT_eSPI*/ +#define LV_USE_TFT_ESPI 0 + +/*Driver for evdev input devices*/ +#define LV_USE_EVDEV 0 + +/*Driver for libinput input devices*/ +#define LV_USE_LIBINPUT 0 + +#if LV_USE_LIBINPUT + #define LV_LIBINPUT_BSD 0 + + /*Full keyboard support*/ + #define LV_LIBINPUT_XKB 0 + #if LV_LIBINPUT_XKB + /*"setxkbmap -query" can help find the right values for your keyboard*/ + #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } + #endif +#endif + +/*Drivers for LCD devices connected via SPI/parallel port*/ +#define LV_USE_ST7735 0 +#define LV_USE_ST7789 0 +#define LV_USE_ST7796 0 +#define LV_USE_ILI9341 0 + +#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) + +/*Driver for Renesas GLCD*/ +#define LV_USE_RENESAS_GLCDC 0 + +/* LVGL Windows backend */ +#define LV_USE_WINDOWS 0 + +/* Use OpenGL to open window on PC and handle mouse and keyboard */ +#define LV_USE_OPENGLES 0 +#if LV_USE_OPENGLES + #define LV_USE_OPENGLES_DEBUG 1 /* Enable or disable debug for opengles */ +#endif + +/* QNX Screen display and input drivers */ +#define LV_USE_QNX 0 +#if LV_USE_QNX + #define LV_QNX_BUF_COUNT 1 /*1 or 2*/ +#endif + +/*================== +* EXAMPLES +*==================*/ + +/*Enable the examples to be built with the library*/ +#define LV_BUILD_EXAMPLES 1 + +/*=================== + * DEMO USAGE + ====================*/ + +/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ +#define LV_USE_DEMO_WIDGETS 0 + +/*Demonstrate the usage of encoder and keyboard*/ +#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 + +/*Benchmark your system*/ +#define LV_USE_DEMO_BENCHMARK 0 + +/*Render test for each primitives. Requires at least 480x272 display*/ +#define LV_USE_DEMO_RENDER 0 + +/*Stress test for LVGL*/ +#define LV_USE_DEMO_STRESS 0 + +/*Music player demo*/ +#define LV_USE_DEMO_MUSIC 0 +#if LV_USE_DEMO_MUSIC + #define LV_DEMO_MUSIC_SQUARE 0 + #define LV_DEMO_MUSIC_LANDSCAPE 0 + #define LV_DEMO_MUSIC_ROUND 0 + #define LV_DEMO_MUSIC_LARGE 0 + #define LV_DEMO_MUSIC_AUTO_PLAY 0 +#endif + +/*Flex layout demo*/ +#define LV_USE_DEMO_FLEX_LAYOUT 0 + +/*Smart-phone like multi-language demo*/ +#define LV_USE_DEMO_MULTILANG 0 + +/*Widget transformation demo*/ +#define LV_USE_DEMO_TRANSFORM 0 + +/*Demonstrate scroll settings*/ +#define LV_USE_DEMO_SCROLL 0 + +/*Vector graphic demo*/ +#define LV_USE_DEMO_VECTOR_GRAPHIC 0 + +#define LV_COLOR_16_SWAP 1 +/*--END OF LV_CONF_H--*/ + +#endif /*LV_CONF_H*/ + +#endif /*End of "Content enable"*/ diff --git a/main/main.c b/main/main.c index bf8a226..731d8e1 100644 --- a/main/main.c +++ b/main/main.c @@ -1,3 +1,4 @@ +<<<<<<< HEAD /* * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD * @@ -289,3 +290,296 @@ void app_main(void) } #endif } +======= +/* + * SPDX-FileCopyrightText: 2021-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Unlicense OR CC0-1.0 + */ + +#include +#include +#include +#include +#include +#include "math.h" + +#include "esp_system.h" +#include "esp_log.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/timers.h" +#include "driver/gpio.h" +#include "nvs.h" +#include "nvs_flash.h" + + +#include "bt_app.h" +#include "lsm6dsv.h" +#include "gui.h" +#include "gpio.h" +#include "keypad.h" +#include "system.h" + + + + +/********************************* + * STATIC FUNCTION DECLARATIONS + ********************************/ +typedef struct { + float alpha; // smoothing factor, 0alpha = alpha; + f->prev_output = init_output; +} + +// Run one input sample through the filter. +// Returns y[n] = alpha * x[n] + (1-alpha) * y[n-1]. +static inline float LPF_Update(LowPassFilter *f, float input) { + float out = f->alpha * input + (1.0f - f->alpha) * f->prev_output; + f->prev_output = out; + return out; +} + + +/********************************* + * STATIC VARIABLE DEFINITIONS + ********************************/ +static const char *TAG = "main"; + +/********************************* + * STATIC FUNCTION DEFINITIONS + ********************************/ + +static void init_gpio(void) +{ + gpio_config_t io_conf; + + + // Configure output GPIO + io_conf.pin_bit_mask = (1ULL << PIN_NUM_LED_1) | (1ULL << PIN_NUM_LED_2); + io_conf.mode = GPIO_MODE_OUTPUT; + io_conf.intr_type = GPIO_INTR_DISABLE; + io_conf.pull_up_en = GPIO_PULLUP_DISABLE; + io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + gpio_config(&io_conf); + + + + +#if 1 + // Configure output power signal + gpio_set_level(PIN_NUM_nON, 1); + + io_conf.pin_bit_mask = (1ULL << PIN_NUM_nON); + io_conf.mode = GPIO_MODE_OUTPUT; + io_conf.intr_type = GPIO_INTR_DISABLE; + io_conf.pull_up_en = GPIO_PULLUP_ENABLE; + io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + gpio_config(&io_conf); +#endif + + + + // Configure LCD Backlight GPIO + io_conf.pin_bit_mask = (1ULL << PIN_NUM_BK_LIGHT); + io_conf.mode = GPIO_MODE_OUTPUT; + io_conf.intr_type = GPIO_INTR_DISABLE; + io_conf.pull_up_en = GPIO_PULLUP_DISABLE; + io_conf.pull_down_en = GPIO_PULLDOWN_DISABLE; + gpio_config(&io_conf); +} + + + + +// IMU task to read sensor data +static void imu_task(void *pvParameters) { + lsm6dsv_data_t imu_data; + char data_str[128]; + + float roll, pitch, yaw; + lsm6dsv_fifo_t fifo; + + ImuData_t imu; + + LowPassFilter lpf; + LPF_Init(&lpf, FILTER_COEFF, 0); + + while (1) { + + // uint8_t samples = lsm6dsv_fifo_ready(); + + //ESP_LOGI(TAG, "Samples: %d", samples); + // while (samples) + // { + // lsm6dsv_fifo_read(&fifo); + + + + // // snprintf(data_str, sizeof(data_str), + // // "tag: %d, count: %d, (%d, %d, %d)", + // // fifo.tag, fifo.count, x, y, z); + + // // ESP_LOGI(TAG, "%s", data_str); + + // samples--; + // } + + // lsm6dsv_getAttitude(&fifo, &roll, &pitch, &yaw); + + // snprintf(data_str, sizeof(data_str), + // "r: %0.3f, p: %0.3f, y: %0.3f", + // roll, pitch, yaw); + + // ESP_LOGI(TAG, "%s", data_str); + + float xz; + float yz; + float xy; + +#if 1 + if (lsm6dsv_read_data(&imu_data) == ESP_OK) + { + // snprintf(data_str, sizeof(data_str), + // "Acc: %.2f, %.2f, %.2f; " + // "Gyro: %.2f, %.2f, %.2f (%d)\n", + // imu_data.acc_x, imu_data.acc_y, imu_data.acc_z, + // imu_data.gyro_x, imu_data.gyro_y, imu_data.gyro_z, lsm6dsv_fifo_ready()); + + + + +#if 1 + imu.raw[ANGLE_XZ] = atan2f((float)imu_data.acc_z, (float)imu_data.acc_x) * 180 / M_PI; + imu.raw[ANGLE_YZ] = atan2f((float)imu_data.acc_z, (float)imu_data.acc_y) * 180 / M_PI; + imu.raw[ANGLE_XY] = atan2f((float)imu_data.acc_x, (float)imu_data.acc_y) * 180 / M_PI; + + + float angle; + + + angle = system_getAngle(); + + if (angle > MAX_INDICATION_ANGLE) + { + angle = MAX_INDICATION_ANGLE; + } + else + if (angle < -MAX_INDICATION_ANGLE) + { + angle = -MAX_INDICATION_ANGLE; + } + + // low pass filter the angle measurement + imu.angle = LPF_Update(&lpf, angle); + + //imu.filtered[ANGLE_XY] = LPF_Update(&lpf, imu.raw[ANGLE_XY]); + + system_setImuData(imu); + + // snprintf(data_str, sizeof(data_str), + // "(%.2f, %.2f, %.2f)", xy, yz, xy); +#endif + +#if 0 + snprintf(data_str, sizeof(data_str), + "(%.1f, %.1f, %.1f) (%.2f, %.2f, %.2f)", + imu.raw[ANGLE_XZ], imu.raw[ANGLE_YZ], imu.raw[ANGLE_XY], + (float)imu_data.acc_x, (float)imu_data.acc_y, (float)imu_data.acc_z); + ESP_LOGI(TAG, "%s", data_str); +#endif + // Update label text in LVGL task + //lv_label_set_text(imu_label, data_str); + + } +#endif + vTaskDelay(pdMS_TO_TICKS(100)); // Update every 100ms + } +} + +/********************************* + * MAIN ENTRY POINT + ********************************/ + +void app_main(void) +{ + + /* initialize NVS — it is used to store PHY calibration data */ + esp_err_t ret = nvs_flash_init(); + if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { + ESP_ERROR_CHECK(nvs_flash_erase()); + ret = nvs_flash_init(); + } + ESP_ERROR_CHECK(ret); + + init_gpio(); + + system_init(); + + + + // Initialize IMU + ESP_ERROR_CHECK(lsm6dsv_init(22, 21)); // SCL = IO14, SDA = IO15 + + + + // Create IMU task + TaskHandle_t h = xTaskCreate(imu_task, "imu_task", 4096, NULL, 5, NULL); + + + + bt_app_init(); + + gui_start(); + + gpio_set_level(PIN_NUM_LED_2, 1); + + +#if 0 + + keypad_start(); + QueueHandle_t q = keypad_getQueue(); + uint32_t ev = 0; + + //gpio_set_level(PIN_NUM_LED_1, 1); + gpio_set_level(PIN_NUM_LED_2, 1); + + // Main loop - LVGL task will run automatically + while (1) { + + if (xQueueReceive(q, &ev, pdMS_TO_TICKS(10)) == pdTRUE) + { + switch (ev) + { + case (KEY_UP << KEY_LONG_PRESS): + { + system_setZeroAngle(); + break; + } + + case (KEY_DOWN << KEY_LONG_PRESS): + { + system_clearZeroAngle(); + break; + } + } + + } + + } +#else + while (1) + { + vTaskDelay(pdMS_TO_TICKS(1000)); + } +#endif +} +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 diff --git a/main/system.c b/main/system.c index ffeb70a..4c9ea22 100644 --- a/main/system.c +++ b/main/system.c @@ -1,3 +1,4 @@ +<<<<<<< HEAD #include "system.h" #include "esp_log.h" @@ -166,4 +167,174 @@ void system_notifyAll(uint32_t eventBits) { } xSemaphoreGive(em->mutex); } +======= +#include "system.h" +#include "esp_log.h" + +static SystemState_t _systemState; + +static EventGroupHandle_t _systemEvent; +static EventManager_t _eventManager; + +void system_init(void) +{ + _systemState.zeroAngle = 0.0f; + _systemState.primaryAxis = PRIMARY_AXIS; + + EventGroupHandle_t evt = xEventGroupCreate(); + + _eventManager.count = 0; + _eventManager.mutex = xSemaphoreCreateMutex(); +} + +int system_getPrimaryAxis(void) +{ + int axis; + + xSemaphoreTake(_eventManager.mutex, portMAX_DELAY); + axis = _systemState.primaryAxis; + xSemaphoreGive(_eventManager.mutex); + + return axis; +} + +float system_getAngle(void) +{ + float angle; + + xSemaphoreTake(_eventManager.mutex, portMAX_DELAY); + + + angle = _systemState.imu.raw[_systemState.primaryAxis] - _systemState.zeroAngle; + + + xSemaphoreGive(_eventManager.mutex); + + return angle; +} + +void system_setZeroAngle(void) +{ + xSemaphoreTake(_eventManager.mutex, portMAX_DELAY); + + + _systemState.zeroAngle = _systemState.imu.raw[_systemState.primaryAxis]; + + ESP_LOGI("system", "Zero: %.1f", _systemState.zeroAngle); + + xSemaphoreGive(_eventManager.mutex); +} + +void system_clearZeroAngle(void) +{ + xSemaphoreTake(_eventManager.mutex, portMAX_DELAY); + + _systemState.zeroAngle = 0.0f; + + ESP_LOGI("system", "Zero: %.1f", _systemState.zeroAngle); + + xSemaphoreGive(_eventManager.mutex); +} + +float system_getZeroAngle(void) +{ + float angle; + + xSemaphoreTake(_eventManager.mutex, portMAX_DELAY); + + angle = _systemState.zeroAngle; + + xSemaphoreGive(_eventManager.mutex); + + return angle; +} + +void system_setImuData(ImuData_t imu) +{ + xSemaphoreTake(_eventManager.mutex, portMAX_DELAY); + + _systemState.imu = imu; + + xSemaphoreGive(_eventManager.mutex); + + //ESP_LOGI("g", "New IMU Data: %.2f", xy); + + system_notifyAll(EM_EVENT_NEW_DATA); +} + +ImuData_t system_getImuData(void) +{ + ImuData_t imu; + xSemaphoreTake(_eventManager.mutex, portMAX_DELAY); + + imu = _systemState.imu; + + xSemaphoreGive(_eventManager.mutex); + + return imu; +} + +void system_waitForEvent(void) +{ +} + +SystemState_t *system_getState(void) +{ + return &_systemState; +} + + +BaseType_t system_subscribe(TaskHandle_t task) { + + EventManager_t *em = &_eventManager; + + ESP_LOGI("g", "Subscribe: %p", task); + if (xSemaphoreTake(em->mutex, portMAX_DELAY) == pdFALSE) { + return pdFAIL; + } + if (em->count < EM_MAX_SUBSCRIBERS) { + // avoid duplicates? + ESP_LOGI("g", "PASS"); + em->subscribers[em->count++] = task; + xSemaphoreGive(em->mutex); + return pdPASS; + } + xSemaphoreGive(em->mutex); + return pdFAIL; // full +} + +BaseType_t system_unsubscribe(TaskHandle_t task) { + + EventManager_t *em = &_eventManager; + + BaseType_t removed = pdFAIL; + if (xSemaphoreTake(em->mutex, portMAX_DELAY) == pdTRUE) { + for (size_t i = 0; i < em->count; ++i) { + if (em->subscribers[i] == task) { + // shift down + for (size_t j = i; j + 1 < em->count; ++j) + em->subscribers[j] = em->subscribers[j+1]; + em->count--; + removed = pdPASS; + break; + } + } + xSemaphoreGive(em->mutex); + } + return removed; +} + +void system_notifyAll(uint32_t eventBits) { + EventManager_t *em = &_eventManager; + if (xSemaphoreTake(em->mutex, portMAX_DELAY) == pdTRUE) { + for (size_t i = 0; i < em->count; ++i) { + // set the bits in each task's notification value + //ESP_LOGI("g", "Notify: %p", em->subscribers[i]); + xTaskNotify(em->subscribers[i], + eventBits, + eSetBits); + } + xSemaphoreGive(em->mutex); + } +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 } \ No newline at end of file diff --git a/main/system.h b/main/system.h index 48e826f..6a4a2a3 100644 --- a/main/system.h +++ b/main/system.h @@ -1,3 +1,4 @@ +<<<<<<< HEAD #ifndef SYSTEM_H #define SYSTEM_H @@ -72,4 +73,80 @@ BaseType_t system_unsubscribe(TaskHandle_t task); void system_notifyAll(uint32_t eventBits); +======= +#ifndef SYSTEM_H +#define SYSTEM_H + +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "freertos/semphr.h" + +#define DISABLE_GUI + +enum +{ + ANGLE_XY = 0, + ANGLE_XZ, + ANGLE_YZ, +}; + + + +typedef struct +{ + float raw[3]; + float filtered[3]; + float angle; +} ImuData_t; + +typedef struct SystemState_s +{ + ImuData_t imu; + + EventGroupHandle_t event; + + float zeroAngle; + int primaryAxis; + +} SystemState_t; + + +#define MAX_INDICATION_ANGLE 5.0f +#define FILTER_COEFF 0.2f // 0 to 1 Smaller number is heavier filter +#define PRIMARY_AXIS ANGLE_YZ + +#define EM_MAX_SUBSCRIBERS 8 // tweak as needed +#define EM_EVENT_NEW_DATA (1UL<<0) +#define EM_EVENT_ERROR (1UL<<1) +// …add more event bit-masks here… + +typedef struct { + TaskHandle_t subscribers[EM_MAX_SUBSCRIBERS]; + size_t count; + SemaphoreHandle_t mutex; +} EventManager_t; + +void system_init(void); +void system_setImuData(ImuData_t imu); + +ImuData_t system_getImuData(void); + +int system_getPrimaryAxis(void); +float system_getAngle(void); + +void system_setZeroAngle(void); +void system_clearZeroAngle(void); +float system_getZeroAngle(void); + +// Subscribe (register) current task to receive events +BaseType_t system_subscribe(TaskHandle_t task); + +// Unsubscribe if you ever need +BaseType_t system_unsubscribe(TaskHandle_t task); + +// Notify all subscribers of one or more event bits +void system_notifyAll(uint32_t eventBits); + + +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 #endif \ No newline at end of file diff --git a/partitions.csv b/partitions.csv index 3081ec2..7a9eeab 100644 --- a/partitions.csv +++ b/partitions.csv @@ -1,6 +1,6 @@ -# Name, Type, SubType, Offset, Size, Flags -# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap,,,, -nvs, data, nvs, , 0x8000, -otadata, data, ota, , 0x2000, -phy_init, data, phy, , 0x1000, -factory, app, factory, , 0x1B6000, +# Name, Type, SubType, Offset, Size, Flags +# Note: if you have increased the bootloader size, make sure to update the offsets to avoid overlap,,,, +nvs, data, nvs, , 0x8000, +otadata, data, ota, , 0x2000, +phy_init, data, phy, , 0x1000, +factory, app, factory, , 0x1B6000, diff --git a/sdkconfig b/sdkconfig index 53e43c9..53a5d04 100644 --- a/sdkconfig +++ b/sdkconfig @@ -1560,7 +1560,7 @@ CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y # 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 -CONFIG_LWIP_DHCP_OPTIONS_LEN=68 +CONFIG_LWIP_DHCP_OPTIONS_LEN=69 CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 diff --git a/sdkconfig.defaults b/sdkconfig.defaults index d2565d2..0f1717b 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -1,3 +1,4 @@ +<<<<<<< HEAD # Override some defaults so BT stack is enabled and # Classic BT is enabled CONFIG_BT_ENABLED=y @@ -7,3 +8,14 @@ CONFIG_BTDM_CTRL_MODE_BTDM=n CONFIG_BT_BLUEDROID_ENABLED=y CONFIG_BT_CLASSIC_ENABLED=y CONFIG_BT_A2DP_ENABLE=y +======= +# Override some defaults so BT stack is enabled and +# Classic BT is enabled +CONFIG_BT_ENABLED=y +CONFIG_BTDM_CTRL_MODE_BLE_ONLY=n +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +CONFIG_BTDM_CTRL_MODE_BTDM=n +CONFIG_BT_BLUEDROID_ENABLED=y +CONFIG_BT_CLASSIC_ENABLED=y +CONFIG_BT_A2DP_ENABLE=y +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442 diff --git a/sdkconfig.old b/sdkconfig.old index faf8793..f6f1e47 100644 --- a/sdkconfig.old +++ b/sdkconfig.old @@ -1,3 +1,4 @@ +<<<<<<< HEAD # # Automatically generated file. DO NOT EDIT. # Espressif IoT Development Framework (ESP-IDF) 5.3.1 Project Configuration @@ -2886,3 +2887,2893 @@ CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y CONFIG_SUPPORT_TERMIOS=y CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 # End of deprecated options +======= +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) 5.3.1 Project Configuration +# +CONFIG_SOC_BROWNOUT_RESET_SUPPORTED="Not determined" +CONFIG_SOC_TWAI_BRP_DIV_SUPPORTED="Not determined" +CONFIG_SOC_DPORT_WORKAROUND="Not determined" +CONFIG_SOC_CAPS_ECO_VER_MAX=301 +CONFIG_SOC_ADC_SUPPORTED=y +CONFIG_SOC_DAC_SUPPORTED=y +CONFIG_SOC_UART_SUPPORTED=y +CONFIG_SOC_MCPWM_SUPPORTED=y +CONFIG_SOC_GPTIMER_SUPPORTED=y +CONFIG_SOC_SDMMC_HOST_SUPPORTED=y +CONFIG_SOC_BT_SUPPORTED=y +CONFIG_SOC_PCNT_SUPPORTED=y +CONFIG_SOC_PHY_SUPPORTED=y +CONFIG_SOC_WIFI_SUPPORTED=y +CONFIG_SOC_SDIO_SLAVE_SUPPORTED=y +CONFIG_SOC_TWAI_SUPPORTED=y +CONFIG_SOC_EFUSE_SUPPORTED=y +CONFIG_SOC_EMAC_SUPPORTED=y +CONFIG_SOC_ULP_SUPPORTED=y +CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y +CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y +CONFIG_SOC_RTC_MEM_SUPPORTED=y +CONFIG_SOC_I2S_SUPPORTED=y +CONFIG_SOC_RMT_SUPPORTED=y +CONFIG_SOC_SDM_SUPPORTED=y +CONFIG_SOC_GPSPI_SUPPORTED=y +CONFIG_SOC_LEDC_SUPPORTED=y +CONFIG_SOC_I2C_SUPPORTED=y +CONFIG_SOC_SUPPORT_COEXISTENCE=y +CONFIG_SOC_AES_SUPPORTED=y +CONFIG_SOC_MPI_SUPPORTED=y +CONFIG_SOC_SHA_SUPPORTED=y +CONFIG_SOC_FLASH_ENC_SUPPORTED=y +CONFIG_SOC_SECURE_BOOT_SUPPORTED=y +CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y +CONFIG_SOC_BOD_SUPPORTED=y +CONFIG_SOC_ULP_FSM_SUPPORTED=y +CONFIG_SOC_CLK_TREE_SUPPORTED=y +CONFIG_SOC_MPU_SUPPORTED=y +CONFIG_SOC_WDT_SUPPORTED=y +CONFIG_SOC_SPI_FLASH_SUPPORTED=y +CONFIG_SOC_RNG_SUPPORTED=y +CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y +CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y +CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y +CONFIG_SOC_PM_SUPPORTED=y +CONFIG_SOC_DPORT_WORKAROUND_DIS_INTERRUPT_LVL=5 +CONFIG_SOC_XTAL_SUPPORT_26M=y +CONFIG_SOC_XTAL_SUPPORT_40M=y +CONFIG_SOC_XTAL_SUPPORT_AUTO_DETECT=y +CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DMA_SUPPORTED=y +CONFIG_SOC_ADC_PERIPH_NUM=2 +CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 +CONFIG_SOC_ADC_ATTEN_NUM=4 +CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 +CONFIG_SOC_ADC_PATT_LEN_MAX=16 +CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_RESULT_BYTES=2 +CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 +CONFIG_SOC_ADC_DIGI_MONITOR_NUM=0 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=2 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=20 +CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=9 +CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_SHARED_POWER=y +CONFIG_SOC_SHARED_IDCACHE_SUPPORTED=y +CONFIG_SOC_IDCACHE_PER_CORE=y +CONFIG_SOC_CPU_CORES_NUM=2 +CONFIG_SOC_CPU_INTR_NUM=32 +CONFIG_SOC_CPU_HAS_FPU=y +CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y +CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=64 +CONFIG_SOC_DAC_CHAN_NUM=2 +CONFIG_SOC_DAC_RESOLUTION=8 +CONFIG_SOC_DAC_DMA_16BIT_ALIGN=y +CONFIG_SOC_GPIO_PORT=1 +CONFIG_SOC_GPIO_PIN_COUNT=40 +CONFIG_SOC_GPIO_VALID_GPIO_MASK=0xFFFFFFFFFF +CONFIG_SOC_GPIO_IN_RANGE_MAX=39 +CONFIG_SOC_GPIO_OUT_RANGE_MAX=33 +CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0xEF0FEA +CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y +CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 +CONFIG_SOC_I2C_NUM=2 +CONFIG_SOC_HP_I2C_NUM=2 +CONFIG_SOC_I2C_FIFO_LEN=32 +CONFIG_SOC_I2C_CMD_REG_NUM=16 +CONFIG_SOC_I2C_SUPPORT_SLAVE=y +CONFIG_SOC_I2C_SUPPORT_APB=y +CONFIG_SOC_I2C_STOP_INDEPENDENT=y +CONFIG_SOC_I2S_NUM=2 +CONFIG_SOC_I2S_HW_VERSION_1=y +CONFIG_SOC_I2S_SUPPORTS_APLL=y +CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y +CONFIG_SOC_I2S_SUPPORTS_PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=1 +CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_PDM_MAX_RX_LINES=1 +CONFIG_SOC_I2S_SUPPORTS_ADC_DAC=y +CONFIG_SOC_I2S_SUPPORTS_ADC=y +CONFIG_SOC_I2S_SUPPORTS_DAC=y +CONFIG_SOC_I2S_SUPPORTS_LCD_CAMERA=y +CONFIG_SOC_I2S_TRANS_SIZE_ALIGN_WORD=y +CONFIG_SOC_I2S_LCD_I80_VARIANT=y +CONFIG_SOC_LCD_I80_SUPPORTED=y +CONFIG_SOC_LCD_I80_BUSES=2 +CONFIG_SOC_LCD_I80_BUS_WIDTH=24 +CONFIG_SOC_LEDC_HAS_TIMER_SPECIFIC_MUX=y +CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y +CONFIG_SOC_LEDC_SUPPORT_REF_TICK=y +CONFIG_SOC_LEDC_SUPPORT_HS_MODE=y +CONFIG_SOC_LEDC_CHANNEL_NUM=8 +CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=20 +CONFIG_SOC_MCPWM_GROUPS=2 +CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 +CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 +CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 +CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y +CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 +CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 +CONFIG_SOC_MMU_PERIPH_NUM=2 +CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=3 +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=8 +CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 +CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 +CONFIG_SOC_RMT_GROUPS=1 +CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=8 +CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 +CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=64 +CONFIG_SOC_RMT_SUPPORT_REF_TICK=y +CONFIG_SOC_RMT_SUPPORT_APB=y +CONFIG_SOC_RMT_CHANNEL_CLK_INDEPENDENT=y +CONFIG_SOC_RTCIO_PIN_COUNT=18 +CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y +CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y +CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y +CONFIG_SOC_SDM_GROUPS=1 +CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 +CONFIG_SOC_SDM_CLK_SUPPORT_APB=y +CONFIG_SOC_SPI_HD_BOTH_INOUT_SUPPORTED=y +CONFIG_SOC_SPI_AS_CS_SUPPORTED=y +CONFIG_SOC_SPI_PERIPH_NUM=3 +CONFIG_SOC_SPI_DMA_CHAN_NUM=2 +CONFIG_SOC_SPI_MAX_CS_NUM=3 +CONFIG_SOC_SPI_SUPPORT_CLK_APB=y +CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 +CONFIG_SOC_SPI_MAX_PRE_DIVIDER=8192 +CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_26M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y +CONFIG_SOC_TIMER_GROUPS=2 +CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 +CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=64 +CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 +CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y +CONFIG_SOC_TOUCH_SENSOR_VERSION=1 +CONFIG_SOC_TOUCH_SENSOR_NUM=10 +CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 +CONFIG_SOC_TWAI_CONTROLLER_NUM=1 +CONFIG_SOC_TWAI_BRP_MIN=2 +CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y +CONFIG_SOC_TWAI_SUPPORT_MULTI_ADDRESS_LAYOUT=y +CONFIG_SOC_UART_NUM=3 +CONFIG_SOC_UART_HP_NUM=3 +CONFIG_SOC_UART_SUPPORT_APB_CLK=y +CONFIG_SOC_UART_SUPPORT_REF_TICK=y +CONFIG_SOC_UART_FIFO_LEN=128 +CONFIG_SOC_UART_BITRATE_MAX=5000000 +CONFIG_SOC_SPIRAM_SUPPORTED=y +CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y +CONFIG_SOC_SHA_SUPPORT_PARALLEL_ENG=y +CONFIG_SOC_SHA_ENDIANNESS_BE=y +CONFIG_SOC_SHA_SUPPORT_SHA1=y +CONFIG_SOC_SHA_SUPPORT_SHA256=y +CONFIG_SOC_SHA_SUPPORT_SHA384=y +CONFIG_SOC_SHA_SUPPORT_SHA512=y +CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 +CONFIG_SOC_MPI_OPERATIONS_NUM=y +CONFIG_SOC_RSA_MAX_BIT_LEN=4096 +CONFIG_SOC_AES_SUPPORT_AES_128=y +CONFIG_SOC_AES_SUPPORT_AES_192=y +CONFIG_SOC_AES_SUPPORT_AES_256=y +CONFIG_SOC_SECURE_BOOT_V1=y +CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=y +CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=32 +CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 +CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_FAST_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_SLOW_MEM_PD=y +CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y +CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y +CONFIG_SOC_PM_SUPPORT_MODEM_PD=y +CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y +CONFIG_SOC_CLK_APLL_SUPPORTED=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_SDMMC_USE_IOMUX=y +CONFIG_SOC_SDMMC_NUM_SLOTS=2 +CONFIG_SOC_WIFI_WAPI_SUPPORT=y +CONFIG_SOC_WIFI_CSI_SUPPORT=y +CONFIG_SOC_WIFI_MESH_SUPPORT=y +CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y +CONFIG_SOC_WIFI_NAN_SUPPORT=y +CONFIG_SOC_BLE_SUPPORTED=y +CONFIG_SOC_BLE_MESH_SUPPORTED=y +CONFIG_SOC_BT_CLASSIC_SUPPORTED=y +CONFIG_SOC_BLUFI_SUPPORTED=y +CONFIG_SOC_BT_H2C_ENC_KEY_CTRL_ENH_VSC_SUPPORTED=y +CONFIG_SOC_ULP_HAS_ADC=y +CONFIG_SOC_PHY_COMBO_MODULE=y +CONFIG_SOC_EMAC_RMII_CLK_OUT_INTERNAL_LOOPBACK=y +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET_ARCH="xtensa" +CONFIG_IDF_TARGET="esp32" +CONFIG_IDF_INIT_VERSION="5.3.1" +CONFIG_IDF_TARGET_ESP32=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0000 + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# CONFIG_APP_REPRODUCIBLE_BUILD is not set +# CONFIG_APP_NO_BLOBS is not set +# CONFIG_APP_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_APP_COMPATIBLE_PRE_V3_1_BOOTLOADERS is not set +# end of Build type + +# +# Bootloader config +# + +# +# Bootloader manager +# +CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y +CONFIG_BOOTLOADER_PROJECT_VER=1 +# end of Bootloader manager + +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x1000 +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 +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + +# CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V is not set +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +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 +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_V1_SUPPORTED=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +# end of Security features + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=9 +# end of Application manager + +CONFIG_ESP_ROM_HAS_CRC_LE=y +CONFIG_ESP_ROM_HAS_CRC_BE=y +CONFIG_ESP_ROM_HAS_MZ_CRC32=y +CONFIG_ESP_ROM_HAS_JPEG_DECODE=y +CONFIG_ESP_ROM_HAS_UART_BUF_SWITCH=y +CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y +CONFIG_ESP_ROM_HAS_NEWLIB=y +CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y +CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y +CONFIG_ESP_ROM_HAS_SW_FLOAT=y +CONFIG_ESP_ROM_USB_OTG_NUM=-1 +CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=-1 +CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_80M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_40M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ="40m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="4MB" +# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +# 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_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# A2DP Example Configuration +# +CONFIG_EXAMPLE_SSP_ENABLED=y +# end of A2DP Example Configuration + +# +# Compiler options +# +# CONFIG_COMPILER_OPTIMIZATION_DEBUG is not set +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +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_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC13_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 +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +# CONFIG_APPTRACE_DEST_UART1 is not set +# CONFIG_APPTRACE_DEST_UART2 is not set +CONFIG_APPTRACE_DEST_UART_NONE=y +CONFIG_APPTRACE_UART_TASK_PRIO=1 +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +CONFIG_BT_ENABLED=y +CONFIG_BT_BLUEDROID_ENABLED=y +# CONFIG_BT_NIMBLE_ENABLED is not set +# CONFIG_BT_CONTROLLER_ONLY is not set +CONFIG_BT_CONTROLLER_ENABLED=y +# CONFIG_BT_CONTROLLER_DISABLED is not set + +# +# Bluedroid Options +# +CONFIG_BT_BTC_TASK_STACK_SIZE=3072 +CONFIG_BT_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BT_BLUEDROID_PINNED_TO_CORE_1 is not set +CONFIG_BT_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BT_BTU_TASK_STACK_SIZE=4352 +# CONFIG_BT_BLUEDROID_MEM_DEBUG is not set +CONFIG_BT_BLUEDROID_ESP_COEX_VSC=y +CONFIG_BT_CLASSIC_ENABLED=y +CONFIG_BT_ENC_KEY_SIZE_CTRL_VSC=y +# CONFIG_BT_ENC_KEY_SIZE_CTRL_NONE is not set +# CONFIG_BT_CLASSIC_BQB_ENABLED is not set +CONFIG_BT_A2DP_ENABLE=y +# CONFIG_BT_SPP_ENABLED is not set +# CONFIG_BT_L2CAP_ENABLED is not set +# CONFIG_BT_HFP_ENABLE is not set +# CONFIG_BT_HID_ENABLED is not set +CONFIG_BT_BLE_ENABLED=y +CONFIG_BT_GATTS_ENABLE=y +# CONFIG_BT_GATTS_PPCP_CHAR_GAP is not set +# CONFIG_BT_BLE_BLUFI_ENABLE is not set +CONFIG_BT_GATT_MAX_SR_PROFILES=8 +CONFIG_BT_GATT_MAX_SR_ATTRIBUTES=100 +# CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set +CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y +CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 +# CONFIG_BT_GATTS_ROBUST_CACHING_ENABLED is not set +# CONFIG_BT_GATTS_DEVICE_NAME_WRITABLE is not set +# CONFIG_BT_GATTS_APPEARANCE_WRITABLE is not set +CONFIG_BT_GATTC_ENABLE=y +CONFIG_BT_GATTC_MAX_CACHE_CHAR=40 +CONFIG_BT_GATTC_NOTIF_REG_MAX=5 +# CONFIG_BT_GATTC_CACHE_NVS_FLASH is not set +CONFIG_BT_GATTC_CONNECT_RETRY_COUNT=3 +CONFIG_BT_BLE_SMP_ENABLE=y +# CONFIG_BT_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set +# CONFIG_BT_BLE_SMP_ID_RESET_ENABLE is not set +# CONFIG_BT_STACK_NO_LOG is not set + +# +# BT DEBUG LOG LEVEL +# +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_HCI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_HCI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_HCI_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTM_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTM_TRACE_LEVEL=2 +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_L2CAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_L2CAP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_RFCOMM_TRACE_LEVEL=2 +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_SDP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_SDP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_SDP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_GAP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_GAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_GAP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BNEP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BNEP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BNEP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_PAN_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_PAN_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_PAN_TRACE_LEVEL=2 +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_A2D_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_A2D_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_A2D_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVDT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVDT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVDT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVCT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVCT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVCT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_AVRC_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_AVRC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_AVRC_TRACE_LEVEL=2 +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_MCA_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_MCA_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_MCA_TRACE_LEVEL=2 +# CONFIG_BT_LOG_HID_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_HID_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_HID_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_HID_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_HID_TRACE_LEVEL=2 +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_APPL_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_APPL_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_APPL_TRACE_LEVEL=2 +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_GATT_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_GATT_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_GATT_TRACE_LEVEL=2 +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_SMP_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_SMP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_SMP_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTIF_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTIF_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTIF_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BTC_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BTC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BTC_TRACE_LEVEL=2 +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_OSI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_OSI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_OSI_TRACE_LEVEL=2 +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_NONE is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_ERROR is not set +CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_WARNING=y +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_API is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_EVENT is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BT_LOG_BLUFI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BT_LOG_BLUFI_TRACE_LEVEL=2 +# end of BT DEBUG LOG LEVEL + +CONFIG_BT_ACL_CONNECTIONS=4 +CONFIG_BT_MULTI_CONNECTION_ENBALE=y +# CONFIG_BT_ALLOCATION_FROM_SPIRAM_FIRST is not set +# CONFIG_BT_BLE_DYNAMIC_ENV_MEMORY is not set +# CONFIG_BT_BLE_HOST_QUEUE_CONG_CHECK is not set +CONFIG_BT_SMP_ENABLE=y +CONFIG_BT_SMP_MAX_BONDS=15 +# CONFIG_BT_BLE_ACT_SCAN_REP_ADV_SCAN is not set +CONFIG_BT_BLE_ESTAB_LINK_CONN_TOUT=30 +CONFIG_BT_MAX_DEVICE_NAME_LEN=32 +# CONFIG_BT_BLE_RPA_SUPPORTED is not set +CONFIG_BT_BLE_RPA_TIMEOUT=900 +# CONFIG_BT_BLE_42_FEATURES_SUPPORTED is not set +# CONFIG_BT_BLE_HIGH_DUTY_ADV_INTERVAL is not set +# end of Bluedroid Options + +# +# Controller Options +# +# CONFIG_BTDM_CTRL_MODE_BLE_ONLY is not set +CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=y +# CONFIG_BTDM_CTRL_MODE_BTDM is not set +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN=2 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN=0 +# CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_HCI is not set +CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_PCM=y +CONFIG_BTDM_CTRL_BR_EDR_SCO_DATA_PATH_EFF=1 +CONFIG_BTDM_CTRL_PCM_ROLE_EDGE_CONFIG=y +CONFIG_BTDM_CTRL_PCM_ROLE_MASTER=y +# CONFIG_BTDM_CTRL_PCM_ROLE_SLAVE is not set +CONFIG_BTDM_CTRL_PCM_POLAR_FALLING_EDGE=y +# CONFIG_BTDM_CTRL_PCM_POLAR_RISING_EDGE is not set +CONFIG_BTDM_CTRL_PCM_ROLE_EFF=0 +CONFIG_BTDM_CTRL_PCM_POLAR_EFF=0 +CONFIG_BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT=y +CONFIG_BTDM_CTRL_LEGACY_AUTH_VENDOR_EVT_EFF=y +CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=0 +CONFIG_BTDM_CTRL_BR_EDR_MAX_ACL_CONN_EFF=2 +CONFIG_BTDM_CTRL_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CTRL_PINNED_TO_CORE_0=y +# CONFIG_BTDM_CTRL_PINNED_TO_CORE_1 is not set +CONFIG_BTDM_CTRL_PINNED_TO_CORE=0 +CONFIG_BTDM_CTRL_HCI_MODE_VHCI=y +# CONFIG_BTDM_CTRL_HCI_MODE_UART_H4 is not set + +# +# MODEM SLEEP Options +# +CONFIG_BTDM_CTRL_MODEM_SLEEP=y +CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_ORIG=y +# CONFIG_BTDM_CTRL_MODEM_SLEEP_MODE_EVED is not set +CONFIG_BTDM_CTRL_LPCLK_SEL_MAIN_XTAL=y +# end of MODEM SLEEP Options + +CONFIG_BTDM_BLE_SLEEP_CLOCK_ACCURACY_INDEX_EFF=1 +# CONFIG_BTDM_CTRL_SCAN_BACKOFF_UPPERLIMITMAX is not set +CONFIG_BTDM_RESERVE_DRAM=0xdb5c +CONFIG_BTDM_CTRL_HLI=y +# end of Controller Options + +# +# Common Options +# +CONFIG_BT_ALARM_MAX_NUM=50 +# end of Common Options + +# CONFIG_BT_HCI_LOG_DEBUG_EN is not set +# end of Bluetooth + +# CONFIG_BLE_MESH is not set + +# +# Console Library +# +# CONFIG_CONSOLE_SORTED_HELP is not set +# end of Console Library + +# +# Driver Configurations +# + +# +# TWAI Configuration +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC=y +CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST=y +CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID=y +CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT=y +CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y +# end of TWAI Configuration + +# +# Legacy ADC Driver Configuration +# +CONFIG_ADC_DISABLE_DAC=y +# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set + +# +# Legacy ADC Calibration Configuration +# +CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y +CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CAL_LUT_ENABLE=y +# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy ADC Calibration Configuration +# end of Legacy ADC Driver Configuration + +# +# Legacy DAC Driver Configurations +# +# CONFIG_DAC_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy DAC Driver Configurations + +# +# Legacy MCPWM Driver Configurations +# +# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy MCPWM Driver Configurations + +# +# Legacy Timer Group Driver Configurations +# +# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy Timer Group Driver Configurations + +# +# Legacy RMT Driver Configurations +# +# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy RMT Driver Configurations + +# +# Legacy I2S Driver Configurations +# +# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy I2S Driver Configurations + +# +# Legacy PCNT Driver Configurations +# +# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy PCNT Driver Configurations + +# +# Legacy SDM Driver Configurations +# +# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy SDM Driver Configurations +# end of Driver Configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_NONE is not set +CONFIG_EFUSE_CODE_SCHEME_COMPAT_3_4=y +# CONFIG_EFUSE_CODE_SCHEME_COMPAT_REPEAT is not set +CONFIG_EFUSE_MAX_BLK_LEN=192 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +# CONFIG_ESP_TLS_USE_SECURE_ELEMENT is not set +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +# end of ESP-TLS + +# +# ADC and ADC Calibration +# +# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set + +# +# ADC Calibration Configurations +# +CONFIG_ADC_CALI_EFUSE_TP_ENABLE=y +CONFIG_ADC_CALI_EFUSE_VREF_ENABLE=y +CONFIG_ADC_CALI_LUT_ENABLE=y +# end of ADC Calibration Configurations + +CONFIG_ADC_DISABLE_DAC_OUTPUT=y +# CONFIG_ADC_ENABLE_DEBUG_LOG is not set +# end of ADC and ADC Calibration + +# +# Wireless Coexistence +# +CONFIG_ESP_COEX_ENABLED=y +CONFIG_ESP_COEX_SW_COEXIST_ENABLE=y +# CONFIG_ESP_COEX_POWER_MANAGEMENT is not set +# end of Wireless Coexistence + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# ESP-Driver:DAC Configurations +# +# CONFIG_DAC_CTRL_FUNC_IN_IRAM is not set +# CONFIG_DAC_ISR_IRAM_SAFE is not set +# CONFIG_DAC_ENABLE_DEBUG_LOG is not set +CONFIG_DAC_DMA_AUTO_16BIT_ALIGN=y +# end of ESP-Driver:DAC Configurations + +# +# ESP-Driver:GPIO Configurations +# +# CONFIG_GPIO_ESP32_SUPPORT_SWITCH_SLP_PULL is not set +# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:GPIO Configurations + +# +# ESP-Driver:GPTimer Configurations +# +CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y +# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set +# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:GPTimer Configurations + +# +# ESP-Driver:I2C Configurations +# +# CONFIG_I2C_ISR_IRAM_SAFE is not set +# CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:I2C Configurations + +# +# ESP-Driver:I2S Configurations +# +# CONFIG_I2S_ISR_IRAM_SAFE is not set +# CONFIG_I2S_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:I2S Configurations + +# +# ESP-Driver:LEDC Configurations +# +# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:LEDC Configurations + +# +# ESP-Driver:MCPWM Configurations +# +# CONFIG_MCPWM_ISR_IRAM_SAFE is not set +# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:MCPWM Configurations + +# +# ESP-Driver:PCNT Configurations +# +# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_PCNT_ISR_IRAM_SAFE is not set +# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:PCNT Configurations + +# +# ESP-Driver:RMT Configurations +# +# CONFIG_RMT_ISR_IRAM_SAFE is not set +# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set +# CONFIG_RMT_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:RMT Configurations + +# +# ESP-Driver:Sigma Delta Modulator Configurations +# +# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_SDM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Sigma Delta Modulator Configurations + +# +# ESP-Driver:SPI Configurations +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of ESP-Driver:SPI Configurations + +# +# ESP-Driver:Touch Sensor Configurations +# +# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set +# CONFIG_TOUCH_ISR_IRAM_SAFE is not set +# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Touch Sensor Configurations + +# +# ESP-Driver:UART Configurations +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of ESP-Driver:UART Configurations + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_ESP32_EMAC=y +CONFIG_ETH_PHY_INTERFACE_RMII=y +CONFIG_ETH_RMII_CLK_INPUT=y +# CONFIG_ETH_RMII_CLK_OUTPUT is not set +CONFIG_ETH_RMII_CLK_IN_GPIO=0 +CONFIG_ETH_DMA_BUFFER_SIZE=512 +CONFIG_ETH_DMA_RX_BUFFER_NUM=10 +CONFIG_ETH_DMA_TX_BUFFER_NUM=10 +# CONFIG_ETH_IRAM_OPTIMIZATION is not set +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set +# CONFIG_ETH_USE_OPENETH is not set +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +CONFIG_ESP_GDBSTUB_ENABLED=y +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y +CONFIG_ESP_GDBSTUB_MAX_TASKS=32 +# end of GDB Stub + +# +# ESP HTTP client +# +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 +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +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 +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set +# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +# end of ESP HTTPS OTA + +# +# ESP HTTPS server +# +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +# end of ESP HTTPS server + +# +# Hardware Settings +# + +# +# Chip revision +# +CONFIG_ESP32_REV_MIN_0=y +# CONFIG_ESP32_REV_MIN_1 is not set +# CONFIG_ESP32_REV_MIN_1_1 is not set +# CONFIG_ESP32_REV_MIN_2 is not set +# CONFIG_ESP32_REV_MIN_3 is not set +# CONFIG_ESP32_REV_MIN_3_1 is not set +CONFIG_ESP32_REV_MIN=0 +CONFIG_ESP32_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 + +# +# Maximum Supported ESP32 Revision (Rev v3.99) +# +CONFIG_ESP32_REV_MAX_FULL=399 +CONFIG_ESP_REV_MAX_FULL=399 +# end of Chip revision + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR is not set +# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set +# end of MAC Config + +# +# Sleep Config +# +# CONFIG_ESP_SLEEP_POWER_DOWN_FLASH is not set +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +# CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU is not set +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +# CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND is not set +CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 +# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set +# CONFIG_ESP_SLEEP_DEBUG is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLK_SRC_INT_RC=y +# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_RTC_CLK_CAL_CYCLES=1024 +# end of RTC Clock Config + +# +# Peripheral Control +# +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y +# end of Peripheral Control + +# +# Main XTAL Config +# +# CONFIG_XTAL_FREQ_26 is not set +CONFIG_XTAL_FREQ_40=y +# CONFIG_XTAL_FREQ_AUTO is not set +CONFIG_XTAL_FREQ=40 +# end of Main XTAL Config + +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 +# +CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set +# end of LCD Peripheral Configuration +# end of LCD and Touch Panel + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +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_RECEIVE_REPORT_ERRORS is not set +# CONFIG_ESP_NETIF_L2_TAP is not set +# CONFIG_ESP_NETIF_BRIDGE_EN is not set +# end of ESP NETIF Adapter + +# +# Partition API Configuration +# +# end of Partition API Configuration + +# +# PHY +# +CONFIG_ESP_PHY_ENABLED=y +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +# CONFIG_ESP_PHY_REDUCE_TX_POWER is not set +CONFIG_ESP_PHY_RF_CAL_PARTIAL=y +# CONFIG_ESP_PHY_RF_CAL_NONE is not set +# CONFIG_ESP_PHY_RF_CAL_FULL is not set +CONFIG_ESP_PHY_CALIBRATION_MODE=0 +# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set +# end of PHY + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +# end of Power Management + +# +# ESP PSRAM +# +# CONFIG_SPIRAM is not set +# end of ESP PSRAM + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP System Settings +# +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160=y +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=160 + +# +# Memory +# +# CONFIG_ESP32_USE_FIXED_STATIC_RAM_SIZE is not set + +# +# Non-backward compatible options +# +# CONFIG_ESP_SYSTEM_ESP32_SRAM1_REGION_AS_IRAM is not set +# end of Non-backward compatible options +# end of Memory + +# +# Trace memory +# +# CONFIG_ESP32_TRAX is not set +CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0 +# end of Trace memory + +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 + +# +# Memory protection +# +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=16384 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=16384 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_INIT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_DEBUG_OCDAWARE=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_5=y + +# +# Brownout Detector +# +CONFIG_ESP_BROWNOUT_DET=y +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_ESP_BROWNOUT_DET_LVL=0 +# end of Brownout Detector + +# CONFIG_ESP32_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y +# end of ESP System Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_TASK_STACK_SIZE=1024 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP Timer (High Resolution Timer) +# +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set +CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 +CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y +CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_TG0_LAC=y +# end of ESP Timer (High Resolution Timer) + +# +# Wi-Fi +# +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 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 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +# CONFIG_ESP_WIFI_CSI_ENABLED is not set +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_NVS_ENABLED=y +CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP_WIFI_IRAM_OPT=y +# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 +CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 +CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 +CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y +CONFIG_ESP_WIFI_GMAC_SUPPORT=y +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +# CONFIG_ESP_WIFI_NAN_ENABLE is not set +CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_WAPI_PSK is not set +# CONFIG_ESP_WIFI_11KV_SUPPORT is not set +# CONFIG_ESP_WIFI_MBO_SUPPORT is not set +# CONFIG_ESP_WIFI_DPP_SUPPORT is not set +# CONFIG_ESP_WIFI_11R_SUPPORT is not set +# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set + +# +# WPS Configuration Options +# +# CONFIG_ESP_WIFI_WPS_STRICT is not set +# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# end of WPS Configuration Options + +# CONFIG_ESP_WIFI_DEBUG_PRINT is not set +# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y +# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +CONFIG_FATFS_VOLUME_COUNT=2 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +# CONFIG_FATFS_SECTOR_512 is not set +CONFIG_FATFS_SECTOR_4096=y +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +# CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 +# CONFIG_FATFS_IMMEDIATE_FSYNC is not set +# CONFIG_FATFS_USE_LABEL is not set +CONFIG_FATFS_LINK_LOCK=y +# end of FAT Filesystem support + +# +# FreeRTOS +# + +# +# Kernel +# +# CONFIG_FREERTOS_SMP is not set +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_HZ=100 +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +# CONFIG_FREERTOS_USE_IDLE_HOOK is not set +# 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_TIMER_SERVICE_TASK_NAME="Tmr Svc" +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set +CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set +# end of Kernel + +# +# Port +# +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y +# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +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_CORETIMER=y +CONFIG_FREERTOS_CORETIMER_0=y +# CONFIG_FREERTOS_CORETIMER_1 is not set +CONFIG_FREERTOS_SYSTICK_USES_CCOUNT=y +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# end of Port + +CONFIG_FREERTOS_PORT=y +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y +CONFIG_FREERTOS_NUMBER_OF_CORES=2 +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y +CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_USE_HOOKS is not set +# CONFIG_HEAP_TASK_TRACKING is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set +# end of Heap memory debugging + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +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 +# CONFIG_LOG_MASTER_LEVEL is not set +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_ENABLE=y +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_ND6=y +# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +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_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=68 +CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 +CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV4=y +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=16 +CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5760 +CONFIG_LWIP_TCP_WND_DEFAULT=5760 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 +# CONFIG_LWIP_TCP_SACK_OUT is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +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_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +CONFIG_LWIP_SNTP_STARTUP_DELAY=y +CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 +# end of SNTP + +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + +CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set +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_IP6_INPUT_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v3.x related +# +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +CONFIG_MBEDTLS_PKCS7_C=y +# end of mbedTLS v3.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set +# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +# CONFIG_MBEDTLS_PSK_MODES is not set +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +# CONFIG_MBEDTLS_DHM_C is not set +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +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_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 +# end of mbedTLS + +# +# ESP-MQTT Configurations +# +CONFIG_MQTT_PROTOCOL_311=y +# CONFIG_MQTT_PROTOCOL_5 is not set +CONFIG_MQTT_TRANSPORT_SSL=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set +# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set +# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set +# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set +# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set +# CONFIG_MQTT_CUSTOM_OUTBOX is not set +# end of ESP-MQTT Configurations + +# +# Newlib +# +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 + +# +# NVS +# +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set + +# +# Thread Operational Dataset +# +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 is not set + +# +# Thread Address Query Config +# +# end of Thread Address Query Config +# end of OpenThread + +# +# Protocomm +# +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y +# end of Protocomm + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# MMU Config +# +CONFIG_MMU_PAGE_SIZE_64KB=y +CONFIG_MMU_PAGE_MODE="64KB" +CONFIG_MMU_PAGE_SIZE=0x10000 +# end of MMU Config + +# +# Main Flash configuration +# + +# +# SPI Flash behavior when brownout +# +CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y +CONFIG_SPI_FLASH_BROWNOUT_RESET=y +# end of SPI Flash behavior when brownout + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_SHARE_SPI1_BUS is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_GD_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORTED=y +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +# CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP is not set +# CONFIG_SPI_FLASH_SUPPORT_TH_CHIP is not set +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# CONFIG_WS_DYNAMIC_BUFFER is not set +# end of Websocket +# end of TCP Transport + +# +# Ultra Low Power (ULP) Co-processor +# +# CONFIG_ULP_COPROC_ENABLED is not set + +# +# ULP Debugging Options +# +# end of ULP Debugging Options +# end of Ultra Low Power (ULP) Co-processor + +# +# Unity unit testing library +# +CONFIG_UNITY_ENABLE_FLOAT=y +CONFIG_UNITY_ENABLE_DOUBLE=y +# CONFIG_UNITY_ENABLE_64BIT is not set +# CONFIG_UNITY_ENABLE_COLOR is not set +CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y +# CONFIG_UNITY_ENABLE_FIXTURE is not set +# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set +# end of Unity unit testing library + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +# CONFIG_VFS_SELECT_IN_RAM is not set +CONFIG_VFS_SUPPORT_TERMIOS=y +CONFIG_VFS_MAX_COUNT=8 + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +# CONFIG_WIFI_PROV_BLE_BONDING is not set +# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set +# CONFIG_WIFI_PROV_KEEP_BLE_ON_AFTER_PROV 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 + +# +# ESP LVGL PORT +# +# end of ESP LVGL PORT + +# +# LVGL configuration +# +CONFIG_LV_CONF_SKIP=y +# CONFIG_LV_CONF_MINIMAL is not set + +# +# Color Settings +# +# CONFIG_LV_COLOR_DEPTH_32 is not set +# CONFIG_LV_COLOR_DEPTH_24 is not set +CONFIG_LV_COLOR_DEPTH_16=y +# CONFIG_LV_COLOR_DEPTH_8 is not set +# CONFIG_LV_COLOR_DEPTH_1 is not set +CONFIG_LV_COLOR_DEPTH=16 +# end of Color Settings + +# +# Memory Settings +# +CONFIG_LV_USE_BUILTIN_MALLOC=y +# CONFIG_LV_USE_CLIB_MALLOC is not set +# CONFIG_LV_USE_MICROPYTHON_MALLOC is not set +# CONFIG_LV_USE_RTTHREAD_MALLOC is not set +# CONFIG_LV_USE_CUSTOM_MALLOC is not set +CONFIG_LV_USE_BUILTIN_STRING=y +# CONFIG_LV_USE_CLIB_STRING is not set +# CONFIG_LV_USE_CUSTOM_STRING is not set +CONFIG_LV_USE_BUILTIN_SPRINTF=y +# CONFIG_LV_USE_CLIB_SPRINTF is not set +# CONFIG_LV_USE_CUSTOM_SPRINTF is not set +CONFIG_LV_MEM_SIZE_KILOBYTES=32 +CONFIG_LV_MEM_POOL_EXPAND_SIZE_KILOBYTES=0 +CONFIG_LV_MEM_ADR=0x0 +# end of Memory Settings + +# +# HAL Settings +# +CONFIG_LV_DEF_REFR_PERIOD=33 +CONFIG_LV_DPI_DEF=130 +# end of HAL Settings + +# +# Operating System (OS) +# +CONFIG_LV_OS_NONE=y +# CONFIG_LV_OS_PTHREAD is not set +# CONFIG_LV_OS_FREERTOS is not set +# CONFIG_LV_OS_CMSIS_RTOS2 is not set +# CONFIG_LV_OS_RTTHREAD is not set +# CONFIG_LV_OS_WINDOWS is not set +# CONFIG_LV_OS_MQX is not set +# CONFIG_LV_OS_CUSTOM is not set +CONFIG_LV_USE_OS=0 +# end of Operating System (OS) + +# +# Rendering Configuration +# +CONFIG_LV_DRAW_BUF_STRIDE_ALIGN=1 +CONFIG_LV_DRAW_BUF_ALIGN=4 +CONFIG_LV_DRAW_LAYER_SIMPLE_BUF_SIZE=24576 +CONFIG_LV_USE_DRAW_SW=y +CONFIG_LV_DRAW_SW_SUPPORT_RGB565=y +CONFIG_LV_DRAW_SW_SUPPORT_RGB565A8=y +CONFIG_LV_DRAW_SW_SUPPORT_RGB888=y +CONFIG_LV_DRAW_SW_SUPPORT_XRGB8888=y +CONFIG_LV_DRAW_SW_SUPPORT_ARGB8888=y +CONFIG_LV_DRAW_SW_SUPPORT_L8=y +CONFIG_LV_DRAW_SW_SUPPORT_AL88=y +CONFIG_LV_DRAW_SW_SUPPORT_A8=y +CONFIG_LV_DRAW_SW_SUPPORT_I1=y +CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT=1 +# CONFIG_LV_USE_DRAW_ARM2D_SYNC is not set +# CONFIG_LV_USE_NATIVE_HELIUM_ASM is not set +CONFIG_LV_DRAW_SW_COMPLEX=y +# CONFIG_LV_USE_DRAW_SW_COMPLEX_GRADIENTS is not set +CONFIG_LV_DRAW_SW_SHADOW_CACHE_SIZE=0 +CONFIG_LV_DRAW_SW_CIRCLE_CACHE_SIZE=4 +CONFIG_LV_DRAW_SW_ASM_NONE=y +# CONFIG_LV_DRAW_SW_ASM_NEON is not set +# CONFIG_LV_DRAW_SW_ASM_HELIUM is not set +# CONFIG_LV_DRAW_SW_ASM_CUSTOM is not set +CONFIG_LV_USE_DRAW_SW_ASM=0 +# CONFIG_LV_USE_DRAW_VGLITE is not set +# CONFIG_LV_USE_PXP is not set +# CONFIG_LV_USE_DRAW_DAVE2D is not set +# CONFIG_LV_USE_DRAW_SDL is not set +# CONFIG_LV_USE_DRAW_VG_LITE is not set +# CONFIG_LV_USE_VECTOR_GRAPHIC is not set +# end of Rendering Configuration + +# +# Feature Configuration +# + +# +# Logging +# +# CONFIG_LV_USE_LOG is not set +# end of Logging + +# +# Asserts +# +CONFIG_LV_USE_ASSERT_NULL=y +CONFIG_LV_USE_ASSERT_MALLOC=y +# CONFIG_LV_USE_ASSERT_STYLE is not set +# CONFIG_LV_USE_ASSERT_MEM_INTEGRITY is not set +# CONFIG_LV_USE_ASSERT_OBJ is not set +CONFIG_LV_ASSERT_HANDLER_INCLUDE="assert.h" +# end of Asserts + +# +# Debug +# +# CONFIG_LV_USE_REFR_DEBUG is not set +# CONFIG_LV_USE_LAYER_DEBUG is not set +# CONFIG_LV_USE_PARALLEL_DRAW_DEBUG is not set +# end of Debug + +# +# Others +# +# CONFIG_LV_ENABLE_GLOBAL_CUSTOM is not set +CONFIG_LV_CACHE_DEF_SIZE=0 +CONFIG_LV_IMAGE_HEADER_CACHE_DEF_CNT=0 +CONFIG_LV_GRADIENT_MAX_STOPS=2 +CONFIG_LV_COLOR_MIX_ROUND_OFS=128 +# CONFIG_LV_OBJ_STYLE_CACHE is not set +# CONFIG_LV_USE_OBJ_ID is not set +# CONFIG_LV_USE_OBJ_PROPERTY is not set +# end of Others +# end of Feature Configuration + +# +# Compiler Settings +# +# CONFIG_LV_BIG_ENDIAN_SYSTEM is not set +CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE=1 +# CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM is not set +# CONFIG_LV_USE_FLOAT is not set +# CONFIG_LV_USE_MATRIX is not set +# CONFIG_LV_USE_PRIVATE_API is not set +# end of Compiler Settings + +# +# Font Usage +# + +# +# Enable built-in fonts +# +# CONFIG_LV_FONT_MONTSERRAT_8 is not set +# CONFIG_LV_FONT_MONTSERRAT_10 is not set +# CONFIG_LV_FONT_MONTSERRAT_12 is not set +CONFIG_LV_FONT_MONTSERRAT_14=y +# CONFIG_LV_FONT_MONTSERRAT_16 is not set +# CONFIG_LV_FONT_MONTSERRAT_18 is not set +CONFIG_LV_FONT_MONTSERRAT_20=y +# CONFIG_LV_FONT_MONTSERRAT_22 is not set +# CONFIG_LV_FONT_MONTSERRAT_24 is not set +# CONFIG_LV_FONT_MONTSERRAT_26 is not set +# CONFIG_LV_FONT_MONTSERRAT_28 is not set +# CONFIG_LV_FONT_MONTSERRAT_30 is not set +# CONFIG_LV_FONT_MONTSERRAT_32 is not set +# CONFIG_LV_FONT_MONTSERRAT_34 is not set +# CONFIG_LV_FONT_MONTSERRAT_36 is not set +# CONFIG_LV_FONT_MONTSERRAT_38 is not set +# CONFIG_LV_FONT_MONTSERRAT_40 is not set +# CONFIG_LV_FONT_MONTSERRAT_42 is not set +# CONFIG_LV_FONT_MONTSERRAT_44 is not set +# CONFIG_LV_FONT_MONTSERRAT_46 is not set +# CONFIG_LV_FONT_MONTSERRAT_48 is not set +# CONFIG_LV_FONT_MONTSERRAT_28_COMPRESSED is not set +# CONFIG_LV_FONT_DEJAVU_16_PERSIAN_HEBREW is not set +# CONFIG_LV_FONT_SIMSUN_14_CJK is not set +# CONFIG_LV_FONT_SIMSUN_16_CJK is not set +CONFIG_LV_FONT_UNSCII_8=y +# CONFIG_LV_FONT_UNSCII_16 is not set +# end of Enable built-in fonts + +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_8 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_10 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_12 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_14 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_16 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_18 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_20 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_22 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_24 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_26 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_30 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_32 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_34 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_36 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_38 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_40 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_42 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_44 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_46 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_48 is not set +# CONFIG_LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED is not set +# CONFIG_LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW is not set +# CONFIG_LV_FONT_DEFAULT_SIMSUN_14_CJK is not set +# CONFIG_LV_FONT_DEFAULT_SIMSUN_16_CJK is not set +CONFIG_LV_FONT_DEFAULT_UNSCII_8=y +# CONFIG_LV_FONT_DEFAULT_UNSCII_16 is not set +# CONFIG_LV_FONT_FMT_TXT_LARGE is not set +# CONFIG_LV_USE_FONT_COMPRESSED is not set +CONFIG_LV_USE_FONT_PLACEHOLDER=y +# end of Font Usage + +# +# Text Settings +# +CONFIG_LV_TXT_ENC_UTF8=y +# CONFIG_LV_TXT_ENC_ASCII is not set +CONFIG_LV_TXT_BREAK_CHARS=" ,.;:-_" +CONFIG_LV_TXT_LINE_BREAK_LONG_LEN=0 +# CONFIG_LV_USE_BIDI is not set +# CONFIG_LV_USE_ARABIC_PERSIAN_CHARS is not set +# end of Text Settings + +# +# Widget Usage +# +CONFIG_LV_WIDGETS_HAS_DEFAULT_VALUE=y +CONFIG_LV_USE_ANIMIMG=y +CONFIG_LV_USE_ARC=y +CONFIG_LV_USE_BAR=y +CONFIG_LV_USE_BUTTON=y +CONFIG_LV_USE_BUTTONMATRIX=y +CONFIG_LV_USE_CALENDAR=y +# CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY is not set +CONFIG_LV_USE_CALENDAR_HEADER_ARROW=y +CONFIG_LV_USE_CALENDAR_HEADER_DROPDOWN=y +# CONFIG_LV_USE_CALENDAR_CHINESE is not set +CONFIG_LV_USE_CANVAS=y +CONFIG_LV_USE_CHART=y +CONFIG_LV_USE_CHECKBOX=y +CONFIG_LV_USE_DROPDOWN=y +CONFIG_LV_USE_IMAGE=y +CONFIG_LV_USE_IMAGEBUTTON=y +CONFIG_LV_USE_KEYBOARD=y +CONFIG_LV_USE_LABEL=y +CONFIG_LV_LABEL_TEXT_SELECTION=y +CONFIG_LV_LABEL_LONG_TXT_HINT=y +CONFIG_LV_LABEL_WAIT_CHAR_COUNT=3 +CONFIG_LV_USE_LED=y +CONFIG_LV_USE_LINE=y +CONFIG_LV_USE_LIST=y +CONFIG_LV_USE_MENU=y +CONFIG_LV_USE_MSGBOX=y +CONFIG_LV_USE_ROLLER=y +CONFIG_LV_USE_SCALE=y +CONFIG_LV_USE_SLIDER=y +CONFIG_LV_USE_SPAN=y +CONFIG_LV_SPAN_SNIPPET_STACK_SIZE=64 +CONFIG_LV_USE_SPINBOX=y +CONFIG_LV_USE_SPINNER=y +CONFIG_LV_USE_SWITCH=y +CONFIG_LV_USE_TEXTAREA=y +CONFIG_LV_TEXTAREA_DEF_PWD_SHOW_TIME=1500 +CONFIG_LV_USE_TABLE=y +CONFIG_LV_USE_TABVIEW=y +CONFIG_LV_USE_TILEVIEW=y +CONFIG_LV_USE_WIN=y +# end of Widget Usage + +# +# Themes +# +CONFIG_LV_USE_THEME_DEFAULT=y +# CONFIG_LV_THEME_DEFAULT_DARK is not set +CONFIG_LV_THEME_DEFAULT_GROW=y +CONFIG_LV_THEME_DEFAULT_TRANSITION_TIME=80 +CONFIG_LV_USE_THEME_SIMPLE=y +# CONFIG_LV_USE_THEME_MONO is not set +# end of Themes + +# +# Layouts +# +CONFIG_LV_USE_FLEX=y +CONFIG_LV_USE_GRID=y +# end of Layouts + +# +# 3rd Party Libraries +# +CONFIG_LV_FS_DEFAULT_DRIVE_LETTER=0 +# CONFIG_LV_USE_FS_STDIO is not set +# CONFIG_LV_USE_FS_POSIX is not set +# CONFIG_LV_USE_FS_WIN32 is not set +# CONFIG_LV_USE_FS_FATFS is not set +# CONFIG_LV_USE_FS_MEMFS is not set +# CONFIG_LV_USE_FS_LITTLEFS is not set +# CONFIG_LV_USE_FS_ARDUINO_ESP_LITTLEFS is not set +# CONFIG_LV_USE_FS_ARDUINO_SD is not set +# CONFIG_LV_USE_LODEPNG is not set +# CONFIG_LV_USE_LIBPNG is not set +# CONFIG_LV_USE_BMP is not set +# CONFIG_LV_USE_TJPGD is not set +# CONFIG_LV_USE_LIBJPEG_TURBO is not set +# CONFIG_LV_USE_GIF is not set +# CONFIG_LV_BIN_DECODER_RAM_LOAD is not set +# CONFIG_LV_USE_RLE is not set +# CONFIG_LV_USE_QRCODE is not set +# CONFIG_LV_USE_BARCODE is not set +# CONFIG_LV_USE_FREETYPE is not set +# CONFIG_LV_USE_TINY_TTF is not set +# CONFIG_LV_USE_RLOTTIE is not set +# CONFIG_LV_USE_THORVG is not set +# CONFIG_LV_USE_LZ4 is not set +# CONFIG_LV_USE_FFMPEG is not set +# end of 3rd Party Libraries + +# +# Others +# +CONFIG_LV_USE_SNAPSHOT=y +# CONFIG_LV_USE_SYSMON is not set +# CONFIG_LV_USE_PROFILER is not set +# CONFIG_LV_USE_MONKEY is not set +# CONFIG_LV_USE_GRIDNAV is not set +# CONFIG_LV_USE_FRAGMENT is not set +# CONFIG_LV_USE_IMGFONT is not set +CONFIG_LV_USE_OBSERVER=y +# CONFIG_LV_USE_IME_PINYIN is not set +# CONFIG_LV_USE_FILE_EXPLORER is not set +CONFIG_LVGL_VERSION_MAJOR=9 +CONFIG_LVGL_VERSION_MINOR=2 +CONFIG_LVGL_VERSION_PATCH=2 +# end of Others + +# +# Devices +# +# CONFIG_LV_USE_SDL is not set +# CONFIG_LV_USE_X11 is not set +# CONFIG_LV_USE_WAYLAND is not set +# CONFIG_LV_USE_LINUX_FBDEV is not set +# CONFIG_LV_USE_NUTTX is not set +# CONFIG_LV_USE_LINUX_DRM is not set +# CONFIG_LV_USE_TFT_ESPI is not set +# CONFIG_LV_USE_EVDEV is not set +# CONFIG_LV_USE_LIBINPUT is not set +# CONFIG_LV_USE_ST7735 is not set +# CONFIG_LV_USE_ST7789 is not set +# CONFIG_LV_USE_ST7796 is not set +# CONFIG_LV_USE_ILI9341 is not set +# CONFIG_LV_USE_GENERIC_MIPI is not set +# CONFIG_LV_USE_RENESAS_GLCDC is not set +# CONFIG_LV_USE_OPENGLES is not set +# CONFIG_LV_USE_QNX is not set +# end of Devices + +# +# Examples +# +CONFIG_LV_BUILD_EXAMPLES=y +# end of Examples + +# +# Demos +# +# CONFIG_LV_USE_DEMO_WIDGETS is not set +# CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER is not set +# CONFIG_LV_USE_DEMO_RENDER is not set +# CONFIG_LV_USE_DEMO_SCROLL is not set +# CONFIG_LV_USE_DEMO_STRESS is not set +# CONFIG_LV_USE_DEMO_MUSIC is not set +# CONFIG_LV_USE_DEMO_FLEX_LAYOUT is not set +# CONFIG_LV_USE_DEMO_MULTILANG is not set +# end of Demos +# end of LVGL configuration +# end of Component config + +# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set + +# Deprecated options for backward compatibility +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_ESP32_NO_BLOBS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V2_1_BOOTLOADERS is not set +# CONFIG_ESP32_COMPATIBLE_PRE_V3_1_BOOTLOADERS 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 +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 is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +CONFIG_MONITOR_BAUD=115200 +# CONFIG_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG is not set +# CONFIG_COMPILER_OPTIMIZATION_DEFAULT is not set +CONFIG_OPTIMIZATION_LEVEL_RELEASE=y +CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE=y +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +CONFIG_BLUEDROID_ENABLED=y +# CONFIG_NIMBLE_ENABLED is not set +CONFIG_BTC_TASK_STACK_SIZE=3072 +CONFIG_BLUEDROID_PINNED_TO_CORE_0=y +# CONFIG_BLUEDROID_PINNED_TO_CORE_1 is not set +CONFIG_BLUEDROID_PINNED_TO_CORE=0 +CONFIG_BTU_TASK_STACK_SIZE=4352 +# CONFIG_BLUEDROID_MEM_DEBUG is not set +CONFIG_CLASSIC_BT_ENABLED=y +CONFIG_A2DP_ENABLE=y +# CONFIG_HFP_ENABLE is not set +CONFIG_GATTS_ENABLE=y +# CONFIG_GATTS_SEND_SERVICE_CHANGE_MANUAL is not set +CONFIG_GATTS_SEND_SERVICE_CHANGE_AUTO=y +CONFIG_GATTS_SEND_SERVICE_CHANGE_MODE=0 +CONFIG_GATTC_ENABLE=y +# CONFIG_GATTC_CACHE_NVS_FLASH is not set +CONFIG_BLE_SMP_ENABLE=y +# CONFIG_SMP_SLAVE_CON_PARAMS_UPD_ENABLE is not set +# CONFIG_HCI_TRACE_LEVEL_NONE is not set +# CONFIG_HCI_TRACE_LEVEL_ERROR is not set +CONFIG_HCI_TRACE_LEVEL_WARNING=y +# CONFIG_HCI_TRACE_LEVEL_API is not set +# CONFIG_HCI_TRACE_LEVEL_EVENT is not set +# CONFIG_HCI_TRACE_LEVEL_DEBUG is not set +# CONFIG_HCI_TRACE_LEVEL_VERBOSE is not set +CONFIG_HCI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTM_TRACE_LEVEL_NONE is not set +# CONFIG_BTM_TRACE_LEVEL_ERROR is not set +CONFIG_BTM_TRACE_LEVEL_WARNING=y +# CONFIG_BTM_TRACE_LEVEL_API is not set +# CONFIG_BTM_TRACE_LEVEL_EVENT is not set +# CONFIG_BTM_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTM_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTM_INITIAL_TRACE_LEVEL=2 +# CONFIG_L2CAP_TRACE_LEVEL_NONE is not set +# CONFIG_L2CAP_TRACE_LEVEL_ERROR is not set +CONFIG_L2CAP_TRACE_LEVEL_WARNING=y +# CONFIG_L2CAP_TRACE_LEVEL_API is not set +# CONFIG_L2CAP_TRACE_LEVEL_EVENT is not set +# CONFIG_L2CAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_L2CAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_L2CAP_INITIAL_TRACE_LEVEL=2 +# CONFIG_RFCOMM_TRACE_LEVEL_NONE is not set +# CONFIG_RFCOMM_TRACE_LEVEL_ERROR is not set +CONFIG_RFCOMM_TRACE_LEVEL_WARNING=y +# CONFIG_RFCOMM_TRACE_LEVEL_API is not set +# CONFIG_RFCOMM_TRACE_LEVEL_EVENT is not set +# CONFIG_RFCOMM_TRACE_LEVEL_DEBUG is not set +# CONFIG_RFCOMM_TRACE_LEVEL_VERBOSE is not set +CONFIG_RFCOMM_INITIAL_TRACE_LEVEL=2 +# CONFIG_SDP_TRACE_LEVEL_NONE is not set +# CONFIG_SDP_TRACE_LEVEL_ERROR is not set +CONFIG_SDP_TRACE_LEVEL_WARNING=y +# CONFIG_SDP_TRACE_LEVEL_API is not set +# CONFIG_SDP_TRACE_LEVEL_EVENT is not set +# CONFIG_SDP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SDP_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTH_LOG_SDP_INITIAL_TRACE_LEVEL=2 +# CONFIG_GAP_TRACE_LEVEL_NONE is not set +# CONFIG_GAP_TRACE_LEVEL_ERROR is not set +CONFIG_GAP_TRACE_LEVEL_WARNING=y +# CONFIG_GAP_TRACE_LEVEL_API is not set +# CONFIG_GAP_TRACE_LEVEL_EVENT is not set +# CONFIG_GAP_TRACE_LEVEL_DEBUG is not set +# CONFIG_GAP_TRACE_LEVEL_VERBOSE is not set +CONFIG_GAP_INITIAL_TRACE_LEVEL=2 +CONFIG_BNEP_INITIAL_TRACE_LEVEL=2 +# CONFIG_PAN_TRACE_LEVEL_NONE is not set +# CONFIG_PAN_TRACE_LEVEL_ERROR is not set +CONFIG_PAN_TRACE_LEVEL_WARNING=y +# CONFIG_PAN_TRACE_LEVEL_API is not set +# CONFIG_PAN_TRACE_LEVEL_EVENT is not set +# CONFIG_PAN_TRACE_LEVEL_DEBUG is not set +# CONFIG_PAN_TRACE_LEVEL_VERBOSE is not set +CONFIG_PAN_INITIAL_TRACE_LEVEL=2 +# CONFIG_A2D_TRACE_LEVEL_NONE is not set +# CONFIG_A2D_TRACE_LEVEL_ERROR is not set +CONFIG_A2D_TRACE_LEVEL_WARNING=y +# CONFIG_A2D_TRACE_LEVEL_API is not set +# CONFIG_A2D_TRACE_LEVEL_EVENT is not set +# CONFIG_A2D_TRACE_LEVEL_DEBUG is not set +# CONFIG_A2D_TRACE_LEVEL_VERBOSE is not set +CONFIG_A2D_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVDT_TRACE_LEVEL_NONE is not set +# CONFIG_AVDT_TRACE_LEVEL_ERROR is not set +CONFIG_AVDT_TRACE_LEVEL_WARNING=y +# CONFIG_AVDT_TRACE_LEVEL_API is not set +# CONFIG_AVDT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVDT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVDT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVDT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVCT_TRACE_LEVEL_NONE is not set +# CONFIG_AVCT_TRACE_LEVEL_ERROR is not set +CONFIG_AVCT_TRACE_LEVEL_WARNING=y +# CONFIG_AVCT_TRACE_LEVEL_API is not set +# CONFIG_AVCT_TRACE_LEVEL_EVENT is not set +# CONFIG_AVCT_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVCT_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVCT_INITIAL_TRACE_LEVEL=2 +# CONFIG_AVRC_TRACE_LEVEL_NONE is not set +# CONFIG_AVRC_TRACE_LEVEL_ERROR is not set +CONFIG_AVRC_TRACE_LEVEL_WARNING=y +# CONFIG_AVRC_TRACE_LEVEL_API is not set +# CONFIG_AVRC_TRACE_LEVEL_EVENT is not set +# CONFIG_AVRC_TRACE_LEVEL_DEBUG is not set +# CONFIG_AVRC_TRACE_LEVEL_VERBOSE is not set +CONFIG_AVRC_INITIAL_TRACE_LEVEL=2 +# CONFIG_MCA_TRACE_LEVEL_NONE is not set +# CONFIG_MCA_TRACE_LEVEL_ERROR is not set +CONFIG_MCA_TRACE_LEVEL_WARNING=y +# CONFIG_MCA_TRACE_LEVEL_API is not set +# CONFIG_MCA_TRACE_LEVEL_EVENT is not set +# CONFIG_MCA_TRACE_LEVEL_DEBUG is not set +# CONFIG_MCA_TRACE_LEVEL_VERBOSE is not set +CONFIG_MCA_INITIAL_TRACE_LEVEL=2 +# CONFIG_HID_TRACE_LEVEL_NONE is not set +# CONFIG_HID_TRACE_LEVEL_ERROR is not set +CONFIG_HID_TRACE_LEVEL_WARNING=y +# CONFIG_HID_TRACE_LEVEL_API is not set +# CONFIG_HID_TRACE_LEVEL_EVENT is not set +# CONFIG_HID_TRACE_LEVEL_DEBUG is not set +# CONFIG_HID_TRACE_LEVEL_VERBOSE is not set +CONFIG_HID_INITIAL_TRACE_LEVEL=2 +# CONFIG_APPL_TRACE_LEVEL_NONE is not set +# CONFIG_APPL_TRACE_LEVEL_ERROR is not set +CONFIG_APPL_TRACE_LEVEL_WARNING=y +# CONFIG_APPL_TRACE_LEVEL_API is not set +# CONFIG_APPL_TRACE_LEVEL_EVENT is not set +# CONFIG_APPL_TRACE_LEVEL_DEBUG is not set +# CONFIG_APPL_TRACE_LEVEL_VERBOSE is not set +CONFIG_APPL_INITIAL_TRACE_LEVEL=2 +# CONFIG_GATT_TRACE_LEVEL_NONE is not set +# CONFIG_GATT_TRACE_LEVEL_ERROR is not set +CONFIG_GATT_TRACE_LEVEL_WARNING=y +# CONFIG_GATT_TRACE_LEVEL_API is not set +# CONFIG_GATT_TRACE_LEVEL_EVENT is not set +# CONFIG_GATT_TRACE_LEVEL_DEBUG is not set +# CONFIG_GATT_TRACE_LEVEL_VERBOSE is not set +CONFIG_GATT_INITIAL_TRACE_LEVEL=2 +# CONFIG_SMP_TRACE_LEVEL_NONE is not set +# CONFIG_SMP_TRACE_LEVEL_ERROR is not set +CONFIG_SMP_TRACE_LEVEL_WARNING=y +# CONFIG_SMP_TRACE_LEVEL_API is not set +# CONFIG_SMP_TRACE_LEVEL_EVENT is not set +# CONFIG_SMP_TRACE_LEVEL_DEBUG is not set +# CONFIG_SMP_TRACE_LEVEL_VERBOSE is not set +CONFIG_SMP_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTIF_TRACE_LEVEL_NONE is not set +# CONFIG_BTIF_TRACE_LEVEL_ERROR is not set +CONFIG_BTIF_TRACE_LEVEL_WARNING=y +# CONFIG_BTIF_TRACE_LEVEL_API is not set +# CONFIG_BTIF_TRACE_LEVEL_EVENT is not set +# CONFIG_BTIF_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTIF_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTIF_INITIAL_TRACE_LEVEL=2 +# CONFIG_BTC_TRACE_LEVEL_NONE is not set +# CONFIG_BTC_TRACE_LEVEL_ERROR is not set +CONFIG_BTC_TRACE_LEVEL_WARNING=y +# CONFIG_BTC_TRACE_LEVEL_API is not set +# CONFIG_BTC_TRACE_LEVEL_EVENT is not set +# CONFIG_BTC_TRACE_LEVEL_DEBUG is not set +# CONFIG_BTC_TRACE_LEVEL_VERBOSE is not set +CONFIG_BTC_INITIAL_TRACE_LEVEL=2 +# CONFIG_OSI_TRACE_LEVEL_NONE is not set +# CONFIG_OSI_TRACE_LEVEL_ERROR is not set +CONFIG_OSI_TRACE_LEVEL_WARNING=y +# CONFIG_OSI_TRACE_LEVEL_API is not set +# CONFIG_OSI_TRACE_LEVEL_EVENT is not set +# CONFIG_OSI_TRACE_LEVEL_DEBUG is not set +# CONFIG_OSI_TRACE_LEVEL_VERBOSE is not set +CONFIG_OSI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLUFI_TRACE_LEVEL_NONE is not set +# CONFIG_BLUFI_TRACE_LEVEL_ERROR is not set +CONFIG_BLUFI_TRACE_LEVEL_WARNING=y +# CONFIG_BLUFI_TRACE_LEVEL_API is not set +# CONFIG_BLUFI_TRACE_LEVEL_EVENT is not set +# CONFIG_BLUFI_TRACE_LEVEL_DEBUG is not set +# CONFIG_BLUFI_TRACE_LEVEL_VERBOSE is not set +CONFIG_BLUFI_INITIAL_TRACE_LEVEL=2 +# CONFIG_BLE_HOST_QUEUE_CONGESTION_CHECK is not set +CONFIG_SMP_ENABLE=y +# CONFIG_BLE_ACTIVE_SCAN_REPORT_ADV_SCAN_RSP_INDIVIDUALLY is not set +CONFIG_BLE_ESTABLISH_LINK_CONNECTION_TIMEOUT=30 +# CONFIG_BTDM_CONTROLLER_MODE_BLE_ONLY is not set +CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY=y +# CONFIG_BTDM_CONTROLLER_MODE_BTDM is not set +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN=2 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN=0 +CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=2 +CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0 +CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0 +CONFIG_BTDM_CONTROLLER_HCI_MODE_VHCI=y +# CONFIG_BTDM_CONTROLLER_HCI_MODE_UART_H4 is not set +CONFIG_BTDM_CONTROLLER_MODEM_SLEEP=y +CONFIG_ADC2_DISABLE_DAC=y +CONFIG_SW_COEXIST_ENABLE=y +CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y +CONFIG_ESP_WIFI_SW_COEXIST_ENABLE=y +# CONFIG_MCPWM_ISR_IN_IRAM is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +CONFIG_GDBSTUB_SUPPORT_TASKS=y +CONFIG_GDBSTUB_MAX_TASKS=32 +# CONFIG_OTA_ALLOW_HTTP is not set +# CONFIG_TWO_UNIVERSAL_MAC_ADDRESS is not set +CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y +CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4 +# CONFIG_ESP_SYSTEM_PD_FLASH is not set +CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32_RTC_CLK_SRC_INT_RC=y +CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y +# CONFIG_ESP32_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL is not set +# CONFIG_ESP32_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC is not set +# CONFIG_ESP32_RTC_CLK_SRC_INT_8MD256 is not set +# CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256 is not set +CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024 +# CONFIG_ESP32_XTAL_FREQ_26 is not set +CONFIG_ESP32_XTAL_FREQ_40=y +# CONFIG_ESP32_XTAL_FREQ_AUTO is not set +CONFIG_ESP32_XTAL_FREQ=40 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# CONFIG_REDUCE_PHY_TX_POWER is not set +# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set +# CONFIG_SPIRAM_SUPPORT is not set +# CONFIG_ESP32_SPIRAM_SUPPORT is not set +# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y +# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set +CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160 +CONFIG_TRACEMEM_RESERVE_DRAM=0x0 +# CONFIG_ESP32_PANIC_PRINT_HALT is not set +CONFIG_ESP32_PANIC_PRINT_REBOOT=y +# CONFIG_ESP32_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP32_PANIC_GDBSTUB is not set +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=16384 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +CONFIG_ESP_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32_DEBUG_OCDAWARE=y +CONFIG_BROWNOUT_DET=y +CONFIG_ESP32_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_0=y +CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_0=y +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_7 is not set +# CONFIG_ESP32_BROWNOUT_DET_LVL_SEL_7 is not set +CONFIG_BROWNOUT_DET_LVL=0 +CONFIG_ESP32_BROWNOUT_DET_LVL=0 +# CONFIG_DISABLE_BASIC_ROM_CONSOLE is not set +CONFIG_IPC_TASK_STACK_SIZE=1024 +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 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 +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_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y +CONFIG_WPA_MBEDTLS_CRYPTO=y +CONFIG_WPA_MBEDTLS_TLS_CLIENT=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# CONFIG_WPA_11R_SUPPORT is not set +# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +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_HAL_ASSERTION_SILIENT is not set +# CONFIG_L2_TO_L3_COPY is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5760 +CONFIG_TCP_WND_DEFAULT=5760 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_HRT=y +CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_HRT is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +# CONFIG_ESP32_ULP_COPROC_ENABLED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options +>>>>>>> 4feb4c0a98bddb1f2a172ea4b195ce31ba18d442