How jgromes/radiolib works
Project type and purpose
• RadioLib is an open‑source, cross‑platform embedded library for wireless communication modules.
• It provides drivers (“modules”) for dozens of radio chips, a hardware abstraction layer (HAL), a suite of protocols (AX.25, LoRaWAN, Morse, SSTV, etc.), and utility code (CRC, FEC, crypto).
• It is not a client/server or full‑stack web app; it is a layered C/C++ library designed to run on Arduino, ESP32/8266, RP2040, STM32, and even bare‑metal or RTOS‑based platforms.
File structure
Top‐level directories and files:
• src/
– hal/ : platform‐specific HAL headers & implementations (Arduino, RPi, Pico, etc.)
– modules/ : per‑chip drivers (e.g., CC1101, SX127x, LR11x0…)
– protocols/ : digital protocol implementations built atop the module drivers
– utils/ : shared helpers (CRC, FEC, cryptography, general utilities)
– RadioLib.h, Module.h, Hal.h – the public API headers
• examples/ : dozens of sketches demonstrating how to use modules + protocols on Arduino and non‑Arduino platforms
• extras/ : tooling (image converter, spectrum scan), CI scripts, unit tests
• CMakeLists.txt, idf_component.yml, library.json, PlatformIO & Arduino metadata – build system & packaging
• .github/workflows/ – CI pipelines for code analysis, tests, documentation
README for additional insights
• Describes supported modules and digital modes (“one radio library to rule them all!”)
• Mentions internal HAL for portability and a consistent, layered API
• Links to API reference, wiki, and status/debug log decoders
1) Application (User Sketch / Non‑Arduino main): calls into ↓
2) Protocol Layer: AX.25, LoRaWAN, Morse, SSTV, etc.
3) Module Drivers: CC1101, SX127x, nRF24, LR11x0, RF69, SX126x, etc.
4) HAL (Hardware Abstraction): ArduinoHal, PiHal, PicoHal, RPi, ESP32, etc.
5) Utilities: CRC, FEC, Cryptography, Utils
6) Build & Packaging: CMake, PlatformIO, Arduino IDE, idf_component
7) Examples & Tests: examples/, extras/test/unit/, extras/ci scripts
• Application → Protocol Layer → Module Drivers → HAL → Physical Hardware
• Protocol Layer ←→ Utilities (for CRC/FEC/crypto)
• Module Drivers ←→ Utilities (timing, bit manipulation)
• Build & Packaging → (configures) → src/, examples/, extras/
• CI workflows → test harness → extras/test unit, examples compilation
c. Architectural patterns & design principles:
• Layered architecture: clear separation of concerns (HAL ↔ Drivers ↔ Protocols ↔ Application)
• Hardware abstraction: isolates MCU specifics in hal/ so modules + protocols remain platform‑agnostic
• Plug‑in modularity: new radio chips live in their own module subdirectory; new protocols in protocols/
• Single public API: RadioLib.h exposes a unified interface regardless of underlying module or protocol
d. Key technologies, frameworks, libraries:
• C++ (headers & implementation files) using idiomatic RTOS‑less design
• CMake for non‑Arduino builds, PlatformIO, Arduino library metadata (library.json, keywords.txt)
• Doxygen for API docs, GitHub Actions for CI (cppcheck, unit tests, doxygen, release)