# jinifu/eventos architecture

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

- Interactive diagram: https://gitdiagram.com/jinifu/eventos
- Repository: https://github.com/jinifu/eventos

## Overview

EventOS Nano is a lightweight, event-driven embedded framework. An application configures and initializes the framework, registers reactor or state-machine actors, then publishes events; the cooperative run loop selects pending work and dispatches it to handlers, which may transition state. Optional capabilities include publish-subscribe, event data, soft timers, hierarchical state machines, and an event bridge. Port examples show the platform adaptation boundary. The README documents these capabilities; sampled core excerpts confirm queue selection and dispatch-related implementation, but do not expose every subsystem’s internal call path.

Main entry points: [`eventos/eventos.c`](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c) (Event bus), [`eventos/eventos.h`](https://github.com/jinifu/eventos/blob/master/eventos/eventos.h) (Framework API), [`documentation/UM-02-002-PortMetal.md`](https://github.com/jinifu/eventos/blob/master/documentation/UM-02-002-PortMetal.md) (Port interfaces), [`eventos/eventos_config.h`](https://github.com/jinifu/eventos/blob/master/eventos/eventos_config.h) (Feature configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["EventOS Runtime"]
  node_config["Feature configuration<br/>[eventos_config.h]"]
  node_types["Core types<br/>[eventos_def.h]"]
  node_api["Framework API<br/>[eventos.h]"]
  node_core["Framework core<br/>[eventos.c]"]
  node_event_bus["Event bus<br/>[eventos.c]"]
  node_global_queue[("Global event queue<br/>[eventos.c]")]
  node_dispatch["Cooperative dispatch<br/>[eventos.c]"]
  node_reactors["Reactor actors<br/>[eventos.c]"]
  node_state_machines["State machines<br/>[eventos.c]"]
  node_pubsub["Publish-subscribe<br/>[eventos.c]"]
  node_event_data["Event payloads<br/>[eventos.c]"]
  node_timers["Soft timers<br/>[eventos.c]"]
  node_event_bridge["Event bridge<br/>[eventos.c]"]
end

subgraph group_platform["Platform Ports"]
  node_port_interface["Port interfaces"]
  node_posix_port["POSIX port<br/>[port_posix.c]"]
  node_stm32_port["STM32 port<br/>[port_stm32f030.c]"]
end

subgraph group_examples["Application Examples"]
  node_posix_app["POSIX example app<br/>[main.c]"]
  node_stm32_app["STM32 example app<br/>[main.c]"]
end

node_developer(("Application developer"))

node_developer -->|"configures"| node_config
node_developer -->|"uses API"| node_api
node_config -->|"configures"| node_core
node_api -->|"exposes"| node_core
node_api -->|"uses types"| node_types
node_core -->|"manages"| node_global_queue
node_core -->|"runs"| node_dispatch
node_dispatch -->|"selects events"| node_global_queue
node_dispatch -.->|"dispatches"| node_reactors
node_dispatch -.->|"dispatches"| node_state_machines
node_developer -->|"publishes events"| node_event_bus
node_event_bus -.->|"queues events"| node_global_queue
node_event_bus -->|"supports mode"| node_pubsub
node_event_bus -->|"carries data"| node_event_data
node_core -->|"supports timers"| node_timers
node_event_bus -.->|"supports bridge"| node_event_bridge
node_developer -->|"implements port"| node_port_interface
node_posix_port -.->|"implements"| node_port_interface
node_stm32_port -.->|"implements"| node_port_interface
node_posix_app -.->|"uses framework"| node_api
node_stm32_app -.->|"uses framework"| node_api

click node_config "https://github.com/jinifu/eventos/blob/master/eventos/eventos_config.h"
click node_types "https://github.com/jinifu/eventos/blob/master/eventos/eventos_def.h"
click node_api "https://github.com/jinifu/eventos/blob/master/eventos/eventos.h"
click node_core "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_event_bus "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_global_queue "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_dispatch "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_reactors "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_state_machines "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_pubsub "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_event_data "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_timers "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_event_bridge "https://github.com/jinifu/eventos/blob/master/eventos/eventos.c"
click node_port_interface "https://github.com/jinifu/eventos/blob/master/documentation/UM-02-002-PortMetal.md"
click node_posix_port "https://github.com/jinifu/eventos/blob/master/examples/posix/port_posix.c"
click node_stm32_port "https://github.com/jinifu/eventos/blob/master/examples/stm32f030/User/port_stm32f030.c"
click node_posix_app "https://github.com/jinifu/eventos/blob/master/examples/posix/main.c"
click node_stm32_app "https://github.com/jinifu/eventos/blob/master/examples/stm32f030/User/main.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_config,node_types,node_api,node_core,node_event_bus,node_global_queue,node_dispatch,node_reactors,node_state_machines,node_pubsub,node_event_data,node_timers,node_event_bridge toneBlue
class node_port_interface,node_posix_port,node_stm32_port toneAmber
class node_posix_app,node_stm32_app toneMint
class node_developer toneIndigo
```

## Components

### EventOS Runtime

- [Feature configuration](https://github.com/jinifu/eventos/blob/master/eventos/eventos_config.h): `eventos/eventos_config.h`
- [Core types](https://github.com/jinifu/eventos/blob/master/eventos/eventos_def.h): `eventos/eventos_def.h`
- [Framework API](https://github.com/jinifu/eventos/blob/master/eventos/eventos.h): `eventos/eventos.h`
- [Framework core](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Event bus](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Global event queue](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Cooperative dispatch](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Reactor actors](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [State machines](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Publish-subscribe](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Event payloads](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Soft timers](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`
- [Event bridge](https://github.com/jinifu/eventos/blob/master/eventos/eventos.c): `eventos/eventos.c`

### Platform Ports

- [Port interfaces](https://github.com/jinifu/eventos/blob/master/documentation/UM-02-002-PortMetal.md): `documentation/UM-02-002-PortMetal.md`
- [POSIX port](https://github.com/jinifu/eventos/blob/master/examples/posix/port_posix.c): `examples/posix/port_posix.c`
- [STM32 port](https://github.com/jinifu/eventos/blob/master/examples/stm32f030/User/port_stm32f030.c): `examples/stm32f030/User/port_stm32f030.c`

### Application Examples

- [POSIX example app](https://github.com/jinifu/eventos/blob/master/examples/posix/main.c): `examples/posix/main.c`
- [STM32 example app](https://github.com/jinifu/eventos/blob/master/examples/stm32f030/User/main.c): `examples/stm32f030/User/main.c`

### Other components

- **Application developer**

## Connections

- Application developer → Feature configuration: configures (evidence: `README.md`)
- Application developer → Framework API: uses API (evidence: `README.md`)
- Feature configuration → Framework core: configures
- Framework API → Framework core: exposes (evidence: `eventos/eventos.h`)
- Framework API → Core types: uses types (evidence: `eventos/eventos.h`)
- Framework core → Global event queue: manages (evidence: `eventos/eventos.c`)
- Framework core → Cooperative dispatch: runs (evidence: `eventos/eventos.c`)
- Cooperative dispatch → Global event queue: selects events (evidence: `eventos/eventos.c`)
- Cooperative dispatch → Reactor actors: dispatches (evidence: `eventos/eventos.c`)
- Cooperative dispatch → State machines: dispatches (evidence: `eventos/eventos.c`)
- Application developer → Event bus: publishes events (evidence: `README.md`)
- Event bus → Global event queue: queues events (evidence: `eventos/eventos.c`)
- Event bus → Publish-subscribe: supports mode (evidence: `README.md`)
- Event bus → Event payloads: carries data (evidence: `README.md`)
- Framework core → Soft timers: supports timers (evidence: `README.md`)
- Event bus → Event bridge: supports bridge (evidence: `README.md`)
- Application developer → Port interfaces: implements port (evidence: `README.md`)
- POSIX port → Port interfaces: implements
- STM32 port → Port interfaces: implements
- POSIX example app → Framework API: uses framework
- STM32 example app → Framework API: uses framework
