add as830 sensor and tvoc10 sensor support Nuttx

This commit is contained in:
wgzAIIT
2022-01-07 11:01:46 +08:00
parent 1f252e418f
commit c08d854d4b
16 changed files with 152 additions and 18 deletions
@@ -588,36 +588,45 @@ config NSH_DISABLE_XD
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
config NSH_DISABLE_TVOC_10
bool "Disable the sensor tb600b_tvoc10."
default n
config NSH_DISABLE_TB600B_IAQ10
bool "Disable the air quality function of the sensor TB600B-IAQ-10"
bool "Disable the sensor tb600b_iaq10."
default n
config NSH_DISABLE_CH4_AS830
bool "Disable the sensor ch4_as830."
default n
config NSH_DISABLE_CO2ZG09
bool "Disable the co2 function of the sensor zg09"
bool "Disable the sensor zg09."
default n
config NSH_DISABLE_PM1_0PS5308
bool "Disable the pm1.0 function of the sensor ps5308"
bool "Disable the pm1.0 function of the sensor ps5308."
default n
config NSH_DISABLE_PM2_5PS5308
bool "Disable the pm2.5 function of the sensor ps5308"
bool "Disable the pm2.5 function of the sensor ps5308."
default n
config NSH_DISABLE_PM10PS5308
bool "Disable the pm10 function of the sensor ps5308"
bool "Disable the pm10 function of the sensor ps5308."
default n
config NSH_DISABLE_VOICED124
bool "Disable the voice function of the sensor d124"
bool "Disable the sensor d124."
default n
config NSH_DISABLE_TEMPHS300X
bool "Disable the temperature function of the sensor Hs300x"
bool "Disable the temperature function of the sensor Hs300x."
default n
config NSH_DISABLE_HUMIHS300X
bool "Disable the humidity function of the sensor Hs300x"
bool "Disable the humidity function of the sensor Hs300x."
default n
endmenu
@@ -1403,10 +1403,19 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
FAR void *arg);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_IAQ) && !defined(CONFIG_NSH_DISABLE_TB600B_IAQ10)
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TVOC_10)
int cmd_Tvoc10(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_IAQ_TB600B_IAQ10) && !defined(CONFIG_NSH_DISABLE_TB600B_IAQ10)
int cmd_Iaq10(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CH4_AS830) && !defined(CONFIG_NSH_DISABLE_CH4_AS830)
int cmd_As830(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CO2_ZG09) && !defined(CONFIG_NSH_DISABLE_CO2ZG09)
int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
@@ -52,6 +52,22 @@
extern int FrameworkInit(void);
/****************************************************************************
* Name: cmd_Tvoc10
****************************************************************************/
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TVOC_10)
extern void TvocTb600bTvoc10(void);
int cmd_Tvoc10(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
printf("Hello, world!\n");
FrameworkInit();
TvocTb600bTvoc10();
return 0;
}
#endif
/****************************************************************************
* Name: cmd_Iaq10
****************************************************************************/
@@ -67,6 +83,21 @@ int cmd_Iaq10(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
}
#endif
/****************************************************************************
* Name: cmd_As830
****************************************************************************/
#if defined(CONFIG_APPLICATION_SENSOR_CH4_AS830) && !defined(CONFIG_NSH_DISABLE_CH4_AS830)
extern void Ch4As830(void);
int cmd_As830(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
printf("Hello, world!\n");
FrameworkInit();
Ch4As830();
return 0;
}
#endif
/****************************************************************************
* Name: cmd_Co2Zg09
****************************************************************************/
@@ -580,12 +580,20 @@ static const struct cmdmap_s g_cmdmap[] =
{ "xd", cmd_xd, 3, 3, "<hex-address> <byte-count>" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_IAQ) && !defined(CONFIG_NSH_DISABLE_TB600B_IAQ10)
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TVOC_10)
{ "tvoc10", cmd_Tvoc10, 1, 1, "[get the concentration of tvoc with sensor tb600b_tvoc10.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_IAQ_TB600B_IAQ10) && !defined(CONFIG_NSH_DISABLE_TB600B_IAQ10)
{ "iaq10", cmd_Iaq10, 1, 1, "[get air quality data with sensor Tb600bIaq10.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CH4_AS830) && !defined(CONFIG_NSH_DISABLE_CH4_AS830)
{ "as830", cmd_As830, 1, 1, "[get the concentration of CH4 with sensor ch4_as830.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CO2_ZG09) && !defined(CONFIG_NSH_DISABLE_CO2ZG09)
{ "zg09", cmd_Co2Zg09, 1, 1, "[get co2 concentration with sensor ZG09.]" },
{ "zg09", cmd_Co2Zg09, 1, 1, "[get the concentration of co2 with sensor ZG09.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
@@ -593,7 +601,7 @@ static const struct cmdmap_s g_cmdmap[] =
#endif
#if defined(CONFIG_APPLICATION_SENSOR_PM2_5_PS5308) && !defined(CONFIG_NSH_DISABLE_PM2_5PS5308)
{ "pm2.5", cmd_Pm25Ps5308, 1, 1, "[get pm2.5with sensor Ps5308.]" },
{ "pm2.5", cmd_Pm25Ps5308, 1, 1, "[get pm2.5 with sensor Ps5308.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_PM10_PS5308) && !defined(CONFIG_NSH_DISABLE_PM10PS5308)