stm32: moved all remaining sensor initialization to common board logic
This commit is contained in:
parent
05e005c58e
commit
5fd9bd5837
80
boards/arm/stm32/common/include/stm32_bh1750.h
Normal file
80
boards/arm/stm32/common/include/stm32_bh1750.h
Normal file
@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
* /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_bh1750.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_BH1750_H
|
||||
#define __STM32_BH1750_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_bh1750_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the MPL115A Pressure Sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/lightN
|
||||
* busno - The I2C bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_bh1750_initialize(int devno, int busno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_BH1750_H
|
81
boards/arm/stm32/common/include/stm32_dhtxx.h
Normal file
81
boards/arm/stm32/common/include/stm32_dhtxx.h
Normal file
@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
* /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_dhtxx.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_DHTXX_H
|
||||
#define __STM32_DHTXX_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_dhtxx_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the DHTxx sensor.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/humN.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) returned on success;
|
||||
* a negated errno value is returned on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_dhtxx_initialize(int devno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_DHTXX_H
|
80
boards/arm/stm32/common/include/stm32_l3gd20.h
Normal file
80
boards/arm/stm32/common/include/stm32_l3gd20.h
Normal file
@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
* /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_l3gd20.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_L3GD20_H
|
||||
#define __STM32_L3GD20_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_l3gd20_initialize()
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the L3GD20 3 axis gyroscope sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/gyroN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_l3gd20_initialize(int devno, int busno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_L3GD20_H
|
80
boards/arm/stm32/common/include/stm32_lis3dsh.h
Normal file
80
boards/arm/stm32/common/include/stm32_lis3dsh.h
Normal file
@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/common/include/stm32_lis3dsh.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_LIS3DSH_H
|
||||
#define __STM32_LIS3DSH_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_lis3dsh_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the LIS3DSH 3-axis accelerometer.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/accN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_lis3dsh_initialize(int devno, int busno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_LIS3DSH_H
|
80
boards/arm/stm32/common/include/stm32_max31855.h
Normal file
80
boards/arm/stm32/common/include/stm32_max31855.h
Normal file
@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/common/include/stm32_max31855.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_MAX31855_H
|
||||
#define __STM32_MAX31855_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_max31855_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the MAX31855 Temperature Sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/tempN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_max31855_initialize(int devno, int busno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_MAX31855_H
|
80
boards/arm/stm32/common/include/stm32_mlx90614.h
Normal file
80
boards/arm/stm32/common/include/stm32_mlx90614.h
Normal file
@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/common/include/stm32_mlx90614.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_MLX90614_H
|
||||
#define __STM32_MLX90614_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_mlx90614_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the MLX90614 Infrared Thermometer.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/thermN
|
||||
* busno - The I2C bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_mlx90614_initialize(int devno, int busno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_MLX90614_H
|
80
boards/arm/stm32/common/include/stm32_mpl115a.h
Normal file
80
boards/arm/stm32/common/include/stm32_mpl115a.h
Normal file
@ -0,0 +1,80 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/common/include/stm32_mpl115a.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_MPL115A_H
|
||||
#define __STM32_MPL115A_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_mpl115a_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the MPL115A Pressure Sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/pressN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_mpl115a_initialize(int devno, int busno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_MPL115A_H
|
81
boards/arm/stm32/common/include/stm32_xen1210.h
Normal file
81
boards/arm/stm32/common/include/stm32_xen1210.h
Normal file
@ -0,0 +1,81 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/common/include/stm32_xen1210.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __STM32_XEN1210_H
|
||||
#define __STM32_XEN1210_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: xen1210_archinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the XEN1210 device driver
|
||||
*
|
||||
* Input Parameters:
|
||||
* devno - The device number, used to build the device path as /dev/accelN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
* returned to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_xen1210_initialize(int devno, int busno);
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // __STM32_XEN1210_H
|
@ -74,6 +74,38 @@ ifeq ($(CONFIG_SENSORS_INA219),y)
|
||||
CSRCS += stm32_ina219.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_L3GD20),y)
|
||||
CSRCS += stm32_l3gd20.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_MPL115A),y)
|
||||
CSRCS += stm32_mpl115a.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_DHTXX),y)
|
||||
CSRCS += stm32_dhtxx.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_XEN1210),y)
|
||||
CSRCS += stm32_xen1210.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_BH1750FVI),y)
|
||||
CSRCS += stm32_bh1750.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_MLX90614),y)
|
||||
CSRCS += stm32_mlx90614.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_MAX31855),y)
|
||||
CSRCS += stm32_max31855.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIS3DSH),y)
|
||||
CSRCS += stm32_lis3dsh.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)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/stm32f4discovery/src/stm32_bh1750fvi.c
|
||||
* boards/arm/stm32/common/src/stm32_bh1750fvi.c
|
||||
*
|
||||
* Copyright (C) 2016 Alan Carvalho de Assis. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
@ -41,22 +41,19 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <arch/board/board.h>
|
||||
#include <nuttx/sensors/bh1750fvi.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_i2c.h"
|
||||
#include "stm32f4discovery.h"
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BH1750FVI)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define BH1750FVI_I2C_PORTNO 1 /* On I2C1 */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -68,14 +65,15 @@
|
||||
* Initialize and register the MPL115A Pressure Sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/light0"
|
||||
* devno - The device number, used to build the device path as /dev/lightN
|
||||
* busno - The I2C bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_bh1750initialize(FAR const char *devpath)
|
||||
int board_bh1750_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
int ret;
|
||||
@ -84,7 +82,7 @@ int stm32_bh1750initialize(FAR const char *devpath)
|
||||
|
||||
/* Initialize I2C */
|
||||
|
||||
i2c = stm32_i2cbus_initialize(BH1750FVI_I2C_PORTNO);
|
||||
i2c = stm32_i2cbus_initialize(busno);
|
||||
|
||||
if (!i2c)
|
||||
{
|
||||
@ -102,4 +100,3 @@ int stm32_bh1750initialize(FAR const char *devpath)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSORS_BH1750FVI && CONFIG_STM32_I2C1 */
|
@ -29,8 +29,6 @@
|
||||
#include <stdio.h>
|
||||
#include "stm32_i2c.h"
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_BMP180)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@ -103,4 +101,3 @@ int board_bmp180_initialize(int devno, int busno)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -43,24 +43,19 @@
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/sensors/dhtxx.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_freerun.h"
|
||||
#include "olimex-stm32-p407.h"
|
||||
|
||||
#if defined(CONFIG_SENSORS_DHTXX)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Use TIM1 as free running timer for the DHTXX sensor. */
|
||||
|
||||
#define DHTXX_FREE_TIMER 1
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
@ -94,22 +89,22 @@ static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, bool mode)
|
||||
{
|
||||
if (mode)
|
||||
{
|
||||
stm32_configgpio(GPIO_DHTXX_PIN_INPUT);
|
||||
stm32_configgpio(BOARD_DHTXX_GPIO_INPUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
stm32_configgpio(GPIO_DHTXX_PIN_OUTPUT);
|
||||
stm32_configgpio(BOARD_DHTXX_GPIO_OUTPUT);
|
||||
}
|
||||
}
|
||||
|
||||
static void dhtxx_set_data_pin(FAR struct dhtxx_config_s *state, bool value)
|
||||
{
|
||||
stm32_gpiowrite(GPIO_DHTXX_PIN_OUTPUT, value);
|
||||
stm32_gpiowrite(BOARD_DHTXX_GPIO_OUTPUT, value);
|
||||
}
|
||||
|
||||
static bool dhtxx_read_data_pin(FAR struct dhtxx_config_s *state)
|
||||
{
|
||||
return stm32_gpioread(GPIO_DHTXX_PIN_INPUT);
|
||||
return stm32_gpioread(BOARD_DHTXX_GPIO_INPUT);
|
||||
}
|
||||
|
||||
static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state)
|
||||
@ -128,15 +123,14 @@ static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_dhtxx_initialize
|
||||
* Name: board_dhtxx_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the DHTxx sensor. This function will register the driver
|
||||
* with the name passed at *devpath.
|
||||
* configure the DHTxx sensor.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The device name to register.
|
||||
* devno - The device number, used to build the device path as /dev/humN.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) returned on success;
|
||||
@ -144,23 +138,25 @@ static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_dhtxx_initialize(FAR const char *devpath)
|
||||
int board_dhtxx_initialize(int devno)
|
||||
{
|
||||
int ret;
|
||||
char devpath[12];
|
||||
|
||||
stm32_configgpio(GPIO_DHTXX_PIN);
|
||||
stm32_configgpio(BOARD_DHTXX_GPIO_OUTPUT);
|
||||
|
||||
stm32_gpiowrite(GPIO_DHTXX_PIN, false);
|
||||
stm32_gpiowrite(BOARD_DHTXX_GPIO_OUTPUT, false);
|
||||
|
||||
/* Initialize the free-running timer with 1uS resolution */
|
||||
|
||||
ret = stm32_freerun_initialize(&g_freerun, DHTXX_FREE_TIMER, 1);
|
||||
ret = stm32_freerun_initialize(&g_freerun, BOARD_DHTXX_FRTIMER, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
snerr("Failed to initialize the free running timer! Err = %d\n", ret);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
snprintf(devpath, 12, "/dev/hum%d", devno);
|
||||
ret = dhtxx_register(devpath, &g_dhtxx_config);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -169,5 +165,3 @@ int stm32_dhtxx_initialize(FAR const char *devpath)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SENSORS_DHTXX */
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/stm32f429i-disco/src/stm32_l3gd20.c
|
||||
* boards/arm/stm32/common/src/stm32_l3gd20.c
|
||||
*
|
||||
* Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
* Author: Mateusz Szafoni <raiden00@railab.me>
|
||||
@ -41,20 +41,19 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/sensors/l3gd20.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_spi.h"
|
||||
#include "stm32f429i-disco.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_SPI) & defined(CONFIG_SENSORS_L3GD20)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
@ -70,7 +69,7 @@ static int l3gd20_attach(FAR struct l3gd20_config_s * cfg, xcpt_t irq);
|
||||
static struct l3gd20_config_s g_l3gd20_config =
|
||||
{
|
||||
.attach = l3gd20_attach,
|
||||
.irq = L3GD20_IRQ,
|
||||
.irq = BOARD_L3GD20_IRQ,
|
||||
.spi_devid = SPIDEV_ACCELEROMETER(0)
|
||||
};
|
||||
|
||||
@ -87,7 +86,8 @@ static struct l3gd20_config_s g_l3gd20_config =
|
||||
|
||||
static int l3gd20_attach(FAR struct l3gd20_config_s *cfg, xcpt_t irq)
|
||||
{
|
||||
return stm32_gpiosetevent(GPIO_L3GD20_DREADY, true, false, true, irq, NULL);
|
||||
return stm32_gpiosetevent(BOARD_L3GD20_GPIO_DREADY, true, false,
|
||||
true, irq, NULL);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -95,31 +95,33 @@ static int l3gd20_attach(FAR struct l3gd20_config_s *cfg, xcpt_t irq)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_l3gd20initialize()
|
||||
* Name: board_l3gd20_initialize()
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the L3GD20 3 axis gyroscope sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/gyro0"
|
||||
* devno - The device number, used to build the device path as /dev/gyroN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_l3gd20initialize(FAR const char *devpath)
|
||||
int board_l3gd20_initialize(int devno, int busno)
|
||||
{
|
||||
int ret = 0;
|
||||
struct spi_dev_s *spi;
|
||||
char devpath[12];
|
||||
|
||||
/* Configure DREADY IRQ input */
|
||||
|
||||
stm32_configgpio(GPIO_L3GD20_DREADY);
|
||||
stm32_configgpio(BOARD_L3GD20_GPIO_DREADY);
|
||||
|
||||
/* Initialize SPI */
|
||||
|
||||
spi = stm32_spi5initialize();
|
||||
spi = stm32_spibus_initialize(busno);
|
||||
|
||||
if (!spi)
|
||||
{
|
||||
@ -129,6 +131,7 @@ int stm32_l3gd20initialize(FAR const char *devpath)
|
||||
|
||||
/* Then register the gyro */
|
||||
|
||||
snprintf(devpath, 12, "/dev/gyro%d", devno);
|
||||
ret = l3gd20_register(devpath, spi, &g_l3gd20_config);
|
||||
if (ret != OK)
|
||||
{
|
||||
@ -138,5 +141,3 @@ int stm32_l3gd20initialize(FAR const char *devpath)
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SPI && CONFIG_SENSORS_L3GD20 */
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/stm32f4discovery/src/stm32_lis3dsh.c
|
||||
* boards/arm/stm32/common/src/stm32_lis3dsh.c
|
||||
*
|
||||
* Copyright (C) 2017 Florian Olbrich. All rights reserved.
|
||||
* Author: Florian Olbrich <flox@posteo.de>
|
||||
@ -41,22 +41,18 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/sensors/lis3dsh.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32f4discovery.h"
|
||||
|
||||
#if defined(CONFIG_STM32F4DISCO_LIS3DSH) && defined(CONFIG_LIS3DSH)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define GPIO_STM32F4DISCO_LIS3DSH_EXT0 \
|
||||
(GPIO_INPUT|GPIO_FLOAT|GPIO_AF0|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
@ -78,14 +74,11 @@
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
int attach_disc_lis3dsh(FAR struct lis3dsh_config_s *config, xcpt_t interrupt_handler)
|
||||
int attach_disc_lis3dsh(FAR struct lis3dsh_config_s *config,
|
||||
xcpt_t interrupt_handler)
|
||||
{
|
||||
return stm32_gpiosetevent(GPIO_STM32F4DISCO_LIS3DSH_EXT0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
interrupt_handler,
|
||||
NULL );
|
||||
return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false,
|
||||
interrupt_handler, NULL);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@ -93,29 +86,31 @@ int attach_disc_lis3dsh(FAR struct lis3dsh_config_s *config, xcpt_t interrupt_ha
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_lis3dshinitialize
|
||||
* Name: board_lis3dsh_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the LIS3DSH 3-axis accelerometer.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/acc0"
|
||||
* devno - The device number, used to build the device path as /dev/accN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_lis3dshinitialize(FAR const char *devpath)
|
||||
int board_lis3dsh_initialize(int devno, int busno)
|
||||
{
|
||||
static struct lis3dsh_config_s acc0_config;
|
||||
char devpath[12];
|
||||
struct spi_dev_s *spi;
|
||||
int ret;
|
||||
|
||||
sninfo("Initializing LIS3DSH\n");
|
||||
|
||||
acc0_config.irq=22;
|
||||
acc0_config.spi_devid=0;
|
||||
acc0_config.irq = 22;
|
||||
acc0_config.spi_devid = 0;
|
||||
acc0_config.attach = &attach_disc_lis3dsh;
|
||||
|
||||
spi = stm32_spibus_initialize(1);
|
||||
@ -126,10 +121,10 @@ int stm32_lis3dshinitialize(FAR const char *devpath)
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(devpath, 12, "/dev/acc%d", devno);
|
||||
ret = lis3dsh_register(devpath, spi, &acc0_config);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_STM32F4DISCO_LIS3DSH && CONFIG_LIS3DSH */
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/stm32f4discovery/src/stm32_max31855.c
|
||||
* boards/arm/stm32/common/src/stm32_max31855.c
|
||||
*
|
||||
* Copyright (C) 2015 Alan Carvalho de Assis. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
@ -41,42 +41,41 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <arch/board/board.h>
|
||||
#include <nuttx/sensors/max31855.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_spi.h"
|
||||
#include "stm32f4discovery.h"
|
||||
|
||||
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_MAX31855) && defined(CONFIG_STM32_SPI2)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_max31855initialize
|
||||
* Name: board_max31855_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the MAX31855 Temperature Sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/temp0"
|
||||
* bus - Bus number (for hardware that has multiple SPI interfaces)
|
||||
* devid - ID associated to the device. E.g., 0, 1, 2, etc.
|
||||
* devno - The device number, used to build the device path as /dev/tempN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_max31855initialize(FAR const char *devpath, int bus, uint16_t devid)
|
||||
int board_max31855_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
spi = stm32_spibus_initialize(bus);
|
||||
spi = stm32_spibus_initialize(busno);
|
||||
|
||||
if (!spi)
|
||||
{
|
||||
@ -85,7 +84,8 @@ int stm32_max31855initialize(FAR const char *devpath, int bus, uint16_t devid)
|
||||
|
||||
/* Then register the barometer sensor */
|
||||
|
||||
ret = max31855_register(devpath, spi, devid);
|
||||
snprintf(devpath, 12, "/dev/temp%d", devno);
|
||||
ret = max31855_register(devpath, spi, devno);
|
||||
if (ret < 0)
|
||||
{
|
||||
snerr("ERROR: Error registering MAX31855\n");
|
||||
@ -93,5 +93,3 @@ int stm32_max31855initialize(FAR const char *devpath, int bus, uint16_t devid)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SPI && CONFIG_SENSORS_MAX31855 */
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/stm32f4discovery/src/stm32_mlx90614.c
|
||||
* boards/arm/stm32/common/src/stm32_mlx90614.c
|
||||
*
|
||||
* Copyright (C) 2016 Alan Carvalho de Assis. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
@ -41,22 +41,18 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/i2c/i2c_master.h>
|
||||
#include <nuttx/sensors/mlx90614.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_i2c.h"
|
||||
#include "stm32f4discovery.h"
|
||||
|
||||
#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_MLX90614)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define MLX90614_I2C_PORTNO 1 /* On I2C1 */
|
||||
|
||||
#define MLX90614_ADDRESS 0x5a /* Default I2C Address, can be chanced in EEPROM */
|
||||
|
||||
/****************************************************************************
|
||||
@ -64,29 +60,31 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_mlx90614init
|
||||
* Name: board_mlx90614_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the MLX90614 Infrared Thermometer.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/therm0"
|
||||
* devno - The device number, used to build the device path as /dev/thermN
|
||||
* busno - The I2C bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_mlx90614init(FAR const char *devpath)
|
||||
int board_mlx90614_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct i2c_master_s *i2c;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
sninfo("Initializing MLX90614!\n");
|
||||
|
||||
/* Initialize I2C */
|
||||
|
||||
i2c = stm32_i2cbus_initialize(MLX90614_I2C_PORTNO);
|
||||
i2c = stm32_i2cbus_initialize(busno);
|
||||
|
||||
if (!i2c)
|
||||
{
|
||||
@ -95,6 +93,7 @@ int stm32_mlx90614init(FAR const char *devpath)
|
||||
|
||||
/* Then register the light sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/therm%d", devno);
|
||||
ret = mlx90614_register(devpath, i2c, MLX90614_ADDRESS);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -103,5 +102,3 @@ int stm32_mlx90614init(FAR const char *devpath)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_I2C && CONFIG_SENSORS_MLX90614 && CONFIG_STM32_I2C1 */
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/viewtool-stm32f107/src/stm32_mpl115a.c
|
||||
* boards/arm/stm32/common/src/stm32_mpl115a.c
|
||||
*
|
||||
* Copyright (C) 2015 Alan Carvalho de Assis. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
@ -41,46 +41,44 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/sensors/mpl115a.h>
|
||||
|
||||
#include "stm32.h"
|
||||
#include "stm32_spi.h"
|
||||
#include "viewtool_stm32f107.h"
|
||||
|
||||
#if defined(CONFIG_SPI) && defined(CONFIG_SENSORS_MPL115A) && defined(CONFIG_STM32_SPI3)
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#define MPL115A_SPI_PORTNO 3 /* On SPI3 */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_mpl115ainitialize
|
||||
* Name: board_mpl115a_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the MPL115A Pressure Sensor driver.
|
||||
*
|
||||
* Input Parameters:
|
||||
* devpath - The full path to the driver to register. E.g., "/dev/press0"
|
||||
* devno - The device number, used to build the device path as /dev/pressN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int stm32_mpl115ainitialize(FAR const char *devpath)
|
||||
int board_mpl115a_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *spi;
|
||||
char devpath[12];
|
||||
int ret;
|
||||
|
||||
spi = stm32_spibus_initialize(MPL115A_SPI_PORTNO);
|
||||
spi = stm32_spibus_initialize(busno);
|
||||
|
||||
if (!spi)
|
||||
{
|
||||
@ -89,6 +87,7 @@ int stm32_mpl115ainitialize(FAR const char *devpath)
|
||||
|
||||
/* Then register the barometer sensor */
|
||||
|
||||
snprintf(devpath, 12, "/dev/press%d", devno);
|
||||
ret = mpl115a_register(devpath, spi);
|
||||
if (ret < 0)
|
||||
{
|
||||
@ -97,5 +96,3 @@ int stm32_mpl115ainitialize(FAR const char *devpath)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SPI && CONFIG_SENSORS_MPL115A && CONFIG_STM32_SPI3 */
|
@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/stm32/stm32f4discovery/src/stm32_xen1210.c
|
||||
* boards/arm/stm32/common/src/stm32_xen1210.c
|
||||
*
|
||||
* Copyright (C) 2016 Gregory Nutt. All rights reserved.
|
||||
* Author: Alan Carvalho de Assis <acassis@gmail.com>
|
||||
@ -58,35 +58,9 @@
|
||||
#include "stm32_spi.h"
|
||||
#include "stm32_pwm.h"
|
||||
|
||||
#include "stm32f4discovery.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#ifdef CONFIG_SENSORS_XEN1210
|
||||
#ifndef CONFIG_STM32_SPI1
|
||||
# error "XEN1210 support requires CONFIG_STM32_SPI1"
|
||||
#endif
|
||||
|
||||
#define BOARD_XEN1210_SPIDEV 1
|
||||
|
||||
#ifndef BOARD_XEN1210_DEVMINOR
|
||||
# define BOARD_XEN1210_DEVMINOR 0
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_STM32_TIM1
|
||||
# error "XEN1210 needs PWM on TIM1 CH1 to be its clock!"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_STM32_TIM1_PWM
|
||||
# error "XEN1210 needs PWM on TIM1 CH1 to be its clock!"
|
||||
#endif
|
||||
|
||||
#if CONFIG_STM32_TIM1_CHANNEL != XEN1210_PWMCHANNEL
|
||||
# error "XEN1210 needs PWM on TIM1 CH1 to be its clock!"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
@ -154,7 +128,7 @@ static struct stm32_xen1210config_s g_xen1210config =
|
||||
|
||||
/* This is the XEN1210 Interrupt handler */
|
||||
|
||||
int xen1210_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int xen1210_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
/* Verify that we have a handler attached */
|
||||
|
||||
@ -209,15 +183,15 @@ static void xen1210_enable(FAR struct xen1210_config_s *state, bool enable)
|
||||
{
|
||||
/* Configure the interrupt using the SAVED handler */
|
||||
|
||||
stm32_configgpio(GPIO_XEN1210_INT);
|
||||
stm32_gpiosetevent(GPIO_XEN1210_INT, false, true,
|
||||
stm32_configgpio(BOARD_XEN1210_GPIO_INT);
|
||||
stm32_gpiosetevent(BOARD_XEN1210_GPIO_INT, false, true,
|
||||
true, xen1210_interrupt, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Configure the interrupt with a NULL handler to disable it */
|
||||
|
||||
stm32_gpiosetevent(GPIO_XEN1210_INT, false, false, false,
|
||||
stm32_gpiosetevent(BOARD_XEN1210_GPIO_INT, false, false, false,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
@ -242,7 +216,7 @@ static void xen1210_clear(FAR struct xen1210_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int xen1210_pwm_setup(void)
|
||||
static int xen1210_pwm_setup(void)
|
||||
{
|
||||
static bool initialized = false;
|
||||
struct pwm_lowerhalf_s *pwm;
|
||||
@ -254,7 +228,7 @@ int xen1210_pwm_setup(void)
|
||||
{
|
||||
/* Call stm32_pwminitialize() to get an instance of the PWM interface */
|
||||
|
||||
pwm = stm32_pwminitialize(XEN1210_PWMTIMER);
|
||||
pwm = stm32_pwminitialize(BOARD_XEN1210_PWMTIMER);
|
||||
if (!pwm)
|
||||
{
|
||||
_err("ERROR: Failed to get the STM32 PWM lower half\n");
|
||||
@ -283,13 +257,11 @@ int xen1210_pwm_setup(void)
|
||||
* Name: xen1210_archinitialize
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports an xen1210 device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the accelerometer device. This function will register the
|
||||
* driver as /dev/accelN where N is the minor device number.
|
||||
* Initialize the XEN1210 device driver
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
* devno - The device number, used to build the device path as /dev/accelN
|
||||
* busno - The SPI bus number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
@ -297,14 +269,11 @@ int xen1210_pwm_setup(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int xen1210_archinitialize(int minor)
|
||||
int board_xen1210_initialize(int devno, int busno)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
|
||||
sninfo("minor %d\n", minor);
|
||||
DEBUGASSERT(minor == 0);
|
||||
|
||||
/* Check if we are already initialized */
|
||||
|
||||
if (!g_xen1210config.handle)
|
||||
@ -319,14 +288,14 @@ int xen1210_archinitialize(int minor)
|
||||
|
||||
/* Configure the XEN1210 interrupt pin as an input */
|
||||
|
||||
stm32_configgpio(GPIO_XEN1210_INT);
|
||||
stm32_configgpio(BOARD_XEN1210_GPIO_INT);
|
||||
|
||||
/* Get an instance of the I2C interface */
|
||||
|
||||
dev = stm32_spibus_initialize(BOARD_XEN1210_SPIDEV);
|
||||
dev = stm32_spibus_initialize(busno);
|
||||
if (!dev)
|
||||
{
|
||||
snerr("ERROR: Failed to initialize SPI bus %d\n", BOARD_XEN1210_SPIDEV);
|
||||
snerr("ERROR: Failed to initialize SPI bus %d\n", busno);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
@ -342,7 +311,7 @@ int xen1210_archinitialize(int minor)
|
||||
|
||||
/* Initialize and register the XEN1210 driver */
|
||||
|
||||
ret = xen1210_register(g_xen1210config.handle, BOARD_XEN1210_DEVMINOR);
|
||||
ret = xen1210_register(g_xen1210config.handle, devno);
|
||||
if (ret < 0)
|
||||
{
|
||||
snerr("ERROR: Failed to register XEN1210 driver: %d\n", ret);
|
||||
@ -352,5 +321,3 @@ int xen1210_archinitialize(int minor)
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SENSORS_XEN1210 */
|
@ -327,4 +327,14 @@
|
||||
#define DMAMAP_USART6_RX DMAMAP_USART6_RX_1
|
||||
#define DMAMAP_USART6_TX DMAMAP_USART6_TX_1
|
||||
|
||||
/* DHTxx pin configuration */
|
||||
|
||||
#define GPIO_DHTXX_PIN (GPIO_PORTG|GPIO_PIN9)
|
||||
#define GPIO_DHTXX_PIN_OUTPUT (GPIO_OUTPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_DHTXX_PIN)
|
||||
#define GPIO_DHTXX_PIN_INPUT (GPIO_INPUT|GPIO_FLOAT|GPIO_DHTXX_PIN)
|
||||
|
||||
#define BOARD_DHTXX_GPIO_INPUT GPIO_DHTXX_PIN_INPUT
|
||||
#define BOARD_DHTXX_GPIO_OUTPUT GPIO_DHTXX_PIN_OUTPUT
|
||||
#define BOARD_DHTXX_FRTIMER 1 /* Free-run timer 1 */
|
||||
|
||||
#endif /* __BOARDS_ARM_STM32_OLIMEX_STM32_P407_INCLUDE_BOARD_H */
|
||||
|
@ -68,10 +68,6 @@ ifeq ($(CONFIG_CAN),y)
|
||||
CSRCS += stm32_can.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_DHTXX),y)
|
||||
CSRCS += stm32_dhtxx.c
|
||||
endif
|
||||
|
||||
DEPPATH += --dep-path board
|
||||
VPATH += :board
|
||||
CFLAGS += $(shell $(INCDIR) $(INCDIROPT) "$(CC)" $(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board)
|
||||
|
@ -169,12 +169,6 @@
|
||||
#define GPIO_BTN_DOWN (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN8)
|
||||
#define GPIO_BTN_CENTER (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTG|GPIO_PIN15)
|
||||
|
||||
/* DHTxx pin configuration */
|
||||
|
||||
#define GPIO_DHTXX_PIN (GPIO_PORTG|GPIO_PIN9)
|
||||
#define GPIO_DHTXX_PIN_OUTPUT (GPIO_OUTPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_DHTXX_PIN)
|
||||
#define GPIO_DHTXX_PIN_INPUT (GPIO_INPUT|GPIO_FLOAT|GPIO_DHTXX_PIN)
|
||||
|
||||
/* USB OTG FS
|
||||
*
|
||||
* PA9 OTG_FS_VBUS VBUS sensing (also connected to the green LED)
|
||||
@ -295,17 +289,5 @@ int stm32_adc_setup(void);
|
||||
int stm32_can_setup(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_dhtxx_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to initialize the DHTxx sensor
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SENSORS_DHTXX
|
||||
int stm32_dhtxx_initialize(FAR const char *devpath);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_ARM_STM32_OLIMEX_STM32_P407_SRC_H */
|
||||
|
@ -65,6 +65,10 @@
|
||||
#include "stm32.h"
|
||||
#include "olimex-stm32-p407.h"
|
||||
|
||||
#ifdef CONFIG_SENSORS_DHTXX
|
||||
#include "stm32_dhtxx.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
@ -201,7 +205,7 @@ int stm32_bringup(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_DHTXX
|
||||
ret = stm32_dhtxx_initialize("/dev/dht0");
|
||||
ret = board_dhtxx_initialize(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_dhtxx_initialize() failed: %d\n", ret);
|
||||
|
@ -458,6 +458,19 @@
|
||||
|
||||
#endif /* CONFIG_STM32_LTDC */
|
||||
|
||||
/* L3GD20 MEMS */
|
||||
|
||||
#define GPIO_L3GD20_DREADY (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTA|GPIO_PIN2)
|
||||
#define L3GD20_IRQ (2 + STM32_IRQ_EXTI0)
|
||||
|
||||
#define BOARD_L3GD20_GPIO_DREADY GPIO_L3GD20_DREADY
|
||||
#define BOARD_L3GD20_IRQ L3GD20_IRQ
|
||||
|
||||
#define GPIO_LIS3DSH_EXT0 \
|
||||
(GPIO_INPUT|GPIO_FLOAT|GPIO_AF0|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
|
||||
|
||||
#define BOARD_LIS3DSH_GPIO_EXT0 GPIO_LIS3DSH_EXT0
|
||||
|
||||
/* DMA ******************************************************************************/
|
||||
|
||||
#define ADC1_DMA_CHAN DMAMAP_ADC1_1
|
||||
|
@ -72,10 +72,6 @@ ifeq ($(CONFIG_STM32F429I_DISCO_ILI9341),y)
|
||||
CSRCS += stm32_ili93414ws.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_L3GD20),y)
|
||||
CSRCS += stm32_l3gd20.c
|
||||
endif
|
||||
|
||||
ifeq ($(and \
|
||||
$(CONFIG_STM32F429I_DISCO_ILI9341_LCDIFACE), \
|
||||
$(CONFIG_STM32F429I_DISCO_ILI9341_FBIFACE), \
|
||||
|
@ -81,6 +81,10 @@
|
||||
#include "stm32.h"
|
||||
#include "stm32f429i-disco.h"
|
||||
|
||||
#ifdef CONFIG_SENSORS_L3GD20
|
||||
#include "stm32_l3gd20.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -358,7 +362,7 @@ int stm32_bringup(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_L3GD20
|
||||
ret = stm32_l3gd20initialize("/dev/gyr0");
|
||||
ret = board_l3gd20_initialize(0, 5);
|
||||
if (ret != OK)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize l3gd20 sensor: %d\n", ret);
|
||||
|
@ -163,11 +163,6 @@
|
||||
#define GPIO_CS_SST25 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
||||
GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN4)
|
||||
|
||||
/* L3GD20 MEMS */
|
||||
|
||||
#define GPIO_L3GD20_DREADY (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTA|GPIO_PIN2)
|
||||
#define L3GD20_IRQ (2 + STM32_IRQ_EXTI0)
|
||||
|
||||
/* USB OTG HS
|
||||
*
|
||||
* PA9 OTG_HS_VBUS VBUS sensing (also connected to the green LED)
|
||||
|
@ -55,6 +55,7 @@ config STM32F4DISCO_LIS3DSH
|
||||
depends on SPI
|
||||
depends on LIS3DSH
|
||||
default n
|
||||
select SENSORS_LIS3DSH
|
||||
---help---
|
||||
Select to create a LIS3DSH driver instance for the builtin accelerometer of
|
||||
STM32F4Discovery. Provides /dev/acc0 device file.
|
||||
|
@ -431,4 +431,25 @@
|
||||
#define BOARD_ZEROCROSS_GPIO \
|
||||
(GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|GPIO_PORTD|GPIO_PIN0)
|
||||
|
||||
/* LIS3DSH */
|
||||
|
||||
#define GPIO_LIS3DSH_EXT0 \
|
||||
(GPIO_INPUT|GPIO_FLOAT|GPIO_AF0|GPIO_SPEED_50MHz|GPIO_PORTE|GPIO_PIN0)
|
||||
|
||||
#define BOARD_LIS3DSH_GPIO_EXT0 GPIO_LIS3DSH_EXT0
|
||||
|
||||
/* XEN1210 magnetic sensor */
|
||||
|
||||
#define GPIO_XEN1210_INT (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|\
|
||||
GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN5)
|
||||
|
||||
#define GPIO_CS_XEN1210 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
||||
GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4)
|
||||
|
||||
#define BOARD_XEN1210_GPIO_INT GPIO_XEN1210_INT
|
||||
|
||||
/* Define what timer to use as XEN1210 CLK (will use channel 1) */
|
||||
|
||||
#define BOARD_XEN1210_PWMTIMER 1
|
||||
|
||||
#endif /* __BOARDS_ARM_STM32_STM32F4DISCOVERY_INCLUDE_BOARD_H */
|
||||
|
@ -65,14 +65,6 @@ ifeq ($(CONFIG_STM32_OTGFS),y)
|
||||
CSRCS += stm32_usb.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_BH1750FVI),y)
|
||||
CSRCS += stm32_bh1750fvi.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_MLX90614),y)
|
||||
CSRCS += stm32_mlx90614.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_ST7567),y)
|
||||
CSRCS += stm32_st7567.c
|
||||
endif
|
||||
@ -85,14 +77,6 @@ ifeq ($(CONFIG_LPWAN_SX127X),y)
|
||||
CSRCS += stm32_sx127x.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_MAX31855),y)
|
||||
CSRCS += stm32_max31855.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_STM32F4DISCO_LIS3DSH),y)
|
||||
CSRCS += stm32_lis3dsh.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_MAX7219),y)
|
||||
CSRCS += stm32_max7219.c
|
||||
endif
|
||||
@ -129,10 +113,6 @@ ifeq ($(CONFIG_PWM),y)
|
||||
CSRCS += stm32_pwm.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_XEN1210),y)
|
||||
CSRCS += stm32_xen1210.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LIB_BOARDCTL),y)
|
||||
CSRCS += stm32_appinit.c
|
||||
ifeq ($(CONFIG_BOARDCTL_RESET),y)
|
||||
|
@ -102,6 +102,26 @@
|
||||
#include "board_qencoder.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_BH1750FVI
|
||||
#include "stm32_bh1750.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LIS3DSH
|
||||
#include "stm32_lis3dsh.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_MAX31855
|
||||
#include "stm32_max31855.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_MLX90614
|
||||
#include "stm32_mlx90614.h"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_XEN1210
|
||||
#include "stm32_xen1210.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@ -196,7 +216,7 @@ int stm32_bringup(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_BH1750FVI
|
||||
ret = stm32_bh1750initialize("/dev/light0");
|
||||
ret = board_bh1750_initialize(0, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_bh1750initialize() failed: %d\n", ret);
|
||||
@ -338,7 +358,7 @@ int stm32_bringup(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_MLX90614
|
||||
ret = stm32_mlx90614init("/dev/therm0");
|
||||
ret = board_mlx90614_initialize(0, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize MLX90614, error %d\n", ret);
|
||||
@ -415,7 +435,7 @@ int stm32_bringup(void)
|
||||
#ifdef CONFIG_SENSORS_MAX31855
|
||||
/* Register device 0 on spi channel 2 */
|
||||
|
||||
ret = stm32_max31855initialize("/dev/temp0", 2, 0);
|
||||
ret = board_max31855_initialize(0, 2);
|
||||
if (ret < 0)
|
||||
{
|
||||
serr("ERROR: stm32_max31855initialize failed: %d\n", ret);
|
||||
@ -451,19 +471,19 @@ int stm32_bringup(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_XEN1210
|
||||
ret = xen1210_archinitialize(0);
|
||||
ret = board_xen1210_initialize(0, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
serr("ERROR: xen1210_archinitialize failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_STM32F4DISCO_LIS3DSH
|
||||
#ifdef CONFIG_LIS3DSH
|
||||
/* Create a lis3dsh driver instance fitting the chip built into
|
||||
* stm32f4discovery
|
||||
*/
|
||||
|
||||
ret = stm32_lis3dshinitialize("/dev/acc0");
|
||||
ret = board_lis3dsh_initialize(0, 1);
|
||||
if (ret < 0)
|
||||
{
|
||||
serr("ERROR: Failed to initialize LIS3DSH driver: %d\n", ret);
|
||||
|
@ -52,11 +52,6 @@
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Define what timer and channel to use as XEN1210 CLK */
|
||||
|
||||
#define XEN1210_PWMTIMER 1
|
||||
#define XEN1210_PWMCHANNEL 1
|
||||
|
||||
/* How many SPI modules does this chip support? */
|
||||
|
||||
#if STM32_NSPI < 1
|
||||
@ -274,13 +269,6 @@
|
||||
#define GPIO_GS2200M_CS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
||||
GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN5)
|
||||
|
||||
/* XEN1210 magnetic sensor */
|
||||
|
||||
#define GPIO_XEN1210_INT (GPIO_INPUT|GPIO_FLOAT|GPIO_EXTI|\
|
||||
GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN5)
|
||||
|
||||
#define GPIO_CS_XEN1210 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
||||
GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4)
|
||||
|
||||
#define GPIO_ENC28J60_CS (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
||||
GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4)
|
||||
@ -466,19 +454,6 @@ FAR struct i2s_dev_s *stm32_i2sdev_initialize(int port);
|
||||
int stm32_bh1750initialize(FAR const char *devpath);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_lis3dshinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI 1, and to register LIS3DSH and its external
|
||||
* interrupt for the stm32f4discovery board.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STM32F4DISCO_LIS3DSH
|
||||
int stm32_lis3dshinitialize(FAR const char *devpath);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stm32_lpwaninitialize
|
||||
*
|
||||
|
@ -54,10 +54,6 @@ CSRCS += stm32_usbdev.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_MPL115A),y)
|
||||
CSRCS += stm32_mpl115a.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_INPUT_ADS7843E),y) # F103
|
||||
CSRCS += stm32_ads7843e.c
|
||||
endif
|
||||
|
@ -54,6 +54,10 @@
|
||||
|
||||
#include "viewtool_stm32f107.h"
|
||||
|
||||
#ifdef CONFIG_SENSORS_MPL115A
|
||||
#include "stm32_mpl115a.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
@ -186,7 +190,7 @@ int stm32_bringup(void)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SENSORS_MPL115A
|
||||
ret = stm32_mpl115ainitialize("/dev/press");
|
||||
ret = board_mpl115a_initialize(0, 5);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_mpl115ainitialize failed: %d\n", ret);
|
||||
|
@ -89,8 +89,10 @@ struct l3gd20_dev_s
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_INFO
|
||||
static void l3gd20_read_register(FAR struct l3gd20_dev_s *dev,
|
||||
uint8_t const reg_addr, uint8_t *reg_data);
|
||||
#endif
|
||||
static void l3gd20_write_register(FAR struct l3gd20_dev_s *dev,
|
||||
uint8_t const reg_addr,
|
||||
uint8_t const reg_data);
|
||||
@ -101,7 +103,8 @@ static void l3gd20_read_gyroscope_data(FAR struct l3gd20_dev_s *dev,
|
||||
uint16_t *z_gyr);
|
||||
static void l3gd20_read_temperature(FAR struct l3gd20_dev_s *dev,
|
||||
uint8_t * temperature);
|
||||
static int l3gd20_interrupt_handler(int irq, FAR void *context);
|
||||
static int l3gd20_interrupt_handler(int irq, FAR void *context,
|
||||
FAR void *arg);
|
||||
static void l3gd20_worker(FAR void *arg);
|
||||
|
||||
static int l3gd20_open(FAR struct file *filep);
|
||||
@ -138,6 +141,7 @@ static struct l3gd20_dev_s *g_l3gd20_list = NULL;
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_INFO
|
||||
/****************************************************************************
|
||||
* Name: l3gd20_read_register
|
||||
****************************************************************************/
|
||||
@ -171,6 +175,7 @@ static void l3gd20_read_register(FAR struct l3gd20_dev_s *dev,
|
||||
|
||||
SPI_LOCK(dev->spi, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: l3gd20_write_register
|
||||
@ -342,7 +347,8 @@ static void l3gd20_read_temperature(FAR struct l3gd20_dev_s *dev,
|
||||
* Name: l3gd20_interrupt_handler
|
||||
****************************************************************************/
|
||||
|
||||
static int l3gd20_interrupt_handler(int irq, FAR void *context)
|
||||
static int l3gd20_interrupt_handler(int irq, FAR void *context,
|
||||
FAR void *arg)
|
||||
{
|
||||
/* This function should be called upon a rising edge on the L3GD20 new data
|
||||
* interrupt pin since it signals that new data has been measured.
|
||||
|
@ -86,8 +86,11 @@ struct lis3dsh_dev_s
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_INFO
|
||||
static void lis3dsh_read_register(FAR struct lis3dsh_dev_s *dev,
|
||||
uint8_t const reg_addr, uint8_t *reg_data);
|
||||
#endif
|
||||
|
||||
static void lis3dsh_write_register(FAR struct lis3dsh_dev_s *dev,
|
||||
uint8_t const reg_addr,
|
||||
uint8_t const reg_data);
|
||||
@ -96,7 +99,8 @@ static void lis3dsh_read_measurement_data(FAR struct lis3dsh_dev_s *dev);
|
||||
static void lis3dsh_read_acclerometer_data(FAR struct lis3dsh_dev_s *dev,
|
||||
uint16_t *x_acc, uint16_t *y_acc,
|
||||
uint16_t *z_acc);
|
||||
static int lis3dsh_interrupt_handler(int irq, FAR void *context);
|
||||
static int lis3dsh_interrupt_handler(int irq, FAR void *context,
|
||||
FAR void *arg);
|
||||
static void lis3dsh_worker(FAR void *arg);
|
||||
|
||||
static int lis3dsh_open(FAR struct file *filep);
|
||||
@ -133,6 +137,7 @@ static struct lis3dsh_dev_s *g_lis3dsh_list = NULL;
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEBUG_SENSORS_INFO
|
||||
/****************************************************************************
|
||||
* Name: lis3dsh_read_register
|
||||
****************************************************************************/
|
||||
@ -166,6 +171,7 @@ static void lis3dsh_read_register(FAR struct lis3dsh_dev_s *dev,
|
||||
|
||||
SPI_LOCK(dev->spi, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lis3dsh_write_register
|
||||
@ -296,7 +302,8 @@ static void lis3dsh_read_acclerometer_data(FAR struct lis3dsh_dev_s *dev,
|
||||
* Name: lis3dsh_interrupt_handler
|
||||
****************************************************************************/
|
||||
|
||||
static int lis3dsh_interrupt_handler(int irq, FAR void *context)
|
||||
static int lis3dsh_interrupt_handler(int irq, FAR void *context,
|
||||
FAR void *arg)
|
||||
{
|
||||
/* This function should be called upon a rising edge on the LIS3DSH new data
|
||||
* interrupt pin since it signals that new data has been measured.
|
||||
@ -309,7 +316,7 @@ static int lis3dsh_interrupt_handler(int irq, FAR void *context)
|
||||
|
||||
for (priv = g_lis3dsh_list;
|
||||
priv && priv->config->irq != irq;
|
||||
priv = priv->flink);
|
||||
priv = priv->flink)
|
||||
{
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user