Revision f606f432 modules/LightRing_1-2/test/DW1000/module_test_DW1000.c

View differences:

modules/LightRing_1-2/test/DW1000/module_test_DW1000.c
18 18

  
19 19
#include <amiroos.h>
20 20

  
21
#if (AMIROOS_CFG_TESTS_ENABLE == true) && (BOARD_DW1000_CONNECTED == true) || defined(__DOXYGEN__)
22

  
21
#if ((AMIROOS_CFG_TESTS_ENABLE == true) && (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10)) || defined(__DOXYGEN__)
23 22

  
24 23
#include <module_test_DW1000.h>
25 24
#include <aos_test_DW1000.h>
26
//#include <aos_test_MIC9404x.h>
27
#include <module_test_MIC9404x.h>
25
#include <string.h>
26
#include <alld_MIC9404x.h>
28 27

  
29 28
/******************************************************************************/
30 29
/* LOCAL DEFINITIONS                                                          */
......
43 42
/******************************************************************************/
44 43

  
45 44
static aos_test_dw1000data_t _data = {
46
  /* UWB data     */ &moduleLldDw1000,
47
  /* event source */ &aos.events.io,
48
  /* event flags  */ MODULE_OS_IOEVENTFLAGS_DW1000,
49
  /* Power supply */ &moduleLldPowerSwitchDw1000,
45
  /* driver */ &moduleLldDw1000,
50 46
};
51 47

  
52
static AOS_TEST(_test, "DW1000", NULL, moduleTestDw1000ShellCb, aosTestDw1000Func, &_data);
48
static AOS_TEST(_test, "DW1000", "UWB transceiver", moduleTestDw1000ShellCb, aosTestDw1000Func, &_data);
53 49

  
54 50
/******************************************************************************/
55 51
/* LOCAL FUNCTIONS                                                            */
......
64 60
  (void)argc;
65 61
  (void)argv;
66 62

  
67
  /* MIC9404x (power switch) */
68
  // Enable 1.8V for DW1000 module on Light Ring
69
  _data.mic9404xd = &moduleLldPowerSwitchV18;
70
  aosTestRun(stream, &_test, "1.8V");
71
  _data.mic9404xd = NULL;
72

  
73
  // Enable 3.3V for DW1000 module on Light Ring
74
  _data.mic9404xd = &moduleLldPowerSwitchV33;
75
  aosTestRun(stream, &_test, "3.3V");
76
  _data.mic9404xd = NULL;
63
  // enable power
64
  mic9404x_lld_set(&moduleLldPowerSwitchV18, MIC9404x_LLD_STATE_ON);
65
  mic9404x_lld_set(&moduleLldPowerSwitchV33, MIC9404x_LLD_STATE_ON);
77 66

  
78

  
79
  /* DW1000 (test) */
80 67
  if (result != NULL) {
81 68
    *result = aosTestRun(stream, &_test, NULL);
82

  
83 69
  } else {
84 70
    aosTestRun(stream, &_test, NULL);
85 71
  }
72

  
73
  chprintf(stream, "TODO: turn off the device\n");
74
  if (result) {
75
    aosTestFailed(stream, result);
76
  }
77

  
86 78
  return AOS_OK;
87 79
}
88 80

  
89
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
81
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) && (BOARD_BREAKOUT_MODULE == BOARD_BREAKOUT_UWBv10) */

Also available in: Unified diff