Revision 3106e8cc
core/inc/aos_system.h | ||
---|---|---|
235 | 235 |
void aosSysStop(void); |
236 | 236 |
void aosSysDeinit(void); |
237 | 237 |
void aosSysShutdownFinal(aos_shutdown_t shutdown); |
238 |
palcallback_t aosSysGetStdIntCallback(void); |
|
238 | 239 |
#if defined(__cplusplus) |
239 | 240 |
} |
240 | 241 |
#endif /* defined(__cplusplus) */ |
core/src/aos_main.cpp | ||
---|---|---|
952 | 952 |
#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2_ARGS) */ |
953 | 953 |
#endif /* defined(AMIROOS_CFG_MAIN_INIT_HOOK_2) */ |
954 | 954 |
|
955 |
// AMiRo-OS and custom OS additions (if any) |
|
955 |
// AMiRo-OS, additional interrupts and custom OS additions (if any)
|
|
956 | 956 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) |
957 | 957 |
aosSysInit(moduleShellPrompt); |
958 | 958 |
#else /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */ |
959 | 959 |
aosSysInit(); |
960 | 960 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */ |
961 |
#if defined(MODULE_INIT_INTERRUPTS) |
|
962 |
MODULE_INIT_INTERRUPTS(); |
|
963 |
#endif |
|
961 | 964 |
#if defined(MODULE_INIT_OS_EXTRA) |
962 | 965 |
MODULE_INIT_OS_EXTRA(); |
963 | 966 |
#endif /* defined(MODULE_INIT_OS_EXTRA) */ |
... | ... | |
998 | 1001 |
#if defined(MODULE_INIT_PERIPHERY_COMM) |
999 | 1002 |
MODULE_INIT_PERIPHERY_COMM(); |
1000 | 1003 |
#endif /* defined(MODULE_INIT_PERIPHERY_COMM) */ |
1001 |
#if (SSSP_STAGE3_ENABLE == true )
|
|
1004 |
#if ((SSSP_STAGE3_ENABLE == true) && (HAL_USE_CAN == TRUE))
|
|
1002 | 1005 |
// CAN |
1003 | 1006 |
if (MODULE_HAL_CAN.state == CAN_STOP) { |
1004 | 1007 |
canStart(&MODULE_HAL_CAN, &moduleHalCanConfig); |
1005 | 1008 |
} |
1006 |
#endif /* (SSSP_STAGE3_ENABLE == true) */ |
|
1009 |
#endif /* (SSSP_STAGE3_ENABLE == true) && (HAL_USE_CAN == TRUE) */
|
|
1007 | 1010 |
// user interface (if any) |
1008 | 1011 |
#if defined(MODULE_HAL_PROGIF) |
1009 | 1012 |
aosIOChannelInit(&_stdiochannel, (BaseAsynchronousChannel*)&MODULE_HAL_PROGIF); |
core/src/aos_system.c | ||
---|---|---|
672 | 672 |
/** |
673 | 673 |
* @brief Generic callback function for GPIO interrupts. |
674 | 674 |
* |
675 |
* @param[in] args Pointer to the GPIO pad identifier.
|
|
675 |
* @param[in] args Pointer to the GPIO line identifier.
|
|
676 | 676 |
*/ |
677 | 677 |
static void _intCallback(void* args) |
678 | 678 |
{ |
679 |
aosDbgCheck((args != NULL) && (*((iopadid_t*)args) < sizeof(eventflags_t) * 8));
|
|
679 |
aosDbgCheck((args != NULL) && (*((ioline_t*)args) != PAL_NOLINE) && (PAL_PAD(*((ioline_t*)args)) < sizeof(eventflags_t) * 8));
|
|
680 | 680 |
|
681 | 681 |
chSysLockFromISR(); |
682 |
chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(*((iopadid_t*)args)));
|
|
682 |
chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(PAL_PAD(*((ioline_t*)args))));
|
|
683 | 683 |
chSysUnlockFromISR(); |
684 | 684 |
|
685 | 685 |
return; |
... | ... | |
690 | 690 |
/** |
691 | 691 |
* @brief Callback function for the Sync signal interrupt. |
692 | 692 |
* |
693 |
* @param[in] args Pointer to the GPIO pad identifier.
|
|
693 |
* @param[in] args Pointer to the GPIO line identifier.
|
|
694 | 694 |
*/ |
695 | 695 |
static void _signalSyncCallback(void *args) |
696 | 696 |
{ |
697 |
aosDbgCheck((args != NULL) && (*((iopadid_t*)args) < sizeof(eventflags_t) * 8));
|
|
697 |
aosDbgCheck((args != NULL) && (*((ioline_t*)args) != PAL_NOLINE) && (PAL_PAD(*((ioline_t*)args)) < sizeof(eventflags_t) * 8));
|
|
698 | 698 |
|
699 | 699 |
apalControlGpioState_t s_state; |
700 | 700 |
aos_timestamp_t uptime; |
... | ... | |
723 | 723 |
} |
724 | 724 |
} |
725 | 725 |
// broadcast event |
726 |
chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(*((iopadid_t*)args)));
|
|
726 |
chEvtBroadcastFlagsI(&aos.events.io, AOS_IOEVENT_FLAG(PAL_PAD(*((ioline_t*)args))));
|
|
727 | 727 |
chSysUnlockFromISR(); |
728 | 728 |
|
729 | 729 |
return; |
... | ... | |
840 | 840 |
/* interrupt setup */ |
841 | 841 |
#if (AMIROOS_CFG_SSSP_ENABLE == true) |
842 | 842 |
// PD signal |
843 |
palSetPadCallback(moduleSsspGpioPd.gpio->port, moduleSsspGpioPd.gpio->pad, _intCallback, &moduleSsspGpioPd.gpio->pad);
|
|
844 |
palEnablePadEvent(moduleSsspGpioPd.gpio->port, moduleSsspGpioPd.gpio->pad, APAL2CH_EDGE(moduleSsspGpioPd.meta.edge));
|
|
843 |
palSetLineCallback(moduleSsspGpioPd.gpio->line, _intCallback, &moduleSsspGpioPd.gpio->line);
|
|
844 |
palEnableLineEvent(moduleSsspGpioPd.gpio->line, APAL2CH_EDGE(moduleSsspGpioPd.meta.edge));
|
|
845 | 845 |
// SYNC signal |
846 | 846 |
#if (AMIROOS_CFG_SSSP_MASTER == true) |
847 |
palSetPadCallback(moduleSsspGpioSync.gpio->port, moduleSsspGpioSync.gpio->pad, _intCallback, &moduleSsspGpioSync.gpio->pad);
|
|
847 |
palSetLineCallback(moduleSsspGpioSync.gpio->line, _intCallback, &moduleSsspGpioSync.gpio->line);
|
|
848 | 848 |
#else /* (AMIROOS_CFG_SSSP_MASTER == true) */ |
849 |
palSetPadCallback(moduleSsspGpioSync.gpio->port, moduleSsspGpioSync.gpio->pad, _signalSyncCallback, &moduleSsspGpioSync.gpio->pad);
|
|
849 |
palSetLineCallback(moduleSsspGpioSync.gpio->line, _signalSyncCallback, &moduleSsspGpioSync.gpio->line);
|
|
850 | 850 |
#endif /* (AMIROOS_CFG_SSSP_MASTER == true) */ |
851 |
palEnablePadEvent(moduleSsspGpioSync.gpio->port, moduleSsspGpioSync.gpio->pad, APAL2CH_EDGE(moduleSsspGpioSync.meta.edge));
|
|
851 |
palEnableLineEvent(moduleSsspGpioSync.gpio->line, APAL2CH_EDGE(moduleSsspGpioSync.meta.edge));
|
|
852 | 852 |
#if (AMIROOS_CFG_SSSP_STACK_START != true) |
853 | 853 |
// DN signal |
854 |
palSetPadCallback(moduleSsspGpioDn.gpio->port, moduleSsspGpioDn.gpio->pad, _intCallback, &moduleSsspGpioDn.gpio->pad);
|
|
855 |
palEnablePadEvent(moduleSsspGpioDn.gpio->port, moduleSsspGpioDn.gpio->pad, APAL2CH_EDGE(moduleSsspGpioDn.meta.edge));
|
|
854 |
palSetLineCallback(moduleSsspGpioDn.gpio->line, _intCallback, &moduleSsspGpioDn.gpio->line);
|
|
855 |
palEnableLineEvent(moduleSsspGpioDn.gpio->line, APAL2CH_EDGE(moduleSsspGpioDn.meta.edge));
|
|
856 | 856 |
#endif /* (AMIROOS_CFG_SSSP_STACK_START != true) */ |
857 | 857 |
#if (AMIROOS_CFG_SSSP_STACK_END != true) |
858 | 858 |
// UP signal |
859 |
palSetPadCallback(moduleSsspGpioUp.gpio->port, moduleSsspGpioUp.gpio->pad, _intCallback, &moduleSsspGpioUp.gpio->pad);
|
|
860 |
palEnablePadEvent(moduleSsspGpioUp.gpio->port, moduleSsspGpioUp.gpio->pad, APAL2CH_EDGE(moduleSsspGpioUp.meta.edge));
|
|
859 |
palSetLineCallback(moduleSsspGpioUp.gpio->line, _intCallback, &moduleSsspGpioUp.gpio->line);
|
|
860 |
palEnableLineEvent(moduleSsspGpioUp.gpio->line, APAL2CH_EDGE(moduleSsspGpioUp.meta.edge));
|
|
861 | 861 |
#endif /* (AMIROOS_CFG_SSSP_STACK_END != true) */ |
862 | 862 |
#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */ |
863 |
#if defined(MODULE_INIT_INTERRUPTS) |
|
864 |
// further interrupt signals |
|
865 |
MODULE_INIT_INTERRUPTS(); |
|
866 |
#endif /* defined(MODULE_INIT_INTERRUPTS) */ |
|
867 | 863 |
|
868 | 864 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) |
869 | 865 |
/* init shell */ |
... | ... | |
1168 | 1164 |
return; |
1169 | 1165 |
} |
1170 | 1166 |
|
1167 |
/** |
|
1168 |
* @brief Generic callback function for GPIO interrupts. |
|
1169 |
* |
|
1170 |
* @param[in] args Pointer to the GPIO pad identifier. |
|
1171 |
*/ |
|
1172 |
palcallback_t aosSysGetStdIntCallback(void) |
|
1173 |
{ |
|
1174 |
return _intCallback; |
|
1175 |
} |
|
1176 |
|
|
1171 | 1177 |
/** @} */ |
modules/DiWheelDrive_1-1/alldconf.h | ||
---|---|---|
33 | 33 |
*/ |
34 | 34 |
#define _AMIRO_LLD_CFG_ |
35 | 35 |
#define AMIRO_LLD_CFG_VERSION_MAJOR 1 |
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 0
|
|
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 1
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* @brief Width of the apalTime_t data type. |
modules/DiWheelDrive_1-1/module.c | ||
---|---|---|
111 | 111 |
SPIConfig moduleHalSpiAccelerometerConfig = { |
112 | 112 |
/* circular buffer mode */ false, |
113 | 113 |
/* callback function pointer */ NULL, |
114 |
/* chip select line port */ GPIOC,
|
|
115 |
/* chip select line pad number */ GPIOC_ACCEL_SS_N,
|
|
114 |
/* chip select line port */ PAL_PORT(LINE_ACCEL_SS_N),
|
|
115 |
/* chip select line pad number */ PAL_PAD(LINE_ACCEL_SS_N),
|
|
116 | 116 |
/* CR1 */ SPI_CR1_BR_0, |
117 | 117 |
/* CR2 */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN, |
118 | 118 |
}; |
... | ... | |
120 | 120 |
SPIConfig moduleHalSpiGyroscopeConfig = { |
121 | 121 |
/* circular buffer mode */ false, |
122 | 122 |
/* callback function pointer */ NULL, |
123 |
/* chip select line port */ GPIOC,
|
|
124 |
/* chip select line pad number */ GPIOC_GYRO_SS_N,
|
|
123 |
/* chip select line port */ PAL_PORT(LINE_GYRO_SS_N),
|
|
124 |
/* chip select line pad number */ PAL_PAD(LINE_GYRO_SS_N),
|
|
125 | 125 |
/* CR1 */ SPI_CR1_BR_0, |
126 | 126 |
/* CR2 */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN, |
127 | 127 |
}; |
... | ... | |
139 | 139 |
* @brief LED output signal GPIO. |
140 | 140 |
*/ |
141 | 141 |
static apalGpio_t _gpioLed = { |
142 |
/* port */ GPIOA, |
|
143 |
/* pad */ GPIOA_LED, |
|
142 |
/* line */ LINE_LED, |
|
144 | 143 |
}; |
145 | 144 |
ROMCONST apalControlGpio_t moduleGpioLed = { |
146 | 145 |
/* GPIO */ &_gpioLed, |
... | ... | |
155 | 154 |
* @brief POWER_EN output signal GPIO. |
156 | 155 |
*/ |
157 | 156 |
static apalGpio_t _gpioPowerEn = { |
158 |
/* port */ GPIOB, |
|
159 |
/* pad */ GPIOB_POWER_EN, |
|
157 |
/* line */ LINE_POWER_EN, |
|
160 | 158 |
}; |
161 | 159 |
ROMCONST apalControlGpio_t moduleGpioPowerEn = { |
162 | 160 |
/* GPIO */ &_gpioPowerEn, |
... | ... | |
171 | 169 |
* @brief COMPASS_DRDY output signal GPIO. |
172 | 170 |
*/ |
173 | 171 |
static apalGpio_t _gpioCompassDrdy = { |
174 |
/* port */ GPIOB, |
|
175 |
/* pad */ GPIOB_COMPASS_DRDY, |
|
172 |
/* line */ LINE_COMPASS_DRDY, |
|
176 | 173 |
}; |
177 | 174 |
ROMCONST apalControlGpio_t moduleGpioCompassDrdy = { |
178 | 175 |
/* GPIO */ &_gpioCompassDrdy, |
... | ... | |
187 | 184 |
* @brief IR_INT input signal GPIO. |
188 | 185 |
*/ |
189 | 186 |
static apalGpio_t _gpioIrInt = { |
190 |
/* port */ GPIOB, |
|
191 |
/* pad */ GPIOB_IR_INT, |
|
187 |
/* line */ LINE_IR_INT, |
|
192 | 188 |
}; |
193 | 189 |
ROMCONST apalControlGpio_t moduleGpioIrInt = { |
194 | 190 |
/* GPIO */ &_gpioIrInt, |
... | ... | |
203 | 199 |
* @brief GYRO_DRDY input signal GPIO. |
204 | 200 |
*/ |
205 | 201 |
static apalGpio_t _gpioGyroDrdy = { |
206 |
/* port */ GPIOB, |
|
207 |
/* pad */ GPIOB_GYRO_DRDY, |
|
202 |
/* line */ LINE_GYRO_DRDY, |
|
208 | 203 |
}; |
209 | 204 |
ROMCONST apalControlGpio_t moduleGpioGyroDrdy = { |
210 | 205 |
/* GPIO */ &_gpioGyroDrdy, |
... | ... | |
219 | 214 |
* @brief SYS_UART_UP bidirectional signal GPIO. |
220 | 215 |
*/ |
221 | 216 |
static apalGpio_t _gpioSysUartUp = { |
222 |
/* port */ GPIOB, |
|
223 |
/* pad */ GPIOB_SYS_UART_UP, |
|
217 |
/* line */ LINE_SYS_UART_UP, |
|
224 | 218 |
}; |
225 | 219 |
ROMCONST apalControlGpio_t moduleGpioSysUartUp = { |
226 | 220 |
/* GPIO */ &_gpioSysUartUp, |
... | ... | |
235 | 229 |
* @brief ACCEL_INT input signal GPIO. |
236 | 230 |
*/ |
237 | 231 |
static apalGpio_t _gpioAccelInt = { |
238 |
/* port */ GPIOB, |
|
239 |
/* pad */ GPIOB_ACCEL_INT_N, |
|
232 |
/* line */ LINE_ACCEL_INT_N, |
|
240 | 233 |
}; |
241 | 234 |
ROMCONST apalControlGpio_t moduleGpioAccelInt = { |
242 | 235 |
/* GPIO */ &_gpioAccelInt, |
... | ... | |
251 | 244 |
* @brief SYS_SNYC bidirectional signal GPIO. |
252 | 245 |
*/ |
253 | 246 |
static apalGpio_t _gpioSysSync = { |
254 |
/* port */ GPIOC, |
|
255 |
/* pad */ GPIOC_SYS_INT_N, |
|
247 |
/* line */ LINE_SYS_INT_N, |
|
256 | 248 |
}; |
257 | 249 |
ROMCONST apalControlGpio_t moduleGpioSysSync = { |
258 | 250 |
/* GPIO */ &_gpioSysSync, |
... | ... | |
267 | 259 |
* @brief PATH_DCSTAT input signal GPIO. |
268 | 260 |
*/ |
269 | 261 |
static apalGpio_t _gpioPathDcStat = { |
270 |
/* port */ GPIOC, |
|
271 |
/* pad */ GPIOC_PATH_DCSTAT, |
|
262 |
/* line */ LINE_PATH_DCSTAT, |
|
272 | 263 |
}; |
273 | 264 |
ROMCONST apalControlGpio_t moduleGpioPathDcStat = { |
274 | 265 |
/* GPIO */ &_gpioPathDcStat, |
... | ... | |
283 | 274 |
* @brief PATH_DCEN output signal GPIO. |
284 | 275 |
*/ |
285 | 276 |
static apalGpio_t _gpioPathDcEn = { |
286 |
/* port */ GPIOC, |
|
287 |
/* pad */ GPIOC_PATH_DCEN, |
|
277 |
/* line */ LINE_PATH_DCEN, |
|
288 | 278 |
}; |
289 | 279 |
ROMCONST apalControlGpio_t moduleGpioPathDcEn = { |
290 | 280 |
/* GPIO */ &_gpioPathDcEn, |
... | ... | |
299 | 289 |
* @brief SYS_PD bidirectional signal GPIO. |
300 | 290 |
*/ |
301 | 291 |
static apalGpio_t _gpioSysPd = { |
302 |
/* port */ GPIOC, |
|
303 |
/* pad */ GPIOC_SYS_PD_N, |
|
292 |
/* line */ LINE_SYS_PD_N, |
|
304 | 293 |
}; |
305 | 294 |
ROMCONST apalControlGpio_t moduleGpioSysPd = { |
306 | 295 |
/* GPIO */ &_gpioSysPd, |
... | ... | |
315 | 304 |
* @brief SYS_REG_EN input signal GPIO. |
316 | 305 |
*/ |
317 | 306 |
static apalGpio_t _gpioSysRegEn = { |
318 |
/* port */ GPIOC, |
|
319 |
/* pad */ GPIOC_SYS_REG_EN, |
|
307 |
/* line */ LINE_SYS_REG_EN, |
|
320 | 308 |
}; |
321 | 309 |
ROMCONST apalControlGpio_t moduleGpioSysRegEn = { |
322 | 310 |
/* GPIO */ &_gpioSysRegEn, |
... | ... | |
331 | 319 |
* @brief SYS_WARMRST bidirectional signal GPIO. |
332 | 320 |
*/ |
333 | 321 |
static apalGpio_t _gpioSysWarmrst = { |
334 |
/* port */ GPIOD, |
|
335 |
/* pad */ GPIOD_SYS_WARMRST_N, |
|
322 |
/* line */ LINE_SYS_WARMRST_N, |
|
336 | 323 |
}; |
337 | 324 |
ROMCONST apalControlGpio_t moduleGpioSysWarmrst = { |
338 | 325 |
/* GPIO */ &_gpioSysWarmrst, |
modules/DiWheelDrive_1-1/module.h | ||
---|---|---|
242 | 242 |
/** |
243 | 243 |
* @brief Event flag to be set on a SYS_SYNC interrupt. |
244 | 244 |
*/ |
245 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(GPIOC_SYS_INT_N)
|
|
245 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
|
|
246 | 246 |
|
247 | 247 |
/** |
248 | 248 |
* @brief Event flag to be set on a SYS_WARMRST interrupt. |
249 | 249 |
*/ |
250 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST AOS_IOEVENT_FLAG(GPIOD_SYS_WARMRST_N)
|
|
250 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
|
|
251 | 251 |
|
252 | 252 |
/** |
253 | 253 |
* @brief Event flag to be set on a PATH_DCSTAT interrupt. |
254 | 254 |
*/ |
255 |
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT AOS_IOEVENT_FLAG(GPIOC_PATH_DCEN)
|
|
255 |
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT AOS_IOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
|
|
256 | 256 |
|
257 | 257 |
/** |
258 | 258 |
* @brief Event flag to be set on a COMPASS_DRDY interrupt. |
259 | 259 |
*/ |
260 |
#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY AOS_IOEVENT_FLAG(GPIOB_COMPASS_DRDY)
|
|
260 |
#define MODULE_OS_IOEVENTFLAGS_COMPASSDRDY AOS_IOEVENT_FLAG(PAL_PAD(LINE_COMPASS_DRDY))
|
|
261 | 261 |
|
262 | 262 |
/** |
263 | 263 |
* @brief Event flag to be set on a SYS_PD interrupt. |
264 | 264 |
*/ |
265 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
|
|
265 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
|
|
266 | 266 |
|
267 | 267 |
/** |
268 | 268 |
* @brief Event flag to be set on a SYS_REG_EN interrupt. |
269 | 269 |
*/ |
270 |
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN AOS_IOEVENT_FLAG(GPIOC_SYS_REG_EN)
|
|
270 |
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
|
|
271 | 271 |
|
272 | 272 |
/** |
273 | 273 |
* @brief Event flag to be set on a IR_INT interrupt. |
274 | 274 |
*/ |
275 |
#define MODULE_OS_IOEVENTFLAGS_IRINT AOS_IOEVENT_FLAG(GPIOB_IR_INT)
|
|
275 |
#define MODULE_OS_IOEVENTFLAGS_IRINT AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
|
|
276 | 276 |
|
277 | 277 |
/** |
278 | 278 |
* @brief Event flag to be set on a GYRO_DRDY interrupt. |
279 | 279 |
*/ |
280 |
#define MODULE_OS_IOEVENTFLAGS_GYRODRDY AOS_IOEVENT_FLAG(GPIOB_GYRO_DRDY)
|
|
280 |
#define MODULE_OS_IOEVENTFLAGS_GYRODRDY AOS_IOEVENT_FLAG(PAL_PAD(LINE_GYRO_DRDY))
|
|
281 | 281 |
|
282 | 282 |
/** |
283 | 283 |
* @brief Event flag to be set on a SYS_UART_UP interrupt. |
284 | 284 |
*/ |
285 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(GPIOB_SYS_UART_UP)
|
|
285 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
|
|
286 | 286 |
|
287 | 287 |
/** |
288 | 288 |
* @brief Event flag to be set on a ACCEL_INT interrupt. |
289 | 289 |
*/ |
290 |
#define MODULE_OS_IOEVENTFLAGS_ACCELINT AOS_IOEVENT_FLAG(GPIOB_ACCEL_INT_N)
|
|
290 |
#define MODULE_OS_IOEVENTFLAGS_ACCELINT AOS_IOEVENT_FLAG(PAL_PAD(LINE_ACCEL_INT_N))
|
|
291 | 291 |
|
292 | 292 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
293 | 293 |
/** |
... | ... | |
309 | 309 |
*/ |
310 | 310 |
#define MODULE_INIT_INTERRUPTS() { \ |
311 | 311 |
/* COMPASS_DRDY */ \ |
312 |
palSetPadCallback(moduleGpioCompassDrdy.gpio->port, moduleGpioCompassDrdy.gpio->pad, _intCallback, &moduleGpioCompassDrdy.gpio->pad); \
|
|
313 |
palEnablePadEvent(moduleGpioCompassDrdy.gpio->port, moduleGpioCompassDrdy.gpio->pad, APAL2CH_EDGE(moduleGpioCompassDrdy.meta.edge)); \
|
|
312 |
palSetLineCallback(moduleGpioCompassDrdy.gpio->line, aosSysGetStdIntCallback(), &moduleGpioCompassDrdy.gpio->line); \
|
|
313 |
palEnableLineEvent(moduleGpioCompassDrdy.gpio->line, APAL2CH_EDGE(moduleGpioCompassDrdy.meta.edge)); \
|
|
314 | 314 |
/* IR_INT */ \ |
315 |
palSetPadCallback(moduleGpioIrInt.gpio->port, moduleGpioIrInt.gpio->pad, _intCallback, &moduleGpioIrInt.gpio->pad); \
|
|
316 |
palEnablePadEvent(moduleGpioIrInt.gpio->port, moduleGpioIrInt.gpio->pad, APAL2CH_EDGE(moduleGpioIrInt.meta.edge)); \
|
|
315 |
palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdIntCallback(), &moduleGpioIrInt.gpio->line); \
|
|
316 |
palEnableLineEvent(moduleGpioIrInt.gpio->line, APAL2CH_EDGE(moduleGpioIrInt.meta.edge)); \
|
|
317 | 317 |
/* GYRO_DRDY */ \ |
318 |
palSetPadCallback(moduleGpioGyroDrdy.gpio->port, moduleGpioGyroDrdy.gpio->pad, _intCallback, &moduleGpioGyroDrdy.gpio->pad); \
|
|
319 |
palEnablePadEvent(moduleGpioGyroDrdy.gpio->port, moduleGpioGyroDrdy.gpio->pad, APAL2CH_EDGE(moduleGpioGyroDrdy.meta.edge)); \
|
|
318 |
palSetLineCallback(moduleGpioGyroDrdy.gpio->line, aosSysGetStdIntCallback(), &moduleGpioGyroDrdy.gpio->line); \
|
|
319 |
palEnableLineEvent(moduleGpioGyroDrdy.gpio->line, APAL2CH_EDGE(moduleGpioGyroDrdy.meta.edge)); \
|
|
320 | 320 |
/* ACCEL_INT */ \ |
321 |
palSetPadCallback(moduleGpioAccelInt.gpio->port, moduleGpioAccelInt.gpio->pad, _intCallback, &moduleGpioAccelInt.gpio->pad); \
|
|
322 |
palEnablePadEvent(moduleGpioAccelInt.gpio->port, moduleGpioAccelInt.gpio->pad, APAL2CH_EDGE(moduleGpioAccelInt.meta.edge)); \
|
|
321 |
palSetLineCallback(moduleGpioAccelInt.gpio->line, aosSysGetStdIntCallback(), &moduleGpioAccelInt.gpio->line); \
|
|
322 |
palEnableLineEvent(moduleGpioAccelInt.gpio->line, APAL2CH_EDGE(moduleGpioAccelInt.meta.edge)); \
|
|
323 | 323 |
/* PATH_DCSTAT */ \ |
324 |
palSetPadCallback(moduleGpioPathDcStat.gpio->port, moduleGpioPathDcStat.gpio->pad, _intCallback, &moduleGpioPathDcStat.gpio->pad); \
|
|
325 |
palEnablePadEvent(moduleGpioPathDcStat.gpio->port, moduleGpioPathDcStat.gpio->pad, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge)); \
|
|
324 |
palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdIntCallback(), &moduleGpioPathDcStat.gpio->line); \
|
|
325 |
palEnableLineEvent(moduleGpioPathDcStat.gpio->line, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge)); \
|
|
326 | 326 |
/* SYS_REG_EN */ \ |
327 |
palSetPadCallback(moduleGpioSysRegEn.gpio->port, moduleGpioSysRegEn.gpio->pad, _intCallback, &moduleGpioSysRegEn.gpio->pad); \
|
|
328 |
palEnablePadEvent(moduleGpioSysRegEn.gpio->port, moduleGpioSysRegEn.gpio->pad, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge)); \
|
|
327 |
palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdIntCallback(), &moduleGpioSysRegEn.gpio->line); \
|
|
328 |
palEnableLineEvent(moduleGpioSysRegEn.gpio->line, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge)); \
|
|
329 | 329 |
/* SYS_WARMRST */ \ |
330 |
palSetPadCallback(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, _intCallback, &moduleGpioSysWarmrst.gpio->pad); \
|
|
331 |
palEnablePadEvent(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge)); \
|
|
330 |
palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdIntCallback(), &moduleGpioSysWarmrst.gpio->line); \
|
|
331 |
palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge)); \
|
|
332 | 332 |
} |
333 | 333 |
|
334 | 334 |
/** |
modules/DiWheelDrive_1-2/alldconf.h | ||
---|---|---|
33 | 33 |
*/ |
34 | 34 |
#define _AMIRO_LLD_CFG_ |
35 | 35 |
#define AMIRO_LLD_CFG_VERSION_MAJOR 1 |
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 0
|
|
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 1
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* @brief Width of the apalTime_t data type. |
modules/DiWheelDrive_1-2/module.c | ||
---|---|---|
121 | 121 |
* @brief LED output signal GPIO. |
122 | 122 |
*/ |
123 | 123 |
static apalGpio_t _gpioLed = { |
124 |
/* port */ GPIOA, |
|
125 |
/* pad */ GPIOA_LED, |
|
124 |
/* line */ LINE_LED, |
|
126 | 125 |
}; |
127 | 126 |
ROMCONST apalControlGpio_t moduleGpioLed = { |
128 | 127 |
/* GPIO */ &_gpioLed, |
... | ... | |
137 | 136 |
* @brief POWER_EN output signal GPIO. |
138 | 137 |
*/ |
139 | 138 |
static apalGpio_t _gpioPowerEn = { |
140 |
/* port */ GPIOB, |
|
141 |
/* pad */ GPIOB_POWER_EN, |
|
139 |
/* line */ LINE_POWER_EN, |
|
142 | 140 |
}; |
143 | 141 |
ROMCONST apalControlGpio_t moduleGpioPowerEn = { |
144 | 142 |
/* GPIO */ &_gpioPowerEn, |
... | ... | |
153 | 151 |
* @brief IR_INT input signal GPIO. |
154 | 152 |
*/ |
155 | 153 |
static apalGpio_t _gpioIrInt = { |
156 |
/* port */ GPIOB, |
|
157 |
/* pad */ GPIOB_IR_INT, |
|
154 |
/* line */ LINE_IR_INT, |
|
158 | 155 |
}; |
159 | 156 |
ROMCONST apalControlGpio_t moduleGpioIrInt = { |
160 | 157 |
/* GPIO */ &_gpioIrInt, |
... | ... | |
169 | 166 |
* @brief SYS_UART_UP bidirectional signal GPIO. |
170 | 167 |
*/ |
171 | 168 |
static apalGpio_t _gpioSysUartUp = { |
172 |
/* port */ GPIOB, |
|
173 |
/* pad */ GPIOB_SYS_UART_UP, |
|
169 |
/* line */ LINE_SYS_UART_UP, |
|
174 | 170 |
}; |
175 | 171 |
ROMCONST apalControlGpio_t moduleGpioSysUartUp = { |
176 | 172 |
/* GPIO */ &_gpioSysUartUp, |
... | ... | |
185 | 181 |
* @brief IMU_INT input signal GPIO. |
186 | 182 |
*/ |
187 | 183 |
static apalGpio_t _gpioImuInt = { |
188 |
/* port */ GPIOB, |
|
189 |
/* pad */ GPIOB_IMU_INT, |
|
184 |
/* line */ LINE_IMU_INT, |
|
190 | 185 |
}; |
191 | 186 |
ROMCONST apalControlGpio_t moduleGpioImuInt = { |
192 | 187 |
/* GPIO */ &_gpioImuInt, |
... | ... | |
201 | 196 |
* @brief SYS_SNYC bidirectional signal GPIO. |
202 | 197 |
*/ |
203 | 198 |
static apalGpio_t _gpioSysSync = { |
204 |
/* port */ GPIOC, |
|
205 |
/* pad */ GPIOC_SYS_INT_N, |
|
199 |
/* line */ LINE_SYS_INT_N, |
|
206 | 200 |
}; |
207 | 201 |
ROMCONST apalControlGpio_t moduleGpioSysSync = { |
208 | 202 |
/* GPIO */ &_gpioSysSync, |
... | ... | |
217 | 211 |
* @brief IMU_RESET output signal GPIO. |
218 | 212 |
*/ |
219 | 213 |
static apalGpio_t _gpioImuReset = { |
220 |
/* port */ GPIOC, |
|
221 |
/* pad */ GPIOC_IMU_RESET_N, |
|
214 |
/* line */ LINE_IMU_RESET_N, |
|
222 | 215 |
}; |
223 | 216 |
ROMCONST apalControlGpio_t moduleGpioImuReset = { |
224 | 217 |
/* GPIO */ &_gpioImuReset, |
... | ... | |
233 | 226 |
* @brief PATH_DCSTAT input signal GPIO. |
234 | 227 |
*/ |
235 | 228 |
static apalGpio_t _gpioPathDcStat = { |
236 |
/* port */ GPIOC, |
|
237 |
/* pad */ GPIOC_PATH_DCSTAT, |
|
229 |
/* line */ LINE_PATH_DCSTAT, |
|
238 | 230 |
}; |
239 | 231 |
ROMCONST apalControlGpio_t moduleGpioPathDcStat = { |
240 | 232 |
/* GPIO */ &_gpioPathDcStat, |
... | ... | |
249 | 241 |
* @brief PATH_DCEN output signal GPIO. |
250 | 242 |
*/ |
251 | 243 |
static apalGpio_t _gpioPathDcEn = { |
252 |
/* port */ GPIOC, |
|
253 |
/* pad */ GPIOC_PATH_DCEN, |
|
244 |
/* line */ LINE_PATH_DCEN, |
|
254 | 245 |
}; |
255 | 246 |
ROMCONST apalControlGpio_t moduleGpioPathDcEn = { |
256 | 247 |
/* GPIO */ &_gpioPathDcEn, |
... | ... | |
265 | 256 |
* @brief SYS_PD bidirectional signal GPIO. |
266 | 257 |
*/ |
267 | 258 |
static apalGpio_t _gpioSysPd = { |
268 |
/* port */ GPIOC, |
|
269 |
/* pad */ GPIOC_SYS_PD_N, |
|
259 |
/* line */ LINE_SYS_PD_N, |
|
270 | 260 |
}; |
271 | 261 |
ROMCONST apalControlGpio_t moduleGpioSysPd = { |
272 | 262 |
/* GPIO */ &_gpioSysPd, |
... | ... | |
281 | 271 |
* @brief SYS_REG_EN input signal GPIO. |
282 | 272 |
*/ |
283 | 273 |
static apalGpio_t _gpioSysRegEn = { |
284 |
/* port */ GPIOC, |
|
285 |
/* pad */ GPIOC_SYS_REG_EN, |
|
274 |
/* line */ LINE_SYS_REG_EN, |
|
286 | 275 |
}; |
287 | 276 |
ROMCONST apalControlGpio_t moduleGpioSysRegEn = { |
288 | 277 |
/* GPIO */ &_gpioSysRegEn, |
... | ... | |
297 | 286 |
* @brief IMU_BOOT_LOAD output signal GPIO. |
298 | 287 |
*/ |
299 | 288 |
static apalGpio_t _gpioImuBootLoad = { |
300 |
/* port */ GPIOC, |
|
301 |
/* pad */ GPIOC_IMU_BOOT_LOAD_N, |
|
289 |
/* line */ LINE_IMU_BOOT_LOAD_N, |
|
302 | 290 |
}; |
303 | 291 |
ROMCONST apalControlGpio_t moduleGpioImuBootLoad = { |
304 | 292 |
/* GPIO */ &_gpioImuBootLoad, |
... | ... | |
313 | 301 |
* @brief IMU_BL_IND input signal GPIO. |
314 | 302 |
*/ |
315 | 303 |
static apalGpio_t _gpioImuBlInd = { |
316 |
/* port */ GPIOC, |
|
317 |
/* pad */ GPIOC_IMU_BL_IND, |
|
304 |
/* line */ LINE_IMU_BL_IND, |
|
318 | 305 |
}; |
319 | 306 |
ROMCONST apalControlGpio_t moduleGpioImuBlInd = { |
320 | 307 |
/* GPIO */ &_gpioImuBlInd, |
... | ... | |
329 | 316 |
* @brief SYS_WARMRST bidirectional signal GPIO. |
330 | 317 |
*/ |
331 | 318 |
static apalGpio_t _gpioSysWarmrst = { |
332 |
/* port */ GPIOD, |
|
333 |
/* pad */ GPIOD_SYS_WARMRST_N, |
|
319 |
/* line */ LINE_SYS_WARMRST_N, |
|
334 | 320 |
}; |
335 | 321 |
ROMCONST apalControlGpio_t moduleGpioSysWarmrst = { |
336 | 322 |
/* GPIO */ &_gpioSysWarmrst, |
modules/DiWheelDrive_1-2/module.h | ||
---|---|---|
232 | 232 |
/** |
233 | 233 |
* @brief Event flag to be set on a SYS_SYNC interrupt. |
234 | 234 |
*/ |
235 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(GPIOC_SYS_INT_N)
|
|
235 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
|
|
236 | 236 |
|
237 | 237 |
/** |
238 | 238 |
* @brief Event flag to be set on a SYS_WARMRST interrupt. |
239 | 239 |
*/ |
240 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST AOS_IOEVENT_FLAG(GPIOD_SYS_WARMRST_N)
|
|
240 |
#define MODULE_OS_IOEVENTFLAGS_SYSWARMRST AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_WARMRST_N))
|
|
241 | 241 |
|
242 | 242 |
/** |
243 | 243 |
* @brief Event flag to be set on a PATH_DCSTAT interrupt. |
244 | 244 |
*/ |
245 |
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT AOS_IOEVENT_FLAG(GPIOC_PATH_DCEN)
|
|
245 |
#define MODULE_OS_IOEVENTFLAGS_PATHDCSTAT AOS_IOEVENT_FLAG(PAL_PAD(LINE_PATH_DCEN))
|
|
246 | 246 |
|
247 | 247 |
/** |
248 | 248 |
* @brief Event flag to be set on a SYS_PD interrupt. |
249 | 249 |
*/ |
250 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
|
|
250 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
|
|
251 | 251 |
|
252 | 252 |
/** |
253 | 253 |
* @brief Event flag to be set on a SYS_REG_EN interrupt. |
254 | 254 |
*/ |
255 |
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN AOS_IOEVENT_FLAG(GPIOC_SYS_REG_EN)
|
|
255 |
#define MODULE_OS_IOEVENTFLAGS_SYSREGEN AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_REG_EN))
|
|
256 | 256 |
|
257 | 257 |
/** |
258 | 258 |
* @brief Event flag to be set on a IR_INT interrupt. |
259 | 259 |
*/ |
260 |
#define MODULE_OS_IOEVENTFLAGS_IRINT AOS_IOEVENT_FLAG(GPIOB_IR_INT)
|
|
260 |
#define MODULE_OS_IOEVENTFLAGS_IRINT AOS_IOEVENT_FLAG(PAL_PAD(LINE_IR_INT))
|
|
261 | 261 |
|
262 | 262 |
/** |
263 | 263 |
* @brief Event flag to be set on a SYS_UART_UP interrupt. |
264 | 264 |
*/ |
265 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(GPIOB_SYS_UART_UP)
|
|
265 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
|
|
266 | 266 |
|
267 | 267 |
/** |
268 | 268 |
* @brief Event flag to be set on a IMU_INT interrupt. |
269 | 269 |
*/ |
270 |
#define MODULE_OS_IOEVENTFLAGS_IMUINT AOS_IOEVENT_FLAG(GPIOB_IMU_INT)
|
|
270 |
#define MODULE_OS_IOEVENTFLAGS_IMUINT AOS_IOEVENT_FLAG(PAL_PAD(LINE_IMU_INT))
|
|
271 | 271 |
|
272 | 272 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
273 | 273 |
/** |
... | ... | |
289 | 289 |
*/ |
290 | 290 |
#define MODULE_INIT_INTERRUPTS() { \ |
291 | 291 |
/* IR_INT */ \ |
292 |
palSetPadCallback(moduleGpioIrInt.gpio->port, moduleGpioIrInt.gpio->pad, _intCallback, &moduleGpioIrInt.gpio->pad); \
|
|
293 |
palEnablePadEvent(moduleGpioIrInt.gpio->port, moduleGpioIrInt.gpio->pad, APAL2CH_EDGE(moduleGpioIrInt.meta.edge)); \
|
|
292 |
palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdIntCallback(), &moduleGpioIrInt.gpio->line); \
|
|
293 |
palEnableLineEvent(moduleGpioIrInt.gpio->line, APAL2CH_EDGE(moduleGpioIrInt.meta.edge)); \
|
|
294 | 294 |
/* IMU_INT */ \ |
295 |
palSetPadCallback(moduleGpioImuInt.gpio->port, moduleGpioImuInt.gpio->pad, _intCallback, &moduleGpioImuInt.gpio->pad); \
|
|
296 |
palEnablePadEvent(moduleGpioImuInt.gpio->port, moduleGpioImuInt.gpio->pad, APAL2CH_EDGE(moduleGpioImuInt.meta.edge)); \
|
|
295 |
palSetLineCallback(moduleGpioImuInt.gpio->line, aosSysGetStdIntCallback(), &moduleGpioImuInt.gpio->line); \
|
|
296 |
palEnableLineEvent(moduleGpioImuInt.gpio->line, APAL2CH_EDGE(moduleGpioImuInt.meta.edge)); \
|
|
297 | 297 |
/* PATH_DCSTAT */ \ |
298 |
palSetPadCallback(moduleGpioPathDcStat.gpio->port, moduleGpioPathDcStat.gpio->pad, _intCallback, &moduleGpioPathDcStat.gpio->pad); \
|
|
299 |
palEnablePadEvent(moduleGpioPathDcStat.gpio->port, moduleGpioPathDcStat.gpio->pad, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge)); \
|
|
298 |
palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdIntCallback(), &moduleGpioPathDcStat.gpio->line); \
|
|
299 |
palEnableLineEvent(moduleGpioPathDcStat.gpio->line, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge)); \
|
|
300 | 300 |
/* SYS_REG_EN */ \ |
301 |
palSetPadCallback(moduleGpioSysRegEn.gpio->port, moduleGpioSysRegEn.gpio->pad, _intCallback, &moduleGpioSysRegEn.gpio->pad); \
|
|
302 |
palEnablePadEvent(moduleGpioSysRegEn.gpio->port, moduleGpioSysRegEn.gpio->pad, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge)); \
|
|
301 |
palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdIntCallback(), &moduleGpioSysRegEn.gpio->line); \
|
|
302 |
palEnableLineEvent(moduleGpioSysRegEn.gpio->line, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge)); \
|
|
303 | 303 |
/* SYS_WARMRST */ \ |
304 |
palSetPadCallback(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, _intCallback, &moduleGpioSysWarmrst.gpio->pad); \
|
|
305 |
palEnablePadEvent(moduleGpioSysWarmrst.gpio->port, moduleGpioSysWarmrst.gpio->pad, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge)); \
|
|
304 |
palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdIntCallback(), &moduleGpioSysWarmrst.gpio->line); \
|
|
305 |
palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge)); \
|
|
306 | 306 |
} |
307 | 307 |
|
308 | 308 |
/** |
modules/LightRing_1-0/alldconf.h | ||
---|---|---|
33 | 33 |
*/ |
34 | 34 |
#define _AMIRO_LLD_CFG_ |
35 | 35 |
#define AMIRO_LLD_CFG_VERSION_MAJOR 1 |
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 0
|
|
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 1
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* @brief Width of the apalTime_t data type. |
modules/LightRing_1-0/module.c | ||
---|---|---|
63 | 63 |
SPIConfig moduleHalSpiLightConfig = { |
64 | 64 |
/* circular buffer mode */ false, |
65 | 65 |
/* callback function pointer */ NULL, |
66 |
/* chip select line port */ GPIOC,
|
|
67 |
/* chip select line pad number */ GPIOC_LIGHT_XLAT,
|
|
66 |
/* chip select line port */ PAL_PORT(LINE_LIGHT_XLAT),
|
|
67 |
/* chip select line pad number */ PAL_PAD(LINE_LIGHT_XLAT),
|
|
68 | 68 |
/* CR1 */ SPI_CR1_BR_0 | SPI_CR1_BR_1, |
69 | 69 |
/* CR2 */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN, |
70 | 70 |
}; |
... | ... | |
72 | 72 |
SPIConfig moduleHalSpiWlConfig = { |
73 | 73 |
/* circular buffer mode */ false, |
74 | 74 |
/* callback function pointer */ NULL, |
75 |
/* chip select line port */ GPIOB,
|
|
76 |
/* chip select line pad number */ GPIOB_WL_SS_N,
|
|
75 |
/* chip select line port */ PAL_PORT(LINE_WL_SS_N),
|
|
76 |
/* chip select line pad number */ PAL_PAD(LINE_WL_SS_N),
|
|
77 | 77 |
/* CR1 */ SPI_CR1_BR_0, |
78 | 78 |
/* CR2 */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN, |
79 | 79 |
}; |
... | ... | |
89 | 89 |
* @brief LIGHT_BANK output signal GPIO. |
90 | 90 |
*/ |
91 | 91 |
static apalGpio_t _gpioLightBlank = { |
92 |
/* port */ GPIOA, |
|
93 |
/* pad */ GPIOA_LIGHT_BLANK, |
|
92 |
/* line */ LINE_LIGHT_BLANK, |
|
94 | 93 |
}; |
95 | 94 |
ROMCONST apalControlGpio_t moduleGpioLightBlank = { |
96 | 95 |
/* GPIO */ &_gpioLightBlank, |
... | ... | |
105 | 104 |
* @brief LASER_EN output signal GPIO. |
106 | 105 |
*/ |
107 | 106 |
static apalGpio_t _gpioLaserEn = { |
108 |
/* port */ GPIOB, |
|
109 |
/* pad */ GPIOB_LASER_EN, |
|
107 |
/* line */ LINE_LASER_EN, |
|
110 | 108 |
}; |
111 | 109 |
ROMCONST apalControlGpio_t moduleGpioLaserEn = { |
112 | 110 |
/* GPIO */ &_gpioLaserEn, |
... | ... | |
121 | 119 |
* @brief LASER_OC input signal GPIO. |
122 | 120 |
*/ |
123 | 121 |
static apalGpio_t _gpioLaserOc = { |
124 |
/* port */ GPIOB, |
|
125 |
/* pad */ GPIOB_LASER_OC_N, |
|
122 |
/* line */ LINE_LASER_OC_N, |
|
126 | 123 |
}; |
127 | 124 |
ROMCONST apalControlGpio_t moduleGpioLaserOc = { |
128 | 125 |
/* GPIO */ &_gpioLaserOc, |
... | ... | |
137 | 134 |
* @brief SYS_UART_DN bidirectional signal GPIO. |
138 | 135 |
*/ |
139 | 136 |
static apalGpio_t _gpioSysUartDn = { |
140 |
/* port */ GPIOB, |
|
141 |
/* pad */ GPIOB_SYS_UART_DN, |
|
137 |
/* line */ LINE_SYS_UART_DN, |
|
142 | 138 |
}; |
143 | 139 |
ROMCONST apalControlGpio_t moduleGpioSysUartDn = { |
144 | 140 |
/* GPIO */ &_gpioSysUartDn, |
... | ... | |
153 | 149 |
* @brief WL_GDO2 input signal GPIO. |
154 | 150 |
*/ |
155 | 151 |
static apalGpio_t _gpioWlGdo2 = { |
156 |
/* port */ GPIOB, |
|
157 |
/* pad */ GPIOB_WL_GDO2, |
|
152 |
/* line */ LINE_WL_GDO2, |
|
158 | 153 |
}; |
159 | 154 |
ROMCONST apalControlGpio_t moduleGpioWlGdo2 = { |
160 | 155 |
/* GPIO */ &_gpioWlGdo2, |
... | ... | |
169 | 164 |
* @brief WL_GDO0 input signal GPIO. |
170 | 165 |
*/ |
171 | 166 |
static apalGpio_t _gpioWlGdo0= { |
172 |
/* port */ GPIOB, |
|
173 |
/* pad */ GPIOB_WL_GDO0, |
|
167 |
/* line */ LINE_WL_GDO0, |
|
174 | 168 |
}; |
175 | 169 |
ROMCONST apalControlGpio_t moduleGpioWlGdo0 = { |
176 | 170 |
/* GPIO */ &_gpioWlGdo0, |
... | ... | |
182 | 176 |
}; |
183 | 177 |
|
184 | 178 |
/** |
185 |
* @brief LIGHT_XLAT output signal GPIO. |
|
186 |
*/ |
|
187 |
static apalGpio_t _gpioLightXlat = { |
|
188 |
/* port */ GPIOC, |
|
189 |
/* pad */ GPIOC_LIGHT_XLAT, |
|
190 |
}; |
|
191 |
ROMCONST apalControlGpio_t moduleGpioLightXlat = { |
|
192 |
/* GPIO */ &_gpioLightXlat, |
|
193 |
/* meta */ { |
|
194 |
/* direction */ APAL_GPIO_DIRECTION_OUTPUT, |
|
195 |
/* active state */ TLC5947_LLD_XLAT_ACTIVE_STATE, |
|
196 |
/* interrupt edge */ APAL_GPIO_EDGE_NONE, |
|
197 |
}, |
|
198 |
}; |
|
199 |
|
|
200 |
/** |
|
201 | 179 |
* @brief SYS_PD bidirectional signal GPIO. |
202 | 180 |
*/ |
203 | 181 |
static apalGpio_t _gpioSysPd = { |
204 |
/* port */ GPIOC, |
|
205 |
/* pad */ GPIOC_SYS_PD_N, |
|
182 |
/* line */ LINE_SYS_PD_N, |
|
206 | 183 |
}; |
207 | 184 |
ROMCONST apalControlGpio_t moduleGpioSysPd = { |
208 | 185 |
/* GPIO */ &_gpioSysPd, |
... | ... | |
217 | 194 |
* @brief SYS_SYNC bidirectional signal GPIO. |
218 | 195 |
*/ |
219 | 196 |
static apalGpio_t _gpioSysSync = { |
220 |
/* port */ GPIOD, |
|
221 |
/* pad */ GPIOD_SYS_INT_N, |
|
197 |
/* line */ LINE_SYS_INT_N, |
|
222 | 198 |
}; |
223 | 199 |
ROMCONST apalControlGpio_t moduleGpioSysSync = { |
224 | 200 |
/* GPIO */ &_gpioSysSync, |
... | ... | |
268 | 244 |
TLC5947Driver moduleLldLedPwm = { |
269 | 245 |
/* SPI driver */ &MODULE_HAL_SPI_LIGHT, |
270 | 246 |
/* BLANK signal GPIO */ &moduleGpioLightBlank, |
271 |
/* XLAT signal GPIO */ &moduleGpioLightXlat,
|
|
247 |
/* XLAT signal GPIO */ NULL,
|
|
272 | 248 |
}; |
273 | 249 |
|
274 | 250 |
TPS20xxBDriver moduleLldPowerSwitchLaser = { |
modules/LightRing_1-0/module.h | ||
---|---|---|
140 | 140 |
extern ROMCONST apalControlGpio_t moduleGpioWlGdo0; |
141 | 141 |
|
142 | 142 |
/** |
143 |
* @brief LIGHT_XLAT output signal GPIO. |
|
144 |
*/ |
|
145 |
extern ROMCONST apalControlGpio_t moduleGpioLightXlat; |
|
146 |
|
|
147 |
/** |
|
148 | 143 |
* @brief SYS_PD bidirectional signal GPIO. |
149 | 144 |
*/ |
150 | 145 |
extern ROMCONST apalControlGpio_t moduleGpioSysPd; |
... | ... | |
166 | 161 |
/** |
167 | 162 |
* @brief Event flag to be set on a LASER_OC interrupt. |
168 | 163 |
*/ |
169 |
#define MODULE_OS_IOEVENTFLAGS_LASEROC AOS_IOEVENT_FLAG(GPIOB_LASER_OC_N)
|
|
164 |
#define MODULE_OS_IOEVENTFLAGS_LASEROC AOS_IOEVENT_FLAG(PAL_PAD(LINE_LASER_OC_N))
|
|
170 | 165 |
|
171 | 166 |
/** |
172 | 167 |
* @brief Event flag to be set on a SYS_UART_DN interrupt. |
173 | 168 |
*/ |
174 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN AOS_IOEVENT_FLAG(GPIOB_SYS_UART_DN)
|
|
169 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
|
|
175 | 170 |
|
176 | 171 |
/** |
177 | 172 |
* @brief Event flag to be set on a WL_GDO2 interrupt. |
178 | 173 |
*/ |
179 |
#define MODULE_OS_IOEVENTFLAGS_WLGDO2 AOS_IOEVENT_FLAG(GPIOB_WL_GDO2)
|
|
174 |
#define MODULE_OS_IOEVENTFLAGS_WLGDO2 AOS_IOEVENT_FLAG(PAL_PAD(LINE_WL_GDO2))
|
|
180 | 175 |
|
181 | 176 |
/** |
182 | 177 |
* @brief Event flag to be set on a WL_GDO0 interrupt. |
183 | 178 |
*/ |
184 |
#define MODULE_OS_IOEVENTFLAGS_WLGDO0 AOS_IOEVENT_FLAG(GPIOB_WL_GDO0)
|
|
179 |
#define MODULE_OS_IOEVENTFLAGS_WLGDO0 AOS_IOEVENT_FLAG(PAL_PAD(LINE_WL_GDO0))
|
|
185 | 180 |
|
186 | 181 |
/** |
187 | 182 |
* @brief Event flag to be set on a SYS_PD interrupt. |
188 | 183 |
*/ |
189 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
|
|
184 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
|
|
190 | 185 |
|
191 | 186 |
/** |
192 | 187 |
* @brief Event flag to be set on a SYS_SYNC interrupt. |
193 | 188 |
*/ |
194 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(GPIOD_SYS_INT_N)
|
|
189 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
|
|
195 | 190 |
|
196 | 191 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
197 | 192 |
/** |
... | ... | |
206 | 201 |
*/ |
207 | 202 |
#define MODULE_INIT_INTERRUPTS() { \ |
208 | 203 |
/* LASER_OC */ \ |
209 |
palSetPadCallback(moduleGpioLaserOc.gpio->port, moduleGpioLaserOc.gpio->pad, _intCallback, &moduleGpioLaserOc.gpio->pad); \
|
|
210 |
palEnablePadEvent(moduleGpioLaserOc.gpio->port, moduleGpioLaserOc.gpio->pad, APAL2CH_EDGE(moduleGpioLaserOc.meta.edge)); \
|
|
204 |
palSetLineCallback(moduleGpioLaserOc.gpio->line, aosSysGetStdIntCallback(), &moduleGpioLaserOc.gpio->line); \
|
|
205 |
palEnableLineEvent(moduleGpioLaserOc.gpio->line, APAL2CH_EDGE(moduleGpioLaserOc.meta.edge)); \
|
|
211 | 206 |
/* WL_GDO2 */ \ |
212 |
palSetPadCallback(moduleGpioWlGdo2.gpio->port, moduleGpioWlGdo2.gpio->pad, _intCallback, &moduleGpioWlGdo2.gpio->pad); \
|
|
213 |
palEnablePadEvent(moduleGpioWlGdo2.gpio->port, moduleGpioWlGdo2.gpio->pad, APAL2CH_EDGE(moduleGpioWlGdo2.meta.edge)); \
|
|
207 |
palSetLineCallback(moduleGpioWlGdo2.gpio->line, aosSysGetStdIntCallback(), &moduleGpioWlGdo2.gpio->line); \
|
|
208 |
palEnableLineEvent(moduleGpioWlGdo2.gpio->line, APAL2CH_EDGE(moduleGpioWlGdo2.meta.edge)); \
|
|
214 | 209 |
/* WL_GDO0 */ \ |
215 |
palSetPadCallback(moduleGpioWlGdo0.gpio->port, moduleGpioWlGdo0.gpio->pad, _intCallback, &moduleGpioWlGdo0.gpio->pad); \
|
|
216 |
/*palEnablePadEvent(moduleGpioWlGdo0.gpio->port, moduleGpioWlGdo0.gpio->pad, APAL2CH_EDGE(moduleGpioWlGdo0.meta.edge)); // this is broken for some reason*/ \
|
|
210 |
palSetLineCallback(moduleGpioWlGdo0.gpio->line, aosSysGetStdIntCallback(), &moduleGpioWlGdo0.gpio->line); \
|
|
211 |
palEnableLineEvent(moduleGpioWlGdo0.gpio->line, APAL2CH_EDGE(moduleGpioWlGdo0.meta.edge)); \
|
|
217 | 212 |
} |
218 | 213 |
|
219 | 214 |
/** |
modules/LightRing_1-2/alldconf.h | ||
---|---|---|
33 | 33 |
*/ |
34 | 34 |
#define _AMIRO_LLD_CFG_ |
35 | 35 |
#define AMIRO_LLD_CFG_VERSION_MAJOR 1 |
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 0
|
|
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 1
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* @brief Width of the apalTime_t data type. |
modules/LightRing_1-2/module.c | ||
---|---|---|
63 | 63 |
SPIConfig moduleHalSpiLightConfig = { |
64 | 64 |
/* circular buffer mode */ false, |
65 | 65 |
/* callback function pointer */ NULL, |
66 |
/* chip select line port */ GPIOC,
|
|
67 |
/* chip select line pad number */ GPIOC_LIGHT_XLAT,
|
|
66 |
/* chip select line port */ PAL_PORT(LINE_LIGHT_XLAT),
|
|
67 |
/* chip select line pad number */ PAL_PAD(LINE_LIGHT_XLAT),
|
|
68 | 68 |
/* CR1 */ SPI_CR1_BR_0 | SPI_CR1_BR_1, |
69 | 69 |
/* CR2 */ SPI_CR2_RXDMAEN | SPI_CR2_TXDMAEN, |
70 | 70 |
}; |
... | ... | |
81 | 81 |
* @brief LIGHT_BANK output signal GPIO. |
82 | 82 |
*/ |
83 | 83 |
static apalGpio_t _gpioLightBlank = { |
84 |
/* port */ GPIOA, |
|
85 |
/* pad */ GPIOA_LIGHT_BLANK, |
|
84 |
/* line */ LINE_LIGHT_BLANK, |
|
86 | 85 |
}; |
87 | 86 |
ROMCONST apalControlGpio_t moduleGpioLightBlank = { |
88 | 87 |
/* GPIO */ &_gpioLightBlank, |
... | ... | |
97 | 96 |
* @brief RS232_R_EN_N output signal GPIO. |
98 | 97 |
*/ |
99 | 98 |
static apalGpio_t _gpioRs232En = { |
100 |
/* port */ GPIOA, |
|
101 |
/* pad */ GPIOA_RS232_R_EN_N, |
|
99 |
/* line */ LINE_RS232_R_EN_N, |
|
102 | 100 |
}; |
103 | 101 |
ROMCONST apalControlGpio_t moduleGpioRs232En = { |
104 | 102 |
/* GPIO */ &_gpioRs232En, |
... | ... | |
113 | 111 |
* @brief SW_V33_EN output signal GPIO. |
114 | 112 |
*/ |
115 | 113 |
static apalGpio_t _gpioSwV33En = { |
116 |
/* port */ GPIOB, |
|
117 |
/* pad */ GPIOB_SW_V33_EN, |
|
114 |
/* line */ LINE_SW_V33_EN, |
|
118 | 115 |
}; |
119 | 116 |
ROMCONST apalControlGpio_t moduleGpioSwV33En = { |
120 | 117 |
/* GPIO */ &_gpioSwV33En, |
... | ... | |
129 | 126 |
* @brief SW_V42_EN output signal GPIO. |
130 | 127 |
*/ |
131 | 128 |
static apalGpio_t _gpioSwV42En = { |
132 |
/* port */ GPIOB, |
|
133 |
/* pad */ GPIOB_SW_V42_EN, |
|
129 |
/* line */ LINE_SW_V42_EN, |
|
134 | 130 |
}; |
135 | 131 |
ROMCONST apalControlGpio_t moduleGpioSwV42En = { |
136 | 132 |
/* GPIO */ &_gpioSwV42En, |
... | ... | |
145 | 141 |
* @brief SW_V50_EN output signal GPIO. |
146 | 142 |
*/ |
147 | 143 |
static apalGpio_t _gpioSwV50En = { |
148 |
/* port */ GPIOB, |
|
149 |
/* pad */ GPIOB_SW_V50_EN, |
|
144 |
/* line */ LINE_SW_V50_EN, |
|
150 | 145 |
}; |
151 | 146 |
ROMCONST apalControlGpio_t moduleGpioSwV50En = { |
152 | 147 |
/* GPIO */ &_gpioSwV50En, |
... | ... | |
161 | 156 |
* @brief IO_3 breakout signal GPIO. |
162 | 157 |
*/ |
163 | 158 |
static apalGpio_t _gpioBreakoutIo3 = { |
164 |
/* port */ GPIOB, |
|
165 |
/* pad */ GPIOB_IO_3, |
|
159 |
/* line */ LINE_IO_3, |
|
166 | 160 |
}; |
167 | 161 |
apalControlGpio_t moduleGpioBreakoutIo3 = { |
168 | 162 |
/* GPIO */ &_gpioBreakoutIo3, |
... | ... | |
177 | 171 |
* @brief IO_5 breakout signal GPIO. |
178 | 172 |
*/ |
179 | 173 |
static apalGpio_t _gpioBreakoutIo5 = { |
180 |
/* port */ GPIOB, |
|
181 |
/* pad */ GPIOB_IO_5, |
|
174 |
/* line */ LINE_IO_5, |
|
182 | 175 |
}; |
183 | 176 |
apalControlGpio_t moduleGpioBreakoutIo5 = { |
184 | 177 |
/* GPIO */ &_gpioBreakoutIo5, |
... | ... | |
193 | 186 |
* @brief IO_6 breakout signal GPIO. |
194 | 187 |
*/ |
195 | 188 |
static apalGpio_t _gpioBreakoutIo6 = { |
196 |
/* port */ GPIOB, |
|
197 |
/* pad */ GPIOB_IO_6, |
|
189 |
/* line */ LINE_IO_6, |
|
198 | 190 |
}; |
199 | 191 |
apalControlGpio_t moduleGpioBreakoutIo6 = { |
200 | 192 |
/* GPIO */ &_gpioBreakoutIo6, |
... | ... | |
209 | 201 |
* @brief SYS_UART_DN bidirectional signal GPIO. |
210 | 202 |
*/ |
211 | 203 |
static apalGpio_t _gpioSysUartDn = { |
212 |
/* port */ GPIOB, |
|
213 |
/* pad */ GPIOB_SYS_UART_DN, |
|
204 |
/* line */ LINE_SYS_UART_DN, |
|
214 | 205 |
}; |
215 | 206 |
ROMCONST apalControlGpio_t moduleGpioSysUartDn = { |
216 | 207 |
/* GPIO */ &_gpioSysUartDn, |
... | ... | |
225 | 216 |
* @brief IO_7 breakout signal GPIO. |
226 | 217 |
*/ |
227 | 218 |
static apalGpio_t _gpioBreakoutIo7 = { |
228 |
/* port */ GPIOB, |
|
229 |
/* pad */ GPIOB_IO_7, |
|
219 |
/* line */ LINE_IO_7, |
|
230 | 220 |
}; |
231 | 221 |
apalControlGpio_t moduleGpioBreakoutIo7 = { |
232 | 222 |
/* GPIO */ &_gpioBreakoutIo7, |
... | ... | |
241 | 231 |
* @brief IO_8 breakout signal GPIO. |
242 | 232 |
*/ |
243 | 233 |
static apalGpio_t _gpioBreakoutIo8 = { |
244 |
/* port */ GPIOB, |
|
245 |
/* pad */ GPIOB_IO_8, |
|
234 |
/* line */ LINE_IO_8, |
|
246 | 235 |
}; |
247 | 236 |
apalControlGpio_t moduleGpioBreakoutIo8 = { |
248 | 237 |
/* GPIO */ &_gpioBreakoutIo8, |
... | ... | |
257 | 246 |
* @brief IO_4 breakout signal GPIO. |
258 | 247 |
*/ |
259 | 248 |
static apalGpio_t _gpioBreakoutIo4 = { |
260 |
/* port */ GPIOC, |
|
261 |
/* pad */ GPIOC_IO_4, |
|
249 |
/* line */ LINE_IO_4, |
|
262 | 250 |
}; |
263 | 251 |
apalControlGpio_t moduleGpioBreakoutIo4 = { |
264 | 252 |
/* GPIO */ &_gpioBreakoutIo4, |
... | ... | |
273 | 261 |
* @brief IO_1 breakout signal GPIO. |
274 | 262 |
*/ |
275 | 263 |
static apalGpio_t _gpioBreakoutIo1 = { |
276 |
/* port */ GPIOC, |
|
277 |
/* pad */ GPIOC_IO_1, |
|
264 |
/* line */ LINE_IO_1, |
|
278 | 265 |
}; |
279 | 266 |
apalControlGpio_t moduleGpioBreakoutIo1 = { |
280 | 267 |
/* GPIO */ &_gpioBreakoutIo1, |
... | ... | |
289 | 276 |
* @brief IO_2 breakout signal GPIO. |
290 | 277 |
*/ |
291 | 278 |
static apalGpio_t _gpioBreakoutIo2 = { |
292 |
/* port */ GPIOC, |
|
293 |
/* pad */ GPIOC_IO_2, |
|
279 |
/* line */ LINE_IO_2, |
|
294 | 280 |
}; |
295 | 281 |
apalControlGpio_t moduleGpioBreakoutIo2 = { |
296 | 282 |
/* GPIO */ &_gpioBreakoutIo2, |
... | ... | |
305 | 291 |
* @brief LED output signal GPIO. |
306 | 292 |
*/ |
307 | 293 |
static apalGpio_t _gpioLed = { |
308 |
/* port */ GPIOC, |
|
309 |
/* pad */ GPIOC_LED, |
|
294 |
/* line */ LINE_LED, |
|
310 | 295 |
}; |
311 | 296 |
ROMCONST apalControlGpio_t moduleGpioLed = { |
312 | 297 |
/* GPIO */ &_gpioLed, |
... | ... | |
318 | 303 |
}; |
319 | 304 |
|
320 | 305 |
/** |
321 |
* @brief LIGHT_XLAT output signal GPIO. |
|
322 |
*/ |
|
323 |
static apalGpio_t _gpioLightXlat = { |
|
324 |
/* port */ GPIOC, |
|
325 |
/* pad */ GPIOC_LIGHT_XLAT, |
|
326 |
}; |
|
327 |
ROMCONST apalControlGpio_t moduleGpioLightXlat = { |
|
328 |
/* GPIO */ &_gpioLightXlat, |
|
329 |
/* meta */ { |
|
330 |
/* direction */ APAL_GPIO_DIRECTION_OUTPUT, |
|
331 |
/* active state */ TLC5947_LLD_XLAT_ACTIVE_STATE, |
|
332 |
/* interrupt edge */ APAL_GPIO_EDGE_NONE, |
|
333 |
}, |
|
334 |
}; |
|
335 |
|
|
336 |
/** |
|
337 | 306 |
* @brief SW_V18_EN output signal GPIO. |
338 | 307 |
*/ |
339 | 308 |
static apalGpio_t _gpioSwV18En = { |
340 |
/* port */ GPIOC, |
|
341 |
/* pad */ GPIOC_SW_V18_EN, |
|
309 |
/* line */ LINE_SW_V18_EN, |
|
342 | 310 |
}; |
343 | 311 |
ROMCONST apalControlGpio_t moduleGpioSwV18En = { |
344 | 312 |
/* GPIO */ &_gpioSwV18En, |
... | ... | |
353 | 321 |
* @brief SW_VSYS_EN output signal GPIO. |
354 | 322 |
*/ |
355 | 323 |
static apalGpio_t _gpioSwVsysEn = { |
356 |
/* port */ GPIOC, |
|
357 |
/* pad */ GPIOC_SW_VSYS_EN, |
|
324 |
/* line */ LINE_SW_VSYS_EN, |
|
358 | 325 |
}; |
359 | 326 |
ROMCONST apalControlGpio_t moduleGpioSwVsysEn = { |
360 | 327 |
/* GPIO */ &_gpioSwVsysEn, |
... | ... | |
369 | 336 |
* @brief SYS_UART_UP bidirectional signal GPIO. |
370 | 337 |
*/ |
371 | 338 |
static apalGpio_t _gpioSysUartUp = { |
372 |
/* port */ GPIOC, |
|
373 |
/* pad */ GPIOC_SYS_UART_UP, |
|
339 |
/* line */ LINE_SYS_UART_UP, |
|
374 | 340 |
}; |
375 | 341 |
ROMCONST apalControlGpio_t moduleGpioSysUartUp = { |
376 | 342 |
/* GPIO */ &_gpioSysUartUp, |
... | ... | |
385 | 351 |
* @brief SYS_PD bidirectional signal GPIO. |
386 | 352 |
*/ |
387 | 353 |
static apalGpio_t _gpioSysPd = { |
388 |
/* port */ GPIOC, |
|
389 |
/* pad */ GPIOC_SYS_PD_N, |
|
354 |
/* line */ LINE_SYS_PD_N, |
|
390 | 355 |
}; |
391 | 356 |
ROMCONST apalControlGpio_t moduleGpioSysPd = { |
392 | 357 |
/* GPIO */ &_gpioSysPd, |
... | ... | |
401 | 366 |
* @brief SYS_SYNC bidirectional signal GPIO. |
402 | 367 |
*/ |
403 | 368 |
static apalGpio_t _gpioSysSync = { |
404 |
/* port */ GPIOD, |
|
405 |
/* pad */ GPIOD_SYS_INT_N, |
|
369 |
/* line */ LINE_SYS_INT_N, |
|
406 | 370 |
}; |
407 | 371 |
ROMCONST apalControlGpio_t moduleGpioSysSync = { |
408 | 372 |
/* GPIO */ &_gpioSysSync, |
... | ... | |
483 | 447 |
TLC5947Driver moduleLldLedPwm = { |
484 | 448 |
/* SPI driver */ &MODULE_HAL_SPI_LIGHT, |
485 | 449 |
/* BLANK signal GPIO */ &moduleGpioLightBlank, |
486 |
/* XLAT signal GPIO */ &moduleGpioLightXlat,
|
|
450 |
/* XLAT signal GPIO */ NULL,
|
|
487 | 451 |
}; |
488 | 452 |
|
489 | 453 |
/** @} */ |
modules/LightRing_1-2/module.h | ||
---|---|---|
185 | 185 |
extern ROMCONST apalControlGpio_t moduleGpioLed; |
186 | 186 |
|
187 | 187 |
/** |
188 |
* @brief LIGHT_XLAT output signal GPIO. |
|
189 |
*/ |
|
190 |
extern ROMCONST apalControlGpio_t moduleGpioLightXlat; |
|
191 |
|
|
192 |
/** |
|
193 | 188 |
* @brief SW_V18_EN output signal GPIO. |
194 | 189 |
*/ |
195 | 190 |
extern ROMCONST apalControlGpio_t moduleGpioSwV18En; |
... | ... | |
226 | 221 |
/** |
227 | 222 |
* @brief Event flag to be set on a IO_4 (breakout) interrupt. |
228 | 223 |
*/ |
229 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO4 AOS_IOEVENT_FLAG(GPIOC_IO_4)
|
|
224 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO4 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_4))
|
|
230 | 225 |
|
231 | 226 |
/** |
232 | 227 |
* @brief Event flag to be set on a IO_1 (breakout) interrupt. |
233 | 228 |
*/ |
234 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO1 AOS_IOEVENT_FLAG(GPIOC_IO_1)
|
|
229 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO1 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_1))
|
|
235 | 230 |
|
236 | 231 |
/** |
237 | 232 |
* @brief Event flag to be set on a SYS_SYNC interrupt. |
238 | 233 |
*/ |
239 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(GPIOD_SYS_INT_N)
|
|
234 |
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
|
|
240 | 235 |
|
241 | 236 |
/** |
242 | 237 |
* @brief Event flag to be set on a IO_3 (breakout) interrupt. |
243 | 238 |
*/ |
244 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO3 AOS_IOEVENT_FLAG(GPIOB_IO_3)
|
|
239 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO3 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_3))
|
|
245 | 240 |
|
246 | 241 |
/** |
247 | 242 |
* @brief Event flag to be set on a IO_5 (breakout) interrupt. |
248 | 243 |
*/ |
249 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO5 AOS_IOEVENT_FLAG(GPIOB_IO_5)
|
|
244 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO5 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_5))
|
|
250 | 245 |
|
251 | 246 |
/** |
252 | 247 |
* @brief Event flag to be set on a IO_6 (breakout) interrupt. |
253 | 248 |
*/ |
254 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO6 AOS_IOEVENT_FLAG(GPIOB_IO_6)
|
|
249 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO6 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_6))
|
|
255 | 250 |
|
256 | 251 |
/** |
257 | 252 |
* @brief Event flag to be set on a SYS_UART_DN interrupt. |
258 | 253 |
*/ |
259 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN AOS_IOEVENT_FLAG(GPIOB_SYS_UART_DN)
|
|
254 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
|
|
260 | 255 |
|
261 | 256 |
/** |
262 | 257 |
* @brief Event flag to be set on a SYS_UART_UP interrupt. |
263 | 258 |
*/ |
264 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(GPIOC_SYS_UART_UP)
|
|
259 |
#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
|
|
265 | 260 |
|
266 | 261 |
/** |
267 | 262 |
* @brief Event flag to be set on a IO_7 (breakout) interrupt. |
268 | 263 |
*/ |
269 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO7 AOS_IOEVENT_FLAG(GPIOB_IO_7)
|
|
264 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO7 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_7))
|
|
270 | 265 |
|
271 | 266 |
/** |
272 | 267 |
* @brief Event flag to be set on a IO_8 (breakout) interrupt. |
273 | 268 |
*/ |
274 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO8 AOS_IOEVENT_FLAG(GPIOB_IO_8)
|
|
269 |
#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO8 AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_8))
|
|
275 | 270 |
|
276 | 271 |
/** |
277 | 272 |
* @brief Event flag to be set on a SYS_PD interrupt. |
278 | 273 |
*/ |
279 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(GPIOC_SYS_PD_N)
|
|
274 |
#define MODULE_OS_IOEVENTFLAGS_SYSPD AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
|
|
280 | 275 |
|
281 | 276 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
282 | 277 |
/** |
modules/NUCLEO-F103RB/alldconf.h | ||
---|---|---|
33 | 33 |
*/ |
34 | 34 |
#define _AMIRO_LLD_CFG_ |
35 | 35 |
#define AMIRO_LLD_CFG_VERSION_MAJOR 1 |
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 0
|
|
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 1
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* @brief Width of the apalTime_t data type. |
... | ... | |
43 | 43 |
*/ |
44 | 44 |
#define AMIROLLD_CFG_TIME_SIZE 32 |
45 | 45 |
|
46 |
#define AMIROLLD_CFG_DW1000 1 |
|
46 |
/** |
|
47 |
* @brief Enable flag for the DW1000 UWB transmitter. |
|
48 |
* @note Uncomment this if the device is attached. |
|
49 |
*/ |
|
50 |
//#define AMIROLLD_CFG_DW1000 1 |
|
47 | 51 |
|
48 | 52 |
#endif /* ALLDCONF_H */ |
49 | 53 |
|
modules/NUCLEO-F103RB/board.h | ||
---|---|---|
63 | 63 |
#define GPIOA_USART2_RX 3U |
64 | 64 |
#define GPIOA_ARD_A2 4U |
65 | 65 |
#define GPIOA_ADC1_IN4 4U |
66 |
#define GPIOA_LED_GREEN 5U |
|
67 | 66 |
#define GPIOA_ARD_D13 5U |
67 |
#define GPIOA_LED_GREEN 5U |
|
68 | 68 |
#define GPIOA_ARD_D12 6U |
69 | 69 |
#define GPIOA_ARD_D11 7U |
70 | 70 |
#define GPIOA_ARD_D7 8U |
... | ... | |
80 | 80 |
#define GPIOB_ADC1_IN8 0U |
81 | 81 |
#define GPIOB_PIN1 1U |
82 | 82 |
#define GPIOB_PIN2 2U |
83 |
#define GPIOB_SWO 3U |
|
84 | 83 |
#define GPIOB_ARD_D3 3U |
84 |
#define GPIOB_SWO 3U |
|
85 | 85 |
#define GPIOB_ARD_D5 4U |
86 | 86 |
#define GPIOB_ARD_D4 5U |
87 | 87 |
#define GPIOB_ARD_D10 6U |
... | ... | |
166 | 166 |
#define GPIOF_PIN13 13U |
167 | 167 |
#define GPIOF_PIN14 14U |
168 | 168 |
#define GPIOF_PIN15 15U |
169 |
|
|
170 |
/* |
|
171 |
* IO lines assignments. |
|
172 |
*/ |
|
173 |
#define LINE_ARD_A0 PAL_LINE(GPIOA, GPIOA_ARD_A0) |
|
174 |
#define LINE_ADC1_IN0 PAL_LINE(GPIOA, GPIOA_ADC1_IN0) |
|
175 |
#define LINE_ARD_A1 PAL_LINE(GPIOA, GPIOA_ARD_A1) |
|
176 |
#define LINE_ADC1_IN1 PAL_LINE(GPIOA, GPIOA_ADC1_IN1) |
|
177 |
#define LINE_ARD_D1 PAL_LINE(GPIOA, GPIOA_ARD_D1) |
|
178 |
#define LINE_USART2_TX PAL_LINE(GPIOA, GPIOA_USART2_TX) |
|
179 |
#define LINE_ARD_D0 PAL_LINE(GPIOA, GPIOA_ARD_D0) |
|
180 |
#define LINE_USART2_RX PAL_LINE(GPIOA, GPIOA_USART2_RX) |
|
181 |
#define LINE_ARD_A2 PAL_LINE(GPIOA, GPIOA_ARD_A2) |
|
182 |
#define LINE_ADC1_IN4 PAL_LINE(GPIOA, GPIOA_ADC1_IN4) |
|
183 |
#define LINE_ARD_D13 PAL_LINE(GPIOA, GPIOA_ARD_D13) |
|
184 |
#define LINE_LED_GREEN PAL_LINE(GPIOA, GPIOA_LED_GREEN) |
|
185 |
#define LINE_ARD_D12 PAL_LINE(GPIOA, GPIOA_ARD_D12) |
|
186 |
#define LINE_ARD_D11 PAL_LINE(GPIOA, GPIOA_ARD_D11) |
|
187 |
#define LINE_ARD_D7 PAL_LINE(GPIOA, GPIOA_ARD_D7) |
|
188 |
#define LINE_ARD_D8 PAL_LINE(GPIOA, GPIOA_ARD_D8) |
|
189 |
#define LINE_ARD_D2 PAL_LINE(GPIOA, GPIOA_ARD_D2) |
|
190 |
#define LINE_SWDIO PAL_LINE(GPIOA, GPIOA_SWDIO) |
|
191 |
#define LINE_SWCLK PAL_LINE(GPIOA, GPIOA_SWCLK) |
|
192 |
|
|
193 |
#define LINE_ARD_A3 PAL_LINE(GPIOB, GPIOB_ARD_A3) |
|
194 |
#define LINE_ADC1_IN8 PAL_LINE(GPIOB, GPIOB_ADC1_IN8) |
|
195 |
#define LINE_ARD_D3 PAL_LINE(GPIOB, GPIOB_ARD_D3) |
|
196 |
#define LINE_SWO PAL_LINE(GPIOB, GPIOB_SWO) |
|
197 |
#define LINE_ARD_D5 PAL_LINE(GPIOB, GPIOB_ARD_D5) |
|
198 |
#define LINE_ARD_D4 PAL_LINE(GPIOB, GPIOB_ARD_D4) |
|
199 |
#define LINE_ARD_D10 PAL_LINE(GPIOB, GPIOB_ARD_D10) |
|
200 |
#define LINE_ARD_D15 PAL_LINE(GPIOB, GPIOB_ARD_D15) |
|
201 |
#define LINE_ARD_D14 PAL_LINE(GPIOB, GPIOB_ARD_D14) |
|
202 |
#define LINE_ARD_D6 PAL_LINE(GPIOB, GPIOB_ARD_D6) |
|
203 |
|
|
204 |
#define LINE_ARD_A5 PAL_LINE(GPIOC, GPIOC_ARD_A5) |
|
205 |
#define LINE_ADC1_IN11 PAL_LINE(GPIOC, GPIOC_ADC1_IN11) |
|
206 |
#define LINE_ARD_A4 PAL_LINE(GPIOC, GPIOC_ARD_A4) |
|
207 |
#define LINE_ADC1_IN10 PAL_LINE(GPIOC, GPIOC_ADC1_IN10) |
|
208 |
#define LINE_ARD_D9 PAL_LINE(GPIOC, GPIOC_ARD_D9) |
|
209 |
#define LINE_BUTTON PAL_LINE(GPIOC, GPIOC_BUTTON) |
|
210 |
|
|
211 |
#define LINE_OSC_IN PAL_LINE(GPIOD, GPIOH_OSC_IN) |
|
212 |
#define LINE_OSC_OUT PAL_LINE(GPIOD, GPIOH_OSC_OUT) |
|
213 |
|
|
214 |
|
|
169 | 215 |
/* |
170 | 216 |
* I/O ports initial setup, this configuration is established soon after reset |
171 | 217 |
* in the initialization code. |
modules/NUCLEO-F103RB/module.c | ||
---|---|---|
85 | 85 |
* @brief LED output signal GPIO. |
86 | 86 |
*/ |
87 | 87 |
static apalGpio_t _gpioLed = { |
88 |
/* port */ GPIOA, |
|
89 |
/* pad */ GPIOA_LED_GREEN, |
|
88 |
/* line */ PAL_LINE(GPIOA, GPIOA_LED_GREEN), |
|
90 | 89 |
}; |
91 | 90 |
ROMCONST apalControlGpio_t moduleGpioLed = { |
92 | 91 |
/* GPIO */ &_gpioLed, |
... | ... | |
103 | 102 |
* @brief DW1000 reset output signal GPIO. |
104 | 103 |
*/ |
105 | 104 |
static apalGpio_t _gpioDw1000Reset = { |
106 |
/* port */ GPIOA, |
|
107 |
/* pad */ GPIOA_ARD_A0, // PIN0 |
|
105 |
/* line */ PAL_LINE(GPIOA, GPIOA_ARD_A0), |
|
108 | 106 |
}; |
109 | 107 |
ROMCONST apalControlGpio_t moduleGpioDw1000Reset = { |
110 | 108 |
/* GPIO */ &_gpioDw1000Reset, |
... | ... | |
120 | 118 |
* @brief DW1000 interrrupt input signal GPIO. |
121 | 119 |
*/ |
122 | 120 |
static apalGpio_t _gpioDw1000Irqn = { |
123 |
/* port */ GPIOB, |
|
124 |
/* pad */ GPIOB_ARD_D6, // GPIOB_PIN10 |
|
121 |
/* line */ PAL_LINE(GPIOB, GPIOB_ARD_D6), |
|
125 | 122 |
}; |
126 | 123 |
ROMCONST apalControlGpio_t moduleGpioDw1000Irqn = { |
127 | 124 |
/* GPIO */ &_gpioDw1000Irqn, |
... | ... | |
137 | 134 |
* @brief DW1000 SPI chip select output signal GPIO. |
138 | 135 |
*/ |
139 | 136 |
static apalGpio_t _gpioSpiChipSelect = { |
140 |
/* port */ GPIOB, |
|
141 |
/* pad */ GPIOB_PIN12, // GPIOB_PIN10 |
|
137 |
/* line */ PAL_LINE(GPIOB, GPIOB_PIN12), |
|
142 | 138 |
}; |
143 | 139 |
ROMCONST apalControlGpio_t moduleGpioSpiChipSelect = { |
144 | 140 |
/* GPIO */ &_gpioSpiChipSelect, |
... | ... | |
155 | 151 |
* @brief User button input signal GPIO. |
156 | 152 |
*/ |
157 | 153 |
static apalGpio_t _gpioUserButton = { |
158 |
/* port */ GPIOC, |
|
159 |
/* pad */ GPIOC_BUTTON, |
|
154 |
/* line */ PAL_LINE(GPIOC, GPIOC_BUTTON), |
|
160 | 155 |
}; |
161 | 156 |
ROMCONST apalControlGpio_t moduleGpioUserButton = { |
162 | 157 |
/* GPIO */ &_gpioUserButton, |
... | ... | |
204 | 199 |
palSetPadMode(GPIOB, GPIOB_PIN13, PAL_MODE_STM32_ALTERNATE_PUSHPULL); |
205 | 200 |
palSetPadMode(GPIOB, GPIOB_PIN14, PAL_MODE_STM32_ALTERNATE_PUSHPULL); |
206 | 201 |
palSetPadMode(GPIOB, GPIOB_PIN15, PAL_MODE_STM32_ALTERNATE_PUSHPULL); |
207 |
palSetPadMode(moduleGpioSpiChipSelect.gpio->port, moduleGpioSpiChipSelect.gpio->pad, PAL_MODE_OUTPUT_PUSHPULL);
|
|
202 |
palSetLineMode(moduleGpioSpiChipSelect.gpio->line, PAL_MODE_OUTPUT_PUSHPULL);
|
|
208 | 203 |
apalGpioWrite(moduleGpioSpiChipSelect.gpio, APAL_GPIO_LOW); |
209 | 204 |
} |
210 | 205 |
|
modules/NUCLEO-F103RB/module.h | ||
---|---|---|
149 | 149 |
/** |
150 | 150 |
* @brief Event flag to be call dwt_isr() interrupt. |
151 | 151 |
*/ |
152 |
#define MODULE_OS_IOEVENTFLAGS_DW1000_IRQn AOS_IOEVENT_FLAG(GPIOB_ARD_D6)
|
|
152 |
#define MODULE_OS_IOEVENTFLAGS_DW1000_IRQn AOS_IOEVENT_FLAG(PAL_PAD(LINE_ARD_D6))
|
|
153 | 153 |
|
154 | 154 |
/** |
155 | 155 |
* @brief Event flag to be set on a USER_BUTTON interrupt. |
156 | 156 |
*/ |
157 |
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON AOS_IOEVENT_FLAG(GPIOC_BUTTON)
|
|
157 |
#define MODULE_OS_IOEVENTFLAGS_USERBUTTON AOS_IOEVENT_FLAG(PAL_PAD(LINE_BUTTON))
|
|
158 | 158 |
|
159 | 159 |
|
160 | 160 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__) |
... | ... | |
164 | 164 |
extern ROMCONST char* moduleShellPrompt; |
165 | 165 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */ |
166 | 166 |
|
167 |
|
|
168 | 167 |
/** |
169 | 168 |
* @brief Interrupt initialization macro. |
170 | 169 |
* @note SSSP related interrupt signals are already initialized in 'aos_system.c'. |
171 | 170 |
*/ |
172 | 171 |
#define MODULE_INIT_INTERRUPTS() { \ |
173 | 172 |
/* user button */ \ |
174 |
palSetPadCallback(moduleGpioUserButton.gpio->port, moduleGpioUserButton.gpio->pad, _intCallback, &moduleGpioUserButton.gpio->pad); \
|
|
175 |
palEnablePadEvent(moduleGpioUserButton.gpio->port, moduleGpioUserButton.gpio->pad, APAL2CH_EDGE(moduleGpioUserButton.meta.edge)); \
|
|
173 |
palSetLineCallback(moduleGpioUserButton.gpio->line, aosSysGetStdIntCallback(), &moduleGpioUserButton.gpio->line); \
|
|
174 |
palEnableLineEvent(moduleGpioUserButton.gpio->line, APAL2CH_EDGE(moduleGpioUserButton.meta.edge)); \
|
|
176 | 175 |
MODULE_INIT_INTERRUPTS_DW1000(); \ |
177 | 176 |
} |
178 | 177 |
#if defined(AMIROLLD_CFG_DW1000) |
179 | 178 |
#define MODULE_INIT_INTERRUPTS_DW1000() { \ |
180 |
palSetPadCallback(moduleGpioDw1000Irqn.gpio->port, moduleGpioDw1000Irqn.gpio->pad, _intCallback, &moduleGpioDw1000Irqn.gpio->pad); \
|
|
181 |
palEnablePadEvent(moduleGpioDw1000Irqn.gpio->port, moduleGpioDw1000Irqn.gpio->pad, APAL2CH_EDGE(moduleGpioDw1000Irqn.meta.edge)); \
|
|
179 |
palSetLineCallback(moduleGpioDw1000Irqn.gpio->line, aosSysGetStdIntCallback(), &moduleGpioDw1000Irqn.gpio->line); \
|
|
180 |
palEnableLineEvent(moduleGpioDw1000Irqn.gpio->line, APAL2CH_EDGE(moduleGpioDw1000Irqn.meta.edge)); \
|
|
182 | 181 |
} |
183 | 182 |
#else /* defined(AMIROLLD_CFG_DW1000) */ |
184 | 183 |
#define MODULE_INIT_INTERRUPTS_DW1000() { \ |
modules/NUCLEO-F401RE/alldconf.h | ||
---|---|---|
33 | 33 |
*/ |
34 | 34 |
#define _AMIRO_LLD_CFG_ |
35 | 35 |
#define AMIRO_LLD_CFG_VERSION_MAJOR 1 |
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 0
|
|
36 |
#define AMIRO_LLD_CFG_VERSION_MINOR 1
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* @brief Width of the apalTime_t data type. |
modules/NUCLEO-F401RE/board.h | ||
---|---|---|
71 | 71 |
#define GPIOA_USART2_RX 3U |
72 | 72 |
#define GPIOA_ARD_A2 4U |
73 | 73 |
#define GPIOA_ADC1_IN4 4U |
74 |
#define GPIOA_LED_GREEN 5U |
|
75 | 74 |
#define GPIOA_ARD_D13 5U |
75 |
#define GPIOA_LED_GREEN 5U |
|
76 | 76 |
#define GPIOA_ARD_D12 6U |
77 | 77 |
#define GPIOA_ARD_D11 7U |
78 | 78 |
#define GPIOA_ARD_D7 8U |
... | ... | |
88 | 88 |
#define GPIOB_ADC1_IN8 0U |
89 | 89 |
#define GPIOB_PIN1 1U |
90 | 90 |
#define GPIOB_PIN2 2U |
91 |
#define GPIOB_SWO 3U |
|
92 | 91 |
#define GPIOB_ARD_D3 3U |
92 |
#define GPIOB_SWO 3U |
|
93 | 93 |
#define GPIOB_ARD_D5 4U |
94 | 94 |
#define GPIOB_ARD_D4 5U |
95 | 95 |
#define GPIOB_ARD_D10 6U |
... | ... | |
227 | 227 |
/* |
228 | 228 |
* IO lines assignments. |
229 | 229 |
*/ |
230 |
#define LINE_ARD_A0 PAL_LINE(GPIOA, 0U) |
|
231 |
#define LINE_ADC1_IN0 PAL_LINE(GPIOA, 0U) |
|
232 |
#define LINE_ARD_A1 PAL_LINE(GPIOA, 1U) |
|
233 |
#define LINE_ADC1_IN1 PAL_LINE(GPIOA, 1U) |
|
234 |
#define LINE_ARD_D1 PAL_LINE(GPIOA, 2U) |
|
235 |
#define LINE_USART2_TX PAL_LINE(GPIOA, 2U) |
|
236 |
#define LINE_ARD_D0 PAL_LINE(GPIOA, 3U) |
|
237 |
#define LINE_USART2_RX PAL_LINE(GPIOA, 3U) |
Also available in: Unified diff