forked from xuos/xiuos
				
			add hcho1os、iaq10、as830 sensor and tvoc10 sensor support Nuttx from Wang_guozhu
it is OK
This commit is contained in:
		
						commit
						4179e4910b
					
				| 
						 | 
					@ -18,7 +18,9 @@
 | 
				
			||||||
 * @date 2021.12.10
 | 
					 * @date 2021.12.10
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <user_api.h>
 | 
					#ifdef ADD_XIUOS_FETURES
 | 
				
			||||||
 | 
					# include <user_api.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
#include <sensor.h>
 | 
					#include <sensor.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,9 @@
 | 
				
			||||||
 * @date 2021.12.15
 | 
					 * @date 2021.12.15
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <user_api.h>
 | 
					#ifdef ADD_XIUOS_FETURES
 | 
				
			||||||
 | 
					# include <user_api.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
#include <sensor.h>
 | 
					#include <sensor.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,9 @@
 | 
				
			||||||
 * @date 2021.12.14
 | 
					 * @date 2021.12.14
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <user_api.h>
 | 
					#ifdef ADD_XIUOS_FETURES
 | 
				
			||||||
 | 
					# include <user_api.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
#include <sensor.h>
 | 
					#include <sensor.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// struct iaq_data {
 | 
					// struct iaq_data {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,9 @@
 | 
				
			||||||
 * @date 2021.12.15
 | 
					 * @date 2021.12.15
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <user_api.h>
 | 
					#ifdef ADD_XIUOS_FETURES
 | 
				
			||||||
 | 
					# include <user_api.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
#include <sensor.h>
 | 
					#include <sensor.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,11 @@ config SENSOR_AS830
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if ADD_NUTTX_FETURES
 | 
					                if ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					                        config SENSOR_DEVICE_AS830_DEV
 | 
				
			||||||
 | 
					                                string "as830 device uart path"
 | 
				
			||||||
 | 
					                                default "/dev/ttyS1"
 | 
				
			||||||
 | 
					                               ---help---
 | 
				
			||||||
 | 
					                                   If USART1 is selected, then fill in /dev/ttyS1 here.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,4 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/ch4/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					include $(wildcard $(APPDIR)/../../../APP_Framework/Framework/sensor/ch4/*/Make.defs)
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/ch4/as830/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					ifneq ($(CONFIG_SENSOR_AS830),)
 | 
				
			||||||
 | 
					CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/sensor/ch4/as830
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,11 @@
 | 
				
			||||||
SRC_FILES := as830.c
 | 
					include $(KERNEL_ROOT)/.config
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
 | 
				
			||||||
 | 
					    include $(APPDIR)/Make.defs
 | 
				
			||||||
 | 
					    CSRCS += as830.c
 | 
				
			||||||
 | 
					    include $(APPDIR)/Application.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(KERNEL_ROOT)/compiler.mk
 | 
					ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
 | 
				
			||||||
 | 
					    SRC_FILES := as830.c
 | 
				
			||||||
 | 
					    include $(KERNEL_ROOT)/compiler.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,18 @@ static struct SensorProductInfo info =
 | 
				
			||||||
 * @param sdev - sensor device pointer
 | 
					 * @param sdev - sensor device pointer
 | 
				
			||||||
 * @return success: 1 , failure: other
 | 
					 * @return success: 1 , failure: other
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					#ifdef ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    sdev->fd = PrivOpen(SENSOR_DEVICE_AS830_DEV, O_RDWR);
 | 
				
			||||||
 | 
					    if (sdev->fd < 0) {
 | 
				
			||||||
 | 
					        printf("open %s error\n", SENSOR_DEVICE_AS830_DEV);
 | 
				
			||||||
 | 
					        return -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sdev->fd;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int result = 0;
 | 
					    int result = 0;
 | 
				
			||||||
| 
						 | 
					@ -64,6 +76,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @description: Read sensor device
 | 
					 * @description: Read sensor device
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,11 @@ config SENSOR_TB600B_WQ_HCHO1OS
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if ADD_NUTTX_FETURES
 | 
					                if ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					                        config SENSOR_DEVICE_TB600B_WQ_HCHO1OS_DEV
 | 
				
			||||||
 | 
					                                string "tb600b wq_hcho1os device uart path"
 | 
				
			||||||
 | 
					                                default "/dev/ttyS1"
 | 
				
			||||||
 | 
					                               ---help---
 | 
				
			||||||
 | 
					                                   If USART1 is selected, then fill in /dev/ttyS1 here.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,4 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/hcho/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					include $(wildcard $(APPDIR)/../../../APP_Framework/Framework/sensor/hcho/*/Make.defs)
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/hcho/tb600b_wq_hcho1os/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					ifneq ($(CONFIG_SENSOR_TB600B_WQ_HCHO1OS),)
 | 
				
			||||||
 | 
					CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/sensor/hcho/tb600b_wq_hcho1os
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,12 @@
 | 
				
			||||||
SRC_FILES := tb600b_wq_hcho1os.c
 | 
					include $(KERNEL_ROOT)/.config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(KERNEL_ROOT)/compiler.mk
 | 
					ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
 | 
				
			||||||
 | 
					    include $(APPDIR)/Make.defs
 | 
				
			||||||
 | 
					    CSRCS += tb600b_wq_hcho1os.c
 | 
				
			||||||
 | 
					    include $(APPDIR)/Application.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
 | 
				
			||||||
 | 
					    SRC_FILES := tb600b_wq_hcho1os.c
 | 
				
			||||||
 | 
					    include $(KERNEL_ROOT)/compiler.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,6 +35,18 @@ static struct SensorProductInfo info =
 | 
				
			||||||
 * @param sdev - sensor device pointer
 | 
					 * @param sdev - sensor device pointer
 | 
				
			||||||
 * @return success: 1 , failure: other
 | 
					 * @return success: 1 , failure: other
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					#ifdef ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    sdev->fd = PrivOpen(SENSOR_DEVICE_TB600B_WQ_HCHO1OS_DEV, O_RDWR);
 | 
				
			||||||
 | 
					    if (sdev->fd < 0) {
 | 
				
			||||||
 | 
					        printf("open %s error\n", SENSOR_DEVICE_TB600B_WQ_HCHO1OS_DEV);
 | 
				
			||||||
 | 
					        return -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sdev->fd;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int result = 0;
 | 
					    int result = 0;
 | 
				
			||||||
| 
						 | 
					@ -65,6 +77,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @description: Read sensor device
 | 
					 * @description: Read sensor device
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,11 @@ config SENSOR_TB600B_IAQ10
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if ADD_NUTTX_FETURES
 | 
					                if ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					                        config SENSOR_DEVICE_TB600B_IAQ10_DEV
 | 
				
			||||||
 | 
					                                string "tb600b iaq10 device uart path"
 | 
				
			||||||
 | 
					                                default "/dev/ttyS1"
 | 
				
			||||||
 | 
					                               ---help---
 | 
				
			||||||
 | 
					                                   If USART1 is selected, then fill in /dev/ttyS1 here.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,4 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/iaq/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					include $(wildcard $(APPDIR)/../../../APP_Framework/Framework/sensor/iaq/*/Make.defs)
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/iaq/tb600b_iaq10/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					ifneq ($(CONFIG_SENSOR_TB600B_IAQ10),)
 | 
				
			||||||
 | 
					CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/sensor/iaq/tb600b_iaq10
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,12 @@
 | 
				
			||||||
SRC_FILES := tb600b_iaq10.c
 | 
					include $(KERNEL_ROOT)/.config
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
 | 
				
			||||||
 | 
					    include $(APPDIR)/Make.defs
 | 
				
			||||||
 | 
					    CSRCS += tb600b_iaq10.c
 | 
				
			||||||
 | 
					    include $(APPDIR)/Application.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(KERNEL_ROOT)/compiler.mk
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
 | 
				
			||||||
 | 
					    SRC_FILES := tb600b_iaq10.c
 | 
				
			||||||
 | 
					    include $(KERNEL_ROOT)/compiler.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,6 +43,17 @@ static struct SensorProductInfo info =
 | 
				
			||||||
 * @param sdev - sensor device pointer
 | 
					 * @param sdev - sensor device pointer
 | 
				
			||||||
 * @return success: 1 , failure: other
 | 
					 * @return success: 1 , failure: other
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					#ifdef ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    sdev->fd = PrivOpen(SENSOR_DEVICE_TB600B_IAQ10_DEV, O_RDWR);
 | 
				
			||||||
 | 
					    if (sdev->fd < 0) {
 | 
				
			||||||
 | 
					        printf("open %s error\n", SENSOR_DEVICE_TB600B_IAQ10_DEV);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sdev->fd;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int result = 0;
 | 
					    int result = 0;
 | 
				
			||||||
| 
						 | 
					@ -73,6 +84,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @description: Read sensor device
 | 
					 * @description: Read sensor device
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -34,6 +34,11 @@ config SENSOR_TB600B_TVOC10
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if ADD_NUTTX_FETURES
 | 
					                if ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					                        config SENSOR_DEVICE_TB600B_TVOC10_DEV
 | 
				
			||||||
 | 
					                                string "tb600b tvoc10 device uart path"
 | 
				
			||||||
 | 
					                                default "/dev/ttyS1"
 | 
				
			||||||
 | 
					                               ---help---
 | 
				
			||||||
 | 
					                                   If USART1 is selected, then fill in /dev/ttyS1 here.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                endif
 | 
					                endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,4 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/tvoc/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					include $(wildcard $(APPDIR)/../../../APP_Framework/Framework/sensor/tvoc/*/Make.defs)
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					# APP_Framework/Framework/sensor/tvoc/tb600b_tvoc10/Make.defs
 | 
				
			||||||
 | 
					############################################################################
 | 
				
			||||||
 | 
					ifneq ($(CONFIG_SENSOR_TB600B_TVOC10),)
 | 
				
			||||||
 | 
					CONFIGURED_APPS += $(APPDIR)/../../../APP_Framework/Framework/sensor/tvoc/tb600b_tvoc10
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,12 @@
 | 
				
			||||||
SRC_FILES := tb600b_tvoc10.c
 | 
					include $(KERNEL_ROOT)/.config
 | 
				
			||||||
 | 
					
 | 
				
			||||||
include $(KERNEL_ROOT)/compiler.mk
 | 
					ifeq ($(CONFIG_ADD_NUTTX_FETURES),y)
 | 
				
			||||||
 | 
					    include $(APPDIR)/Make.defs
 | 
				
			||||||
 | 
					    CSRCS += tb600b_tvoc10.c
 | 
				
			||||||
 | 
					    include $(APPDIR)/Application.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifeq ($(CONFIG_ADD_XIUOS_FETURES),y)
 | 
				
			||||||
 | 
					    SRC_FILES := tb600b_tvoc10.c
 | 
				
			||||||
 | 
					    include $(KERNEL_ROOT)/compiler.mk
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -35,6 +35,18 @@ static struct SensorProductInfo info =
 | 
				
			||||||
 * @param sdev - sensor device pointer
 | 
					 * @param sdev - sensor device pointer
 | 
				
			||||||
 * @return success: 1 , failure: other
 | 
					 * @return success: 1 , failure: other
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
 | 
					#ifdef ADD_NUTTX_FETURES
 | 
				
			||||||
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    sdev->fd = PrivOpen(SENSOR_DEVICE_TB600B_TVOC10_DEV, O_RDWR);
 | 
				
			||||||
 | 
					    if (sdev->fd < 0) {
 | 
				
			||||||
 | 
					        printf("open %s error\n", SENSOR_DEVICE_TB600B_TVOC10_DEV);
 | 
				
			||||||
 | 
					        return -1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return sdev->fd;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
					static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    int result = 0;
 | 
					    int result = 0;
 | 
				
			||||||
| 
						 | 
					@ -65,6 +77,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * @description: Read sensor device
 | 
					 * @description: Read sensor device
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -588,32 +588,48 @@ config NSH_DISABLE_XD
 | 
				
			||||||
	default y if DEFAULT_SMALL
 | 
						default y if DEFAULT_SMALL
 | 
				
			||||||
	default n 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_TB600B_TVOC10
 | 
				
			||||||
 | 
						bool "Disable the sensor tb600b_tvoc10."
 | 
				
			||||||
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					config NSH_DISABLE_TB600B_IAQ10
 | 
				
			||||||
 | 
						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
 | 
					config NSH_DISABLE_CO2ZG09
 | 
				
			||||||
	bool "Disable the co2 function of the sensor zg09"
 | 
						bool "Disable the sensor zg09."
 | 
				
			||||||
	default n
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config NSH_DISABLE_PM1_0PS5308
 | 
					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
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config NSH_DISABLE_PM2_5PS5308
 | 
					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
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config NSH_DISABLE_PM10PS5308
 | 
					config NSH_DISABLE_PM10PS5308
 | 
				
			||||||
	bool "Disable the pm10 function of the sensor ps5308"
 | 
						bool "Disable the pm10 function of the sensor ps5308."
 | 
				
			||||||
	default n
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config NSH_DISABLE_VOICED124
 | 
					config NSH_DISABLE_VOICED124
 | 
				
			||||||
	bool "Disable the voice function of the sensor d124"
 | 
						bool "Disable the sensor d124."
 | 
				
			||||||
	default n
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config NSH_DISABLE_TEMPHS300X
 | 
					config NSH_DISABLE_TEMPHS300X
 | 
				
			||||||
	bool "Disable the temperature function of the sensor Hs300x"
 | 
						bool "Disable the temperature function of the sensor Hs300x."
 | 
				
			||||||
	default n
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config NSH_DISABLE_HUMIHS300X
 | 
					config NSH_DISABLE_HUMIHS300X
 | 
				
			||||||
	bool "Disable the humidity function of the sensor Hs300x"
 | 
						bool "Disable the humidity function of the sensor Hs300x."
 | 
				
			||||||
	default n
 | 
						default n
 | 
				
			||||||
 | 
					
 | 
				
			||||||
endmenu
 | 
					endmenu
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1403,6 +1403,22 @@ int nsh_foreach_var(FAR struct nsh_vtbl_s *vtbl, nsh_foreach_var_t cb,
 | 
				
			||||||
                    FAR void *arg);
 | 
					                    FAR void *arg);
 | 
				
			||||||
#endif
 | 
					#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_TB600B_TVOC10)
 | 
				
			||||||
 | 
					  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)
 | 
					#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);
 | 
					  int cmd_Co2Zg09(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -52,6 +52,67 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
extern int FrameworkInit(void);
 | 
					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_TB600B_TVOC10)
 | 
				
			||||||
 | 
					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
 | 
				
			||||||
 | 
					 ****************************************************************************/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(CONFIG_APPLICATION_SENSOR_IAQ) && !defined(CONFIG_NSH_DISABLE_TB600B_IAQ10)
 | 
				
			||||||
 | 
					extern void IaqTb600bIaq10(void);
 | 
				
			||||||
 | 
					int cmd_Iaq10(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    printf("Hello, world!\n");
 | 
				
			||||||
 | 
					    FrameworkInit();
 | 
				
			||||||
 | 
					    IaqTb600bIaq10();
 | 
				
			||||||
 | 
					    return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					#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
 | 
					 * Name: cmd_Co2Zg09
 | 
				
			||||||
 ****************************************************************************/
 | 
					 ****************************************************************************/
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -580,8 +580,24 @@ static const struct cmdmap_s g_cmdmap[] =
 | 
				
			||||||
  { "xd",       cmd_xd,       3, 3, "<hex-address> <byte-count>" },
 | 
					  { "xd",       cmd_xd,       3, 3, "<hex-address> <byte-count>" },
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#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)
 | 
					#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
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
 | 
					#if defined(CONFIG_APPLICATION_SENSOR_PM1_0_PS5308) && !defined(CONFIG_NSH_DISABLE_PM1_0PS5308)
 | 
				
			||||||
| 
						 | 
					@ -589,7 +605,7 @@ static const struct cmdmap_s g_cmdmap[] =
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(CONFIG_APPLICATION_SENSOR_PM2_5_PS5308) && !defined(CONFIG_NSH_DISABLE_PM2_5PS5308)
 | 
					#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
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(CONFIG_APPLICATION_SENSOR_PM10_PS5308) && !defined(CONFIG_NSH_DISABLE_PM10PS5308)
 | 
					#if defined(CONFIG_APPLICATION_SENSOR_PM10_PS5308) && !defined(CONFIG_NSH_DISABLE_PM10PS5308)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue