add hcho1os sensor support Nuttx

This commit is contained in:
wgzAIIT
2022-01-07 12:08:14 +08:00
parent c08d854d4b
commit 6bfbbc18f2
10 changed files with 71 additions and 7 deletions
@@ -588,8 +588,11 @@ config NSH_DISABLE_XD
default y if DEFAULT_SMALL
default n if !DEFAULT_SMALL
config NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS
bool "Disable the sensor tb600b_wq_hcho1os."
default n
config NSH_DISABLE_TVOC_10
config NSH_DISABLE_TB600B_TVOC10
bool "Disable the sensor tb600b_tvoc10."
default n
@@ -1403,8 +1403,11 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
FAR void *arg);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS) && !defined(CONFIG_NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS)
int cmd_Hcho1os(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TVOC_10)
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TB600B_TVOC10)
int cmd_Tvoc10(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#endif
@@ -52,11 +52,26 @@
extern int FrameworkInit(void);
/****************************************************************************
* Name: cmd_Hcho1os
****************************************************************************/
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TB600B_TVOC10)
extern void HchoTb600bHcho1os(void);
int cmd_Hcho1os(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
printf("Hello, world!\n");
FrameworkInit();
HchoTb600bHcho1os();
return 0;
}
#endif
/****************************************************************************
* Name: cmd_Tvoc10
****************************************************************************/
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TVOC_10)
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TB600B_TVOC10)
extern void TvocTb600bTvoc10(void);
int cmd_Tvoc10(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
@@ -580,7 +580,11 @@ static const struct cmdmap_s g_cmdmap[] =
{ "xd", cmd_xd, 3, 3, "<hex-address> <byte-count>" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TVOC_10)
#if defined(CONFIG_APPLICATION_SENSOR_HCHO_TB600B_WQ_HCHO1OS) && !defined(CONFIG_NSH_DISABLE_HCHO_TB600B_WQ_HCHO1OS)
{ "hcho1os", cmd_Hcho1os, 1, 1, "[get the concentration of formaldehyde with sensor tb600b_wq_hcho1os.]" },
#endif
#if defined(CONFIG_APPLICATION_SENSOR_TVOC_TB600B_TVOC10) && !defined(CONFIG_NSH_DISABLE_TB600B_TVOC10)
{ "tvoc10", cmd_Tvoc10, 1, 1, "[get the concentration of tvoc with sensor tb600b_tvoc10.]" },
#endif