Revision 1a8fb642 modules/NUCLEO-F767ZI/module.h
modules/NUCLEO-F767ZI/module.h | ||
---|---|---|
101 | 101 |
/** |
102 | 102 |
* @brief Event flag to be set on a USER_BUTTON interrupt. |
103 | 103 |
*/ |
104 |
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
|
|
104 |
#define MODULE_OS_GPIOEVENTFLAG_USERBUTTON AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
|
|
105 | 105 |
|
106 | 106 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
107 | 107 |
/** |
... | ... | |
116 | 116 |
*/ |
117 | 117 |
#define MODULE_INIT_INTERRUPTS() { \ |
118 | 118 |
/* user button */ \ |
119 |
palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioUserButton.gpio->line); \
|
|
119 |
palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioUserButton.gpio->line); \
|
|
120 | 120 |
palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge)); \ |
121 | 121 |
} |
122 | 122 |
|
123 | 123 |
/** |
124 |
* @brief Unit test initialization hook.
|
|
124 |
* @brief Test initialization hook.
|
|
125 | 125 |
*/ |
126 | 126 |
#define MODULE_INIT_TESTS() { \ |
127 |
/* add unit-test shell commands */ \
|
|
127 |
/* add test commands to shell */ \
|
|
128 | 128 |
} |
129 | 129 |
|
130 | 130 |
/** |
... | ... | |
139 | 139 |
* @brief Periphery communication interface deinitialization hook. |
140 | 140 |
*/ |
141 | 141 |
#define MODULE_SHUTDOWN_PERIPHERY_IF() { \ |
142 |
/* don't stop the serial driver so messages can still be printed */ \ |
|
142 | 143 |
} |
143 | 144 |
|
144 | 145 |
/** |
145 | 146 |
* @brief HOOK to toggle the LEDs when the user button is pressed. |
146 | 147 |
*/ |
147 |
#define MODULE_MAIN_LOOP_IO_EVENT(eventflags) { \
|
|
148 |
if (eventflags & MODULE_OS_IOEVENTFLAGS_USERBUTTON) { \
|
|
148 |
#define MODULE_MAIN_LOOP_GPIOEVENT(eventflags) { \
|
|
149 |
if (eventflags & MODULE_OS_GPIOEVENTFLAG_USERBUTTON) { \
|
|
149 | 150 |
apalControlGpioState_t buttonstate; \ |
150 | 151 |
apalControlGpioGet(&moduleGpioUserButton, &buttonstate); \ |
151 | 152 |
apalControlGpioSet(&moduleGpioLed1, buttonstate); \ |
Also available in: Unified diff