stm32f4discovery: Add support to APDS9960

This commit is contained in:
Alan Carvalho de Assis 2022-07-24 16:30:19 -03:00 committed by Xiang Xiao
parent bee9dcc73a
commit 9a08b04d3f
2 changed files with 22 additions and 0 deletions

View File

@ -439,6 +439,13 @@
#define BOARD_ZEROCROSS_GPIO \
(GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTD|GPIO_PIN0)
/* Pin for APDS-9960 sensor */
#define GPIO_APDS9960_INT \
(GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTE|GPIO_PIN0)
#define BOARD_APDS9960_GPIO_INT GPIO_APDS9960_INT
/* LIS3DSH */
#define GPIO_LIS3DSH_EXT0 \

View File

@ -54,6 +54,10 @@
# include <nuttx/usb/rndis.h>
#endif
#ifdef CONFIG_SENSORS_APDS9960
#include "stm32_apds9960.h"
#endif
#include "stm32f4discovery.h"
/* Conditional logic in stm32f4discovery.h will determine if certain features
@ -420,6 +424,17 @@ int stm32_bringup(void)
}
#endif
#ifdef CONFIG_SENSORS_APDS9960
/* Register the APDS-9960 gesture sensor */
ret = board_apds9960_initialize(0, 1);
if (ret < 0)
{
syslog(LOG_ERR, "ERROR: board_apds9960_initialize() failed: %d\n",
ret);
}
#endif
#ifdef CONFIG_RTC_DS1307
ret = stm32_ds1307_init();
if (ret < 0)