# Architecture Design The module consists of two parallel top-level subdirectories: docs/ and firmware/. - docs/ adopts the Sphinx RST documentation system; the top-level index.rst organizes 1_hardware (hardware specifications), 2_software (environment setup), 3_examples (examples categorized by basics/advance/classic/Agent/AudioAI), 4_xiaozhi (Xiaozhi AI Assistant topic), 5_api (four-level API reference: library/mPython/micropython/pythonStd/mpy_ref), 6_C_program (Arduino/PlatformIO/ESP-IDF development guide), and 7_faq through the toctree; boards/ledong_v2/ contains a mirror documentation tree for an independent board, each with its own conf.py/Makefile for separate builds. - firmware/ is an ESP-IDF v5.x + CMake project; the top-level CMakeLists.txt selects boards//mpconfigboard.cmake via the MICROPY_BOARD variable and merges multiple sdkconfig.* files to generate the final configuration; the default board is mpython_v3, and five board types are additionally supported: labplus_Ledong_v2, labplus_for_xuejing, labplus_xunfei_js_middle, and labplus_xunfei_js_primary; each board provides board-level description files such as board.json, manifest.py, mpconfigboard.h/.cmake, partitions-*.csv, and sdkconfig.*. - The firmware is clearly layered: builtins/ stores C extensions compiled into the firmware (machine_i2c, machine_pin, modmusic, modmotion, modframebuf, network_wlan, esp32_nvs, icon, etc.); modules/ stores Python modules loaded at runtime (sensor drivers such as apds9960/max30102/hcsr04, networking siot/xunfei/ai_cloud, BLE mpython_ble, GUI gui.py/lv_utils, fonts font/, etc.); components/ contains the IDF components esp_lcd_jd9853 (JD9853 screen driver) and gen_bmgr_codes (board manager code generation); drivers/mpu6050/ integrates eMPL/Motion Processing Library to implement the IMU fusion algorithm; file_system/ organizes LVGL UI and business scripts by board (main.py/lv_gui.py/lv_oled.py); and examples/ provides demonstration programs such as GUI/audio/tft_display/xuejing_hw_test. - Build artifacts are packaged by makeimg.py in the merge_bin target; qstrdefsport.h manages the string table; and usercmodule/ (enabled via comment) is used for third-party C module integration.