commit cda1472944648652764c6980f5ee3f3e91459ef3
Author: Thomas Schöpping <tschoepp@cit-ec.uni-bielefeld.de>
Date:   Mon Oct 28 11:15:03 2019 +0100

    Major SSSP overhaul:
    - SSSP no works even without Bootloader (AMiRo-OS implements startup and shutdown phases)
    - MSI and calendar synchronization are currently not available (WIP)
    - lots of minor changes

diff --git a/modules/LightRing_1-2/module.h b/modules/LightRing_1-2/module.h
index d62f6b5..a9da746 100644
--- a/modules/LightRing_1-2/module.h
+++ b/modules/LightRing_1-2/module.h
@@ -246,77 +246,76 @@ extern ROMCONST apalControlGpio_t moduleGpioSysSync;
 /**
  * @brief   Event flag to be set on a IO_4 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO4      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_4))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO4     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_4))
 
 /**
  * @brief   Event flag to be set on a IO_1 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO1      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_1))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO1     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_1))
 
 /**
  * @brief   Event flag to be set on a SYS_SYNC interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSSYNC          AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSSYNC         AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_INT_N))
 
 /**
  * @brief   Event flag to be set on a IO_3 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO3      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_3))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO3     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_3))
 
 /**
  * @brief   Event flag to be set on a IO_5 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO5      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_5))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO5     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_5))
 
 /**
  * @brief   Event flag to be set on a IO_6 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO6      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_6))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO6     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_6))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_DN interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTDN        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTDN       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_DN))
 
 /**
  * @brief   Event flag to be set on a SYS_UART_UP interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSUARTUP        AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
+#define MODULE_OS_GPIOEVENTFLAG_SYSUARTUP       AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_UART_UP))
 
 /**
  * @brief   Event flag to be set on a IO_7 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO7      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_7))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO7     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_7))
 
 /**
  * @brief   Event flag to be set on a IO_8 (breakout) interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_BREAKOUTIO8      AOS_IOEVENT_FLAG(PAL_PAD(LINE_IO_8))
+#define MODULE_OS_GPIOEVENTFLAG_BREAKOUTIO8     AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_IO_8))
 
 /**
  * @brief   Event flag to be set on a SYS_PD interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_SYSPD            AOS_IOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
+#define MODULE_OS_GPIOEVENTFLAG_SYSPD           AOS_GPIOEVENT_FLAG(PAL_PAD(LINE_SYS_PD_N))
 
 #if (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10) || defined(__DOXYGEN__)
 
 /**
  * @brief   Event flag to be set on a DW1000 interrupt.
  */
-#define MODULE_OS_IOEVENTFLAGS_DW1000           MODULE_OS_IOEVENTFLAGS_BREAKOUTIO8
+#define MODULE_OS_GPIOEVENTFLAG_DW1000          MODULE_OS_GPIOEVENTFLAGS_BREAKOUTIO8
 
 #endif /* (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10) */
 
-#if (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
+#if (AMIROOS_CFG_SHELL_ENABLE == true) || defined(__DOXYGEN__)
 /**
  * @brief   Shell prompt text.
  */
 extern ROMCONST char* moduleShellPrompt;
-#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) || (AMIROOS_CFG_TESTS_ENABLE == true) */
+#endif /* (AMIROOS_CFG_SHELL_ENABLE == true) */
 
 /**
  * @brief   Interrupt initialization macro.
- * @note    SSSP related interrupt signals are already initialized in 'aos_system.c'.
  */
 #define MODULE_INIT_INTERRUPTS() {                                            \
   /* breakout interrupts must be enabled explicitely */                       \
@@ -324,7 +323,7 @@ extern ROMCONST char* moduleShellPrompt;
 }
 #if (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10)
   #define MODULE_INIT_INTERRUPTS_BREAKOUT() {                                 \
-    palSetLineCallback(moduleLldDw1000.gpio_exti->gpio->line, aosSysGetStdExtiCallback(), &moduleLldDw1000.gpio_exti->gpio->line);  \
+    palSetLineCallback(moduleLldDw1000.gpio_exti->gpio->line, aosSysGetStdGpioCallback(), &moduleLldDw1000.gpio_exti->gpio->line);  \
     palEnableLineEvent(moduleLldDw1000.gpio_exti->gpio->line, APAL2CH_EDGE(moduleLldDw1000.gpio_exti->meta.edge));                  \
   }
 #elif (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_NONE)
@@ -333,10 +332,10 @@ extern ROMCONST char* moduleShellPrompt;
 #endif
 
 /**
- * @brief   Unit test initialization hook.
+ * @brief   Test initialization hook.
  */
 #define MODULE_INIT_TESTS() {                                                 \
-  /* initialize tests and add to shell */                                     \
+  /* add test commands to shell */                                            \
   aosShellAddCommand(&aos.shell, &moduleTestAt24c01bShellCmd);                \
   aosShellAddCommand(&aos.shell, &moduleTestIna219ShellCmd);                  \
   aosShellAddCommand(&aos.shell, &moduleTestLedShellCmd);                     \
@@ -367,6 +366,8 @@ extern ROMCONST char* moduleShellPrompt;
   i2cStart(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT, &moduleHalI2cEepromPwrmtrBreakoutConfig);  \
   /* SPI */                                                                   \
   spiStart(&MODULE_HAL_SPI_LIGHT, &moduleHalSpiLightConfig);                  \
+  /* CAN */                                                                   \
+  canStart(&MODULE_HAL_CAN, &moduleHalCanConfig);                             \
   /* breakout module */                                                       \
   MODULE_INIT_PERIPHERY_COMM_BREAKOUT();                                      \
 }
@@ -383,12 +384,14 @@ extern ROMCONST char* moduleShellPrompt;
  * @brief   Periphery communication interface deinitialization hook.
  */
 #define MODULE_SHUTDOWN_PERIPHERY_IF() {                                      \
+  /* breakout module */                                                       \
+  MODULE_SHUTDOWN_PERIPHERY_COMM_BREAKOUT();                                  \
+  /* CAN */                                                                   \
+  canStop(&MODULE_HAL_CAN);                                                   \
   /* SPI */                                                                   \
   spiStop(&MODULE_HAL_SPI_LIGHT);                                             \
   /* I2C */                                                                   \
   i2cStop(&MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT);                            \
-  /* breakout module */                                                       \
-  MODULE_SHUTDOWN_PERIPHERY_COMM_BREAKOUT();                                  \
   /* don't stop the serial driver so messages can still be printed */         \
 }
 #if (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10)
@@ -410,45 +413,49 @@ extern ROMCONST char* moduleShellPrompt;
  */
 /*===========================================================================*/
 
+#if (AMIROOS_CFG_SSSP_ENABLE == true) || defined(__DOXYGEN__)
+
 /**
  * @brief   PD signal GPIO.
  */
-#define moduleSsspGpioPd                        moduleGpioSysPd
+#define moduleSsspGpioPD                        moduleGpioSysPd
 
 /**
- * @brief   SYNC signal GPIO.
+ * @brief   S signal GPIO.
  */
-#define moduleSsspGpioSync                      moduleGpioSysSync
+#define moduleSsspGpioS                         moduleGpioSysSync
 
 /**
  * @brief   UP signal GPIO.
  */
-#define moduleSsspGpioUp                        moduleGpioSysUartUp
+#define moduleSsspGpioUP                        moduleGpioSysUartUp
 
 /**
  * @brief   DN signal GPIO.
  */
-#define moduleSsspGpioDn                        moduleGpioSysUartDn
+#define moduleSsspGpioDN                        moduleGpioSysUartDn
 
 /**
- * @brief   Event flags for PD signal events.
+ * @brief   Event flag for PD signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_PD               MODULE_OS_IOEVENTFLAGS_SYSPD
+#define MODULE_SSSP_EVENTFLAG_PD                MODULE_OS_GPIOEVENTFLAG_SYSPD
 
 /**
- * @brief   Event flags for SYNC signal events.
+ * @brief   Event flag for S signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_SYNC             MODULE_OS_IOEVENTFLAGS_SYSSYNC
+#define MODULE_SSSP_EVENTFLAG_S                 MODULE_OS_GPIOEVENTFLAG_SYSSYNC
 
 /**
- * @brief   Event flags for UP signal events.
+ * @brief   Event flag for UP signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_UP               MODULE_OS_IOEVENTFLAGS_SYSUARTUP
+#define MODULE_SSSP_EVENTFLAG_UP                MODULE_OS_GPIOEVENTFLAGS_SYSUARTUP
 
 /**
- * @brief   Event flags for DN signal events.
+ * @brief   Event flag for DN signal events.
  */
-#define MODULE_SSSP_EVENTFLAGS_DN               MODULE_OS_IOEVENTFLAGS_SYSUARTDN
+#define MODULE_SSSP_EVENTFLAG_DN                MODULE_OS_GPIOEVENTFLAG_SYSUARTDN
+
+#endif /* (AMIROOS_CFG_SSSP_ENABLE == true) */
 
 /** @} */
 
