Reorganize drivers and utility modules into lib/ subdirectory and update server and upload scripts

This commit is contained in:
Adolfo Reyna
2026-06-17 22:22:02 -04:00
parent 2813c11104
commit 75475723fa
16 changed files with 31 additions and 14 deletions
+14 -10
View File
@@ -43,17 +43,21 @@ To bypass the memory and protocol constraints of the microcontroller, we use a h
* **[boot.py](boot.py)**: Automatically connects to Wi-Fi using credentials in `wifi_config.py` and renders connection logs on the screen.
* **[main.py](main.py)**: Background execution loop. Handlers for buttons (manual dashboard refresh, LED state cycle), NeoPixel animation loop, and non-blocking MCP server requests.
* **[mcp_server.py](mcp_server.py)**: The lightweight JSON-RPC server implementing the MCP tools list and call handlers.
* **[audio_util.py](audio_util.py)**: Audio drivers for the ES7210 microphone array and the ES8311 speaker DAC. Implements sine-wave tone generation (`play_tone`), voice recording (`record_audio`), and file-based audio playing (`play_wav`).
* **[rlcd.py](rlcd.py)**: Low-level FrameBuffer driver for the 4.2" Reflective LCD, including PBM loaders and screenshot exporters.
* **[sd_util.py](sd_util.py)**: Mounting and filesystem management utility for the onboard microSD card slot.
* **Hardware Drivers**:
* [shtc3_util.py](shtc3_util.py) (Temperature & Humidity)
* [rtc_util.py](rtc_util.py) (Hardware Real-Time Clock)
* [battery_util.py](battery_util.py) (Voltage & Capacity reader)
* [rgb_led_util.py](rgb_led_util.py) (WS2812 NeoPixel animations)
* [button_util.py](button_util.py) (Key & Boot button debouncer)
* [ble_util.py](ble_util.py) (Passive BLE scanning & UART)
* **[wifi_config.py](wifi_config.py)**: Wi-Fi credentials. **(Do not commit real credentials to Git)**.
* **`lib/`**: Hardware drivers and utility modules automatically searched by MicroPython:
* **[audio_util.py](lib/audio_util.py)**: Audio drivers for the ES7210 microphone array and the ES8311 speaker DAC. Implements sine-wave tone generation (`play_tone`), voice recording (`record_audio`), and file-based audio playing (`play_wav`).
* **[rlcd.py](lib/rlcd.py)**: Low-level FrameBuffer driver for the 4.2" Reflective LCD, including PBM loaders and screenshot exporters.
* **[sd_util.py](lib/sd_util.py)**: Mounting and filesystem management utility for the onboard microSD card slot.
* **[shtc3_util.py](lib/shtc3_util.py)**: Temperature & Humidity sensor utility.
* **[rtc_util.py](lib/rtc_util.py)**: PCF85063 Hardware Real-Time Clock driver.
* **[battery_util.py](lib/battery_util.py)**: Battery voltage and capacity reader.
* **[rgb_led_util.py](lib/rgb_led_util.py)**: WS2812 NeoPixel animation manager.
* **[button_util.py](lib/button_util.py)**: Boot/Key button debouncer utility.
* **[ble_util.py](lib/ble_util.py)**: Passive BLE scanning and BLE UART interface.
* **[ft6336u.py](lib/ft6336u.py)**: I2C Capacitive touchscreen controller driver.
* **[ili9341.py](lib/ili9341.py)**: ILI9341 LCD driver.
* **[st7796.py](lib/st7796.py)**: ST7796 LCD driver.
* **[download_util.py](lib/download_util.py)**: Helper for streaming downloads to the local filesystem.
### Host-Side files
* **[mcp_bridge.py](mcp_bridge.py)**: The stdio-to-HTTP LAN bridge connecting the LLM client to the board. Handles image resizing, dithering, and formatting.