Revision cda14729 modules/DiWheelDrive_1-1/module.h
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(PAL_PAD(LINE_SYS_INT_N))
|
|
245 |
#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC AOS_GPIOEVENT_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(PAL_PAD(LINE_SYS_WARMRST_N))
|
|
250 |
#define MODULE_OS_GPIOEVENTFLAG_SYSWARMRST AOS_GPIOEVENT_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(PAL_PAD(LINE_PATH_DCEN))
|
|
255 |
#define MODULE_OS_GPIOEVENTFLAG_PATHDCSTAT AOS_GPIOEVENT_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(PAL_PAD(LINE_COMPASS_DRDY))
|
|
260 |
#define MODULE_OS_GPIOEVENTFLAG_COMPASSDRDY AOS_GPIOEVENT_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(PAL_PAD(LINE_SYS_PD_N))
|
|
265 |
#define MODULE_OS_GPIOEVENTFLAG_SYSPD AOS_GPIOEVENT_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(PAL_PAD(LINE_SYS_REG_EN))
|
|
270 |
#define MODULE_OS_GPIOEVENTFLAG_SYSREGEN AOS_GPIOEVENT_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(PAL_PAD(LINE_IR_INT))
|
|
275 |
#define MODULE_OS_GPIOEVENTFLAG_IRINT AOS_GPIOEVENT_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(PAL_PAD(LINE_GYRO_DRDY))
|
|
280 |
#define MODULE_OS_GPIOEVENTFLAG_GYRODRDY AOS_GPIOEVENT_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(PAL_PAD(LINE_SYS_UART_UP))
|
|
285 |
#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP AOS_GPIOEVENT_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(PAL_PAD(LINE_ACCEL_INT_N))
|
|
290 |
#define MODULE_OS_GPIOEVENTFLAG_ACCELINT AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_ACCEL_INT_N))
|
|
291 | 291 |
|
292 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
|
|
292 |
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__) |
|
293 | 293 |
/** |
294 | 294 |
* @brief Shell prompt text. |
295 | 295 |
*/ |
296 | 296 |
extern ROMCONST char* moduleShellPrompt; |
297 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
|
|
297 |
#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */ |
|
298 | 298 |
|
299 | 299 |
/** |
300 | 300 |
* @brief Interrupt initialization macro. |
301 |
* @note SSSP related interrupt signals are already initialized in 'aos_system.c'. |
|
302 | 301 |
*/ |
303 | 302 |
#define MODULE_INIT_INTERRUPTS() { \ |
304 | 303 |
/* COMPASS_DRDY */ \ |
305 |
palSetLineCallback(moduleGpioCompassDrdy.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioCompassDrdy.gpio->line); \
|
|
304 |
palSetLineCallback(moduleGpioCompassDrdy.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioCompassDrdy.gpio->line); \
|
|
306 | 305 |
palEnableLineEvent(moduleGpioCompassDrdy.gpio->line, APAL2CH_EDGE(moduleGpioCompassDrdy.meta.edge)); \ |
307 | 306 |
/* IR_INT */ \ |
308 |
palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioIrInt.gpio->line); \
|
|
307 |
palSetLineCallback(moduleGpioIrInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioIrInt.gpio->line); \
|
|
309 | 308 |
palEnableLineEvent(moduleGpioIrInt.gpio->line, APAL2CH_EDGE(moduleGpioIrInt.meta.edge)); \ |
310 | 309 |
/* GYRO_DRDY */ \ |
311 |
palSetLineCallback(moduleGpioGyroDrdy.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioGyroDrdy.gpio->line); \
|
|
310 |
palSetLineCallback(moduleGpioGyroDrdy.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioGyroDrdy.gpio->line); \
|
|
312 | 311 |
palEnableLineEvent(moduleGpioGyroDrdy.gpio->line, APAL2CH_EDGE(moduleGpioGyroDrdy.meta.edge)); \ |
313 | 312 |
/* ACCEL_INT */ \ |
314 |
palSetLineCallback(moduleGpioAccelInt.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioAccelInt.gpio->line); \
|
|
313 |
palSetLineCallback(moduleGpioAccelInt.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioAccelInt.gpio->line); \
|
|
315 | 314 |
palEnableLineEvent(moduleGpioAccelInt.gpio->line, APAL2CH_EDGE(moduleGpioAccelInt.meta.edge)); \ |
316 | 315 |
/* PATH_DCSTAT */ \ |
317 |
palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioPathDcStat.gpio->line); \
|
|
316 |
palSetLineCallback(moduleGpioPathDcStat.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioPathDcStat.gpio->line); \
|
|
318 | 317 |
palEnableLineEvent(moduleGpioPathDcStat.gpio->line, APAL2CH_EDGE(moduleGpioPathDcStat.meta.edge)); \ |
319 | 318 |
/* SYS_REG_EN */ \ |
320 |
palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysRegEn.gpio->line); \
|
|
319 |
palSetLineCallback(moduleGpioSysRegEn.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysRegEn.gpio->line); \
|
|
321 | 320 |
palEnableLineEvent(moduleGpioSysRegEn.gpio->line, APAL2CH_EDGE(moduleGpioSysRegEn.meta.edge)); \ |
322 | 321 |
/* SYS_WARMRST */ \ |
323 |
palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdExtiCallback(), &moduleGpioSysWarmrst.gpio->line); \
|
|
322 |
palSetLineCallback(moduleGpioSysWarmrst.gpio->line, aosSysGetStdGpioCallback(), &moduleGpioSysWarmrst.gpio->line); \
|
|
324 | 323 |
palEnableLineEvent(moduleGpioSysWarmrst.gpio->line, APAL2CH_EDGE(moduleGpioSysWarmrst.meta.edge)); \ |
325 | 324 |
} |
326 | 325 |
|
... | ... | |
328 | 327 |
* @brief Test initialization hook. |
329 | 328 |
*/ |
330 | 329 |
#define MODULE_INIT_TESTS() { \ |
331 |
/* initialize tests and add to shell */ \
|
|
330 |
/* add test commands to shell */ \
|
|
332 | 331 |
aosShellAddCommand(&aos.shell, &moduleTestA3906ShellCmd); \ |
333 | 332 |
aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd); \ |
334 | 333 |
aosShellAddCommand(&aos.shell, &moduleTestHmc5883lShellCmd); \ |
... | ... | |
367 | 366 |
qeiStart(&MODULE_HAL_QEI_RIGHT_WHEEL, &moduleHalQeiConfig); \ |
368 | 367 |
qeiEnable(&MODULE_HAL_QEI_LEFT_WHEEL); \ |
369 | 368 |
qeiEnable(&MODULE_HAL_QEI_RIGHT_WHEEL); \ |
369 |
/* CAN */ \ |
|
370 |
canStart(&MODULE_HAL_CAN, &moduleHalCanConfig); \ |
|
370 | 371 |
} |
371 | 372 |
|
372 | 373 |
/** |
373 | 374 |
* @brief Periphery communication interface deinitialization hook. |
374 | 375 |
*/ |
375 | 376 |
#define MODULE_SHUTDOWN_PERIPHERY_IF() { \ |
377 |
/* CAN */ \ |
|
378 |
canStop(&MODULE_HAL_CAN); \ |
|
376 | 379 |
/* PWM */ \ |
377 | 380 |
pwmStop(&MODULE_HAL_PWM_DRIVE); \ |
378 | 381 |
/* QEI */ \ |
... | ... | |
395 | 398 |
*/ |
396 | 399 |
/*===========================================================================*/ |
397 | 400 |
|
401 |
#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__) |
|
402 |
|
|
398 | 403 |
/** |
399 | 404 |
* @brief PD signal GPIO. |
400 | 405 |
*/ |
401 |
#define moduleSsspGpioPd moduleGpioSysPd
|
|
406 |
#define moduleSsspGpioPD moduleGpioSysPd
|
|
402 | 407 |
|
403 | 408 |
/** |
404 |
* @brief SYNC signal GPIO.
|
|
409 |
* @brief S signal GPIO. |
|
405 | 410 |
*/ |
406 |
#define moduleSsspGpioSync moduleGpioSysSync
|
|
411 |
#define moduleSsspGpioS moduleGpioSysSync
|
|
407 | 412 |
|
408 | 413 |
/** |
409 | 414 |
* @brief UP signal GPIO. |
410 | 415 |
*/ |
411 |
#define moduleSsspGpioUp moduleGpioSysUartUp
|
|
416 |
#define moduleSsspGpioUP moduleGpioSysUartUp
|
|
412 | 417 |
|
413 | 418 |
/** |
414 |
* @brief Event flags for PD signal events.
|
|
419 |
* @brief Event flag for PD signal events. |
|
415 | 420 |
*/ |
416 |
#define MODULE_SSSP_EVENTFLAGS_PD MODULE_OS_IOEVENTFLAGS_SYSPD
|
|
421 |
#define MODULE_SSSP_EVENTFLAG_PD MODULE_OS_GPIOEVENTFLAG_SYSPD
|
|
417 | 422 |
|
418 | 423 |
/** |
419 |
* @brief Event flags for SYNC signal events.
|
|
424 |
* @brief Event flag for S signal events.
|
|
420 | 425 |
*/ |
421 |
#define MODULE_SSSP_EVENTFLAGS_SYNC MODULE_OS_IOEVENTFLAGS_SYSSYNC
|
|
426 |
#define MODULE_SSSP_EVENTFLAG_S MODULE_OS_GPIOEVENTFLAG_SYSSYNC
|
|
422 | 427 |
|
423 | 428 |
/** |
424 |
* @brief Event flags for UP signal events.
|
|
429 |
* @brief Event flag for UP signal events. |
|
425 | 430 |
*/ |
426 |
#define MODULE_SSSP_EVENTFLAGS_UP MODULE_OS_IOEVENTFLAGS_SYSUARTUP |
|
431 |
#define MODULE_SSSP_EVENTFLAG_UP MODULE_OS_GPIOEVENTFLAG_SYSUARTUP |
|
432 |
|
|
433 |
#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */ |
|
427 | 434 |
|
428 | 435 |
/** @} */ |
429 | 436 |
|
Also available in: Unified diff