# eartkey/lf_alpha architecture

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

- Interactive diagram: https://gitdiagram.com/eartkey/lf_alpha
- Repository: https://github.com/eartkey/lf_alpha

## Overview

LF_Alpha is an ESP32-S3 Arduino firmware library that presents a unified API for board sensors, controls, and communications. The principal workflow is application code calling that API to initialize peripherals, collect or process measurements, and control outputs. The tree includes a large central implementation and header, plus bundled display, sensor-processing, and PWM libraries. Several README-listed peripherals have no separate files in the supplied tree, so they are represented as capabilities of the central implementation; their internal call paths are not asserted.

Main entry points: [`src/LF_Alpha.h`](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.h) (LF_Alpha API), [`src/LF_Alpha.cpp`](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp) (Sensor Interfaces), [`src/lib/Adafruit_SSD1306/Adafruit_SSD1306.cpp`](https://github.com/eartkey/lf_alpha/blob/main/src/lib/Adafruit_SSD1306/Adafruit_SSD1306.cpp) (SSD1306 Driver), [`src/lib/MPU6050/MPU6050.cpp`](https://github.com/eartkey/lf_alpha/blob/main/src/lib/MPU6050/MPU6050.cpp) (MPU6050 Driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Firmware API"]
  node_lfapi["LF_Alpha API<br/>[LF_Alpha.h]"]
  node_firmware["Peripheral Implementations<br/>[LF_Alpha.cpp]"]
end

subgraph group_sensors["Sensors"]
  node_sensor_suite["Sensor Interfaces<br/>[LF_Alpha.cpp]"]
  node_mpu["MPU6050 Interface<br/>[LF_Alpha.cpp]"]
  node_max["MAX30102 Interface<br/>[LF_Alpha.cpp]"]
  node_other_sensors["Other Sensors<br/>[LF_Alpha.cpp]"]
end

subgraph group_display["Display"]
  node_oled["OLED Interface<br/>[LF_Alpha.cpp]"]
  node_gfx["Graphics Rendering<br/>[Adafruit_GFX.cpp]"]
  node_ssd["SSD1306 Driver"]
end

subgraph group_outputs["Controls"]
  node_controls["Board Controls<br/>[LF_Alpha.cpp]"]
  node_servo_pwm["Servo PWM<br/>[ESP32PWM.cpp]"]
end

subgraph group_comms["Communications"]
  node_network["WiFi and HTTP<br/>[LF_Alpha.cpp]"]
  node_i2cscan["I2C Scanner<br/>[LF_Alpha.cpp]"]
end

subgraph group_bundled["Bundled Libraries"]
  node_max_algo["Pulse Oximetry Algorithm<br/>[algorithm.cpp]"]
  node_heart_algo["Heart Rate Processing<br/>[heartRate.cpp]"]
  node_mpu_driver["MPU6050 Driver<br/>[MPU6050.cpp]"]
  node_i2cdev["I2C Device Access<br/>[I2Cdev.cpp]"]
end

node_application(("Arduino Application"))

node_application -->|"calls"| node_lfapi
node_lfapi -->|"implements"| node_firmware
node_lfapi -->|"exposes"| node_sensor_suite
node_lfapi -->|"exposes"| node_controls
node_lfapi -->|"exposes"| node_network
node_lfapi -->|"exposes"| node_i2cscan
node_sensor_suite -->|"includes"| node_mpu
node_sensor_suite -->|"includes"| node_max
node_sensor_suite -->|"includes"| node_other_sensors
node_lfapi -->|"exposes"| node_oled
node_oled -->|"uses"| node_ssd
node_ssd -->|"inherits graphics"| node_gfx
node_max -->|"declares dependency"| node_max_algo
node_max -->|"declares dependency"| node_heart_algo
node_mpu -->|"declares dependency"| node_mpu_driver
node_mpu_driver -->|"uses"| node_i2cdev
node_controls -.->|"uses"| node_servo_pwm

click node_lfapi "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.h"
click node_firmware "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_sensor_suite "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_mpu "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_max "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_other_sensors "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_oled "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_gfx "https://github.com/eartkey/lf_alpha/blob/main/src/lib/Adafruit_SSD1306/Adafruit_GFX.cpp"
click node_ssd "https://github.com/eartkey/lf_alpha/blob/main/src/lib/Adafruit_SSD1306/Adafruit_SSD1306.cpp"
click node_controls "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_servo_pwm "https://github.com/eartkey/lf_alpha/blob/main/src/lib/ESP32PWM/ESP32PWM.cpp"
click node_network "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_i2cscan "https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp"
click node_max_algo "https://github.com/eartkey/lf_alpha/blob/main/src/lib/MAX30102/algorithm.cpp"
click node_heart_algo "https://github.com/eartkey/lf_alpha/blob/main/src/lib/MAX30102/heartRate.cpp"
click node_mpu_driver "https://github.com/eartkey/lf_alpha/blob/main/src/lib/MPU6050/MPU6050.cpp"
click node_i2cdev "https://github.com/eartkey/lf_alpha/blob/main/src/lib/MPU6050/I2Cdev.cpp"

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_lfapi,node_firmware toneBlue
class node_sensor_suite,node_mpu,node_max,node_other_sensors toneAmber
class node_oled,node_gfx,node_ssd toneMint
class node_controls,node_servo_pwm toneRose
class node_network,node_i2cscan,node_application toneIndigo
class node_max_algo,node_heart_algo,node_mpu_driver,node_i2cdev toneTeal
```

## Components

### Firmware API

- [LF_Alpha API](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.h): `src/LF_Alpha.h`
- [Peripheral Implementations](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`

### Sensors

- [Sensor Interfaces](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`
- [MPU6050 Interface](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`
- [MAX30102 Interface](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`
- [Other Sensors](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`

### Display

- [OLED Interface](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`
- [Graphics Rendering](https://github.com/eartkey/lf_alpha/blob/main/src/lib/Adafruit_SSD1306/Adafruit_GFX.cpp): `src/lib/Adafruit_SSD1306/Adafruit_GFX.cpp`
- [SSD1306 Driver](https://github.com/eartkey/lf_alpha/blob/main/src/lib/Adafruit_SSD1306/Adafruit_SSD1306.cpp): `src/lib/Adafruit_SSD1306/Adafruit_SSD1306.cpp`

### Controls

- [Board Controls](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`
- [Servo PWM](https://github.com/eartkey/lf_alpha/blob/main/src/lib/ESP32PWM/ESP32PWM.cpp): `src/lib/ESP32PWM/ESP32PWM.cpp`

### Communications

- [WiFi and HTTP](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`
- [I2C Scanner](https://github.com/eartkey/lf_alpha/blob/main/src/LF_Alpha.cpp): `src/LF_Alpha.cpp`

### Bundled Libraries

- [Pulse Oximetry Algorithm](https://github.com/eartkey/lf_alpha/blob/main/src/lib/MAX30102/algorithm.cpp): `src/lib/MAX30102/algorithm.cpp`
- [Heart Rate Processing](https://github.com/eartkey/lf_alpha/blob/main/src/lib/MAX30102/heartRate.cpp): `src/lib/MAX30102/heartRate.cpp`
- [MPU6050 Driver](https://github.com/eartkey/lf_alpha/blob/main/src/lib/MPU6050/MPU6050.cpp): `src/lib/MPU6050/MPU6050.cpp`
- [I2C Device Access](https://github.com/eartkey/lf_alpha/blob/main/src/lib/MPU6050/I2Cdev.cpp): `src/lib/MPU6050/I2Cdev.cpp`

### Other components

- **Arduino Application**

## Connections

- Arduino Application → LF_Alpha API: calls
- LF_Alpha API → Peripheral Implementations: implements (evidence: `src/LF_Alpha.h`)
- LF_Alpha API → Sensor Interfaces: exposes
- LF_Alpha API → Board Controls: exposes
- LF_Alpha API → WiFi and HTTP: exposes
- LF_Alpha API → I2C Scanner: exposes
- Sensor Interfaces → MPU6050 Interface: includes (evidence: `src/LF_Alpha.cpp`)
- Sensor Interfaces → MAX30102 Interface: includes (evidence: `src/LF_Alpha.cpp`)
- Sensor Interfaces → Other Sensors: includes (evidence: `src/LF_Alpha.cpp`)
- LF_Alpha API → OLED Interface: exposes
- OLED Interface → SSD1306 Driver: uses
- SSD1306 Driver → Graphics Rendering: inherits graphics
- MAX30102 Interface → Pulse Oximetry Algorithm: declares dependency
- MAX30102 Interface → Heart Rate Processing: declares dependency
- MPU6050 Interface → MPU6050 Driver: declares dependency
- MPU6050 Driver → I2C Device Access: uses
- Board Controls → Servo PWM: uses
