forked from xuos/xiuos
add d124 and zg09 sensor support Nuttx on stm32f407-discovery
This commit is contained in:
@@ -588,6 +588,10 @@ config NSH_DISABLE_XD
|
||||
default y if DEFAULT_SMALL
|
||||
default n if !DEFAULT_SMALL
|
||||
|
||||
config NSH_DISABLE_CO2ZG09
|
||||
bool "Disable the co2 function of the sensor zg09"
|
||||
default n
|
||||
|
||||
config NSH_DISABLE_PM1_0PS5308
|
||||
bool "Disable the pm1.0 function of the sensor ps5308"
|
||||
default n
|
||||
@@ -600,6 +604,10 @@ config NSH_DISABLE_PM10PS5308
|
||||
bool "Disable the pm10 function of the sensor ps5308"
|
||||
default n
|
||||
|
||||
config NSH_DISABLE_VOICED124
|
||||
bool "Disable the voice function of the sensor d124"
|
||||
default n
|
||||
|
||||
config NSH_DISABLE_TEMPHS300X
|
||||
bool "Disable the temperature function of the sensor Hs300x"
|
||||
default n
|
||||
|
||||
@@ -1403,6 +1403,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
|
||||
FAR void *arg);
|
||||
#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
|
||||
|
||||
#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
|
||||
@@ -1415,6 +1419,10 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
|
||||
int cmd_Pm100Ps5308(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_VOICE_D124) && !defined(CONFIG_NSH_DISABLE_VOICED124)
|
||||
int cmd_VoiceD124(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_TEMPERATURE_HS300X) && !defined(CONFIG_NSH_DISABLE_TEMPHS300X)
|
||||
int cmd_TempHs300x(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
|
||||
#endif
|
||||
|
||||
@@ -52,6 +52,21 @@
|
||||
|
||||
extern int FrameworkInit(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_Co2Zg09
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_CO2_ZG09) && !defined(CONFIG_NSH_DISABLE_CO2ZG09)
|
||||
extern void Co2Zg09(void);
|
||||
int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
printf("Hello, world!\n");
|
||||
FrameworkInit();
|
||||
Co2Zg09();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_Pm10Ps5308
|
||||
****************************************************************************/
|
||||
@@ -97,6 +112,21 @@ int cmd_Pm100Ps5308(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_VoiceD124
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_VOICE_D124) && !defined(CONFIG_NSH_DISABLE_VOICED124)
|
||||
extern void VoiceD124(void);
|
||||
int cmd_VoiceD124(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
|
||||
{
|
||||
printf("Hello, world!\n");
|
||||
FrameworkInit();
|
||||
VoiceD124();
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: cmd_TempHs300x
|
||||
****************************************************************************/
|
||||
|
||||
@@ -580,24 +580,32 @@ static const struct cmdmap_s g_cmdmap[] =
|
||||
{ "xd", cmd_xd, 3, 3, "<hex-address> <byte-count>" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_CO2_ZG09) && !defined(CONFIG_NSH_DISABLE_CO2ZG09)
|
||||
{ "zg09", cmd_Co2Zg09, 1, 1, "[get co2 concentration with sensor ZG09.]" },
|
||||
#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]" },
|
||||
{ "pm1.0", cmd_Pm10Ps5308, 1, 1, "[get pm1.0 with sensor Ps5308.]" },
|
||||
#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.5with sensor Ps5308.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_PM10_PS5308) && !defined(CONFIG_NSH_DISABLE_PM10PS5308)
|
||||
{ "pm10", cmd_Pm100Ps5308, 1, 1, "[get pm10 with sensor Ps5308]" },
|
||||
{ "pm10", cmd_Pm100Ps5308, 1, 1, "[get pm10 with sensor Ps5308.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_VOICE_D124) && !defined(CONFIG_NSH_DISABLE_VOICED124)
|
||||
{ "d124", cmd_VoiceD124, 1, 1, "[get decibel of noise with sensor D124.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_TEMPERATURE_HS300X) && !defined(CONFIG_NSH_DISABLE_TEMPHS300X)
|
||||
{ "temp", cmd_TempHs300x, 1, 1, "[Get humidity with sensor HS300x]" },
|
||||
{ "temp", cmd_TempHs300x, 1, 1, "[get temperature with sensor HS300x.]" },
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_APPLICATION_SENSOR_HUMIDITY_HS300X) && !defined(CONFIG_NSH_DISABLE_HUMIHS300X)
|
||||
{ "humi", cmd_HumiHs300x, 1, 1, "[Get temperature with sensor HS300x]" },
|
||||
{ "humi", cmd_HumiHs300x, 1, 1, "[get humidity with sensor HS300x.]" },
|
||||
#endif
|
||||
|
||||
{ NULL, NULL, 1, 1, NULL }
|
||||
|
||||
Reference in New Issue
Block a user