Revision 61460fde

View differences:

modules/LightRing_1-2/module.c
594 594
}
595 595
AOS_SHELL_COMMAND(moduleTestAllShellCmd, "test:all", _testAllShellCmdCb);
596 596

  
597

  
598

  
599

  
600
//#include <string.h>
601

  
602
///*
603
// * EEPROM (AT24C01B)
604
// */
605
//static int _utShellCmdCb_AlldAt24c01b(BaseSequentialStream* stream, int argc, char* argv[])
606
//{
607
//  (void)argc;
608
//  (void)argv;
609
//  aosUtRun(stream, &moduleUtAlldAt24c01b, NULL);
610
//  return AOS_OK;
611
//}
612
//static ut_at24c01bdata_t _utAlldAt24c01bData = {
613
//  /* driver   */ &moduleLldEeprom,
614
//  /* timeout  */ MICROSECONDS_PER_SECOND,
615
//};
616
//aos_unittest_t moduleUtAlldAt24c01b = {
617
//  /* name           */ "AT24C01B",
618
//  /* info           */ "1kbit EEPROM",
619
//  /* test function  */ utAlldAt24c01bFunc,
620
//  /* shell command  */ {
621
//    /* name     */ "unittest:EEPROM",
622
//    /* callback */ _utShellCmdCb_AlldAt24c01b,
623
//    /* next     */ NULL,
624
//  },
625
//  /* data           */ &_utAlldAt24c01bData,
626
//};
627

  
628
///*
629
// * INA219 (power monitor)
630
// */
631
//static int _utShellCmdCb_AlldIna219(BaseSequentialStream* stream, int argc, char* argv[])
632
//{
633
//  (void)argc;
634
//  (void)argv;
635
//  aosUtRun(stream, &moduleUtAlldIna219, "VLED (4.2V)");
636
//  return AOS_OK;
637
//}
638
//static ut_ina219data_t _utIna219Data = {
639
//  /* driver           */ &moduleLldPowerMonitorVled,
640
//  /* expected voltage */ 4.2f,
641
//  /* tolerance        */ 0.2f,
642
//  /* timeout */ MICROSECONDS_PER_SECOND,
643
//};
644
//aos_unittest_t moduleUtAlldIna219 = {
645
//  /* name           */ "INA219",
646
//  /* info           */ "power monitor",
647
//  /* test function  */ utAlldIna219Func,
648
//  /* shell command  */ {
649
//    /* name     */ "unittest:PowerMonitor",
650
//    /* callback */ _utShellCmdCb_AlldIna219,
651
//    /* next     */ NULL,
652
//  },
653
//  /* data           */ &_utIna219Data,
654
//};
655

  
656
///*
657
// * Status LED
658
// */
659
//static int _utShellCmdCb_AlldLed(BaseSequentialStream* stream, int argc, char* argv[])
660
//{
661
//  (void)argc;
662
//  (void)argv;
663
//  aosUtRun(stream, &moduleUtAlldLed, NULL);
664
//  return AOS_OK;
665
//}
666
//aos_unittest_t moduleUtAlldLed = {
667
//  /* name           */ "LED",
668
//  /* info           */ NULL,
669
//  /* test function  */ utAlldLedFunc,
670
//  /* shell command  */ {
671
//    /* name     */ "unittest:StatusLED",
672
//    /* callback */ _utShellCmdCb_AlldLed,
673
//    /* next     */ NULL,
674
//  },
675
//  /* data           */ &moduleLldStatusLed,
676
//};
677

  
678
///*
679
// * Power switch driver (MIC9404x)
680
// */
681
//static int _utShellCmdCb_Mic9404x(BaseSequentialStream* stream, int argc, char* argv[])
682
//{
683
//  // evaluate arguments
684
//  if (argc == 2) {
685
//    if (strcmp(argv[1], "1.8V") == 0) {
686
//      moduleUtAlldMic9404x.data = &moduleLldPowerSwitchV18;
687
//      aosUtRun(stream, &moduleUtAlldMic9404x, "1.8V");
688
//      moduleUtAlldMic9404x.data = NULL;
689
//      return AOS_OK;
690
//    }
691
//    else if (strcmp(argv[1], "3.3V") == 0) {
692
//      moduleUtAlldMic9404x.data = &moduleLldPowerSwitchV33;
693
//      aosUtRun(stream, &moduleUtAlldMic9404x, "3.3V");
694
//      moduleUtAlldMic9404x.data = NULL;
695
//      return AOS_OK;
696
//    }
697
//// The 4.2V switch is disabled due to a hardware bug.
698
////    else if (strcmp(argv[1], "4.2V") == 0) {
699
////      moduleUtAlldMic9404x.data = &moduleLldPowerSwitchV42;
700
////      aosUtRun(stream, &moduleUtAlldMic9404x, "4.2V");
701
////      moduleUtAlldMic9404x.data = NULL;
702
////      return AOS_OK;
703
////    }
704
//    else if (strcmp(argv[1], "5.0V") == 0) {
705
//      moduleUtAlldMic9404x.data = &moduleLldPowerSwitchV50;
706
//      aosUtRun(stream, &moduleUtAlldMic9404x, "5.0V");
707
//      moduleUtAlldMic9404x.data = NULL;
708
//      return AOS_OK;
709
//    }
710
//    else if (strcmp(argv[1], "VSYS") == 0) {
711
//      moduleUtAlldMic9404x.data = &moduleLldPowerSwitchVsys;
712
//      aosUtRun(stream, &moduleUtAlldMic9404x, "VSYS");
713
//      moduleUtAlldMic9404x.data = NULL;
714
//      return AOS_OK;
715
//    }
716
//  }
717
//  // print help
718
//  chprintf(stream, "Usage: %s OPTION\n", argv[0]);
719
//  chprintf(stream, "Options:\n");
720
//  chprintf(stream, "  1.8V\n");
721
//  chprintf(stream, "    Test power switch for 1.8V supply.\n");
722
//  chprintf(stream, "  3.3V\n");
723
//  chprintf(stream, "    Test power switch for 3.3V supply.\n");
724
//// The 4.2V switch is disabled due to a hardware bug.
725
////  chprintf(stream, "  4.2V\n");
726
////  chprintf(stream, "    Test power switch for 4.2V supply.\n");
727
//  chprintf(stream, "  5.0V\n");
728
//  chprintf(stream, "    Test power switch for 5.0V supply.\n");
729
//  chprintf(stream, "  VSYS\n");
730
//  chprintf(stream, "    Test power switch for VSYS supply.\n");
731
//  return AOS_INVALIDARGUMENTS;
732
//}
733
//aos_unittest_t moduleUtAlldMic9404x = {
734
//  /* info           */ "MIC9404x",
735
//  /* name           */ "power swicth driver",
736
//  /* test function  */ utAlldMic9404xFunc,
737
//  /* shell command  */ {
738
//    /* name     */ "unittest:PowerSwitch",
739
//    /* callback */ _utShellCmdCb_Mic9404x,
740
//    /* next     */ NULL,
741
//  },
742
//  /* data           */ NULL,
743
//};
744

  
745
///*
746
// * LED PWM driver (TLC5947)
747
// */
748
//static int _utShellCmdCb_Tlc5947(BaseSequentialStream* stream, int argc, char* argv[])
749
//{
750
//  (void)argc;
751
//  (void)argv;
752
//  aosUtRun(stream, &moduleUtAlldTlc5947, NULL);
753
//  return AOS_OK;
754
//}
755
//aos_unittest_t moduleUtAlldTlc5947 = {
756
//  /* info           */ "TLC5947",
757
//  /* name           */ "LED PWM driver",
758
//  /* test function  */ utAlldTlc5947Func,
759
//  /* shell command  */ {
760
//    /* name     */ "unittest:Lights",
761
//    /* callback */ _utShellCmdCb_Tlc5947,
762
//    /* next     */ NULL,
763
//  },
764
//  /* data           */ &moduleLldLedPwm,
765
//};
766

  
767 597
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
768 598

  
769 599
/** @} */
modules/LightRing_1-2/test/DW1000/module_test_DW1000.c
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2019  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19
#include <amiroos.h>
20

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

  
23
#include <module_test_DW1000.h>
24
#include <aos_test_DW1000.h>
25

  
26
/******************************************************************************/
27
/* LOCAL DEFINITIONS                                                          */
28
/******************************************************************************/
29

  
30
/******************************************************************************/
31
/* EXPORTED VARIABLES                                                         */
32
/******************************************************************************/
33

  
34
/******************************************************************************/
35
/* LOCAL TYPES                                                                */
36
/******************************************************************************/
37

  
38
/******************************************************************************/
39
/* LOCAL VARIABLES                                                            */
40
/******************************************************************************/
41

  
42
static aos_test_dw1000data_t _data = {
43
  /* UWB data     */ &moduleLldDw1000,
44
  /* event source */ &aos.events.io,
45
  /* event flags  */ MODULE_OS_IOEVENTFLAGS_DW1000_IRQn,
46
};
47

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

  
50
/******************************************************************************/
51
/* LOCAL FUNCTIONS                                                            */
52
/******************************************************************************/
53

  
54
/******************************************************************************/
55
/* EXPORTED FUNCTIONS                                                         */
56
/******************************************************************************/
57

  
58
int moduleTestDw1000ShellCb(BaseSequentialStream* stream, int argc, char* argv[], aos_testresult_t* result)
59
{
60
  (void)argc;
61
  (void)argv;
62

  
63
  if (result != NULL) {
64
    *result = aosTestRun(stream, &_test, NULL);
65
  } else {
66
    aosTestRun(stream, &_test, NULL);
67
  }
68

  
69
  return AOS_OK;
70
}
71

  
72
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
modules/LightRing_1-2/test/DW1000/module_test_DW1000.h
1
/*
2
AMiRo-OS is an operating system designed for the Autonomous Mini Robot (AMiRo) platform.
3
Copyright (C) 2016..2019  Thomas Schöpping et al.
4

  
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9

  
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14

  
15
You should have received a copy of the GNU General Public License
16
along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
*/
18

  
19

  
20
#ifndef MODULE_TEST_LED_H
21
#define MODULE_TEST_LED_H
22

  
23
#include <amiroos.h>
24

  
25
#if (AMIROOS_CFG_TESTS_ENABLE == true) || defined(__DOXYGEN__)
26

  
27
/******************************************************************************/
28
/* CONSTANTS                                                                  */
29
/******************************************************************************/
30

  
31
/******************************************************************************/
32
/* SETTINGS                                                                   */
33
/******************************************************************************/
34

  
35
/******************************************************************************/
36
/* CHECKS                                                                     */
37
/******************************************************************************/
38

  
39
/******************************************************************************/
40
/* DATA STRUCTURES AND TYPES                                                  */
41
/******************************************************************************/
42

  
43
/******************************************************************************/
44
/* MACROS                                                                     */
45
/******************************************************************************/
46

  
47
/******************************************************************************/
48
/* EXTERN DECLARATIONS                                                        */
49
/******************************************************************************/
50

  
51
#if defined(__cplusplus)
52
extern "C" {
53
#endif /* defined(__cplusplus) */
54
  int moduleTestDw1000ShellCb(BaseSequentialStream* stream, int argc, char* argv[], aos_testresult_t* result);
55
#if defined(__cplusplus)
56
}
57
#endif /* defined(__cplusplus) */
58

  
59
/******************************************************************************/
60
/* INLINE FUNCTIONS                                                           */
61
/******************************************************************************/
62

  
63
#endif /* (AMIROOS_CFG_TESTS_ENABLE == true) */
64

  
65
#endif /* MODULE_TEST_LED_H */
66

  

Also available in: Unified diff