commit 358802325beb64d9e49b4c33251db4c3563c2ec9
Author: Julia Niermann <jniermann@techfak.uni-bielefeld.de>
Date:   Fri Aug 16 12:00:08 2019 +0200

    Finish nfc dummy

diff --git a/modules/LightRing_1-2/module.c b/modules/LightRing_1-2/module.c
index ef43352..936caf7 100644
--- a/modules/LightRing_1-2/module.c
+++ b/modules/LightRing_1-2/module.c
@@ -443,6 +443,13 @@ P9221RDriver moduleQiCharger = {
   /* configuration    */ NULL,
 };
 
+PN532Driver moduleNfc = {
+  /* I2C Driver       */ &MODULE_HAL_I2C_EEPROM_PWRMTR_BREAKOUT,
+  /* I²C address      */ PN532_LLD_I2C_ADDR_FIXED,  //TODO
+  /* current LSB (uA) */ 0x00u,
+  /* configuration    */ NULL,
+};
+
 LEDDriver moduleLldStatusLed = {
   /* LED enable Gpio */ &moduleGpioLed,
 };
@@ -517,6 +524,16 @@ static int _testP9221rShellCmdCb(BaseSequentialStream* stream, int argc, char* a
 AOS_SHELL_COMMAND(moduleTestP9221rShellCmd, "test:QiCharger", _testP9221rShellCmdCb);
 
 /*
+ * PN632 (nfc)
+ */
+#include <module_test_PN532.h>
+static int _testPn532ShellCmdCb(BaseSequentialStream* stream, int argc, char* argv[])
+{
+  return moduleTestPn532ShellCb(stream, argc, argv, NULL);
+}
+AOS_SHELL_COMMAND(moduleTestPn532ShellCmd, "test:QiCharger", _testPn532ShellCmdCb);
+
+/*
  * Status LED
  */
 #include <module_test_LED.h>
diff --git a/modules/LightRing_1-2/module.h b/modules/LightRing_1-2/module.h
index c488da3..0b4ddae 100644
--- a/modules/LightRing_1-2/module.h
+++ b/modules/LightRing_1-2/module.h
@@ -303,7 +303,8 @@ extern ROMCONST char* moduleShellPrompt;
   aosShellAddCommand(&aos.shell, &moduleTestIna219ShellCmd);                  \
   aosShellAddCommand(&aos.shell, &moduleTestLedShellCmd);                     \
   aosShellAddCommand(&aos.shell, &moduleTestMic9404xShellCmd);                \
-  aosShellAddCommand(&aos.shell, &moduleTestP9221rShellCmd);                 \
+  aosShellAddCommand(&aos.shell, &moduleTestP9221rShellCmd);                  \
+  aosShellAddCommand(&aos.shell, &moduleTestPn532ShellCmd);                  \
   aosShellAddCommand(&aos.shell, &moduleTestTlc5947ShellCmd);                 \
   aosShellAddCommand(&aos.shell, &moduleTestAllShellCmd);                     \
 }
@@ -394,6 +395,7 @@ extern ROMCONST char* moduleShellPrompt;
 #include <alld_AT24C01B.h>
 #include <alld_INA219.h>
 #include <alld_P9221R.h>
+#include <alld_PN532.h>
 #include <alld_LED.h>
 #include <alld_MIC9404x.h>
 // TODO: add SNx5C3221E
@@ -410,11 +412,16 @@ extern AT24C01BDriver moduleLldEeprom;
 extern INA219Driver moduleLldPowerMonitorVled;
 
 /**
- * @brief   ???
+ * @brief   Qi charger driver
  */
 extern P9221RDriver moduleQiCharger;
 
 /**
+ * @brief   Nfc driver
+ */
+extern PN532Driver moduleNfc;
+
+/**
  * @brief   Status LED driver.
  */
 extern LEDDriver moduleLldStatusLed;
@@ -478,6 +485,11 @@ extern aos_shellcommand_t moduleTestIna219ShellCmd;
 extern aos_shellcommand_t moduleTestP9221rShellCmd;
 
 /**
+ * @brief   PN532 (nfc) unit test object.
+ */
+extern aos_shellcommand_t moduleTestPn532ShellCmd;
+
+/**
  * @brief   Status LED test command.
  */
 extern aos_shellcommand_t moduleTestLedShellCmd;
diff --git a/modules/LightRing_1-2/test/PN532/module_test_PN532.c b/modules/LightRing_1-2/test/PN532/module_test_PN532.c
index 703ae83..8c59a8c 100644
--- a/modules/LightRing_1-2/test/PN532/module_test_PN532.c
+++ b/modules/LightRing_1-2/test/PN532/module_test_PN532.c
@@ -21,7 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
 #include <module_test_PN532.h>
-//#include <aos_test_PN532.h>
+#include <aos_test_PN532.h>
 
 /******************************************************************************/
 /* LOCAL DEFINITIONS                                                          */
@@ -39,17 +39,12 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* LOCAL VARIABLES                                                            */
 /******************************************************************************/
 
-//static aos_test_pn532data_t _data = {
- // /* driver           */ &moduleQiCharger, // !!!!
- // /* x alignment      */ 0.0f,
- // /* y alignment      */ 0.0f,
- // /* op freq          */ 0.0f,
- // /* voltage          */ 0.0f,
- // /* current          */ 0.0f,
- // /* timeout */ MICROSECONDS_PER_SECOND,
-//};
+static aos_test_pn532data_t _data = {
+  /* driver           */ &moduleNfc, // !!
+  /* timeout */ MICROSECONDS_PER_SECOND,
+};
 
-//static AOS_TEST(_test, "PN532", "nfc", moduleTestPn532ShellCb, aosTestPn532Func, &_data);
+static AOS_TEST(_test, "PN532", "nfc", moduleTestPn532ShellCb, aosTestPn532Func, &_data);
 
 /******************************************************************************/
 /* LOCAL FUNCTIONS                                                            */
@@ -59,19 +54,19 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /* EXPORTED FUNCTIONS                                                         */
 /******************************************************************************/
 
-// int moduleTestPn532ShellCb(BaseSequentialStream* stream, int argc, char* argv[], aos_testresult_t* result)
-//{
-//  (void)argc;
-//  (void)argv;
+ int moduleTestPn532ShellCb(BaseSequentialStream* stream, int argc, char* argv[], aos_testresult_t* result)
+{
+  (void)argc;
+  (void)argv;
 
-//  if (result != NULL) {
-//    *result = aosTestRun(stream, &_test, NULL);
-//  } else {
-//    aosTestRun(stream, &_test, NULL);
-//  }
+  if (result != NULL) {
+    *result = aosTestRun(stream, &_test, NULL);
+  } else {
+    aosTestRun(stream, &_test, NULL);
+  }
 
-//  return AOS_OK;
-//}
+  return AOS_OK;
+}
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
diff --git a/modules/LightRing_1-2/test/PN532/module_test_PN532.h b/modules/LightRing_1-2/test/PN532/module_test_PN532.h
index 29814ff..fc31a75 100644
--- a/modules/LightRing_1-2/test/PN532/module_test_PN532.h
+++ b/modules/LightRing_1-2/test/PN532/module_test_PN532.h
@@ -62,6 +62,6 @@ extern "C" {
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
-#endif /* MODULE_TEST_P9221R_H */
+#endif /* MODULE_TEST_PN532_H */
 
 
diff --git a/periphery-lld/AMiRo-LLD b/periphery-lld/AMiRo-LLD
index 27eae8c..15f74f8 160000
--- a/periphery-lld/AMiRo-LLD
+++ b/periphery-lld/AMiRo-LLD
@@ -1 +1 @@
-Subproject commit 27eae8ce786bec4b53d5d12fe0bbf30ae565f114
+Subproject commit 15f74f80d61e1ece782ba90ccdefabfd4fe19933
diff --git a/test/periphery-lld/PN532_v1/aos_test_PN532.c b/test/periphery-lld/PN532_v1/aos_test_PN532.c
index f057ce0..ee597f0 100644
--- a/test/periphery-lld/PN532_v1/aos_test_PN532.c
+++ b/test/periphery-lld/PN532_v1/aos_test_PN532.c
@@ -3,7 +3,6 @@
 
 #if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
 
-#include <math.h>
 
 /******************************************************************************/
 /* LOCAL DEFINITIONS                                                          */
@@ -30,13 +29,28 @@
 /******************************************************************************/
 
 
-aos_testresult_t aosTestP9221rFunc(BaseSequentialStream* stream, const aos_test_t* test)
+aos_testresult_t aosTestPn532Func(BaseSequentialStream* stream, const aos_test_t* test)
 {
-    aosDbgCheck(test->data != NULL && ((aos_test_p9221rdata_t*)(test->data))->PRd != NULL);
-
-    // local variables
-   
-    return result;
+    aosDbgCheck(test->data != NULL && ((aos_test_pn532data_t*)(test->data))->PRd != NULL);
+
+     //local variables
+     aos_testresult_t result = {0, 0}; 
+     uint32_t status;
+     uint8_t data[2] = {0xA5};
+
+     chprintf(stream, "read all registers...\n");
+     status = pn532_lld_read_register(((aos_test_pn532data_t*)test->data)->PRd, PN532_LLD_REGISTER, data, 2, ((aos_test_pn532data_t*)test->data)->timeout);
+    if (status == APAL_STATUS_SUCCESS) {
+      aosTestPassed(stream, &result);
+      for(int i=0; i<2; i++){
+          chprintf(stream, "register: 0x%02x, data: 0x%02X \n", 0x00+i, data[i]);
+      }
+    } else {
+      aosTestFailed(stream, &result);
+    }
+
+
+     return result;
 }
 
 #endif /* AMIROOS_CFG_TESTS_ENABLE == true */
diff --git a/test/periphery-lld/PN532_v1/aos_test_PN532.h b/test/periphery-lld/PN532_v1/aos_test_PN532.h
index 3283343..27208ba 100644
--- a/test/periphery-lld/PN532_v1/aos_test_PN532.h
+++ b/test/periphery-lld/PN532_v1/aos_test_PN532.h
@@ -40,6 +40,20 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 /******************************************************************************/
 /* DATA STRUCTURES AND TYPES                                                  */
 /******************************************************************************/
+/**
+ * @brief   Custom data structure for the test.
+ */
+typedef struct {
+  /**
+   * @brief   RN532 driver to use.
+   */
+  PN532Driver *PRd;
+ 
+/**
+   * @brief   Timeout delay for certain tests.
+   */
+  apalTime_t timeout;
+} aos_test_pn532data_t;
 
 /******************************************************************************/
 /* MACROS                                                                     */
@@ -52,7 +66,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #if defined(__cplusplus)
 extern "C" {
 #endif /* defined(__cplusplus) */
- // aos_testresult_t aosTestP9221rFunc(BaseSequentialStream* stream, const aos_test_t* test);
+  aos_testresult_t aosTestPn532Func(BaseSequentialStream* stream, const aos_test_t* test);
 #if defined(__cplusplus)
 }
 #endif /* defined(__cplusplus) */
@@ -63,5 +77,5 @@ extern "C" {
 
 #endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
 
-#endif /* AMIROOS_TEST_P9221R_H */
+#endif /* AMIROOS_TEST_PN532_H */
 
