# rogerclarkmelbourne/arduino_stm32 architecture

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

- Interactive diagram: https://gitdiagram.com/rogerclarkmelbourne/arduino_stm32
- Repository: https://github.com/rogerclarkmelbourne/arduino_stm32

## Overview

Arduino STM32 supplies Arduino 1.8.x hardware support for Maple, Maple Mini, and other STM32 boards. The principal workflow is a sketch using Arduino-facing APIs on a selected board, with the core providing runtime and peripheral support. The tree also contains substantial peripheral libraries, USB composite functions, and three bundled FreeRTOS versions. The README establishes the platform scope; the source index supports only a few specific module relationships, so unverified connections are omitted or dashed.

Main entry points: [`STM32F1/cores/maple/Stream.h`](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/Stream.h) (Stream API), [`STM32F1/cores/maple/libmaple`](https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/cores/maple/libmaple) (STM32 peripheral drivers), [`STM32F1/cores/maple/HardwareSerial.cpp`](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/HardwareSerial.cpp) (Hardware serial), [`STM32F1/variants`](https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/variants) (Board variants)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Arduino core"]
  node_core_runtime["Core runtime<br/>[main.cpp]"]
  node_print["Print API<br/>[Print.h]"]
  node_stream["Stream API<br/>[Stream.h]"]
  node_serial["Hardware serial<br/>[HardwareSerial.cpp]"]
end

subgraph group_hardware["Board and drivers"]
  node_board_config["Board variants"]
  node_peripheral_drivers["STM32 peripheral drivers"]
  node_system_libmaple["Libmaple system"]
  node_analog["Analog and PWM<br/>[wirish_analog.cpp]"]
  node_digital["Digital I/O<br/>[wirish_digital.cpp]"]
end

subgraph group_libraries["Peripheral libraries"]
  node_spi["SPI library<br/>[SPI.cpp]"]
  node_wire["Wire library<br/>[Wire.cpp]"]
  node_ethernet["Ethernet library<br/>[Ethernet_STM.cpp]"]
  node_storage["EEPROM storage<br/>[EEPROM.cpp]"]
  node_display["Display libraries"]
end

subgraph group_runtime["RTOS and USB"]
  node_usb_composite["USB composite<br/>[USBComposite.cpp]"]
  node_usb_mass["USB mass storage<br/>[USBMassStorage.cpp]"]
  node_freertos701["FreeRTOS 7.01<br/>[tasks.c]"]
  node_freertos821["FreeRTOS 8.21<br/>[tasks.c]"]
  node_freertos900["FreeRTOS 9.00<br/>[tasks.c]"]
end

node_developer(("Arduino sketch author"))

node_developer -.->|"uses platform"| node_core_runtime
node_stream -->|"inherits"| node_print
node_serial -->|"uses API"| node_stream
node_board_config -.->|"selects support"| node_peripheral_drivers
node_peripheral_drivers -.->|"uses system layer"| node_system_libmaple
node_usb_mass -->|"registers component"| node_usb_composite

click node_core_runtime "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/main.cpp"
click node_print "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/Print.h"
click node_stream "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/Stream.h"
click node_serial "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/HardwareSerial.cpp"
click node_board_config "https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/variants"
click node_peripheral_drivers "https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/cores/maple/libmaple"
click node_system_libmaple "https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/system/libmaple"
click node_analog "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/wirish_analog.cpp"
click node_digital "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/wirish_digital.cpp"
click node_spi "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/SPI/src/SPI.cpp"
click node_wire "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/Wire/Wire.cpp"
click node_ethernet "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/Ethernet_STM/src/Ethernet_STM.cpp"
click node_storage "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/EEPROM/EEPROM.cpp"
click node_display "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/Adafruit_GFX_AS/Adafruit_GFX_AS.cpp"
click node_usb_composite "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/USBComposite/USBComposite.cpp"
click node_usb_mass "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/USBComposite/USBMassStorage.cpp"
click node_freertos701 "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/FreeRTOS701/utility/tasks.c"
click node_freertos821 "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/FreeRTOS821/utility/tasks.c"
click node_freertos900 "https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/FreeRTOS900/utility/tasks.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_core_runtime,node_print,node_stream,node_serial toneBlue
class node_board_config,node_peripheral_drivers,node_system_libmaple,node_analog,node_digital toneAmber
class node_spi,node_wire,node_ethernet,node_storage,node_display toneMint
class node_usb_composite,node_usb_mass,node_freertos701,node_freertos821,node_freertos900 toneRose
class node_developer toneIndigo
```

## Components

### Arduino core

- [Core runtime](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/main.cpp): `STM32F1/cores/maple/main.cpp`
- [Print API](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/Print.h): `STM32F1/cores/maple/Print.h`
- [Stream API](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/Stream.h): `STM32F1/cores/maple/Stream.h`
- [Hardware serial](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/HardwareSerial.cpp): `STM32F1/cores/maple/HardwareSerial.cpp`

### Board and drivers

- [Board variants](https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/variants): `STM32F1/variants`
- [STM32 peripheral drivers](https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/cores/maple/libmaple): `STM32F1/cores/maple/libmaple`
- [Libmaple system](https://github.com/rogerclarkmelbourne/arduino_stm32/tree/master/STM32F1/system/libmaple): `STM32F1/system/libmaple`
- [Analog and PWM](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/wirish_analog.cpp): `STM32F1/cores/maple/wirish_analog.cpp`
- [Digital I/O](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/cores/maple/wirish_digital.cpp): `STM32F1/cores/maple/wirish_digital.cpp`

### Peripheral libraries

- [SPI library](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/SPI/src/SPI.cpp): `STM32F1/libraries/SPI/src/SPI.cpp`
- [Wire library](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/Wire/Wire.cpp): `STM32F1/libraries/Wire/Wire.cpp`
- [Ethernet library](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/Ethernet_STM/src/Ethernet_STM.cpp): `STM32F1/libraries/Ethernet_STM/src/Ethernet_STM.cpp`
- [EEPROM storage](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/EEPROM/EEPROM.cpp): `STM32F1/libraries/EEPROM/EEPROM.cpp`
- [Display libraries](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/Adafruit_GFX_AS/Adafruit_GFX_AS.cpp): `STM32F1/libraries/Adafruit_GFX_AS/Adafruit_GFX_AS.cpp`

### RTOS and USB

- [USB composite](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/USBComposite/USBComposite.cpp): `STM32F1/libraries/USBComposite/USBComposite.cpp`
- [USB mass storage](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/USBComposite/USBMassStorage.cpp): `STM32F1/libraries/USBComposite/USBMassStorage.cpp`
- [FreeRTOS 7.01](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/FreeRTOS701/utility/tasks.c): `STM32F1/libraries/FreeRTOS701/utility/tasks.c`
- [FreeRTOS 8.21](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/FreeRTOS821/utility/tasks.c): `STM32F1/libraries/FreeRTOS821/utility/tasks.c`
- [FreeRTOS 9.00](https://github.com/rogerclarkmelbourne/arduino_stm32/blob/master/STM32F1/libraries/FreeRTOS900/utility/tasks.c): `STM32F1/libraries/FreeRTOS900/utility/tasks.c`

### Other components

- **Arduino sketch author**

## Connections

- Arduino sketch author → Core runtime: uses platform
- Stream API → Print API: inherits (evidence: `STM32F1/cores/maple/Stream.h`)
- Hardware serial → Stream API: uses API
- Board variants → STM32 peripheral drivers: selects support
- STM32 peripheral drivers → Libmaple system: uses system layer
- USB mass storage → USB composite: registers component (evidence: `STM32F1/libraries/USBComposite/USBMassStorage.cpp`)
