# elektronikaembedded/st7735 architecture

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

- Interactive diagram: https://gitdiagram.com/elektronikaembedded/st7735
- Repository: https://github.com/elektronikaembedded/st7735

## Overview

This is a portable embedded driver for ST7735 TFT displays. A platform application supplies SPI, GPIO-pin and OSAL timing implementations, initializes a driver instance, then uses its operations to initialize the panel, change rotation and draw or fill regions. The implementation owns panel command sequencing and delegates hardware access through those abstractions. The README also identifies configurable templates and an LVGL port; their behavior is not shown in the sampled source, so those links are left unverified.

Main entry points: [`src/st7735.c`](https://github.com/elektronikaembedded/st7735/blob/main/src/st7735.c) (ST7735 driver), [`inc/st7735.h`](https://github.com/elektronikaembedded/st7735/blob/main/inc/st7735.h) (Driver API), [`inc/st7735_pin.h`](https://github.com/elektronikaembedded/st7735/blob/main/inc/st7735_pin.h) (Pin interface), [`template/st7735_pin.c.example`](https://github.com/elektronikaembedded/st7735/blob/main/template/st7735_pin.c.example) (Pin template)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Driver interface"]
  node_driver_api["Driver API<br/>[st7735.h]"]
  node_pin_api["Pin interface<br/>[st7735_pin.h]"]
end

subgraph group_runtime["Display runtime"]
  node_driver["ST7735 driver<br/>[st7735.c]"]
end

subgraph group_ports["Platform ports"]
  node_spi["SPI abstraction"]
  node_osal["OSAL timing"]
  node_gpio["Platform GPIO"]
  node_pin_template["Pin template"]
  node_lvgl_template["LVGL port template"]
end

node_application(("Platform application"))

node_application -->|"uses"| node_driver_api
node_driver_api -->|"dispatches"| node_driver
node_driver -->|"writes SPI"| node_spi
node_driver -->|"delays via"| node_osal
node_driver -->|"toggles pins"| node_pin_api
node_pin_api -.->|"implemented by"| node_gpio
node_application -.->|"configures from"| node_pin_template
node_application -.->|"may integrate"| node_lvgl_template

click node_driver_api "https://github.com/elektronikaembedded/st7735/blob/main/inc/st7735.h"
click node_pin_api "https://github.com/elektronikaembedded/st7735/blob/main/inc/st7735_pin.h"
click node_driver "https://github.com/elektronikaembedded/st7735/blob/main/src/st7735.c"
click node_pin_template "https://github.com/elektronikaembedded/st7735/blob/main/template/st7735_pin.c.example"
click node_lvgl_template "https://github.com/elektronikaembedded/st7735/blob/main/template/st7735_lvgl_port.c.example"

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_driver_api,node_pin_api toneBlue
class node_driver toneAmber
class node_spi,node_osal,node_gpio,node_pin_template,node_lvgl_template toneMint
class node_application toneIndigo
```

## Components

### Driver interface

- [Driver API](https://github.com/elektronikaembedded/st7735/blob/main/inc/st7735.h): `inc/st7735.h`
- [Pin interface](https://github.com/elektronikaembedded/st7735/blob/main/inc/st7735_pin.h): `inc/st7735_pin.h`

### Display runtime

- [ST7735 driver](https://github.com/elektronikaembedded/st7735/blob/main/src/st7735.c): `src/st7735.c`

### Platform ports

- **SPI abstraction**
- **OSAL timing**
- **Platform GPIO**
- [Pin template](https://github.com/elektronikaembedded/st7735/blob/main/template/st7735_pin.c.example): `template/st7735_pin.c.example`
- [LVGL port template](https://github.com/elektronikaembedded/st7735/blob/main/template/st7735_lvgl_port.c.example): `template/st7735_lvgl_port.c.example`

### Other components

- **Platform application**

## Connections

- Platform application → Driver API: uses (evidence: `README.md`)
- Driver API → ST7735 driver: dispatches (evidence: `src/st7735.c`)
- ST7735 driver → SPI abstraction: writes SPI (evidence: `src/st7735.c`)
- ST7735 driver → OSAL timing: delays via (evidence: `src/st7735.c`)
- ST7735 driver → Pin interface: toggles pins (evidence: `src/st7735.c`)
- Pin interface → Platform GPIO: implemented by
- Platform application → Pin template: configures from
- Platform application → LVGL port template: may integrate
