# kororos/avrx architecture

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

- Interactive diagram: https://gitdiagram.com/kororos/avrx
- Repository: https://github.com/kororos/avrx

## Overview

AvrX is an AVR real-time kernel and supporting library. An embedded application uses kernel tasking and synchronization primitives; the repository also provides message passing, timers, priority control, EEPROM access, single-step support, a FIFO, and optional monitor/serial utilities. The excerpts show the FIFO’s semaphore calls and kernel data definitions, but not the assembly runtime’s call graph, so those relationships are left unasserted.

Main entry points: [`AvrXFifo.c`](https://github.com/kororos/avrx/blob/master/AvrXFifo.c) (Byte FIFO), [`avrx.h`](https://github.com/kororos/avrx/blob/master/avrx.h) (Kernel API), [`AvrXKernel.c`](https://github.com/kororos/avrx/blob/master/AvrXKernel.c) (Kernel data), [`AvrXFifo.h`](https://github.com/kororos/avrx/blob/master/AvrXFifo.h) (FIFO interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel and tasking"]
  node_kernel_data["Kernel data<br/>[AvrXKernel.c]"]
  node_kernel_api["Kernel API<br/>[avrx.h]"]
  node_tasking["Task scheduling<br/>[avrx_tasking.S]"]
  node_reschedule["Rescheduling<br/>[avrx_reschedule.S]"]
  node_suspend["Task suspension<br/>[avrx_suspend.S]"]
  node_terminate["Task termination<br/>[avrx_terminate.S]"]
  node_priority["Priority control<br/>[avrx_priority.S]"]
end

subgraph group_sync["Synchronization and messaging"]
  node_semaphores["Semaphores<br/>[avrx_semaphores.S]"]
  node_semaphore_ops["Semaphore operations"]
  node_messages["Message passing<br/>[avrx_message.S]"]
  node_receive["Message receive<br/>[avrx_recvmessage.S]"]
  node_fifo_api["FIFO interface<br/>[AvrXFifo.h]"]
  node_fifo["Byte FIFO<br/>[AvrXFifo.c]"]
end

subgraph group_time["Timers and interrupts"]
  node_timer_queue["Timer queue<br/>[avrx_timequeue.S]"]
  node_timer_start["Timer messages"]
  node_timer_cancel["Timer cancellation<br/>[avrx_canceltimer.S]"]
  node_single_step["Single stepping<br/>[avrx_singlestep.S]"]
  node_interrupts["Interrupt setup"]
end

subgraph group_support["Utilities and hardware"]
  node_eeprom["EEPROM access<br/>[avrx_eeprom.S]"]
  node_monitor["Monitor<br/>[monitor.S]"]
  node_serial["Serial I/O<br/>[serialio.S]"]
  node_io_header["I/O compatibility<br/>[avrx-io.h]"]
  node_signal_header["Interrupt compatibility<br/>[avrx-signal.h]"]
  node_signal_service["Serial service<br/>[serialio.h]"]
end

node_application(("AVR application"))

node_fifo -->|"sets semaphores"| node_semaphores
node_fifo -->|"resets semaphores"| node_semaphore_ops
node_fifo -->|"uses API"| node_kernel_api
node_fifo_api -->|"includes API"| node_kernel_api
node_kernel_data -->|"includes API"| node_kernel_api

click node_kernel_data "https://github.com/kororos/avrx/blob/master/AvrXKernel.c"
click node_kernel_api "https://github.com/kororos/avrx/blob/master/avrx.h"
click node_tasking "https://github.com/kororos/avrx/blob/master/avrx_tasking.S"
click node_reschedule "https://github.com/kororos/avrx/blob/master/avrx_reschedule.S"
click node_suspend "https://github.com/kororos/avrx/blob/master/avrx_suspend.S"
click node_terminate "https://github.com/kororos/avrx/blob/master/avrx_terminate.S"
click node_priority "https://github.com/kororos/avrx/blob/master/avrx_priority.S"
click node_semaphores "https://github.com/kororos/avrx/blob/master/avrx_semaphores.S"
click node_semaphore_ops "https://github.com/kororos/avrx/blob/master/avrx_resetsemaphore.S"
click node_messages "https://github.com/kororos/avrx/blob/master/avrx_message.S"
click node_receive "https://github.com/kororos/avrx/blob/master/avrx_recvmessage.S"
click node_fifo_api "https://github.com/kororos/avrx/blob/master/AvrXFifo.h"
click node_fifo "https://github.com/kororos/avrx/blob/master/AvrXFifo.c"
click node_timer_queue "https://github.com/kororos/avrx/blob/master/avrx_timequeue.S"
click node_timer_start "https://github.com/kororos/avrx/blob/master/avrx_starttimermessage.S"
click node_timer_cancel "https://github.com/kororos/avrx/blob/master/avrx_canceltimer.S"
click node_single_step "https://github.com/kororos/avrx/blob/master/avrx_singlestep.S"
click node_interrupts "https://github.com/kororos/avrx/blob/master/avrx_generatesinglestepinterrupt.S"
click node_eeprom "https://github.com/kororos/avrx/blob/master/avrx_eeprom.S"
click node_monitor "https://github.com/kororos/avrx/blob/master/monitor.S"
click node_serial "https://github.com/kororos/avrx/blob/master/serialio.S"
click node_io_header "https://github.com/kororos/avrx/blob/master/avrx-io.h"
click node_signal_header "https://github.com/kororos/avrx/blob/master/avrx-signal.h"
click node_signal_service "https://github.com/kororos/avrx/blob/master/serialio.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_kernel_data,node_kernel_api,node_tasking,node_reschedule,node_suspend,node_terminate,node_priority toneBlue
class node_semaphores,node_semaphore_ops,node_messages,node_receive,node_fifo_api,node_fifo toneAmber
class node_timer_queue,node_timer_start,node_timer_cancel,node_single_step,node_interrupts toneMint
class node_eeprom,node_monitor,node_serial,node_io_header,node_signal_header,node_signal_service toneRose
class node_application toneIndigo
```

## Components

### Kernel and tasking

- [Kernel data](https://github.com/kororos/avrx/blob/master/AvrXKernel.c): `AvrXKernel.c`
- [Kernel API](https://github.com/kororos/avrx/blob/master/avrx.h): `avrx.h`
- [Task scheduling](https://github.com/kororos/avrx/blob/master/avrx_tasking.S): `avrx_tasking.S`
- [Rescheduling](https://github.com/kororos/avrx/blob/master/avrx_reschedule.S): `avrx_reschedule.S`
- [Task suspension](https://github.com/kororos/avrx/blob/master/avrx_suspend.S): `avrx_suspend.S`
- [Task termination](https://github.com/kororos/avrx/blob/master/avrx_terminate.S): `avrx_terminate.S`
- [Priority control](https://github.com/kororos/avrx/blob/master/avrx_priority.S): `avrx_priority.S`

### Synchronization and messaging

- [Semaphores](https://github.com/kororos/avrx/blob/master/avrx_semaphores.S): `avrx_semaphores.S`
- [Semaphore operations](https://github.com/kororos/avrx/blob/master/avrx_resetsemaphore.S): `avrx_resetsemaphore.S`
- [Message passing](https://github.com/kororos/avrx/blob/master/avrx_message.S): `avrx_message.S`
- [Message receive](https://github.com/kororos/avrx/blob/master/avrx_recvmessage.S): `avrx_recvmessage.S`
- [FIFO interface](https://github.com/kororos/avrx/blob/master/AvrXFifo.h): `AvrXFifo.h`
- [Byte FIFO](https://github.com/kororos/avrx/blob/master/AvrXFifo.c): `AvrXFifo.c`

### Timers and interrupts

- [Timer queue](https://github.com/kororos/avrx/blob/master/avrx_timequeue.S): `avrx_timequeue.S`
- [Timer messages](https://github.com/kororos/avrx/blob/master/avrx_starttimermessage.S): `avrx_starttimermessage.S`
- [Timer cancellation](https://github.com/kororos/avrx/blob/master/avrx_canceltimer.S): `avrx_canceltimer.S`
- [Single stepping](https://github.com/kororos/avrx/blob/master/avrx_singlestep.S): `avrx_singlestep.S`
- [Interrupt setup](https://github.com/kororos/avrx/blob/master/avrx_generatesinglestepinterrupt.S): `avrx_generatesinglestepinterrupt.S`

### Utilities and hardware

- [EEPROM access](https://github.com/kororos/avrx/blob/master/avrx_eeprom.S): `avrx_eeprom.S`
- [Monitor](https://github.com/kororos/avrx/blob/master/monitor.S): `monitor.S`
- [Serial I/O](https://github.com/kororos/avrx/blob/master/serialio.S): `serialio.S`
- [I/O compatibility](https://github.com/kororos/avrx/blob/master/avrx-io.h): `avrx-io.h`
- [Interrupt compatibility](https://github.com/kororos/avrx/blob/master/avrx-signal.h): `avrx-signal.h`
- [Serial service](https://github.com/kororos/avrx/blob/master/serialio.h): `serialio.h`

### Other components

- **AVR application**

## Connections

- Byte FIFO → Semaphores: sets semaphores (evidence: `AvrXFifo.c`)
- Byte FIFO → Semaphore operations: resets semaphores (evidence: `AvrXFifo.c`)
- Byte FIFO → Kernel API: uses API (evidence: `AvrXFifo.c`)
- FIFO interface → Kernel API: includes API (evidence: `AvrXFifo.h`)
- Kernel data → Kernel API: includes API (evidence: `AvrXKernel.c`)
