Revision 6b53f6bf

View differences:

modules/DiWheelDrive_1-1/aosconf.h
28 28

  
29 29
#include <stdbool.h>
30 30

  
31
/*===========================================================================*/
32
/**
33
 * @name Kernel parameters and options
34
 * @{
35
 */
36
/*===========================================================================*/
37

  
38 31
/*
39 32
 * Include an external configuration file to override the following default settings only if required.
40 33
 */
......
42 35
  #include <osconf.h>
43 36
#endif
44 37

  
38
/*===========================================================================*/
45 39
/**
46
 * @brief   Flag to set the module as SSSP master.
47
 */
48
#if !defined(OS_CFG_SSSP_MASTER)
49
  #define AMIROOS_CFG_SSSP_MASTER               false
50
#else
51
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
52
#endif
53

  
54
/**
55
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
56
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
57
 *          All modules need to align their local uptime to the nearest multiple of this value.
40
 * @name Kernel parameters and options
41
 * @{
58 42
 */
59
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
60
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
61
#else
62
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
63
#endif
43
/*===========================================================================*/
64 44

  
65 45
/**
66 46
 * @brief   Flag to enable/disable debug API.
......
103 83

  
104 84
/*===========================================================================*/
105 85
/**
86
 * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
87
 * @{
88
 */
89
/*===========================================================================*/
90

  
91
/**
92
 * @brief   Flag to set the module as SSSP master.
93
 * @details There must be only one module with this flag set to true in a system.
94
 */
95
#if !defined(OS_CFG_SSSP_MASTER)
96
  #define AMIROOS_CFG_SSSP_MASTER               false
97
#else
98
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
99
#endif
100

  
101
/**
102
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
103
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
104
 *          All modules need to align their local uptime to the nearest multiple of this value.
105
 */
106
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
107
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
108
#else
109
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
110
#endif
111

  
112
/** @} */
113

  
114
/*===========================================================================*/
115
/**
106 116
 * @name System shell options
107 117
 * @{
108 118
 */
modules/DiWheelDrive_1-1/module.c
36 36
  (void)extp;
37 37

  
38 38
  chSysLockFromISR();
39
  chEvtBroadcastFlagsI(&aos.events.io.source, (1 << channel));
39
  chEvtBroadcastFlagsI(&aos.events.io, (1 << channel));
40 40
  chSysUnlockFromISR();
41 41

  
42 42
  return;
......
297 297
 */
298 298
/*===========================================================================*/
299 299

  
300
apalControlGpio_t moduleSsspPd = {
300
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
301
const char* moduleShellPrompt = "DiWheelDrive";
302
#endif
303

  
304
/** @} */
305

  
306
/*===========================================================================*/
307
/**
308
 * @name Startup Shutdown Synchronization Protocol (SSSP)
309
 * @{
310
 */
311
/*===========================================================================*/
312

  
313

  
314
apalControlGpio_t moduleSsspGpioPd = {
301 315
  /* GPIO */ &moduleGpioSysPd,
302 316
  /* meta */ {
303 317
    /* active state */ APAL_GPIO_ACTIVE_LOW,
......
306 320
  },
307 321
};
308 322

  
309
apalControlGpio_t moduleSsspSync = {
323
apalControlGpio_t moduleSsspGpioSync = {
310 324
  /* GPIO */ &moduleGpioSysSync,
311 325
  /* meta */ {
312 326
    /* active state */ APAL_GPIO_ACTIVE_LOW,
......
315 329
  },
316 330
};
317 331

  
318
const char* moduleShellPrompt = "DiWheelDrive";
319

  
320 332
/** @} */
321 333

  
322 334
/*===========================================================================*/
......
497 509
}
498 510
static ut_hmc5883ldata_t _utHmc5883lData = {
499 511
  /* HMC driver   */ &moduleLldCompass,
500
  /* event source */ &aos.events.io.source,
512
  /* event source */ &aos.events.io,
501 513
  /* event flags  */ (1 << MODULE_GPIO_EXTCHANNEL_COMPASSDRDY),
502 514
  /* timeout      */ MICROSECONDS_PER_SECOND,
503 515
};
......
553 565
static ut_l3g4200ddata_t _utL3g4200dData = {
554 566
  /* driver            */ &moduleLldGyroscope,
555 567
  /* SPI configuration */ &moduleHalSpiGyroscopeConfig,
556
  /* event source */ &aos.events.io.source,
568
  /* event source */ &aos.events.io,
557 569
  /* event flags  */ (1 << MODULE_GPIO_EXTCHANNEL_GYRODRDY),
558 570
};
559 571
aos_unittest_t moduleUtAlldL3g4200d = {
......
602 614
static ut_lis331dlhdata_t _utLis331dlhData = {
603 615
  /* driver            */ &moduleLldAccelerometer,
604 616
  /* SPI configuration */ &moduleHalSpiAccelerometerConfig,
605
  /* event source */ &aos.events.io.source,
617
  /* event source */ &aos.events.io,
606 618
  /* event flags  */ (1 << MODULE_GPIO_EXTCHANNEL_ACCELINT),
607 619
};
608 620
aos_unittest_t moduleUtAlldLis331dlh = {
......
758 770
static ut_vcnl4020data_t _utVcnl4020Data = {
759 771
  /* driver       */ &moduleLldProximity,
760 772
  /* timeout      */ MICROSECONDS_PER_SECOND,
761
  /* event source */ &aos.events.io.source,
773
  /* event source */ &aos.events.io,
762 774
  /* event flags  */ (1 << MODULE_GPIO_EXTCHANNEL_IRINT),
763 775
};
764 776
aos_unittest_t moduleUtAlldVcnl4020 = {
modules/DiWheelDrive_1-1/module.h
342 342
 */
343 343
#define MODULE_OS_IOEVENTFLAGS_ACCELINT         ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_ACCELINT))
344 344

  
345
/**
346
 * @brief   PD signal for SSSP.
347
 */
348
extern apalControlGpio_t moduleSsspPd;
349

  
350
/**
351
 * @brief   SYNC signal for SSSP.
352
 */
353
extern apalControlGpio_t moduleSsspSync;
354

  
345
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
355 346
/**
356 347
 * @brief   Shell prompt text.
357 348
 */
358 349
extern const char* moduleShellPrompt;
350
#endif
359 351

  
360 352
/**
361 353
 * @brief   Additional HAL initialization hook.
......
369 361
 */
370 362
#define MODULE_INIT_TESTS() {                                                 \
371 363
  /* add unit-test shell commands */                                          \
372
  aosShellAddCommand(aos.shell, &moduleUtAlldA3906.shellcmd);                 \
373
  aosShellAddCommand(aos.shell, &moduleUtAlldAt24c01bn.shellcmd);             \
374
  aosShellAddCommand(aos.shell, &moduleUtAlldHmc5883l.shellcmd);              \
375
  aosShellAddCommand(aos.shell, &moduleUtAlldIna219.shellcmd);                \
376
  aosShellAddCommand(aos.shell, &moduleUtAlldL3g4200d.shellcmd);              \
377
  aosShellAddCommand(aos.shell, &moduleUtAlldLed.shellcmd);                   \
378
  aosShellAddCommand(aos.shell, &moduleUtAlldLis331dlh.shellcmd);             \
379
  aosShellAddCommand(aos.shell, &moduleUtAlldLtc4412.shellcmd);               \
380
  aosShellAddCommand(aos.shell, &moduleUtAlldPca9544a.shellcmd);              \
381
  aosShellAddCommand(aos.shell, &moduleUtAlldTps62113.shellcmd);              \
382
  aosShellAddCommand(aos.shell, &moduleUtAlldVcnl4020.shellcmd);              \
364
  aosShellAddCommand(&aos.shell, &moduleUtAlldA3906.shellcmd);                \
365
  aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01bn.shellcmd);            \
366
  aosShellAddCommand(&aos.shell, &moduleUtAlldHmc5883l.shellcmd);             \
367
  aosShellAddCommand(&aos.shell, &moduleUtAlldIna219.shellcmd);               \
368
  aosShellAddCommand(&aos.shell, &moduleUtAlldL3g4200d.shellcmd);             \
369
  aosShellAddCommand(&aos.shell, &moduleUtAlldLed.shellcmd);                  \
370
  aosShellAddCommand(&aos.shell, &moduleUtAlldLis331dlh.shellcmd);            \
371
  aosShellAddCommand(&aos.shell, &moduleUtAlldLtc4412.shellcmd);              \
372
  aosShellAddCommand(&aos.shell, &moduleUtAlldPca9544a.shellcmd);             \
373
  aosShellAddCommand(&aos.shell, &moduleUtAlldTps62113.shellcmd);             \
374
  aosShellAddCommand(&aos.shell, &moduleUtAlldVcnl4020.shellcmd);             \
383 375
}
384 376

  
385 377
/**
......
409 401
}
410 402

  
411 403
/**
412
 * @brief   Hook to handle IO events during SSSP startup synchronization.
413
 */
414
#define MODULE_SSP_STARTUP_OUTRO_IO_EVENT(mask, flags) {                      \
415
  /* ignore all events */                                                     \
416
  (void)mask;                                                                 \
417
  (void)flags;                                                                \
418
}
419

  
420
/**
421 404
 * @brief   Periphery communication interface deinitialization hook.
422 405
 */
423 406
#define MODULE_SHUTDOWN_PERIPHERY_COMM() {                                    \
......
438 421

  
439 422
/*===========================================================================*/
440 423
/**
424
 * @name Startup Shutdown Synchronization Protocol (SSSP)
425
 * @{
426
 */
427
/*===========================================================================*/
428

  
429
/**
430
 * @brief   PD signal GPIO.
431
 */
432
extern apalControlGpio_t moduleSsspGpioPd;
433

  
434
/**
435
 * @brief   SYNC signal GPIO.
436
 */
437
extern apalControlGpio_t moduleSsspGpioSync;
438

  
439
/**
440
 * @brief   Event flags for PD signal events.
441
 */
442
#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
443

  
444
/**
445
 * @brief   Event flags for Sync signal events.
446
 */
447
#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
448

  
449
/**
450
 * @brief   Hook to handle IO events during SSSP startup synchronization.
451
 */
452
#define MODULE_SSSP_STARTUP_OSINIT_OUTRO_IOEVENT_HOOK(mask, flags) {          \
453
  /* ignore all events */                                                     \
454
  (void)mask;                                                                 \
455
  (void)flags;                                                                \
456
}
457

  
458
/** @} */
459

  
460
/*===========================================================================*/
461
/**
441 462
 * @name Low-level drivers
442 463
 * @{
443 464
 */
modules/LightRing_1-0/aosconf.h
28 28

  
29 29
#include <stdbool.h>
30 30

  
31
/*===========================================================================*/
32
/**
33
 * @name Kernel parameters and options
34
 * @{
35
 */
36
/*===========================================================================*/
37

  
38 31
/*
39 32
 * Include an external configuration file to override the following default settings only if required.
40 33
 */
......
42 35
  #include <osconf.h>
43 36
#endif
44 37

  
38
/*===========================================================================*/
45 39
/**
46
 * @brief   Flag to set the module as SSSP master.
47
 */
48
#if !defined(OS_CFG_SSSP_MASTER)
49
  #define AMIROOS_CFG_SSSP_MASTER               false
50
#else
51
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
52
#endif
53

  
54
/**
55
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
56
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
57
 *          All modules need to align their local uptime to the nearest multiple of this value.
40
 * @name Kernel parameters and options
41
 * @{
58 42
 */
59
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
60
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
61
#else
62
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
63
#endif
43
/*===========================================================================*/
64 44

  
65 45
/**
66 46
 * @brief   Flag to enable/disable debug API.
......
103 83

  
104 84
/*===========================================================================*/
105 85
/**
86
 * @name SSSP (Startup Shutdown Synchronization Protocol) configuration.
87
 * @{
88
 */
89
/*===========================================================================*/
90

  
91
/**
92
 * @brief   Flag to set the module as SSSP master.
93
 * @details There must be only one module with this flag set to true in a system.
94
 */
95
#if !defined(OS_CFG_SSSP_MASTER)
96
  #define AMIROOS_CFG_SSSP_MASTER               false
97
#else
98
  #define AMIROOS_CFG_SSSP_MASTER               OS_CFG_SSSP_MASTER
99
#endif
100

  
101
/**
102
 * @brief   Time boundary for robot wide clock synchronization in microseconds.
103
 * @details Whenever the SSSP S (snychronization) signal gets logically deactivated,
104
 *          All modules need to align their local uptime to the nearest multiple of this value.
105
 */
106
#if !defined(OS_CFG_SSSP_SYSSYNCPERIOD)
107
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        1000000
108
#else
109
  #define AMIROOS_CFG_SSSP_SYSSYNCPERIOD        OS_CFG_SSSP_SYSSYNCPERIOD
110
#endif
111

  
112
/** @} */
113

  
114
/*===========================================================================*/
115
/**
106 116
 * @name System shell options
107 117
 * @{
108 118
 */
modules/LightRing_1-0/module.c
36 36
  (void)extp;
37 37

  
38 38
  chSysLockFromISR();
39
  chEvtBroadcastFlagsI(&aos.events.io.source, (1 << channel));
39
  chEvtBroadcastFlagsI(&aos.events.io, (1 << channel));
40 40
  chSysUnlockFromISR();
41 41

  
42 42
  return;
......
219 219
 */
220 220
/*===========================================================================*/
221 221

  
222
apalControlGpio_t moduleSsspPd = {
222
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
223
const char* moduleShellPrompt = "LightRing";
224
#endif
225

  
226
/** @} */
227

  
228
/*===========================================================================*/
229
/**
230
 * @name Startup Shutdown Synchronization Protocol (SSSP)
231
 * @{
232
 */
233
/*===========================================================================*/
234

  
235
apalControlGpio_t moduleSsspGpioPd = {
223 236
  /* GPIO */ &moduleGpioSysPd,
224 237
  /* meta */ {
225 238
    /* active state */ APAL_GPIO_ACTIVE_LOW,
......
228 241
  },
229 242
};
230 243

  
231
apalControlGpio_t moduleSsspSync = {
244
apalControlGpio_t moduleSsspGpioSync = {
232 245
  /* GPIO */ &moduleGpioSysSync,
233 246
  /* meta */ {
234 247
    /* active state */ APAL_GPIO_ACTIVE_LOW,
......
237 250
  },
238 251
};
239 252

  
240
const char* moduleShellPrompt = "LightRing";
241

  
242 253
/** @} */
243 254

  
244 255
/*===========================================================================*/
modules/LightRing_1-0/module.h
215 215
 */
216 216
#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          ((eventflags_t)(1 << MODULE_GPIO_EXTCHANNEL_SYSSYNC))
217 217

  
218
/**
219
 * @brief   PD signal for SSSP.
220
 */
221
extern apalControlGpio_t moduleSsspPd;
222

  
223
/**
224
 * @brief   SYNC signal for SSSP.
225
 */
226
extern apalControlGpio_t moduleSsspSync;
227

  
218
#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
228 219
/**
229 220
 * @brief   Shell prompt text.
230 221
 */
231 222
extern const char* moduleShellPrompt;
223
#endif
232 224

  
233 225
/**
234 226
 * @brief   Unit test initialization hook.
235 227
 */
236 228
#define MODULE_INIT_TESTS() {                                                 \
237 229
  /* add unit-test shell commands */                                          \
238
  aosShellAddCommand(aos.shell, &moduleUtAlldAt24c01bn.shellcmd);             \
239
  aosShellAddCommand(aos.shell, &moduleUtAlldTlc5947.shellcmd);               \
240
  aosShellAddCommand(aos.shell, &moduleUtAlldTps2051bdbv.shellcmd);           \
230
  aosShellAddCommand(&aos.shell, &moduleUtAlldAt24c01bn.shellcmd);            \
231
  aosShellAddCommand(&aos.shell, &moduleUtAlldTlc5947.shellcmd);              \
232
  aosShellAddCommand(&aos.shell, &moduleUtAlldTps2051bdbv.shellcmd);          \
241 233
}
242 234

  
243 235
/**
......
255 247
}
256 248

  
257 249
/**
258
 * @brief   Hook to handle IO events during SSSP startup synchronization.
259
 */
260
#define MODULE_SSP_STARTUP_OUTRO_IO_EVENT(mask, flags) {                      \
261
  /* ignore all events */                                                     \
262
  (void)mask;                                                                 \
263
  (void)flags;                                                                \
264
}
265

  
266
/**
267 250
 * @brief   Periphery communication interface deinitialization hook.
268 251
 */
269 252
#define MODULE_SHUTDOWN_PERIPHERY_COMM() {                                    \
......
278 261

  
279 262
/*===========================================================================*/
280 263
/**
264
 * @name Startup Shutdown Synchronization Protocol (SSSP)
265
 * @{
266
 */
267
/*===========================================================================*/
268

  
269
/**
270
 * @brief   PD signal GPIO.
271
 */
272
extern apalControlGpio_t moduleSsspGpioPd;
273

  
274
/**
275
 * @brief   SYNC signal GPIO.
276
 */
277
extern apalControlGpio_t moduleSsspGpioSync;
278