rtos2-utils/README.md
2024-11-11 18:53:29 +01:00

63 lines
2.3 KiB
Markdown

# STA RTOS Utilities
![pre-release v1.0.0](https://img.shields.io/static/v1?label=pre-release&message=v1.0.0&color=orange&logo=git)
![Standard: C++11](https://img.shields.io/static/v1?label=standard&message=C%2B%2B11&color=blue&logo=cplusplus)
Library providing the software stack for use with the ALPAKA hardware design for RTOS projects.
Modules can be configured via defines set in `<sta/config.hpp>` header file which must be provided by the application.
# ALPAKA Modules
The startup of all features that need to be initialized before the RTOS is started is implemented in the `startTACOS()` function offered by [TACOS](https://git.intern.spaceteamaachen.de/ALPAKA/TACOS). Alternatively the following code can be used to start the system:
```cpp
sta::rtos::initSystemEvents();
HAL_TIM_Base_Start(&STA_STM32_DELAY_US_TIM);
sta::rtos::signalStartupEvent();
```
## Can Bus
Mainly defers to the TACOS CAN module, but provides a simple interface for sending and receiving messages.
Expandable for isotp.
# STA-Core Interfaces
The library provides implementations for the following interfaces using CMSIS-RTOS2 functionality:
* `Mutex`
* `Signal`
# Wrapped CMSIS-RTOS2 Functions
Many CMSIS-RTOS2 functions are wrapped in classes to provide a more object-oriented interface. Previously mentioned interfaces will not be repeated here. Detailed information can be found in the `.hpp` files or the doxygen documentation.
## Event Flags
Event flags are a very useful tool for inter-task synchronization.
## Memory Pool
Fixed-size memory pools are used to allocate memory for objects of the same size. Unprotected against incorrect pointer usage. Shared memory is recommended to be used instead.
## Shared Memory
Shared memory is a memory pool that is protected against incorrect pointer usage by providing set interfaces for reading and writing data instead of direct pointer access.
## Message Queue
Simple and safe message queue implementation. Does what it says on the tin.
## Signal
A binary semaphore that can be used to signal events between tasks. Offers various control functions.
## Timer
Timers with a user defined callback function. Also repeatable, so they are also great for scheduling tasks.
## Thread
A simple thread that can be inherited from to create a new task. Offers a loop function that is called periodically. Also supports thread flags and murder.