AvrIO  1.4.5
Bibliothèque C modulaire pour ATMEL AVR
mutex.h
1 
18 #ifndef _AVRIO_MUTEX_H_
19 # define _AVRIO_MUTEX_H_
20 
21 # include <avrio/defs.h>
22 
23 __BEGIN_C_DECLS
24  /* ======================================================================== */
41 # define MUTEX_LOCK (0)
42 
46 # define MUTEX_UNLOCK (-1)
47 
54 # define MUTEX_INITIALIZER MUTEX_UNLOCK
55 
59 typedef volatile uint8_t xMutex;
60 
65 void vMutexUnlock (xMutex * pxMutex);
66 
71 void vMutexLock (xMutex * pxMutex);
72 
79 int8_t xMutexTryLock (xMutex * pxMutex);
80 
96 void vMutexUnlockBit (xMutex * pxMutex, uint8_t ucMask);
97 
103 void vMutexLockBit (xMutex * pxMutex, uint8_t ucMask);
104 
111 int8_t xMutexTryLockBit (xMutex * pxMutex, uint8_t ucMask);
112 
119 bool xMutexBitLocked (xMutex * pxMutex, uint8_t ucMask);
120 
126 void vMutexUntilBitUnlocked (xMutex * pxMutex, uint8_t ucMask);
127 
132 # if defined(__DOXYGEN__)
133 /*
134  * __DOXYGEN__ defined
135  * Partie documentation ne devant pas être compilée.
136  * =============================================================================
137  */
138 
143 # else
144 /*
145  * __DOXYGEN__ not defined
146  * Partie ne devant pas être documentée.
147  * =============================================================================
148  */
149 
150 # endif /* __DOXYGEN__ not defined */
151 /* ========================================================================== */
152 __END_C_DECLS
153 #endif /* _AVRIO_MUTEX_H_ */
void vMutexLock(xMutex *pxMutex)
Attend jusqu&#39;à ce que le mutex soit libre et le verrouille (P)
volatile uint8_t xMutex
Type mutex.
Definition: mutex.h:59
int8_t xMutexTryLockBit(xMutex *pxMutex, uint8_t ucMask)
Variante non bloquante de vMutexLockBit()
bool xMutexBitLocked(xMutex *pxMutex, uint8_t ucMask)
Teste si un ou plusieurs bits sont verrouillés.
void vMutexUnlockBit(xMutex *pxMutex, uint8_t ucMask)
void vMutexUnlock(xMutex *pxMutex)
void vMutexUntilBitUnlocked(xMutex *pxMutex, uint8_t ucMask)
Attend tant qu&#39;un ou plusieurs bits d&#39;un mutex sont verrouillés (P)
int8_t xMutexTryLock(xMutex *pxMutex)
Variante non bloquante de vMutexLock.
void vMutexLockBit(xMutex *pxMutex, uint8_t ucMask)
Attend jusqu&#39;à ce qu&#39;un ou plusieurs bits d&#39;un mutex soit libres et les verrouillent (P) ...