cancel
Showing results for 
Search instead for 
Did you mean: 

Use LPS22HB with mems1

JM?�l
Associate II

I got a nucleo STM32WB55 and a LPS22HB click board from Mikroe.

I generate with Cube-MX a Projekte including the lps22hb mems driver.

so what i know have in the Project:

app_x-cube-mems1.h/.c files

custom_mems_conf.h

lps22hb_reg.h/.c

lps22hb.h/.c

i search on the ST sides to find an example or an description how to use the MEMS-driver for the LPS22HB.

in the custom_mems_conf.h

i found the custom settings:

/* USER CODE BEGIN 1 */
 
#define USE_CUSTOM_ENV_SENSOR_LPS22HB_0           1U
 
/* USER CODE END 1 */
 
#define CUSTOM_LPS22HB_0_I2C_Init BSP_I2C1_Init
#define CUSTOM_LPS22HB_0_I2C_DeInit BSP_I2C1_DeInit
#define CUSTOM_LPS22HB_0_I2C_ReadReg BSP_I2C1_ReadReg
#define CUSTOM_LPS22HB_0_I2C_WriteReg BSP_I2C1_WriteReg

in the lps22hb driver i found the init and read funktion

int32_t LPS22HB_Init(LPS22HB_Object_t *pObj);
 
 
int32_t LPS22HB_PRESS_Enable(LPS22HB_Object_t *pObj);
int32_t LPS22HB_PRESS_Disable(LPS22HB_Object_t *pObj);
int32_t LPS22HB_PRESS_GetOutputDataRate(LPS22HB_Object_t *pObj, float *Odr);
int32_t LPS22HB_PRESS_SetOutputDataRate(LPS22HB_Object_t *pObj, float Odr);
int32_t LPS22HB_PRESS_GetPressure(LPS22HB_Object_t *pObj, float *Value);
int32_t LPS22HB_PRESS_Get_DRDY_Status(LPS22HB_Object_t *pObj, uint8_t *Status);
int32_t LPS22HB_PRESS_Get_FThStatus(LPS22HB_Object_t *pObj, uint8_t *Status);

so how to init the sensor and to get Values from it?

Should i create a new handler?

is CUSTOM_LPS22HB_0_I2C_... already set. should i set this?

what to set in the handler?

2 REPLIES 2
JM?�l
Associate II

Nobodoy knows were to find documants to ST X-Cube-Mems?

Eleon BORLINI
ST Employee

Hi @JM??l​ , being the STM32WB55 based on STM32L4 family MCU, I suggest you to start from the FP-SNS-ALLMEMS1 function pack, which includes the libraries for LPS22HB acquisition with STM32L4. Regards