# sysch415/mite-esc architecture

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

- Interactive diagram: https://gitdiagram.com/sysch415/mite-esc
- Repository: https://github.com/sysch415/mite-esc

## Overview

MITE is a pair of bare-metal STM32F411 firmwares: the handheld controller samples joystick axes and transmits a fixed four-byte command, while the crawler receives it and updates motor and servo outputs. The graph separates the two device workflows from the shared nRF24 driver and register-level HAL, and includes the documented board designs. HAL internals and hardware behavior are not sampled; edges show only calls visible in firmware or relationships stated in the README.

Main entry points: [`crawler/main.cpp`](https://github.com/sysch415/mite-esc/blob/master/crawler/main.cpp) (Receive and control), [`controller/main.cpp`](https://github.com/sysch415/mite-esc/blob/master/controller/main.cpp) (Sample and transmit), [`drivers/src/nrf24.cpp`](https://github.com/sysch415/mite-esc/blob/master/drivers/src/nrf24.cpp) (nRF24 driver), [`drivers/include/nrf24.hpp`](https://github.com/sysch415/mite-esc/blob/master/drivers/include/nrf24.hpp) (nRF24 interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_controller["Controller firmware"]
  node_controller_startup["Controller startup<br/>[startup.cpp]"]
  node_controller_main["Sample and transmit<br/>[main.cpp]"]
end

subgraph group_crawler["Crawler firmware"]
  node_crawler_startup["Crawler startup<br/>[startup.cpp]"]
  node_crawler_main["Receive and control<br/>[main.cpp]"]
end

subgraph group_shared["Shared firmware"]
  node_nrf_driver["nRF24 driver<br/>[nrf24.cpp]"]
  node_nrf_api["nRF24 interface<br/>[nrf24.hpp]"]
  node_hal["Register-level HAL"]
end

subgraph group_hardware["Board designs"]
  node_crawler_board["MITE v1 board"]
  node_controller_board["Controller board"]
end

node_operator(("Operator"))
node_joystick(("Joystick axes"))
node_radio(("nRF24L01+ radios"))
node_motor(("Brushed motor"))
node_servo(("Steering servo"))

node_operator -->|"moves"| node_joystick
node_joystick -->|"provides axes"| node_controller_main
node_controller_startup -->|"calls"| node_controller_main
node_controller_main -->|"reads ADC"| node_hal
node_controller_main -->|"transmits payload"| node_nrf_driver
node_controller_main -->|"uses interface"| node_nrf_api
node_nrf_driver -->|"uses SPI and GPIO"| node_hal
node_nrf_driver -->|"implements"| node_nrf_api
node_nrf_driver -->|"commands"| node_radio
node_radio -->|"delivers commands"| node_crawler_main
node_crawler_startup -->|"calls"| node_crawler_main
node_crawler_main -->|"configures peripherals"| node_hal
node_crawler_main -->|"receives payload"| node_nrf_driver
node_crawler_main -->|"uses interface"| node_nrf_api
node_crawler_main -->|"sets PWM and direction"| node_motor
node_crawler_main -->|"sets servo pulse"| node_servo

click node_controller_startup "https://github.com/sysch415/mite-esc/blob/master/controller/startup.cpp"
click node_controller_main "https://github.com/sysch415/mite-esc/blob/master/controller/main.cpp"
click node_crawler_startup "https://github.com/sysch415/mite-esc/blob/master/crawler/startup.cpp"
click node_crawler_main "https://github.com/sysch415/mite-esc/blob/master/crawler/main.cpp"
click node_nrf_driver "https://github.com/sysch415/mite-esc/blob/master/drivers/src/nrf24.cpp"
click node_nrf_api "https://github.com/sysch415/mite-esc/blob/master/drivers/include/nrf24.hpp"
click node_hal "https://github.com/sysch415/mite-esc/tree/master/hal_lib"
click node_crawler_board "https://github.com/sysch415/mite-esc/tree/master/hardware/crawler_schematic"
click node_controller_board "https://github.com/sysch415/mite-esc/tree/master/hardware/controller_schematic"

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_controller_startup,node_controller_main toneBlue
class node_crawler_startup,node_crawler_main toneAmber
class node_nrf_driver,node_nrf_api,node_hal toneMint
class node_crawler_board,node_controller_board toneRose
class node_operator,node_joystick,node_radio,node_motor,node_servo toneIndigo
```

## Components

### Controller firmware

- [Controller startup](https://github.com/sysch415/mite-esc/blob/master/controller/startup.cpp): `controller/startup.cpp`
- [Sample and transmit](https://github.com/sysch415/mite-esc/blob/master/controller/main.cpp): `controller/main.cpp`

### Crawler firmware

- [Crawler startup](https://github.com/sysch415/mite-esc/blob/master/crawler/startup.cpp): `crawler/startup.cpp`
- [Receive and control](https://github.com/sysch415/mite-esc/blob/master/crawler/main.cpp): `crawler/main.cpp`

### Shared firmware

- [nRF24 driver](https://github.com/sysch415/mite-esc/blob/master/drivers/src/nrf24.cpp): `drivers/src/nrf24.cpp`
- [nRF24 interface](https://github.com/sysch415/mite-esc/blob/master/drivers/include/nrf24.hpp): `drivers/include/nrf24.hpp`
- [Register-level HAL](https://github.com/sysch415/mite-esc/tree/master/hal_lib): `hal_lib`

### Board designs

- [MITE v1 board](https://github.com/sysch415/mite-esc/tree/master/hardware/crawler_schematic): `hardware/crawler_schematic`
- [Controller board](https://github.com/sysch415/mite-esc/tree/master/hardware/controller_schematic): `hardware/controller_schematic`

### Other components

- **Operator**
- **Joystick axes**
- **nRF24L01+ radios**
- **Brushed motor**
- **Steering servo**

## Connections

- Operator → Joystick axes: moves (evidence: `README.md`)
- Joystick axes → Sample and transmit: provides axes (evidence: `controller/main.cpp`)
- Controller startup → Sample and transmit: calls (evidence: `controller/startup.cpp`)
- Sample and transmit → Register-level HAL: reads ADC (evidence: `controller/main.cpp`)
- Sample and transmit → nRF24 driver: transmits payload (evidence: `controller/main.cpp`)
- Sample and transmit → nRF24 interface: uses interface (evidence: `controller/main.cpp`)
- nRF24 driver → Register-level HAL: uses SPI and GPIO (evidence: `drivers/src/nrf24.cpp`)
- nRF24 driver → nRF24 interface: implements (evidence: `drivers/src/nrf24.cpp`)
- nRF24 driver → nRF24L01+ radios: commands (evidence: `README.md`)
- nRF24L01+ radios → Receive and control: delivers commands (evidence: `README.md`)
- Crawler startup → Receive and control: calls (evidence: `crawler/startup.cpp`)
- Receive and control → Register-level HAL: configures peripherals (evidence: `crawler/main.cpp`)
- Receive and control → nRF24 driver: receives payload (evidence: `crawler/main.cpp`)
- Receive and control → nRF24 interface: uses interface (evidence: `crawler/main.cpp`)
- Receive and control → Brushed motor: sets PWM and direction (evidence: `crawler/main.cpp`)
- Receive and control → Steering servo: sets servo pulse (evidence: `crawler/main.cpp`)
