AvrIO  1.4.5
Bibliothèque C modulaire pour ATMEL AVR
button.h
1 
18 #ifndef _AVRIO_BUTTON_H_
19 #define _AVRIO_BUTTON_H_
20 
21 #include <avrio/defs.h>
22 
23 __BEGIN_C_DECLS
24  /* ======================================================================== */
25 #include "avrio-config.h"
26 #ifdef AVRIO_BUTTON_ENABLE
27 #include "avrio-board-button.h"
44  /* internal public functions ============================================== */
48 void vButInit (void);
49 
57 xButMask xButGet (xButMask xMask);
58 
59 #if defined(__DOXYGEN__)
60 /*
61  * __DOXYGEN__ defined
62  * Partie documentation ne devant pas être compilée.
63  * =============================================================================
64  */
65 
66 /* constants ================================================================ */
73 #define BUTTON_QUANTITY
74 
83 #define BUTTON_BUTTON1
84 
91 #define BUTTON_ALL_BUTTONS
92 
99 #define BUTTON_NO_BUTTON
100 
101 /* types ==================================================================== */
108 typedef xButMask;
109 
110 /* internal public functions ================================================ */
120 static inline xButMask xButGetMask (uint8_t ucBut);
121 
126 #else
127 /*
128  * __DOXYGEN__ not defined
129  * Partie ne devant pas être documentée.
130  * =============================================================================
131  */
132 
133 #ifdef BUTTON_MASK_ARRAY_ENABLE
134 extern const xButMask xButMaskArray[BUTTON_QUANTITY];
135 
136 static inline xButMask
137 xButGetMask (uint8_t ucBut) {
138 
139  return xButMaskArray[ucBut];
140 }
141 #endif
142 
143 #endif /* __DOXYGEN__ not defined */
144 #else /* AVRIO_BUTTON_ENABLE not defined */
145 #warning "AVRIO_BUTTON_ENABLE undefined, using a bogus implementation !"
146 typedef uint8_t xButMask;
147 #define BUTTON_QUANTITY 1
148 #define BUTTON_BUTTON1 1
149 #define BUTTON_ALL_BUTTONS (BUTTON_BUTTON1)
150 #define BUTTON_NO_BUTTON (0)
151 #define vButInit()
152 #define xButGet(m) (xButMask)(0)
153 /* ========================================================================== */
154 __END_C_DECLS
155 #endif /* AVRIO_BUTTON_ENABLE defined */
156 #endif /* _AVRIO_BUTTON_H_ */
typedef xButMask
Type utilisé pour les masques de bouton poussoir.
Definition: button.h:108
#define BUTTON_QUANTITY
Nombre de boutons poussoirs disponibles.
Definition: button.h:73
void vButInit(void)
Initialise les boutons poussoirs.
static xButMask xButGetMask(uint8_t ucBut)
Renvoie le masque associé à un bouton poussoir.
xButMask xButGet(xButMask xMask)
Lecture d&#39;un ou plusieurs boutons poussoirs.