mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
Merge pull request #17697 from viktorbatista/drivers/lps22ch
driver/lpsxxx: adding lps22ch support
This commit is contained in:
commit
a3fc5c1d17
@ -88,7 +88,7 @@ ifneq (,$(filter tmp1075 lm75%,$(USEMODULE)))
|
|||||||
USEMODULE += lm75
|
USEMODULE += lm75
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(filter lps331ap lps2%hb lps22hh,$(USEMODULE)))
|
ifneq (,$(filter lps331ap lps2%,$(USEMODULE)))
|
||||||
USEMODULE += lpsxxx
|
USEMODULE += lpsxxx
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ extern "C" {
|
|||||||
#include "periph/i2c.h"
|
#include "periph/i2c.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @defgroup drivers_lpsxxx_config LPS331AP/LPS25HB/LPS22HB driver compile configuration
|
* @defgroup drivers_lpsxxx_config LPS331AP/LPS25HB/LPS22HB/LPS22HH/LPS22CH driver compile configuration
|
||||||
* @ingroup config_drivers_sensors
|
* @ingroup config_drivers_sensors
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
@ -81,7 +81,7 @@ typedef enum {
|
|||||||
LPSXXX_RATE_25HZ = 3, /**< sample with 25Hz, default */
|
LPSXXX_RATE_25HZ = 3, /**< sample with 25Hz, default */
|
||||||
LPSXXX_RATE_50HZ = 4, /**< sample with 50Hz */
|
LPSXXX_RATE_50HZ = 4, /**< sample with 50Hz */
|
||||||
LPSXXX_RATE_75HZ = 5 /**< sample with 75Hz */
|
LPSXXX_RATE_75HZ = 5 /**< sample with 75Hz */
|
||||||
#elif MODULE_LPS22HH
|
#elif MODULE_LPS22HH || MODULE_LPS22CH
|
||||||
LPSXXX_RATE_10HZ = 2, /**< sample with 10Hz */
|
LPSXXX_RATE_10HZ = 2, /**< sample with 10Hz */
|
||||||
LPSXXX_RATE_25HZ = 3, /**< sample with 25Hz, default */
|
LPSXXX_RATE_25HZ = 3, /**< sample with 25Hz, default */
|
||||||
LPSXXX_RATE_50HZ = 4, /**< sample with 50Hz */
|
LPSXXX_RATE_50HZ = 4, /**< sample with 50Hz */
|
||||||
@ -96,7 +96,7 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
#if MODULE_LPS331AP || MODULE_LPS25HB
|
#if MODULE_LPS331AP || MODULE_LPS25HB
|
||||||
#define LPSXXX_DEFAULT_RATE (LPSXXX_RATE_7HZ)
|
#define LPSXXX_DEFAULT_RATE (LPSXXX_RATE_7HZ)
|
||||||
#else /* MODULE_LPS22HB || MODULE_LPS22HH */
|
#else /* MODULE_LPS22HB || MODULE_LPS22HH || MODULE_LPS22CH */
|
||||||
#define LPSXXX_DEFAULT_RATE (LPSXXX_RATE_25HZ)
|
#define LPSXXX_DEFAULT_RATE (LPSXXX_RATE_25HZ)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ menuconfig MODULE_LPSXXX
|
|||||||
select MODULE_PERIPH_I2C
|
select MODULE_PERIPH_I2C
|
||||||
help
|
help
|
||||||
Device driver for the LPSXXX pressure sensor family
|
Device driver for the LPSXXX pressure sensor family
|
||||||
(LPS331AP/LPS25HB/LPS22HB/LPS22HH). Select a model.
|
(LPS331AP/LPS25HB/LPS22HB/LPS22HH/LPS22CH). Select a model.
|
||||||
|
|
||||||
if MODULE_LPSXXX
|
if MODULE_LPSXXX
|
||||||
|
|
||||||
@ -25,9 +25,10 @@ choice
|
|||||||
default MODULE_LPS22HB if HAVE_LPS22HB
|
default MODULE_LPS22HB if HAVE_LPS22HB
|
||||||
default MODULE_LPS22HH if HAVE_LPS22HH
|
default MODULE_LPS22HH if HAVE_LPS22HH
|
||||||
default MODULE_LPS25HB if HAVE_LPS25HB
|
default MODULE_LPS25HB if HAVE_LPS25HB
|
||||||
|
default MODULE_LPS22CH if HAVE_LPS22CH
|
||||||
help
|
help
|
||||||
Device driver for the LPSXXX pressure sensor family
|
Device driver for the LPSXXX pressure sensor family
|
||||||
(LPS331AP/LPS25HB/LPS22HB/LPS22HH). Select a model.
|
(LPS331AP/LPS25HB/LPS22HB/LPS22HH/LPS22CH). Select a model.
|
||||||
|
|
||||||
config MODULE_LPS331AP
|
config MODULE_LPS331AP
|
||||||
bool "LPS331AP"
|
bool "LPS331AP"
|
||||||
@ -41,6 +42,9 @@ config MODULE_LPS22HH
|
|||||||
config MODULE_LPS25HB
|
config MODULE_LPS25HB
|
||||||
bool "LPS25HB"
|
bool "LPS25HB"
|
||||||
|
|
||||||
|
config MODULE_LPS22CH
|
||||||
|
bool "LPS22CH"
|
||||||
|
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
endif # MODULE_LPSXXX
|
endif # MODULE_LPSXXX
|
||||||
@ -91,3 +95,9 @@ config HAVE_LPS25HB
|
|||||||
select HAVE_LPSXXX
|
select HAVE_LPSXXX
|
||||||
help
|
help
|
||||||
Indicates that a LPS25HB sensor is present.
|
Indicates that a LPS25HB sensor is present.
|
||||||
|
|
||||||
|
config HAVE_LPS22CH
|
||||||
|
bool
|
||||||
|
select HAVE_LPSXXX
|
||||||
|
help
|
||||||
|
Indicates that a LPS22CH sensor is present.
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# include variants of lpsxxx drivers as pseudo modules
|
# include variants of lpsxxx drivers as pseudo modules
|
||||||
PSEUDOMODULES += lps331ap
|
PSEUDOMODULES += lps331ap
|
||||||
|
PSEUDOMODULES += lps22ch
|
||||||
PSEUDOMODULES += lps22hb
|
PSEUDOMODULES += lps22hb
|
||||||
PSEUDOMODULES += lps22hh
|
PSEUDOMODULES += lps22hh
|
||||||
PSEUDOMODULES += lps25hb
|
PSEUDOMODULES += lps25hb
|
||||||
|
@ -168,10 +168,10 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define LPSXXX_WHO_AM_I (0xb1)
|
#define LPSXXX_WHO_AM_I (0xb1)
|
||||||
|
|
||||||
#elif MODULE_LPS22HH
|
#elif MODULE_LPS22HH || MODULE_LPS22CH
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name LPS22HH registers
|
* @name LPS22HH/LPS22CH registers
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define LPSXXX_REG_INT_CFG (0x0b)
|
#define LPSXXX_REG_INT_CFG (0x0b)
|
||||||
@ -198,7 +198,7 @@ extern "C" {
|
|||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name LPS22HH CTRL_REG1 bitfields
|
* @name LPS22HH/LPS22CH CTRL_REG1 bitfields
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define LPSXXX_CTRL_REG1_EN_LPFP (0x08)
|
#define LPSXXX_CTRL_REG1_EN_LPFP (0x08)
|
||||||
@ -207,18 +207,18 @@ extern "C" {
|
|||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name LPS22HH CTRL_REG2 bitfields
|
* @name LPS22HH/LPS22CH CTRL_REG2 bitfields
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
#define LPSXXX_CTRL_REG2_ID_ADD_INC (0x10)
|
#define LPSXXX_CTRL_REG2_ID_ADD_INC (0x10)
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief LPS22HH WHO_AM_I register value
|
* @brief LPS22HH/LPS22CH WHO_AM_I register value
|
||||||
*/
|
*/
|
||||||
#define LPSXXX_WHO_AM_I (0xb3)
|
#define LPSXXX_WHO_AM_I (0xb3)
|
||||||
|
|
||||||
#endif /* MODULE_LPS22HH */
|
#endif /* MODULE_LPS22HH/LPS22CH */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,8 @@ extern "C" {
|
|||||||
#define LPSXXX_SAUL_NAME "lps22hb"
|
#define LPSXXX_SAUL_NAME "lps22hb"
|
||||||
#elif MODULE_LPS22HH
|
#elif MODULE_LPS22HH
|
||||||
#define LPSXXX_SAUL_NAME "lps22hh"
|
#define LPSXXX_SAUL_NAME "lps22hh"
|
||||||
|
#elif MODULE_LPS22CH
|
||||||
|
#define LPSXXX_SAUL_NAME "lps22ch"
|
||||||
#endif
|
#endif
|
||||||
#ifndef LPSXXX_SAUL_INFO
|
#ifndef LPSXXX_SAUL_INFO
|
||||||
#define LPSXXX_SAUL_INFO { .name = LPSXXX_SAUL_NAME }
|
#define LPSXXX_SAUL_INFO { .name = LPSXXX_SAUL_NAME }
|
||||||
|
@ -106,7 +106,7 @@ int lpsxxx_init(lpsxxx_t *dev, const lpsxxx_params_t * params)
|
|||||||
#elif MODULE_LPS22HB
|
#elif MODULE_LPS22HB
|
||||||
tmp = LPSXXX_CTRL_REG1_EN_LPFP | /* Low-pass filter configuration: ODR/9 */
|
tmp = LPSXXX_CTRL_REG1_EN_LPFP | /* Low-pass filter configuration: ODR/9 */
|
||||||
LPSXXX_CTRL_REG1_BDU | (DEV_RATE << LPSXXX_CTRL_REG1_ODR_POS);
|
LPSXXX_CTRL_REG1_BDU | (DEV_RATE << LPSXXX_CTRL_REG1_ODR_POS);
|
||||||
#elif MODULE_LPS22HH
|
#elif MODULE_LPS22HH || MODULE_LPS22CH
|
||||||
tmp = LPSXXX_CTRL_REG1_EN_LPFP | /* Low-pass filter configuration: ODR/9 */
|
tmp = LPSXXX_CTRL_REG1_EN_LPFP | /* Low-pass filter configuration: ODR/9 */
|
||||||
LPSXXX_CTRL_REG1_BDU | (DEV_RATE << LPSXXX_CTRL_REG1_ODR_POS);
|
LPSXXX_CTRL_REG1_BDU | (DEV_RATE << LPSXXX_CTRL_REG1_ODR_POS);
|
||||||
#endif
|
#endif
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* @{
|
* @{
|
||||||
*
|
*
|
||||||
* @file
|
* @file
|
||||||
* @brief LPSXXX (LPS331ap/LPS25HB/LPS22HB/LPS22HH) adaption to SAUL
|
* @brief LPSXXX (LPS331ap/LPS25HB/LPS22HB/LPS22HH/LPS22CH) adaption to SAUL
|
||||||
* interface
|
* interface
|
||||||
*
|
*
|
||||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# About
|
# About
|
||||||
|
|
||||||
This is a manual test application for the LPSXXX family of pressure sensors
|
This is a manual test application for the LPSXXX family of pressure sensors
|
||||||
driver. This driver can be used with LPS331AP, LPS25HB, LPS22HB and LPS22HH.
|
driver. This driver can be used with LPS331AP, LPS22CH, LPS25HB, LPS22HB and LPS22HH.
|
||||||
|
|
||||||
Default driver is `lps331ap`. To use the LPS25HB driver, set the `DRIVER` when
|
Default driver is `lps331ap`. To use the LPS25HB driver, set the `DRIVER` when
|
||||||
building the application:
|
building the application:
|
||||||
|
Loading…
Reference in New Issue
Block a user