mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/TACOS.git
synced 2025-06-12 01:25:59 +00:00
98 lines
1.9 KiB
C++
98 lines
1.9 KiB
C++
/**
|
|
* @file
|
|
* @brief Implementation of system events.
|
|
*/
|
|
#ifndef STA_TACOS_SYSTEM_EVENTS_HPP
|
|
#define STA_TACOS_SYSTEM_EVENTS_HPP
|
|
|
|
|
|
/**
|
|
* @defgroup STA_RTOS_SysEvent System Events
|
|
* @ingroup STA_RTOS_API
|
|
* @brief System events.
|
|
*
|
|
* Check @ref STA_RTOS_BuildConfig for configuration options.
|
|
*/
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
// System event flags
|
|
//
|
|
|
|
/**
|
|
* @brief Startup system event flag.
|
|
*
|
|
* @ingroup STA_RTOS_SysEvent
|
|
*/
|
|
#define STA_TACOS_SYSTEM_EVENTS_STARTUP 0x100000U
|
|
|
|
|
|
namespace sta
|
|
{
|
|
namespace tacos
|
|
{
|
|
namespace events
|
|
{
|
|
enum class Types : uint32_t
|
|
{
|
|
STARTUP = (0x01 << 0x00),
|
|
TICK_100Hz = (0x01 << 0x01),
|
|
TICK_50Hz = (0x01 << 0x02),
|
|
TOCK_50Hz = (0x01 << 0x03),
|
|
TICK_20Hz = (0x01 << 0x04),
|
|
TOCK_20Hz = (0x01 << 0x05),
|
|
TICK_10Hz = (0x01 << 0x06),
|
|
TOCK_10Hz = (0x01 << 0x07),
|
|
TICK_1Hz = (0x01 << 0x08),
|
|
TOCK_1Hz = (0x01 << 0x09)
|
|
};
|
|
|
|
/**
|
|
* @brief Initialize system events.
|
|
*/
|
|
void init();
|
|
|
|
/**
|
|
* @brief Signal system events.
|
|
*
|
|
* @param flags System event flags
|
|
*
|
|
* @ingroup STA_RTOS_SysEvent
|
|
*/
|
|
void signal(uint32_t flags);
|
|
|
|
/**
|
|
* @brief Wait for system events.
|
|
*
|
|
* @param flags System event flags
|
|
* @param options osFlagsWaitAll or osFlagsWaitAny (osFlagsNoClear always set)
|
|
* @param timeout Wait timeout (0 = instant, osWaitForever = infinite)
|
|
*
|
|
* @ingroup STA_RTOS_SysEvent
|
|
*/
|
|
void wait(uint32_t flags, uint32_t options, uint32_t timeout);
|
|
|
|
/**
|
|
* @brief Signal startup system event.
|
|
*
|
|
* @ingroup STA_RTOS_SysEvent
|
|
*/
|
|
void signalStartup();
|
|
|
|
/**
|
|
* @brief Wait for startup system event.
|
|
*
|
|
* Blocking while waiting
|
|
*
|
|
* @ingroup STA_RTOS_SysEvent
|
|
*/
|
|
void waitForStartup();
|
|
} // namespace events
|
|
} // namespace tacos
|
|
} // namespace sta
|
|
|
|
|
|
#endif // STA_RTOS_SYSTEM_EVENTS_HPP
|