14 #ifndef HEADERS_R_RTOS_MONITOR_H_ 15 #define HEADERS_R_RTOS_MONITOR_H_ 18 #include "R_RTOS_memMngr.h 24 typedef uint8_t mntrFlgs; 52 typedef enum mntrAccessState 55 MNTR_LOCK_ERROR = (mntrFlgs) 0x00u,
56 MNTR_READ = (mntrFlgs) 0x1u,
57 MNTR_WRITE = (mntrFlgs) 0x2u,
59 MNTR_NOOP = (mntrFlgs) 0x8u,
61 MNTR_FREE = (mntrFlgs) 0x10u,
62 MNTR_FREE_READ = (mntrFlgs) 0x11u,
63 MNTR_FREE_NOOP = (mntrFlgs) 0x18u,
65 MNTR_PENDING = (mntrFlgs) 0x20u,
66 MNTR_PENDING_WRITE = (mntrFlgs) 0x22u,
68 MNTR_LOCK = (mntrFlgs) 0x40u,
69 MNTR_LOCK_WRITE = (mntrFlgs) 0x42u,
71 MNTR_RW = (mntrFlgs) 0x3u,
72 MNTR_RPW = (mntrFlgs) 0x72u,
73 MNTR_WPW = (mntrFlgs) 0x62u
80 typedef uint8_t mntrRfrcCnt;
95 Data protectedData; //!> Pointer to the data to protect
96 TskID mntrWaitrsQTskIDStrt;
128 RetCode mntr_DelMntr(
const MntrNr mntrNr );
RetCode mntr_ReleaseAccssMntr(const MntrNr mntrNr)
Release a previously made access request (read or write).
Definition: R_RTOS_monitor.c:278
RetCode mntr_ReqstWriteAccssMntr(const MntrNr mntrNr, PTskTCB const tsk)
Request write access to the data protected by the monitor.
Definition: R_RTOS_monitor.c:226
Defines, Typedefs and Macros for the whole system.
uint32_t * Data
Data to store in a data container.
Definition: R_RTOS_inc.h:400
uint8_t TskID
Task identification number (ID).
Definition: R_RTOS_inc.h:532
TskID mntrWaitrsQTskIDEnd
TskID of the task containing the start of the waiters list
Definition: R_RTOS_monitor.h:97
RetCode mntr_ReqstReadAccssMntr(const MntrNr mntrNr, PTskTCB const tsk)
Request read access to the data protected by the monitor.
Definition: R_RTOS_monitor.c:172
mntrRfrcCnt refCntr
Current (access) state of the monitor
Definition: R_RTOS_monitor.h:99
RetCode mntr_InitMntr(const MntrNr mntrNr, const Data const data)
Initialize the monitor with the given MntrNr.
Definition: R_RTOS_monitor.c:137
Task Control Block.
Definition: R_RTOS_inc.h:1322
uint8_t mntrRfrcCnt
Reference counter data type.
Definition: R_RTOS_monitor.h:80
enum mntrAccessState MntrState
See mntrAccessState.
RetCode mntr_INIT(void)
Initialize the Monitor functionality.
Definition: R_RTOS_monitor.c:126
uint8_t RetCode
Return codes for functions.
Definition: R_RTOS_inc.h:1424
Monitor for synchronized access.
Definition: R_RTOS_monitor.h:93
MntrState curState
TskID of the task containing the end of the waiters list
Definition: R_RTOS_monitor.h:98