# gardener847/freertos-projects architecture

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

- Interactive diagram: https://gitdiagram.com/gardener847/freertos-projects
- Repository: https://github.com/gardener847/freertos-projects

## Overview

FreeRTOS-Projects is an LPC17xx/Cortex-M3 embedded framework accompanied by independent firmware examples. The recurring workflow is a board or user input handled by an application task, which uses a peripheral or higher-level service to produce device output, process data, or persist it. The graph groups the shared runtime layers and representative examples; it is not one combined firmware execution path. The README documents the wider protocol and RTOS topics, while some subsystems are represented by indexed references rather than sampled implementation excerpts.

Main entry points: [`lib/L1_FreeRTOS`](https://github.com/gardener847/freertos-projects/tree/master/lib/L1_FreeRTOS) (FreeRTOS kernel), [`lib/L2_Drivers`](https://github.com/gardener847/freertos-projects/tree/master/lib/L2_Drivers) (Peripheral drivers), [`lib/L5_HighLevel/tasks.hpp`](https://github.com/gardener847/freertos-projects/blob/master/lib/L5_HighLevel/tasks.hpp) (Terminal and handlers), [`Projects/UART/L5_Application/main.cpp`](https://github.com/gardener847/freertos-projects/blob/master/Projects/UART/L5_Application/main.cpp) (UART demo)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime foundation"]
  node_lowlevel["Chip support"]
  node_freertos["FreeRTOS kernel"]
  node_scheduler["Task utilities<br/>[scheduler_task.hpp]"]
  node_command["Command processor"]
end

subgraph group_drivers["Peripheral drivers"]
  node_uart0["UART console<br/>[uart0_min.h]"]
  node_peripheral["Peripheral drivers"]
  node_char_device["Character device<br/>[char_dev.hpp]"]
end

subgraph group_services["Board services"]
  node_board_io["Board sensors and IO<br/>[io.hpp]"]
  node_storage["File storage<br/>[storage.hpp]"]
  node_fatfs["FAT filesystem<br/>[ff.h]"]
  node_wireless["Wireless mesh<br/>[wireless.h]"]
  node_terminal["Terminal and handlers<br/>[tasks.hpp]"]
end

subgraph group_examples["Firmware examples"]
  node_adc_pwm["ADC and PWM demo<br/>[main.cpp]"]
  node_uart_demo["UART demo<br/>[main.cpp]"]
  node_spi_demo["SPI flash demo<br/>[main.cpp]"]
  node_i2c_demo["I2C demo<br/>[main.cpp]"]
  node_interrupt_demo["Interrupt demo<br/>[main.cpp]"]
  node_watchdog_demo["Sensor watchdog<br/>[main.cpp]"]
  node_mp3_demo["MP3 player<br/>[main.cpp]"]
  node_tasks_demo["Task scheduling demo<br/>[main.cpp]"]
end

node_board(("LPC17xx board"))
node_user(("Board user"))

node_board -->|"runs on"| node_lowlevel
node_user -.->|"enters commands"| node_terminal
node_terminal -->|"dispatches commands"| node_command
node_terminal -->|"uses task base"| node_scheduler
node_terminal -.->|"uses console"| node_uart0
node_terminal -->|"saves telemetry"| node_storage
node_storage -->|"uses filesystem"| node_fatfs
node_wireless -.->|"uses radio drivers"| node_peripheral
node_adc_pwm -->|"starts tasks"| node_freertos
node_adc_pwm -->|"uses ADC/PWM"| node_peripheral
node_uart_demo -->|"uses UART"| node_peripheral
node_uart_demo -->|"uses board IO"| node_board_io
node_uart_demo -->|"starts tasks"| node_freertos
node_spi_demo -->|"accesses SPI"| node_peripheral
node_spi_demo -->|"starts tasks"| node_freertos
node_i2c_demo -->|"uses I2C"| node_peripheral
node_i2c_demo -->|"starts tasks"| node_freertos
node_interrupt_demo -->|"registers interrupts"| node_peripheral
node_interrupt_demo -->|"starts tasks"| node_freertos
node_watchdog_demo -->|"reads light sensor"| node_board_io
node_watchdog_demo -->|"appends readings"| node_storage
node_watchdog_demo -->|"coordinates tasks"| node_freertos
node_mp3_demo -->|"drives audio"| node_peripheral
node_mp3_demo -->|"uses board IO"| node_board_io
node_mp3_demo -->|"starts tasks"| node_freertos
node_tasks_demo -->|"starts scheduler"| node_freertos
node_char_device -->|"uses queues and semaphores"| node_freertos
node_command -->|"uses command IO"| node_char_device
node_lowlevel -.->|"provides chip access"| node_peripheral

click node_lowlevel "https://github.com/gardener847/freertos-projects/tree/master/lib/L0_LowLevel"
click node_freertos "https://github.com/gardener847/freertos-projects/tree/master/lib/L1_FreeRTOS"
click node_scheduler "https://github.com/gardener847/freertos-projects/blob/master/lib/L3_Utils/scheduler_task.hpp"
click node_command "https://github.com/gardener847/freertos-projects/blob/master/lib/L3_Utils/command_handler.hpp"
click node_uart0 "https://github.com/gardener847/freertos-projects/blob/master/lib/L0_LowLevel/uart0_min.h"
click node_peripheral "https://github.com/gardener847/freertos-projects/tree/master/lib/L2_Drivers"
click node_char_device "https://github.com/gardener847/freertos-projects/blob/master/lib/L2_Drivers/base/char_dev.hpp"
click node_board_io "https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/io.hpp"
click node_storage "https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/storage.hpp"
click node_fatfs "https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/fat/ff.h"
click node_wireless "https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/wireless/wireless.h"
click node_terminal "https://github.com/gardener847/freertos-projects/blob/master/lib/L5_HighLevel/tasks.hpp"
click node_adc_pwm "https://github.com/gardener847/freertos-projects/blob/master/Projects/ADC%2BPWM/L5_Application/main.cpp"
click node_uart_demo "https://github.com/gardener847/freertos-projects/blob/master/Projects/UART/L5_Application/main.cpp"
click node_spi_demo "https://github.com/gardener847/freertos-projects/blob/master/Projects/SPI/L5_Application/main.cpp"
click node_i2c_demo "https://github.com/gardener847/freertos-projects/blob/master/Projects/I2C/L5_Application/main.cpp"
click node_interrupt_demo "https://github.com/gardener847/freertos-projects/blob/master/Projects/Interrupts/L5_Application/main.cpp"
click node_watchdog_demo "https://github.com/gardener847/freertos-projects/blob/master/Projects/WatchDog/L5_Application/main.cpp"
click node_mp3_demo "https://github.com/gardener847/freertos-projects/blob/master/Projects/mp/mp3/L5_Application/main.cpp"
click node_tasks_demo "https://github.com/gardener847/freertos-projects/blob/master/Projects/Tasks/L5_Application/main.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_lowlevel,node_freertos,node_scheduler,node_command,node_user toneBlue
class node_uart0,node_peripheral,node_char_device toneAmber
class node_board_io,node_storage,node_fatfs,node_wireless,node_terminal toneMint
class node_adc_pwm,node_uart_demo,node_spi_demo,node_i2c_demo,node_interrupt_demo,node_watchdog_demo,node_mp3_demo,node_tasks_demo toneRose
class node_board toneIndigo
```

## Components

### Runtime foundation

- [Chip support](https://github.com/gardener847/freertos-projects/tree/master/lib/L0_LowLevel): `lib/L0_LowLevel`
- [FreeRTOS kernel](https://github.com/gardener847/freertos-projects/tree/master/lib/L1_FreeRTOS): `lib/L1_FreeRTOS`
- [Task utilities](https://github.com/gardener847/freertos-projects/blob/master/lib/L3_Utils/scheduler_task.hpp): `lib/L3_Utils/scheduler_task.hpp`
- [Command processor](https://github.com/gardener847/freertos-projects/blob/master/lib/L3_Utils/command_handler.hpp): `lib/L3_Utils/command_handler.hpp`

### Peripheral drivers

- [UART console](https://github.com/gardener847/freertos-projects/blob/master/lib/L0_LowLevel/uart0_min.h): `lib/L0_LowLevel/uart0_min.h`
- [Peripheral drivers](https://github.com/gardener847/freertos-projects/tree/master/lib/L2_Drivers): `lib/L2_Drivers`
- [Character device](https://github.com/gardener847/freertos-projects/blob/master/lib/L2_Drivers/base/char_dev.hpp): `lib/L2_Drivers/base/char_dev.hpp`

### Board services

- [Board sensors and IO](https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/io.hpp): `lib/L4_IO/io.hpp`
- [File storage](https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/storage.hpp): `lib/L4_IO/storage.hpp`
- [FAT filesystem](https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/fat/ff.h): `lib/L4_IO/fat/ff.h`
- [Wireless mesh](https://github.com/gardener847/freertos-projects/blob/master/lib/L4_IO/wireless/wireless.h): `lib/L4_IO/wireless/wireless.h`
- [Terminal and handlers](https://github.com/gardener847/freertos-projects/blob/master/lib/L5_HighLevel/tasks.hpp): `lib/L5_HighLevel/tasks.hpp`

### Firmware examples

- [ADC and PWM demo](https://github.com/gardener847/freertos-projects/blob/master/Projects/ADC%2BPWM/L5_Application/main.cpp): `Projects/ADC+PWM/L5_Application/main.cpp`
- [UART demo](https://github.com/gardener847/freertos-projects/blob/master/Projects/UART/L5_Application/main.cpp): `Projects/UART/L5_Application/main.cpp`
- [SPI flash demo](https://github.com/gardener847/freertos-projects/blob/master/Projects/SPI/L5_Application/main.cpp): `Projects/SPI/L5_Application/main.cpp`
- [I2C demo](https://github.com/gardener847/freertos-projects/blob/master/Projects/I2C/L5_Application/main.cpp): `Projects/I2C/L5_Application/main.cpp`
- [Interrupt demo](https://github.com/gardener847/freertos-projects/blob/master/Projects/Interrupts/L5_Application/main.cpp): `Projects/Interrupts/L5_Application/main.cpp`
- [Sensor watchdog](https://github.com/gardener847/freertos-projects/blob/master/Projects/WatchDog/L5_Application/main.cpp): `Projects/WatchDog/L5_Application/main.cpp`
- [MP3 player](https://github.com/gardener847/freertos-projects/blob/master/Projects/mp/mp3/L5_Application/main.cpp): `Projects/mp/mp3/L5_Application/main.cpp`
- [Task scheduling demo](https://github.com/gardener847/freertos-projects/blob/master/Projects/Tasks/L5_Application/main.cpp): `Projects/Tasks/L5_Application/main.cpp`

### Other components

- **LPC17xx board**
- **Board user**

## Connections

- LPC17xx board → Chip support: runs on (evidence: `README.md`)
- Board user → Terminal and handlers: enters commands (evidence: `lib/L5_HighLevel/tasks.hpp`)
- Terminal and handlers → Command processor: dispatches commands (evidence: `lib/L5_HighLevel/tasks.hpp`)
- Terminal and handlers → Task utilities: uses task base (evidence: `lib/L5_HighLevel/tasks.hpp`)
- Terminal and handlers → UART console: uses console (evidence: `lib/L5_HighLevel/tasks.hpp`)
- Terminal and handlers → File storage: saves telemetry (evidence: `lib/L5_HighLevel/tasks.hpp`)
- File storage → FAT filesystem: uses filesystem (evidence: `lib/L4_IO/src/storage.cpp`)
- Wireless mesh → Peripheral drivers: uses radio drivers (evidence: `lib/L2_Drivers/nrf_stream.hpp`)
- ADC and PWM demo → FreeRTOS kernel: starts tasks (evidence: `Projects/ADC+PWM/L5_Application/main.cpp`)
- ADC and PWM demo → Peripheral drivers: uses ADC/PWM (evidence: `Projects/ADC+PWM/L5_Application/main.cpp`)
- UART demo → Peripheral drivers: uses UART (evidence: `Projects/UART/L5_Application/main.cpp`)
- UART demo → Board sensors and IO: uses board IO (evidence: `Projects/UART/L5_Application/main.cpp`)
- UART demo → FreeRTOS kernel: starts tasks (evidence: `Projects/UART/L5_Application/main.cpp`)
- SPI flash demo → Peripheral drivers: accesses SPI (evidence: `Projects/SPI/L5_Application/main.cpp`)
- SPI flash demo → FreeRTOS kernel: starts tasks (evidence: `Projects/SPI/L5_Application/main.cpp`)
- I2C demo → Peripheral drivers: uses I2C (evidence: `Projects/I2C/L5_Application/main.cpp`)
- I2C demo → FreeRTOS kernel: starts tasks (evidence: `Projects/I2C/L5_Application/main.cpp`)
- Interrupt demo → Peripheral drivers: registers interrupts (evidence: `Projects/Interrupts/L5_Application/main.cpp`)
- Interrupt demo → FreeRTOS kernel: starts tasks (evidence: `Projects/Interrupts/L5_Application/main.cpp`)
- Sensor watchdog → Board sensors and IO: reads light sensor (evidence: `Projects/WatchDog/L5_Application/main.cpp`)
- Sensor watchdog → File storage: appends readings (evidence: `Projects/WatchDog/L5_Application/main.cpp`)
- Sensor watchdog → FreeRTOS kernel: coordinates tasks (evidence: `Projects/WatchDog/L5_Application/main.cpp`)
- MP3 player → Peripheral drivers: drives audio (evidence: `Projects/mp/mp3/L5_Application/main.cpp`)
- MP3 player → Board sensors and IO: uses board IO (evidence: `Projects/mp/mp3/L5_Application/main.cpp`)
- MP3 player → FreeRTOS kernel: starts tasks (evidence: `Projects/mp/mp3/L5_Application/main.cpp`)
- Task scheduling demo → FreeRTOS kernel: starts scheduler (evidence: `Projects/Tasks/L5_Application/main.cpp`)
- Character device → FreeRTOS kernel: uses queues and semaphores (evidence: `lib/L2_Drivers/base/char_dev.hpp`)
- Command processor → Character device: uses command IO (evidence: `lib/L3_Utils/command_handler.hpp`)
- Chip support → Peripheral drivers: provides chip access (evidence: `lib/L0_LowLevel/lpc_sys.h`)
