add g8s sensor support Nuttx on stm32f407-discovery

This commit is contained in:
zhr
2022-07-26 18:43:39 +08:00
parent 71f00ec06f
commit 21dce4f25e
10 changed files with 97 additions and 6 deletions
@@ -571,6 +571,10 @@ config NSH_DISABLE_CO2ZG09
bool "Disable the sensor zg09."
default n
config NSH_DISABLE_CO2G8S
bool "Disable the sensor g8-s."
default n
config NSH_DISABLE_PM1_0PS5308
bool "Disable the pm1.0 function of the sensor ps5308."
default n
@@ -1474,6 +1474,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
int cmd_Co2G8S(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
int cmd_Pm10Ps5308(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
@@ -125,6 +125,21 @@ int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
}
#endif
/****************************************************************************
* Name: cmd_Co2g8s
****************************************************************************/
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
extern void Co2G8s(void);
int cmd_Co2G8S(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
nsh_output(vtbl, "Hello, world!\n");
FrameworkInit();
Co2G8s();
return OK;
}
#endif
/****************************************************************************
* Name: cmd_Pm10Ps5308
****************************************************************************/
@@ -620,6 +620,10 @@ static const struct cmdmap_s g_cmdmap[] =
{ "zg09", cmd_Co2Zg09, 1, 1, "[get the concentration of co2 with sensor ZG09.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_CO2_G8S) && !defined(CONFIG_NSH_DISABLE_CO2G8S)
{ "g8s", cmd_Co2G8S, 1, 1, "[get the concentration of co2 with sensor G8S.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
{ "pm1.0", cmd_Pm10Ps5308, 1, 1, "[get pm1.0 with sensor Ps5308.]" },
#endif