forked from xuos/xiuos
add as830 sensor and tvoc10 sensor support Nuttx
This commit is contained in:
@@ -34,6 +34,11 @@ config SENSOR_AS830
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
|
||||
4
APP_Framework/Framework/sensor/ch4/Make.defs
Normal file
4
APP_Framework/Framework/sensor/ch4/Make.defs
Normal file
@@ -0,0 +1,4 @@
|
||||
############################################################################
|
||||
# APP_Framework/Framework/sensor/ch4/Make.defs
|
||||
############################################################################
|
||||
include $(wildcard $(APPDIR)/../../../APP_Framework/Framework/sensor/ch4/*/Make.defs)
|
||||
6
APP_Framework/Framework/sensor/ch4/as830/Make.defs
Normal file
6
APP_Framework/Framework/sensor/ch4/as830/Make.defs
Normal file
@@ -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
|
||||
* @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)
|
||||
{
|
||||
int result = 0;
|
||||
@@ -64,6 +76,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @description: Read sensor device
|
||||
|
||||
@@ -34,6 +34,11 @@ config SENSOR_TB600B_TVOC10
|
||||
endif
|
||||
|
||||
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
|
||||
|
||||
|
||||
4
APP_Framework/Framework/sensor/tvoc/Make.defs
Normal file
4
APP_Framework/Framework/sensor/tvoc/Make.defs
Normal file
@@ -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
|
||||
* @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)
|
||||
{
|
||||
int result = 0;
|
||||
@@ -65,6 +77,7 @@ static int SensorDeviceOpen(struct SensorDevice *sdev)
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @description: Read sensor device
|
||||
|
||||
Reference in New Issue
Block a user