lps22hb 2.0.0.0
lps22hb.h File Reference

This file contains API for LPS22HB Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_spi_master.h"

Go to the source code of this file.

Data Structures

struct  lps22hb_s
 Click ctx object definition. More...
 
struct  lps22hb_cfg_t
 Click configuration structure definition. More...
 

Macros

#define LPS22HB_MAP_MIKROBUS(cfg, mikrobus)
 
#define LPS22HB_MASTER_I2C   0
 
#define LPS22HB_MASTER_SPI   1
 
#define LPS22HB_RETVAL   uint8_t
 
#define LPS22HB_OK   0x00
 
#define LPS22HB_INIT_ERROR   0xFF
 
#define LPS22HB_DEV_RES_PRES   4096.0
 
#define LPS22HB_DEV_RES_TEMP   100.0
 
#define LPS22HB_I2C_ADDRESS_0   0x5C
 
#define LPS22HB_I2C_ADDRESS_1   0x5D
 
#define LPS22HB_REG_INTERRUPT_CFG   0x0B
 
#define LPS22HB_REG_THS_P_L   0x0C
 
#define LPS22HB_REG_THS_P_H   0x0D
 
#define LPS22HB_REG_WHO_AM_I   0x0F
 
#define LPS22HB_REG_REF_P_XL   0x15
 
#define LPS22HB_REG_REF_P_L   0x16
 
#define LPS22HB_REG_REF_P_H   0x17
 
#define LPS22HB_REG_RPDS_L   0x18
 
#define LPS22HB_REG_RPDS_H   0x19
 
#define LPS22HB_REG_RES_CONF   0x1A
 
#define LPS22HB_REG_INT_SOURCE   0x25
 
#define LPS22HB_REG_FIFO_STATUS   0x26
 
#define LPS22HB_REG_STATUS   0x27
 
#define LPS22HB_REG_PRESS_OUT_XL   0x28
 
#define LPS22HB_REG_PRESS_OUT_L   0x29
 
#define LPS22HB_REG_PRESS_OUT_H   0x2A
 
#define LPS22HB_REG_TEMP_OUT_L   0x2B
 
#define LPS22HB_REG_TEMP_OUT_H   0x2C
 
#define LPS22HB_REG_CLOCK_TREE_CONFIGURATION   0x43
 
#define LPS22HB_RES_CONF_NORMAL_MODE   0x00
 
#define LPS22HB_RES_CONF_LOW_CURRENT_MODE   0x01
 
#define LPS22HB_CTRL_REG_R1   0x10
 
#define LPS22HB_CTRL_REG_R2   0x11
 
#define LPS22HB_CTRL_REG_R3   0x12
 
#define LPS22HB_CTRL_REG_FIFO   0x14
 
#define LPS22HB_CTRL_I2C   0x10
 
#define LPS22HB_CTRL_SPI   0x18
 
#define LPS22HB_MASK_DATA   0x80
 
#define LPS22HB_MASK_DATA_RESET   0x02
 
#define LPS22HB_MASK_DATA_ODR   0x30
 
#define LPS22HB_MASK_REG1_ODR   0x70
 
#define LPS22HB_MASK_REG1_LPFP   0x08
 
#define LPS22HB_MASK_REG1_LPFP_CUTOFF   0x04
 
#define LPS22HB_MASK_REG1_BDU   0x02
 
#define LPS22HB_MASK_REG1_SIM   0x01
 
#define LPS22HB_MASK_REG2_FIFO_EN   0x40
 
#define LPS22HB_MASK_REG2_WTM_EN   0x20
 
#define LPS22HB_MASK_REG2_ADD_INC   0x10
 
#define LPS22HB_MASK_REG2_I2C   0x08
 
#define LPS22HB_MASK_REG2_ONE_SHOT   0x01
 
#define LPS22HB_MASK_REG3_INT_H_L   0x80
 
#define LPS22HB_MASK_REG3_PP_OD   0x40
 
#define LPS22HB_MASK_REG3_FIFO_FULL   0x20
 
#define LPS22HB_MASK_REG3_FIFO_FTH   0x10
 
#define LPS22HB_MASK_REG3_FIFO_OVR   0x08
 
#define LPS22HB_MASK_REG3_DRDY   0x04
 
#define LPS22HB_MASK_REG3_INT_S12   0x03
 
#define LPS22HB_INT_MASK_CFG_AUTORIFP   0x80
 
#define LPS22HB_INT_MASK_CFG_RESET_ARP   0x40
 
#define LPS22HB_INT_MASK_CFG_AUTOZERO   0x20
 
#define LPS22HB_INT_MASK_CFG_RESET_AZ   0x10
 
#define LPS22HB_INT_MASK_CFG_DIFF_EN   0x08
 
#define LPS22HB_INT_MASK_CFG_LIR   0x04
 
#define LPS22HB_INT_MASK_CFG_PLE   0x02
 
#define LPS22HB_INT_MASK_CFG_PHE   0x01
 
#define LPS22HB_INT_MASK_SOURCE_BOOT_STATUS   0x80
 
#define LPS22HB_INT_MASK_SOURCE_IA   0x04
 
#define LPS22HB_INT_MASK_SOURCE_PL   0x02
 
#define LPS22HB_INT_MASK_SOURCE_PH   0x01
 
#define LPS22HB_INT_MASK_SOURCE_TOR   0x20
 
#define LPS22HB_INT_MASK_SOURCE_POR   0x10
 
#define LPS22HB_INT_MASK_SOURCE_TDA   0x02
 
#define LPS22HB_INT_MASK_SOURCE_PDA   0x01
 
#define LPS22HB_FIFO_MASK_CTRL_MODE   0xE0
 
#define LPS22HB_FIFO_MASK_CTRL_WTM_POINT   0x1F
 
#define LPS22HB_FIFO_MASK_STATUS_FTH   0x80
 
#define LPS22HB_FIFO_MASK_STATUS_OVR   0x40
 
#define LPS22HB_FIFO_MASK_STATUS_LEVEL   0x3F
 
#define LPS22HB_FIFO_STATUS_EMPTY   0x00
 
#define LPS22HB_FIFO_STATUS_FULL   0x20
 

Typedefs

typedef uint8_t lps22hb_select_t
 Communication type.
 
typedef void(* lps22hb_master_io_t) (struct lps22hb_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct lps22hb_s lps22hb_t
 Click ctx object definition.
 

Functions

void lps22hb_cfg_setup (lps22hb_cfg_t *cfg)
 Config Object Initialization function.
 
LPS22HB_RETVAL lps22hb_init (lps22hb_t *ctx, lps22hb_cfg_t *cfg)
 Initialization function.
 
void lps22hb_default_cfg (lps22hb_t *ctx, lps22hb_cfg_t *cfg)
 Click Default Configuration function.
 
void lps22hb_generic_write (lps22hb_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void lps22hb_generic_read (lps22hb_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void lps22hb_soft_reset (lps22hb_t *ctx)
 Soft reset function.
 
void lps22hb_start_configuration (lps22hb_t *ctx)
 Set start configuration function.
 
void lps22hb_update_reg (lps22hb_t *ctx, uint8_t reg_adr, uint8_t reg_val)
 Update register function.
 
float lps22hb_get_pressure (lps22hb_t *ctx)
 Get pressure value function.
 
float lps22hb_get_temp (lps22hb_t *ctx)
 Get temperature value function.
 
void lps22hb_set_fifo_mode (lps22hb_t *ctx, uint8_t mode_sel, uint8_t wm_lvl)
 Set FIFO control mode function.
 
uint8_t lps22hb_check_int (lps22hb_t *ctx)
 Check Interrupt state function.
 

Detailed Description

This file contains API for LPS22HB Click driver.