fsfw/src/fsfw/osal/freertos/Mutex.h

28 lines
668 B
C
Raw Normal View History

2020-05-29 14:02:14 +02:00
#ifndef FRAMEWORK_FREERTOS_MUTEX_H_
#define FRAMEWORK_FREERTOS_MUTEX_H_
2018-07-13 15:56:37 +02:00
#include "FreeRTOS.h"
2022-02-02 10:29:30 +01:00
#include "fsfw/ipc/MutexIF.h"
#include "semphr.h"
2018-07-13 15:56:37 +02:00
2020-05-29 14:02:14 +02:00
/**
* @brief OS component to implement MUTual EXclusion
*
* @details
* Mutexes are binary semaphores which include a priority inheritance mechanism.
* Documentation: https://www.freertos.org/Real-time-embedded-RTOS-mutexes.html
* @ingroup osal
*/
2018-07-13 15:56:37 +02:00
class Mutex : public MutexIF {
2022-02-02 10:29:30 +01:00
public:
Mutex();
~Mutex();
ReturnValue_t lockMutex(TimeoutType timeoutType, uint32_t timeoutMs) override;
ReturnValue_t unlockMutex() override;
2020-08-07 22:10:58 +02:00
2022-02-02 10:29:30 +01:00
private:
SemaphoreHandle_t handle;
2018-07-13 15:56:37 +02:00
};
2020-05-29 14:02:14 +02:00
#endif /* FRAMEWORK_FREERTOS_MUTEX_H_ */