Merged in alinjerpelea/nuttx (pull request #1019)

Add the sensor initialization for cxd56xx boards in the common board folder

* boards: cxd56xx: apds9930: typo fix

    fix apds9930 typos

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* boards: cxd56xx: add cxd56_ak09912 initialization

    We are adding the sensor initialization for cxd56xx boards in the
    common board folder.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* boards: cxd56xx: move cxd56_bmi160 initialization

    We are adding the sensor initialization for cxd56xx boards in the
    common board folder.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* boards: cxd56xx: add cxd56_apds9930 initialization

    We are adding the sensor initialization for cxd56xx boards in the
    common board folder.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

* boards: cxd56xx: add cxd56_apds9960 initialization

    We are adding the sensor initialization for cxd56xx boards in the
    common board folder.

    Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Alin Jerpelea 2019-08-22 13:55:35 +00:00 committed by Gregory Nutt
parent a91d86523c
commit d6366c1e82
13 changed files with 648 additions and 8 deletions

View File

@ -32,6 +32,26 @@
#
############################################################################
ifeq ($(CONFIG_SENSORS_AK09912),y)
CSRCS += cxd56_ak09912_i2c.c
endif
ifeq ($(CONFIG_SENSORS_AK09912_SCU),y)
CSRCS += cxd56_ak09912_scu.c
endif
ifeq ($(CONFIG_SENSORS_APDS9930_SCU),y)
CSRCS += cxd56_apds9930_scu.c
endif
ifeq ($(CONFIG_SENSORS_APDS9960),y)
CSRCS += cxd56_apds9960_i2c.c
endif
ifeq ($(CONFIG_SENSORS_BMI160_I2C),y)
CSRCS += cxd56_bmi160_i2c.c
endif
DEPPATH += --dep-path src
VPATH += :src
CFLAGS += $(shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)src)

View File

@ -0,0 +1,79 @@
/****************************************************************************
* boards/arm/cxd56xx/spresense/src/cxd56_ak09912.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <nuttx/sensors/ak09912.h>
#include "cxd56_i2c.h"
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_AK09912)
int board_ak09912_initialize(FAR const char *devpath, int bus)
{
int ret;
FAR struct i2c_master_s *i2c;
sninfo("Initializing AK09912...\n");
/* Initialize i2c deivce */
i2c = cxd56_i2cbus_initialize(bus);
if (!i2c)
{
snerr("ERROR: Failed to initialize i2c%d.\n", bus);
return -ENODEV;
}
ret = ak09912_register(devpath, i2c);
if (ret < 0)
{
snerr("Error registering AK09912.\n");
}
return ret;
}
#endif

View File

@ -0,0 +1,99 @@
/****************************************************************************
* boards/arm/cxd56xx/spresense/src/cxd56_ak09912.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <nuttx/sensors/ak09912.h>
#include "cxd56_i2c.h"
#include <arch/chip/scu.h>
#ifdef CONFIG_CXD56_DECI_AK09912
# define MAG_NR_SEQS 3
#else
# define MAG_NR_SEQS 1
#endif
#ifdef CONFIG_SENSORS_AK09912_SCU
int board_ak09912_initialize(FAR const char *devpath, int bus)
{
int i;
int ret;
FAR struct i2c_master_s *i2c;
sninfo("Initializing AK09912...\n");
/* Initialize i2c deivce */
i2c = cxd56_i2cbus_initialize(bus);
if (!i2c)
{
snerr("ERROR: Failed to initialize i2c%d.\n", bus);
return -ENODEV;
}
ret = ak09912_init(i2c, bus);
if (ret < 0)
{
snerr("Error initialize AK09912.\n");
return ret;
}
for (i = 0; i < MAG_NR_SEQS; i++)
{
/* register deivce at I2C bus */
ret = ak09912_register(devpath, i, i2c, bus);
if (ret < 0)
{
snerr("Error registering AK09912.\n");
return ret;
}
}
return ret;
}
#endif

View File

@ -0,0 +1,95 @@
/****************************************************************************
* boards/arm/cxd56xx/common/src/cxd56_apds9930_scu.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <nuttx/sensors/apds9930.h>
#include <arch/chip/scu.h>
#include "cxd56_i2c.h"
#ifdef CONFIG_SENSORS_APDS9930_SCU
int board_apds9930_initialize(int bus)
{
int ret;
FAR struct i2c_master_s *i2c;
sninfo("Initializing APDS9930...\n");
/* Initialize i2c deivce */
i2c = cxd56_i2cbus_initialize(bus);
if (!i2c)
{
snerr("ERROR: Failed to initialize i2c%d.\n", bus);
return -ENODEV;
}
ret = apds9930_init(i2c, bus);
if (ret < 0)
{
snerr("Error initialize APDS9930.\n");
return ret;
}
/* Register devices for each FIFOs at I2C bus */
ret = apds9930als_register("/dev/light", 0, i2c, bus);
if (ret < 0)
{
snerr("Error registering APDS9930[ALS].\n");
return ret;
}
ret = apds9930ps_register("/dev/proximity", 0, i2c, bus);
if (ret < 0)
{
snerr("Error registering APDS9930[PS].\n");
return ret;
}
return ret;
}
#endif /* CONFIG_SENSORS_APDS9930_SCU */

View File

@ -0,0 +1,89 @@
/****************************************************************************
* boards/arm/cxd56xx/common/src/cxd56_apds9960_i2c.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <stdio.h>
#include <debug.h>
#include <errno.h>
#include <nuttx/board.h>
#include <nuttx/sensors/apds9960.h>
#include "cxd56_i2c.h"
#if defined(CONFIG_CXD56_I2C) && defined(CONFIG_APDS9960)
int board_apds9960_initialize(FAR const char *devpath, int bus)
{
int ret;
FAR struct i2c_master_s *i2c;
sninfo("Initializing APDS9960...\n");
/* Initialize i2c deivce */
i2c = cxd56_i2cbus_initialize(bus);
if (!i2c)
{
snerr("ERROR: Failed to initialize i2c%d.\n", bus);
return -ENODEV;
}
ret = apds9960_init(i2c, bus);
if (ret < 0)
{
snerr("Error initialize APDS9960.\n");
return ret;
}
/* Register devices for each FIFOs at I2C bus */
ret = apds9960_register(devpath, i2c, bus);
if (ret < 0)
{
snerr("Error registering APDS9960.\n");
return ret;
}
return ret;
}
#endif /* CONFIG_CXD56_I2C && CONFIG_APDS9960 */

View File

@ -1,5 +1,5 @@
/****************************************************************************
* boards/arm/cxd56xx/spresense/src/cxd56_bmi160_i2c.c
* boards/arm/cxd56xx/common/src/cxd56_bmi160_i2c.c
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*

View File

@ -53,7 +53,7 @@
#include <nuttx/irq.h>
#include <arch/chip/scu.h>
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_APDS9930_SKU)
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_APDS9930_SCU)
/****************************************************************************
* Pre-processor Definitions

View File

@ -52,11 +52,15 @@
#include "cxd56_charger.h"
#include "cxd56_gs2200m.h"
#include "cxd56_i2cdev.h"
#include "cxd56_bmi160.h"
#include "cxd56_sdcard.h"
#include "cxd56_wdt.h"
#include "cxd56_gpioif.h"
#include "cxd56_ak09912.h"
#include "cxd56_apds9930.h"
#include "cxd56_apds9960.h"
#include "cxd56_bmi160.h"
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

View File

@ -0,0 +1,86 @@
/****************************************************************************
* boards/arm/cxd56xx/spresense/include/cxd56_ak09912.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_AK09912_H
#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_AK09912_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_ak09912_initialize
*
* Description:
* Initialize AK09912 i2c driver and register the AK09912 device.
*
****************************************************************************/
#if defined (CONFIG_SENSORS_AK09912) || defined (CONFIG_SENSORS_AK09912_SCU)
int board_ak09912_initialize(FAR const char *devpath, int bus);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_AK09912_H */

View File

@ -0,0 +1,86 @@
/****************************************************************************
* boards/arm/cxd56xx/spresense/include/cxd56_apds9930.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_APDS9930_H
#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_APDS9930_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_apds9930_initialize
*
* Description:
* Initialize APDS9930 i2c driver and register the APDS9930 device.
*
****************************************************************************/
#if defined(CONFIG_SENSORS_APDS9930) || defined(CONFIG_SENSORS_APDS9930_SCU)
int board_apds9930_initialize(int bus);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_APDS9930_H */

View File

@ -0,0 +1,86 @@
/****************************************************************************
* boards/arm/cxd56xx/spresense/include/cxd56_apds9960.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_APDS9960_H
#define __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_APDS9960_H
/****************************************************************************
* Included Files
****************************************************************************/
#include <nuttx/config.h>
/****************************************************************************
* Public Types
****************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************
* Public Data
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C"
{
#else
#define EXTERN extern
#endif
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
/****************************************************************************
* Name: board_apds9960_initialize
*
* Description:
* Initialize APDS9960 i2c driver and register the APDS9960 device.
*
****************************************************************************/
#if defined(CONFIG_SENSORS_APDS9960) || defined(CONFIG_SENSORS_APDS9960_SCU)
int board_apds9960_initialize(FAR const char *devpath, int bus);
#endif
#undef EXTERN
#if defined(__cplusplus)
}
#endif
#endif /* __ASSEMBLY__ */
#endif /* __BOARDS_ARM_CXD56XX_SPRESENSE_INCLUDE_CXD56_APDS9960_H */

View File

@ -110,10 +110,6 @@ ifeq ($(CONFIG_WL_GS2200M),y)
CSRCS += cxd56_gs2200m.c
endif
ifeq ($(CONFIG_SENSORS_BMI160_I2C),y)
CSRCS += cxd56_bmi160_i2c.c
endif
ifeq ($(CONFIG_CXD56_I2C_DRIVER),y)
CSRCS += cxd56_i2cdev.c
endif

View File

@ -38,7 +38,7 @@
#include <nuttx/config.h>
#if defined(CONFIG_I2C) && (defined(SENSORS_CONFIG_APDS9930) || defined(SENSORS_CONFIG_APDS9930_SCU))
#if defined(CONFIG_I2C) && (defined(CONFIG_SENSORS_APDS9930) || defined(CONFIG_SENSORS_APDS9930_SCU))
/****************************************************************************
* Pre-processor Definitions