press 2.1.0.0
press.h File Reference

This file contains API for PRESS Click Driver. More...

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

Go to the source code of this file.

Data Structures

struct  press_t
 PRESS Click context object. More...
 
struct  press_cfg_t
 PRESS Click configuration object. More...
 

Macros

#define PRESS_REG_INTERRUPT_CFG   0x0B
 PRESS description register.
 
#define PRESS_REG_THS_P_L   0x0C
 
#define PRESS_REG_THS_P_H   0x0D
 
#define PRESS_REG_IF_CTRL   0x0E
 
#define PRESS_REG_WHO_AM_I   0x0F
 
#define PRESS_REG_CTRL_REG1   0x10
 
#define PRESS_REG_CTRL_REG2   0x11
 
#define PRESS_REG_CTRL_REG3   0x12
 
#define PRESS_REG_FIFO_CTRL   0x14
 
#define PRESS_REG_FIFO_WTM   0x15
 
#define PRESS_REG_REF_P_L   0x16
 
#define PRESS_REG_REF_P_H   0x17
 
#define PRESS_REG_I3C_IF_CTRL   0x19
 
#define PRESS_REG_RPDS_L   0x1A
 
#define PRESS_REG_RPDS_H   0x1B
 
#define PRESS_REG_INT_SOURCE   0x24
 
#define PRESS_REG_FIFO_STATUS1   0x25
 
#define PRESS_REG_FIFO_STATUS2   0x26
 
#define PRESS_REG_STATUS   0x27
 
#define PRESS_REG_PRESSURE_OUT_XL   0x28
 
#define PRESS_REG_PRESSURE_OUT_L   0x29
 
#define PRESS_REG_PRESSURE_OUT_H   0x2A
 
#define PRESS_REG_TEMP_OUT_L   0x2B
 
#define PRESS_REG_TEMP_OUT_H   0x2C
 
#define PRESS_REG_FIFO_DATA_OUT_PRESS_XL   0x78
 
#define PRESS_REG_FIFO_DATA_OUT_PRESS_L   0x79
 
#define PRESS_REG_FIFO_DATA_OUT_PRESS_H   0x7A
 
#define PRESS_WHO_AM_I   0xB4
 PRESS device Who am I data value.
 
#define PRESS_ODR_PWR_DOWN_ONE_SHOT   0x00
 PRESS description of control register 1, output data rate and average selection.
 
#define PRESS_ODR_1HZ   0x08
 
#define PRESS_ODR_4HZ   0x10
 
#define PRESS_ODR_10HZ   0x18
 
#define PRESS_ODR_25HZ   0x20
 
#define PRESS_ODR_50HZ   0x28
 
#define PRESS_ODR_75HZ   0x30
 
#define PRESS_ODR_100HZ   0x38
 
#define PRESS_ODR_200HZ   0x40
 
#define PRESS_ODR_BIT_MASK   0x78
 
#define PRESS_AVG_4   0x00
 
#define PRESS_AVG_8   0x01
 
#define PRESS_AVG_16   0x02
 
#define PRESS_AVG_32   0x03
 
#define PRESS_AVG_64   0x04
 
#define PRESS_AVG_128   0x05
 
#define PRESS_AVG_512   0x07
 
#define PRESS_AVG_BIT_MASK   0x07
 
#define PRESS_BOOT_NORMAL_MODE   0x00
 PRESS description of control register 2 setting.
 
#define PRESS_REBOOT_MEMORY_CONTENT   0x80
 
#define PRESS_FS_MODE_1_1260HPA   0x00
 
#define PRESS_FS_MODE_2_4060HPA   0x40
 
#define PRESS_LFPF_CFG_ODR_4   0x00
 
#define PRESS_LFPF_CFG_ODR_9   0x20
 
#define PRESS_DISABLE_LPFP   0x00
 
#define PRESS_ENABLE_LPFP   0x10
 
#define PRESS_BDU_CONTINUOUS   0x00
 
#define PRESS_BDU_MSB_LSB_READ   0x08
 
#define PRESS_SW_RESET   0x04
 
#define PRESS_ONESHOT_IDLE   0x00
 
#define PRESS_ONESHOT_NEW_DATA   0x01
 
#define PRESS_REBOOT_AH_QVAR_EN   0x80
 PRESS description of control register 3, Qvar configuration and auto increment.
 
#define PRESS_REBOOT_AH_QVAR_DIS   0x00
 
#define PRESS_REBOOT_AH_QVAR_P_AUTO_EN   0x20
 
#define PRESS_REBOOT_AH_QVAR_P_AUTO_DIS   0x00
 
#define PRESS_REBOOT_IF_ADD_INC_EN   0x01
 
#define PRESS_REBOOT_IF_ADD_INC_DIS   0x00
 
#define PRESS_TRIG_F_MODE_BYPASS   0x00
 PRESS description of FIFO mode selection.
 
#define PRESS_TRIG_F_MODE_FIFO   0x01
 
#define PRESS_TRIG_F_MODE_CONT   0x02
 
#define PRESS_TRIG_F_MODE_BYPASS_FIFO   0x05
 
#define PRESS_TRIG_F_MODE_BYPASS_CONT   0x06
 
#define PRESS_TRIG_F_MODE_CONT_FIFO   0x07
 
#define PRESS_STATUS_TEMP_OVERRUN   0x20
 PRESS description of status register.
 
#define PRESS_STATUS_PRESS_OVERRUN   0x10
 
#define PRESS_STATUS_TEMP_AVAILABLE   0x02
 
#define PRESS_STATUS_PRESS_AVAILABLE   0x01
 
#define PRESS_AH_QVAR_DISABLE   0x00
 PRESS description AH and Qvar configuration.
 
#define PRESS_AH_QVAR_ENABLE   0x01
 
#define PRESS_LSB_HPA_FS_MODE_4096   4096.0f
 PRESS description of calculation values.
 
#define PRESS_LSB_HPA_FS_MODE_2048   2048.0f
 
#define PRESS_TEMP_SENS   100.0f
 
#define PRESS_QVAR_GAIN_LSB_MV   426000.0f
 
#define PRESS_DEVICE_ADDRESS   0x5C
 PRESS device address setting.
 
#define PRESS_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  press_return_value_t { PRESS_OK = 0 , PRESS_ERROR = -1 }
 PRESS Click return value data. More...
 

Functions

void press_cfg_setup (press_cfg_t *cfg)
 PRESS configuration object setup function.
 
err_t press_init (press_t *ctx, press_cfg_t *cfg)
 PRESS initialization function.
 
err_t press_default_cfg (press_t *ctx)
 PRESS default configuration function.
 
err_t press_generic_write (press_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 PRESS I2C writing function.
 
err_t press_generic_read (press_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 PRESS I2C reading function.
 
err_t press_reg_write (press_t *ctx, uint8_t reg, uint8_t data_in)
 PRESS I2C register writing function.
 
err_t press_reg_read (press_t *ctx, uint8_t reg, uint8_t *data_out)
 PRESS I2C register reading function.
 
err_t press_sw_reset (press_t *ctx)
 PRESS software reset function.
 
err_t press_config_ah_qvar (press_t *ctx, uint8_t ah_qvar_en)
 PRESS config AH and Qva function.
 
err_t press_get_raw_data (press_t *ctx, uint32_t *press_data, uint32_t *qvar_data, uint16_t *temp_data)
 PRESS gets the raw data function.
 
err_t press_get_measurement_data (press_t *ctx, float *pressure, float *temperature)
 PRESS gets the measurement data function.
 
err_t press_get_ah_qvar_data (press_t *ctx, float *ah_qvar)
 PRESS gets the AH/Qvar data function.
 

Detailed Description

This file contains API for PRESS Click Driver.

Enumeration Type Documentation

◆ press_return_value_t

PRESS Click return value data.

Predefined enum values for driver return values.

Enumerator
PRESS_OK 
PRESS_ERROR