|
caffeine-sal 0.1.17
Header-only polymorphic middleware services layer for the Caffeine Framework
|
Caffeine-Services is the polymorphic middleware layer of the Caffeine Framework. It provides a strictly C11-compliant, header-only, Virtual Method Table (VMT) architecture to define abstract interfaces for high-level hardware devices and software services.
Built directly on top of Caffeine-HAL, this library ensures that business logic remains completely portable across different hardware implementations.
The library decouples high-level application logic from concrete implementations. By providing generic interfaces like Transport or Connection, application code can interact with any communication link (UART, BLE, LoRaWAN, TCP) through a unified API.
static inline wrappers.cfn_hal_driver_t container, ensuring a consistent lifecycle (init, deinit, config, callback) across the entire framework.Connection and Transport (Sync/Async) abstractions for link-layer and data-stream management.CFN_HAL_WITH_LOCK mechanism.caffeine-build/: Submodule containing centralized build presets, toolchains, scripts, and hardware target definitions.include/cfn_sal.h: Core macros and FourCC definitions.include/devices/: Hardware-agnostic interfaces for physical components.led.h, button.h, accel.h, temp_sensor.h, hum_sensor.h, battery.h, light_sensor.h, pressure_sensor.h, gnss.h, display.h, composite.h.include/network/: Generic connectivity and protocol abstractions.connection.h (Link-layer management), transport.h (Streaming/Datagram Data).include/utilities/: High-level software services and data structures.cli.h, at_parser.h, collection.h, fs.h (File System), logging.h.The API reference for this repository is generated automatically via Doxygen and hosted on GitHub Pages.
📚 View the Caffeine-SAL API Documentation
The project includes built-in targets for maintaining code quality. Use the framework's centralized scripts for orchestration:
All contributions must adhere to the core framework guidelines:
While this library is no Mondrian, it deals with a different form of abstraction art. Hardware abstraction is a craft of its own—one that keeps your application code portable and your debugging sessions short.
Whether Caffeine is fueling an elegant embedded project or just helping you wake up your hardware, you can contribute in the following ways:
If my projects helped you, feel free to buy me a brew. Or if it caused you an extra debugging session, open a PR!
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.