Revision ddf34c3d modules/PowerManagement_1-1/module.c

View differences:

modules/PowerManagement_1-1/module.c
206 206
  /* GPIO */ &_gpioChargeStat2A,
207 207
  /* meta */ {
208 208
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
209
    /* active state   */ BQ24103A_LLD_CHARGE_STATUS_GPIO_ACTIVE_STATE,
209
    /* active state   */ BQ241xx_LLD_CHARGE_STATUS_GPIO_ACTIVE_STATE,
210 210
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
211 211
  },
212 212
};
......
286 286
  /* GPIO */ &_gpioChargeStat1A,
287 287
  /* meta */ {
288 288
    /* direction      */ APAL_GPIO_DIRECTION_INPUT,
289
    /* active state   */ BQ24103A_LLD_CHARGE_STATUS_GPIO_ACTIVE_STATE,
289
    /* active state   */ BQ241xx_LLD_CHARGE_STATUS_GPIO_ACTIVE_STATE,
290 290
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
291 291
  },
292 292
};
......
334 334
  /* GPIO */ &_gpioChargeEn1,
335 335
  /* meta */ {
336 336
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
337
    /* active state   */ BQ24103A_LLD_ENABLED_GPIO_ACTIVE_STATE,
337
    /* active state   */ BQ241xx_LLD_ENABLED_GPIO_ACTIVE_STATE,
338 338
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
339 339
  },
340 340
};
......
532 532
  /* GPIO */ &_gpioChargeEn2,
533 533
  /* meta */ {
534 534
    /* direction      */ APAL_GPIO_DIRECTION_OUTPUT,
535
    /* active state   */ BQ24103A_LLD_ENABLED_GPIO_ACTIVE_STATE,
535
    /* active state   */ BQ241xx_LLD_ENABLED_GPIO_ACTIVE_STATE,
536 536
    /* interrupt edge */ APAL_GPIO_EDGE_NONE,
537 537
  },
538 538
};
......
568 568
 */
569 569
/*===========================================================================*/
570 570

  
571
AT24C01BNDriver moduleLldEeprom = {
571
AT24C01BDriver moduleLldEeprom = {
572 572
  /* I2C driver   */ &MODULE_HAL_I2C_SR_PM42_PM50_PMVDD_EEPROM_GAUGEFRONT,
573
  /* I2C address  */ AT24C01BN_LLD_I2C_ADDR_FIXED,
573
  /* I2C address  */ AT24C01B_LLD_I2C_ADDR_FIXED,
574 574
};
575 575

  
576
BQ24103ADriver moduleLldBatteryChargerFront = {
576
BQ241xxDriver moduleLldBatteryChargerFront = {
577 577
  /* charge enable GPIO */ &moduleGpioChargeEn1,
578 578
  /* charge status GPIO */ &moduleGpioChargeStat1A,
579 579
};
580 580

  
581
BQ24103ADriver moduleLldBatteryChargerRear = {
581
BQ241xxDriver moduleLldBatteryChargerRear = {
582 582
  /* charge enable GPIO */ &moduleGpioChargeEn2,
583 583
  /* charge status GPIO */ &moduleGpioChargeStat2A,
584 584
};
......
634 634
  /* LED GPIO */ &moduleGpioLed,
635 635
};
636 636

  
637
TPS62113Driver moduleLldStepDownConverter = {
637
TPS6211xDriver moduleLldStepDownConverter = {
638 638
  /* Power enable GPIO */ &moduleGpioPowerEn,
639 639
};
640 640

  
......
740 740
};
741 741

  
742 742
/*
743
 * AT24C01BN-SH-B (EEPROM)
743
 * AT24C01B (EEPROM)
744 744
 */
745
static int _utShellCmdCb_AlldAt24c01bn(BaseSequentialStream* stream, int argc, char* argv[])
745
static int _utShellCmdCb_AlldAt24c01b(BaseSequentialStream* stream, int argc, char* argv[])
746 746
{
747 747
  (void)argc;
748 748
  (void)argv;
749
  aosUtRun(stream, &moduleUtAlldAt24c01bn, NULL);
749
  aosUtRun(stream, &moduleUtAlldAt24c01b, NULL);
750 750
  return AOS_OK;
751 751
}
752
static ut_at24c01bndata_t _utAlldAt24c01bnData = {
752
static ut_at24c01bdata_t _utAlldAt24c01bData = {
753 753
  /* driver   */ &moduleLldEeprom,
754 754
  /* timeout  */ MICROSECONDS_PER_SECOND,
755 755
};
756
aos_unittest_t moduleUtAlldAt24c01bn = {
757
  /* name           */ "AT24C01BN-SH-B",
756
aos_unittest_t moduleUtAlldAt24c01b = {
757
  /* name           */ "AT24C01B",
758 758
  /* info           */ "1kbit EEPROM",
759
  /* test function  */ utAlldAt24c01bnFunc,
759
  /* test function  */ utAlldAt24c01bFunc,
760 760
  /* shell command  */ {
761 761
    /* name     */ "unittest:EEPROM",
762
    /* callback */ _utShellCmdCb_AlldAt24c01bn,
762
    /* callback */ _utShellCmdCb_AlldAt24c01b,
763 763
    /* next     */ NULL,
764 764
  },
765
  /* data           */ &_utAlldAt24c01bnData,
765
  /* data           */ &_utAlldAt24c01bData,
766 766
};
767 767

  
768 768
/*
769
 * BQ24103A (battery charger)
769
 * bq24103a (battery charger)
770 770
 */
771 771
static int _utShellCmdCb_AlldBq24103a(BaseSequentialStream* stream, int argc, char* argv[])
772 772
{
......
806 806
  }
807 807
}
808 808
aos_unittest_t moduleUtAlldBq24103a = {
809
  /* name           */ "BQ24103A",
809
  /* name           */ "bq24103a",
810 810
  /* info           */ "battery charger",
811
  /* test function  */ utAlldBq24103aFunc,
811
  /* test function  */ utAlldBq241xxFunc,
812 812
  /* shell command  */ {
813 813
    /* name     */ "unittest:BatteryCharger",
814 814
    /* callback */ _utShellCmdCb_AlldBq24103a,
......
818 818
};
819 819

  
820 820
/*
821
 * BQ27500 (fuel gauge)
821
 * bq27500 (fuel gauge)
822 822
 */
823 823
static int _utShellCmdCb_AlldBq27500(BaseSequentialStream* stream, int argc, char* argv[])
824 824
{
......
851 851
  /* timeout  */ MICROSECONDS_PER_SECOND,
852 852
};
853 853
aos_unittest_t moduleUtAlldBq27500 = {
854
  /* name           */ "BQ27500",
854
  /* name           */ "bq27500",
855 855
  /* info           */ "fuel gauge",
856 856
  /* test function  */ utAlldBq27500Func,
857 857
  /* shell command  */ {
......
863 863
};
864 864

  
865 865
/*
866
 * BQ27500 (fuel gauge) in combination with BQ24103A (battery charger)
866
 * bq27500 (fuel gauge) in combination with bq24103a (battery charger)
867 867
 */
868 868
static int _utShellCmdCb_AlldBq27500Bq24103a(BaseSequentialStream* stream, int argc, char* argv[])
869 869
{
870 870
  // evaluate arguments
871 871
  if (argc == 2) {
872 872
    if (strcmp(argv[1], "-f") == 0 || strcmp(argv[1], "--front") == 0) {
873
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = &moduleLldFuelGaugeFront;
874
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq24103a = &moduleLldBatteryChargerFront;
873
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = &moduleLldFuelGaugeFront;
874
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = &moduleLldBatteryChargerFront;
875 875
      aosUtRun(stream, &moduleUtAlldBq27500Bq24103a, "front battery");
876
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = NULL;
877
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq24103a = NULL;
876
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = NULL;
877
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = NULL;
878 878
      return AOS_OK;
879 879
    }
880 880
    else if (strcmp(argv[1], "-r") == 0 || strcmp(argv[1], "--rear") == 0) {
881
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = &moduleLldFuelGaugeRear;
882
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq24103a = &moduleLldBatteryChargerRear;
881
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = &moduleLldFuelGaugeRear;
882
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = &moduleLldBatteryChargerRear;
883 883
      aosUtRun(stream, &moduleUtAlldBq27500Bq24103a, "rear battery");
884
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = NULL;
885
      ((ut_bq27500bq24103adata_t*)moduleUtAlldBq27500Bq24103a.data)->bq24103a = NULL;
884
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq27500 = NULL;
885
      ((ut_bq27500bq241xxdata_t*)moduleUtAlldBq27500Bq24103a.data)->bq241xx = NULL;
886 886
      return AOS_OK;
887 887
    }
888 888
  }
......
895 895
  chprintf(stream, "    Test the rear battery fuel gauge and charger.\n");
896 896
  return AOS_INVALID_ARGUMENTS;
897 897
}
898
static ut_bq27500bq24103adata_t _utAlldBq27500Bq24103aData= {
899
  /* BQ27500 driver   */ NULL,
900
  /* BQ23203A driver  */ NULL,
898
static ut_bq27500bq241xxdata_t _utAlldBq27500Bq24103aData= {
899
  /* bq27500 driver   */ NULL,
900
  /* bq24103a driver  */ NULL,
901 901
  /* timeout          */ MICROSECONDS_PER_SECOND,
902 902
};
903 903
aos_unittest_t moduleUtAlldBq27500Bq24103a = {
904 904
  /* name           */ "BQ27500 & BQ24103A",
905 905
  /* info           */ "fuel gauge & battery charger",
906
  /* test function  */ utAlldBq27500Bq24103aFunc,
906
  /* test function  */ utAlldBq27500Bq241xxFunc,
907 907
  /* shell command  */ {
908 908
    /* name     */ "unittest:FuelGauge&BatteryCharger",
909 909
    /* callback */ _utShellCmdCb_AlldBq27500Bq24103a,
......
1025 1025
  aosUtRun(stream, &moduleUtAlldPklcs1212e4001, NULL);
1026 1026
  return AOS_OK;
1027 1027
}
1028
static ut_pklcs1212e4001_t _utAlldPklcs1212e4001Data = {
1028
static ut_pkxxxexxx_t _utAlldPklcs1212e4001Data = {
1029 1029
  /* PWM driver   */ &MODULE_HAL_PWM_BUZZER,
1030 1030
  /* PWM channel  */ MODULE_HAL_PWM_BUZZER_CHANNEL
1031 1031
};
1032 1032
aos_unittest_t moduleUtAlldPklcs1212e4001 = {
1033 1033
  /* name           */ "PKLCS1212E4001",
1034 1034
  /* info           */ "buzzer",
1035
  /* test function  */ utAlldPklcs1212e4001Func,
1035
  /* test function  */ utAlldPkxxxexxxFunc,
1036 1036
  /* shell command  */ {
1037 1037
    /* name     */ "unittest:Buzzer",
1038 1038
    /* callback */ _utShellCmdCb_AlldPklcs1212e4001,
......
1042 1042
};
1043 1043

  
1044 1044
/*
1045
 * TPS62113 (stop-down converter)
1045
 * TPS62113 (step-down converter)
1046 1046
 */
1047 1047
static int _utShellCmdCb_AlldTps62113(BaseSequentialStream* stream, int argc, char* argv[])
1048 1048
{
......
1056 1056
aos_unittest_t moduleUtAlldTps62113 = {
1057 1057
  /* name           */ "TPS62113",
1058 1058
  /* info           */ "step-down converter",
1059
  /* test function  */ utAlldTps62113Func,
1059
  /* test function  */ utAlldTps6211xFunc,
1060 1060
  /* shell command  */ {
1061 1061
    /* name     */ "unittest:StepDownConverter",
1062 1062
    /* callback */ _utShellCmdCb_AlldTps62113,
......
1075 1075
  aosUtRun(stream, &moduleUtAlldTps62113Ina219, "VSYS (4.2V)");
1076 1076
  return AOS_OK;
1077 1077
}
1078
static ut_tps62113ina219data_t _utAlldTps62113Ina219Data = {
1078
static ut_tps6211xina219data_t _utAlldTps62113Ina219Data = {
1079 1079
  /* TPS62113 */ &moduleLldStepDownConverter,
1080 1080
  /* INA219   */ &moduleLldPowerMonitorVsys42,
1081 1081
  /* timeout  */ MICROSECONDS_PER_SECOND,
......
1083 1083
aos_unittest_t moduleUtAlldTps62113Ina219 = {
1084 1084
  /* name           */ "TPS62113 & INA219",
1085 1085
  /* info           */ "step-down converter & power monitor",
1086
  /* test function  */ utAlldTps62113Ina219Func,
1086
  /* test function  */ utAlldTps6211xIna219Func,
1087 1087
  /* shell command  */ {
1088 1088
    /* name     */ "unittest:StepDownConverter&PowerMonitor",
1089 1089
    /* callback */ _utShellCmdCb_AlldTps62113Ina219,

Also available in: Unified diff