add ch438 driver and a demo

This commit is contained in:
Liu_Kai
2022-04-26 17:36:34 +08:00
parent a337904560
commit 9ac84e7cb4
7 changed files with 942 additions and 1 deletions
@@ -1417,6 +1417,8 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
FAR void *arg);
#endif
int cmd_Ch438(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
#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
@@ -38,6 +38,17 @@
extern int FrameworkInit(void);
extern void CH438Demo(void);
int cmd_Ch438(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
{
nsh_output(vtbl, "Hello, world!\n");
FrameworkInit();
CH438Demo();
return OK;
}
/****************************************************************************
* Name: cmd_Hcho1os
****************************************************************************/
@@ -590,6 +590,8 @@ static const struct cmdmap_s g_cmdmap[] =
{ "xd", cmd_xd, 3, 3, "<hex-address> <byte-count>" },
#endif
{ "ch438", cmd_Ch438, 1, 1, "[get the concentration of formaldehyde with sensor tb600b_wq_hcho1os.]" },
#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