# adrielsimo12/ihm_lvgl architecture

> Architecture diagram of the GitHub repository adrielsimo12/ihm_lvgl, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/adrielsimo12/ihm_lvgl
- Repository: https://github.com/adrielsimo12/ihm_lvgl

## Overview

IHM_LVGL is ESP32-S3 firmware for a light-therapy control interface. The principal workflow is selecting a phototype and treatment, presenting treatment controls and status, and controlling LEDs; the README also documents BLE commands and multilingual UI. The graph includes the display/touch runtime and BLE library as supporting layers. Firmware-level wiring is not shown in the sampled source, so product-level links rely on README statements; the tree also contains two UI source sets, whose relationship is unclear.

Main entry points: [`Ecran/src/screens/ui_MenuSoins.c`](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/screens/ui_MenuSoins.c) (LVGL screens), [`Ecran/src/ui_events.c`](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui_events.c) (LED control), [`Ecran/libraries/ArduinoBLE/src/BLEDevice.cpp`](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/BLEDevice.cpp) (BLE device), [`Ecran/lvgl_v8_port.cpp`](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/lvgl_v8_port.cpp) (LVGL display port)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_ui["LVGL screens<br/>[ui_MenuSoins.c]"]
  node_ui_init["UI initialization<br/>[ui.c]"]
  node_ui_events["UI events<br/>[ui_events.c]"]
  node_language["Language selection<br/>[lang.c]"]
  node_lvgl["LVGL runtime<br/>[lvgl.h]"]
end

subgraph group_therapy["Treatment control"]
  node_therapy_data["Treatment data<br/>[ui.h]"]
  node_led_control["LED control<br/>[ui_events.c]"]
end

subgraph group_hardware["Display hardware"]
  node_display_port["LVGL display port<br/>[lvgl_v8_port.cpp]"]
  node_panel["Panel drivers<br/>[esp_panel_lcd.cpp]"]
  node_touch["Touch drivers"]
  node_board["Board configuration"]
end

subgraph group_connectivity["Connectivity"]
  node_ble_api["ArduinoBLE API<br/>[ArduinoBLE.h]"]
  node_ble_device["BLE device<br/>[BLEDevice.cpp]"]
  node_ble_services["BLE services<br/>[BLEService.cpp]"]
  node_ble_characteristics["BLE characteristics"]
end

node_user(("Operator"))
node_ble_peer(("BLE peer"))
node_i2c_peer(("Inter-ESP peer"))

node_user -->|"selects treatment"| node_ui
node_ui_init -->|"initializes screens"| node_ui
node_ui -->|"dispatches events"| node_ui_events
node_ui -->|"shows selections"| node_therapy_data
node_ui -->|"selects language"| node_language
node_ui -->|"controls LEDs"| node_led_control
node_ui -->|"builds interface with"| node_lvgl
node_display_port -->|"adapts runtime"| node_lvgl
node_display_port -->|"uses display panel"| node_panel
node_user -->|"touch input"| node_touch
node_board -.->|"configures hardware"| node_panel
node_led_control -->|"issues BLE commands"| node_ble_api
node_ble_api -->|"exposes device API"| node_ble_device
node_ble_device -.->|"provides services"| node_ble_services
node_ble_services -->|"contains characteristics"| node_ble_characteristics
node_ble_device -->|"communicates over BLE"| node_ble_peer
node_led_control -.->|"uses I2C"| node_i2c_peer

click node_ui "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/screens/ui_MenuSoins.c"
click node_ui_init "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui.c"
click node_ui_events "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui_events.c"
click node_language "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/lang.c"
click node_therapy_data "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui.h"
click node_led_control "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui_events.c"
click node_lvgl "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/lvgl/lvgl.h"
click node_display_port "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/lvgl_v8_port.cpp"
click node_panel "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ESP32_Display_Panel/src/drivers/lcd/esp_panel_lcd.cpp"
click node_touch "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ESP32_Display_Panel/src/drivers/touch/esp_panel_touch.cpp"
click node_board "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/ESP_Panel_Board_Custom.h"
click node_ble_api "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/ArduinoBLE.h"
click node_ble_device "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/BLEDevice.cpp"
click node_ble_services "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/BLEService.cpp"
click node_ble_characteristics "https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/BLECharacteristic.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ui,node_ui_init,node_ui_events,node_language,node_lvgl toneBlue
class node_therapy_data,node_led_control toneAmber
class node_display_port,node_panel,node_touch,node_board toneMint
class node_ble_api,node_ble_device,node_ble_services,node_ble_characteristics toneRose
class node_user,node_ble_peer,node_i2c_peer toneIndigo
```

## Components

### User interface

- [LVGL screens](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/screens/ui_MenuSoins.c): `Ecran/src/screens/ui_MenuSoins.c`
- [UI initialization](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui.c): `Ecran/src/ui.c`
- [UI events](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui_events.c): `Ecran/src/ui_events.c`
- [Language selection](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/lang.c): `Ecran/src/lang.c`
- [LVGL runtime](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/lvgl/lvgl.h): `Ecran/libraries/lvgl/lvgl.h`

### Treatment control

- [Treatment data](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui.h): `Ecran/src/ui.h`
- [LED control](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/src/ui_events.c): `Ecran/src/ui_events.c`

### Display hardware

- [LVGL display port](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/lvgl_v8_port.cpp): `Ecran/lvgl_v8_port.cpp`
- [Panel drivers](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ESP32_Display_Panel/src/drivers/lcd/esp_panel_lcd.cpp): `Ecran/libraries/ESP32_Display_Panel/src/drivers/lcd/esp_panel_lcd.cpp`
- [Touch drivers](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ESP32_Display_Panel/src/drivers/touch/esp_panel_touch.cpp): `Ecran/libraries/ESP32_Display_Panel/src/drivers/touch/esp_panel_touch.cpp`
- [Board configuration](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/ESP_Panel_Board_Custom.h): `Ecran/ESP_Panel_Board_Custom.h`

### Connectivity

- [ArduinoBLE API](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/ArduinoBLE.h): `Ecran/libraries/ArduinoBLE/src/ArduinoBLE.h`
- [BLE device](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/BLEDevice.cpp): `Ecran/libraries/ArduinoBLE/src/BLEDevice.cpp`
- [BLE services](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/BLEService.cpp): `Ecran/libraries/ArduinoBLE/src/BLEService.cpp`
- [BLE characteristics](https://github.com/adrielsimo12/ihm_lvgl/blob/master/Ecran/libraries/ArduinoBLE/src/BLECharacteristic.h): `Ecran/libraries/ArduinoBLE/src/BLECharacteristic.h`

### Other components

- **Operator**
- **BLE peer**
- **Inter-ESP peer**

## Connections

- Operator → LVGL screens: selects treatment
- UI initialization → LVGL screens: initializes screens (evidence: `Ecran/src/ui.c`)
- LVGL screens → UI events: dispatches events
- LVGL screens → Treatment data: shows selections (evidence: `Ecran/src/ui.h`)
- LVGL screens → Language selection: selects language
- LVGL screens → LED control: controls LEDs
- LVGL screens → LVGL runtime: builds interface with
- LVGL display port → LVGL runtime: adapts runtime
- LVGL display port → Panel drivers: uses display panel
- Operator → Touch drivers: touch input
- Board configuration → Panel drivers: configures hardware
- LED control → ArduinoBLE API: issues BLE commands
- ArduinoBLE API → BLE device: exposes device API
- BLE device → BLE services: provides services
- BLE services → BLE characteristics: contains characteristics (evidence: `Ecran/libraries/ArduinoBLE/src/BLEService.cpp`)
- BLE device → BLE peer: communicates over BLE
- LED control → Inter-ESP peer: uses I2C
