configs/nucleo-l432kc: Added Zero Cross sensor to nucleo-l432kc.

This commit is contained in:
Daniel P. Carvalho 2019-07-23 16:07:17 -06:00 committed by Gregory Nutt
parent 53e760d072
commit 752a7d249c
3 changed files with 31 additions and 0 deletions

View File

@ -80,6 +80,10 @@ ifeq ($(CONFIG_PWM),y)
CSRCS += stm32_pwm.c
endif
ifeq ($(CONFIG_SENSORS_ZEROCROSS),y)
CSRCS += stm32_zerocross.c
endif
ifeq ($(CONFIG_TIMER),y)
CSRCS += stm32_timer.c
endif

View File

@ -110,6 +110,10 @@
#define GPIO_INT1 (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN3)
/* ZERO CROSS pin definition */
#define GPIO_ZEROCROSS (GPIO_INPUT|GPIO_FLOAT|GPIO_PORTA|GPIO_PIN0)
/************************************************************************************
* Public Data
************************************************************************************/
@ -231,6 +235,18 @@ int stm32_ina226initialize(FAR const char *devpath);
int stm32_ina219initialize(FAR const char *devpath);
#endif
/****************************************************************************
* Name: stm32_zerocross_initialize
*
* Description:
* Initialize and register the zero cross driver
*
****************************************************************************/
#ifdef CONFIG_SENSORS_ZEROCROSS
int stm32_zerocross_initialize(void);
#endif
/****************************************************************************
* Name: board_timer_driver_initialize
*

View File

@ -274,6 +274,17 @@ int board_app_initialize(uintptr_t arg)
}
#endif
#ifdef CONFIG_SENSORS_ZEROCROSS
/* Configure the zero-crossing driver */
ret = stm32_zerocross_initialize();
if (ret < 0)
{
syslog(LOG_ERR, "Failed to initialize Zero-Cross, error %d\n", ret);
return ret;
}
#endif
#ifdef CONFIG_TIMER
/* Initialize and register the timer driver */