# h-000-h/mini_tree architecture

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

- Interactive diagram: https://gitdiagram.com/h-000-h/mini_tree
- Repository: https://github.com/h-000-h/mini_tree

## Overview

mini_tree is platform-independent embedded middleware for device-tree-based peripheral access across bare-metal and several RTOS backends. The principal workflow is application use of a board-described device, through the documented board/VFS/bus/HAL layers, to platform-provided hardware support. Runtime services and product drivers are additional capabilities. The VFS implementation and generated probe-table sources are absent from the supplied tree, so their wiring is shown only where documented; unsampled integration details are omitted.

Main entry points: [`board/src/board_device.c`](https://github.com/h-000-h/mini_tree/blob/main/board/src/board_device.c) (Board Devices), [`bus`](https://github.com/h-000-h/mini_tree/tree/main/bus) (Peripheral Buses), [`board/src/board_driver.c`](https://github.com/h-000-h/mini_tree/blob/main/board/src/board_driver.c) (Board Drivers), [`hal`](https://github.com/h-000-h/mini_tree/tree/main/hal) (Peripheral HAL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Device Model"]
  node_device_tree["Device Tree"]
  node_board_devices["Board Devices<br/>[board_device.c]"]
  node_board_drivers["Board Drivers<br/>[board_driver.c]"]
  node_vfs["VFS"]
  node_product_drivers["Product Drivers"]
end

subgraph group_hardware["Hardware Access"]
  node_buses["Peripheral Buses"]
  node_hal["Peripheral HAL"]
  node_platform["Platform Support"]
end

subgraph group_runtime["Runtime Services"]
  node_event_bus["EventBus<br/>[event_bus.c]"]
  node_virtual_irq["Virtual IRQ<br/>[interrupt.c]"]
  node_buffers["Buffers"]
  node_backend["OS Backends"]
  node_task_manager["Task Manager<br/>[task_manager.c]"]
  node_safe_state["Platform Safety"]
end

subgraph group_network["Network Integration"]
  node_mqtt_client["MQTT Client<br/>[mqtt_client.c]"]
end

node_application(("Application"))
node_mqtt_broker(("MQTT Broker"))

node_application -->|"uses devices"| node_board_devices
node_device_tree -->|"describes devices"| node_board_devices
node_board_devices -->|"probes"| node_board_drivers
node_board_drivers -->|"exposes devices"| node_vfs
node_vfs -->|"uses buses"| node_buses
node_buses -->|"accesses hardware"| node_hal
node_hal -->|"calls platform"| node_platform
node_product_drivers -->|"uses buses"| node_buses
node_application -->|"publishes events"| node_event_bus
node_application -->|"uses IRQ blocks"| node_virtual_irq
node_virtual_irq -->|"defers work"| node_buffers
node_application -->|"creates tasks"| node_task_manager
node_task_manager -->|"creates tasks"| node_backend
node_application -->|"uses safety hooks"| node_safe_state
node_application -.->|"uses client"| node_mqtt_client
node_mqtt_client -.->|"exchanges messages"| node_mqtt_broker

click node_board_devices "https://github.com/h-000-h/mini_tree/blob/main/board/src/board_device.c"
click node_board_drivers "https://github.com/h-000-h/mini_tree/blob/main/board/src/board_driver.c"
click node_product_drivers "https://github.com/h-000-h/mini_tree/tree/main/drivers"
click node_buses "https://github.com/h-000-h/mini_tree/tree/main/bus"
click node_hal "https://github.com/h-000-h/mini_tree/tree/main/hal"
click node_event_bus "https://github.com/h-000-h/mini_tree/blob/main/core/src/event_bus.c"
click node_virtual_irq "https://github.com/h-000-h/mini_tree/blob/main/interrupt/interrupt.c"
click node_buffers "https://github.com/h-000-h/mini_tree/tree/main/algorithm/buffer"
click node_backend "https://github.com/h-000-h/mini_tree/tree/main/core/src"
click node_task_manager "https://github.com/h-000-h/mini_tree/blob/main/system_c/src/task_manager.c"
click node_safe_state "https://github.com/h-000-h/mini_tree/blob/main/hal/system/hal_platform_safety.c"
click node_mqtt_client "https://github.com/h-000-h/mini_tree/blob/main/net/port/mqtt/mqtt_client.c"

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_device_tree,node_board_devices,node_board_drivers,node_vfs,node_product_drivers toneBlue
class node_buses,node_hal,node_platform toneAmber
class node_event_bus,node_virtual_irq,node_buffers,node_backend,node_task_manager,node_safe_state toneMint
class node_mqtt_client toneRose
class node_application,node_mqtt_broker toneIndigo
```

## Components

### Device Model

- **Device Tree**
- [Board Devices](https://github.com/h-000-h/mini_tree/blob/main/board/src/board_device.c): `board/src/board_device.c`
- [Board Drivers](https://github.com/h-000-h/mini_tree/blob/main/board/src/board_driver.c): `board/src/board_driver.c`
- **VFS**
- [Product Drivers](https://github.com/h-000-h/mini_tree/tree/main/drivers): `drivers`

### Hardware Access

- [Peripheral Buses](https://github.com/h-000-h/mini_tree/tree/main/bus): `bus`
- [Peripheral HAL](https://github.com/h-000-h/mini_tree/tree/main/hal): `hal`
- **Platform Support**

### Runtime Services

- [EventBus](https://github.com/h-000-h/mini_tree/blob/main/core/src/event_bus.c): `core/src/event_bus.c`
- [Virtual IRQ](https://github.com/h-000-h/mini_tree/blob/main/interrupt/interrupt.c): `interrupt/interrupt.c`
- [Buffers](https://github.com/h-000-h/mini_tree/tree/main/algorithm/buffer): `algorithm/buffer`
- [OS Backends](https://github.com/h-000-h/mini_tree/tree/main/core/src): `core/src`
- [Task Manager](https://github.com/h-000-h/mini_tree/blob/main/system_c/src/task_manager.c): `system_c/src/task_manager.c`
- [Platform Safety](https://github.com/h-000-h/mini_tree/blob/main/hal/system/hal_platform_safety.c): `hal/system/hal_platform_safety.c`

### Network Integration

- [MQTT Client](https://github.com/h-000-h/mini_tree/blob/main/net/port/mqtt/mqtt_client.c): `net/port/mqtt/mqtt_client.c`

### Other components

- **Application**
- **MQTT Broker**

## Connections

- Application → Board Devices: uses devices
- Device Tree → Board Devices: describes devices
- Board Devices → Board Drivers: probes
- Board Drivers → VFS: exposes devices
- VFS → Peripheral Buses: uses buses
- Peripheral Buses → Peripheral HAL: accesses hardware
- Peripheral HAL → Platform Support: calls platform
- Product Drivers → Peripheral Buses: uses buses
- Application → EventBus: publishes events
- Application → Virtual IRQ: uses IRQ blocks
- Virtual IRQ → Buffers: defers work
- Application → Task Manager: creates tasks
- Task Manager → OS Backends: creates tasks
- Application → Platform Safety: uses safety hooks
- Application → MQTT Client: uses client
- MQTT Client → MQTT Broker: exchanges messages
