Merge io_interfaces repo into helpers

This commit is contained in:
Henrik Stickann
2022-05-02 13:20:25 +02:00
24 changed files with 1726 additions and 4 deletions

View File

@@ -32,9 +32,9 @@ Debug serial output macros.
Configuration:
* `#define STA_DEBUG_SERIAL_ENABLE`: Enable module
* `#define STA_DEBUG_SERIAL_DISABLE`: Forces module off when defined
* `DEBUG`: Automatically enables module when defined
* `NDEBUG`: Forces module off when defined
* `#define STA_DEBUG_SERIAL_FORCE`: Ignore debug defines and always enable output
* `DEBUG`: Enables output when defined
* `NDEBUG`: Disables output when defined (overrides DEBUG)
The `sta::DebugSerial` instance must be provided.
@@ -78,4 +78,37 @@ Configuration:
* `#define STA_HAL_DELAY_US_TIM <tim_handle>`: 1 MHz TIM instance used by `sta::delayUs`
TIM time base must be started before using `sta::delayUs` by calling `sta::initHAL`.
When using the startup system task this is handled automatically.
When using the startup system task this is handled automatically.
## Interfaces
The intention of these interfaces is to provide an abstraction layer for commonly used
resources. Libraries using these interfaces can be reused on different platforms
by simply implementing the required interfaces for the selected platform.
Interfaces for the following resources are provided:
* GPIO pin
* Mutex
* Signal
* SPI
* UART
## HAL implementations
Implementations using the HAL are provided for the following interfaces:
* GpioPin
* SpiInterface, SpiDevice
* UART
To enable these implementations follow the instructions from the individual headers.
## Atomic implementations
Implementations using atomic variables are provided for the following interfaces:
* Mutex
* Signal
To enable these implementations define `STA_ATOMIC_ENABLE` in `<sta/config.hpp>`.