pressure3 2.0.0.0
pressure3.h File Reference

This file contains API for Pressure 3 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  pressure3_coeff_t
 Coefficients structure. More...
 
struct  pressure3_s
 Click ctx object definition. More...
 
struct  pressure3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PRESSURE3_MAP_MIKROBUS(cfg, mikrobus)
 
#define PRESSURE3_MASTER_I2C   0
 
#define PRESSURE3_MASTER_SPI   1
 
#define PRESSURE3_RETVAL   uint8_t
 
#define PRESSURE3_OK   0x00
 
#define PRESSURE3_INIT_ERROR   0xFF
 
#define PRESSURE3_I2C_SELECT   0
 
#define PRESSURE3_SPI_SELECT   1
 
#define PRESSURE3_SPI_CMD_WRITE   0x7F
 
#define PRESSURE3_SPI_CMD_READ   0x80
 
#define PRESSURE3_I2C_ADDRESS   0x76
 
#define PRESSURE3_REG_PSR_B2   0x00
 
#define PRESSURE3_REG_PSR_B1   0x01
 
#define PRESSURE3_REG_PSR_B0   0x02
 
#define PRESSURE3_REG_TMP_B2   0x03
 
#define PRESSURE3_REG_TMP_B1   0x04
 
#define PRESSURE3_REG_TMP_B0   0x05
 
#define PRESSURE3_REG_PRS_CFG   0x06
 
#define PRESSURE3_REG_TMP_CFG   0x07
 
#define PRESSURE3_REG_MEAS_CFG   0x08
 
#define PRESSURE3_REG_CFG_REG   0x09
 
#define PRESSURE3_REG_INT_STS   0x0A
 
#define PRESSURE3_REG_FIFO_STS   0x0B
 
#define PRESSURE3_REG_RESET   0x0C
 
#define PRESSURE3_REG_PRODUCT_ID   0x0D
 
#define PRESSURE3_REG_COEF_C0_MBS   0x10
 
#define PRESSURE3_REG_COEF_C0_LBS_C1_MBS   0x11
 
#define PRESSURE3_REG_COEF_C1_LBS   0x12
 
#define PRESSURE3_REG_COEF_C00_MBS   0x13
 
#define PRESSURE3_REG_COEF_C00_LSB   0x14
 
#define PRESSURE3_REG_COEF_C00_XLSB_C10_MSB   0x15
 
#define PRESSURE3_REG_COEF_C10_LSB   0x16
 
#define PRESSURE3_REG_COEF_C10_XLSB   0x17
 
#define PRESSURE3_REG_COEF_C01_MSB   0x18
 
#define PRESSURE3_REG_COEF_C01_LSB   0x19
 
#define PRESSURE3_REG_COEF_C11_MSB   0x1A
 
#define PRESSURE3_REG_COEF_C11_LSB   0x1B
 
#define PRESSURE3_REG_COEF_C20_MSB   0x1C
 
#define PRESSURE3_REG_COEF_C20_LSB   0x1D
 
#define PRESSURE3_REG_COEF_C21_MSB   0x1E
 
#define PRESSURE3_REG_COEF_C21_LSB   0x1F
 
#define PRESSURE3_REG_COEF_C30_MSB   0x20
 
#define PRESSURE3_REG_COEF_C30_LSB   0x21
 
#define PRESSURE3_REG_COEF_SRCE   0x28
 
#define PRESSURE3_BIT_MASK_PM_RATE_1_PER_SEC   0x00
 
#define PRESSURE3_BIT_MASK_PM_RATE_2_PER_SEC   0x10
 
#define PRESSURE3_BIT_MASK_PM_RATE_4_PER_SEC   0x20
 
#define PRESSURE3_BIT_MASK_PM_RATE_8_PER_SEC   0x30
 
#define PRESSURE3_BIT_MASK_PM_RATE_16_PER_SEC   0x40
 
#define PRESSURE3_BIT_MASK_PM_RATE_32_PER_SEC   0x50
 
#define PRESSURE3_BIT_MASK_PM_RATE_64_PER_SEC   0x60
 
#define PRESSURE3_BIT_MASK_PM_RATE_128_PER_SEC   0x70
 
#define PRESSURE3_BIT_MASK_PM_PRC_1_PER_SEC   0x00
 
#define PRESSURE3_BIT_MASK_PM_PRC_2_PER_SEC   0x01
 
#define PRESSURE3_BIT_MASK_PM_PRC_4_PER_SEC   0x02
 
#define PRESSURE3_BIT_MASK_PM_PRC_8_PER_SEC   0x03
 
#define PRESSURE3_BIT_MASK_PM_PRC_16_PER_SEC   0x04
 
#define PRESSURE3_BIT_MASK_PM_PRC_32_PER_SEC   0x05
 
#define PRESSURE3_BIT_MASK_PM_PRC_64_PER_SEC   0x06
 
#define PRESSURE3_BIT_MASK_PM_PRC_128_PER_SEC   0x07
 
#define PRESSURE3_BIT_MASK_TMP_EXT_INTERNAL_SENSOR   0x00
 
#define PRESSURE3_BIT_MASK_TMP_EXT_EXTERNAL_SENSOR   0x80
 
#define PRESSURE3_BIT_MASK_TMP_RATE_1_PER_SEC   0x00
 
#define PRESSURE3_BIT_MASK_TMP_RATE_2_PER_SEC   0x10
 
#define PRESSURE3_BIT_MASK_TMP_RATE_4_PER_SEC   0x20
 
#define PRESSURE3_BIT_MASK_TMP_RATE_8_PER_SEC   0x30
 
#define PRESSURE3_BIT_MASK_TMP_RATE_16_PER_SEC   0x40
 
#define PRESSURE3_BIT_MASK_TMP_RATE_32_PER_SEC   0x50
 
#define PRESSURE3_BIT_MASK_TMP_RATE_64_PER_SEC   0x60
 
#define PRESSURE3_BIT_MASK_TMP_RATE_128_PER_SEC   0x70
 
#define PRESSURE3_BIT_MASK_TMP_PRC_1_PER_SEC   0x00
 
#define PRESSURE3_BIT_MASK_TMP_PRC_2_PER_SEC   0x01
 
#define PRESSURE3_BIT_MASK_TMP_PRC_4_PER_SEC   0x02
 
#define PRESSURE3_BIT_MASK_TMP_PRC_8_PER_SEC   0x03
 
#define PRESSURE3_BIT_MASK_TMP_PRC_16_PER_SEC   0x04
 
#define PRESSURE3_BIT_MASK_TMP_PRC_32_PER_SEC   0x05
 
#define PRESSURE3_BIT_MASK_TMP_PRC_64_PER_SEC   0x06
 
#define PRESSURE3_BIT_MASK_TMP_PRC_128_PER_SEC   0x07
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_COEF_RDY_AVB   0x80
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_COEF_RDY_NO_AVB   0x00
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_SENSOR_RDY_CMP   0x40
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_SENSOR_RDY_NO_CMP   0x00
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_TMP_RDY   0x20
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_PRS_RDY   0x10
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_MEAS_CTRL_IDLE   0x00
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_MEAS_CTRL_PRS   0x01
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_MEAS_CTRL_TMP   0x02
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_MEAS_CTRL_CNT_PRS   0x05
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_MEAS_CTRL_CNT_TMP   0x06
 
#define PRESSURE3_BIT_MASK_MEAS_CFG_MEAS_CTRL_CNT_PRS_TMP   0x07
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_HL_LOW   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_HL_HIGH   0x80
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_FIFO_DISABLE   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_FIFO_ENABLE   0x40
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_TMP_DISABLE   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_TMP_ENABLE   0x20
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_PRS_DISABLE   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_INT_PRS_ENABLE   0x10
 
#define PRESSURE3_BIT_MASK_CFG_REG_T_SHIFT_NO_SHIFT   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_T_SHIFT_SHIFT   0x08
 
#define PRESSURE3_BIT_MASK_CFG_REG_P_SHIFT_NO_SHIFT   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_P_SHIFT_SHIFT   0x04
 
#define PRESSURE3_BIT_MASK_CFG_REG_FIFO_EN_DISABLE   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_FIFO_EN_ENABLE   0x02
 
#define PRESSURE3_BIT_MASK_CFG_REG_SPI_MODE_DISABLE   0x00
 
#define PRESSURE3_BIT_MASK_CFG_REG_SPI_MODE_ENABLE   0x01
 
#define PRESSURE3_BIT_MASK_INT_STS_INT_FIFO_FULL_NO_ACTIVE   0x00
 
#define PRESSURE3_BIT_MASK_INT_STS_INT_FIFO_FULL_ACTIVE   0x04
 
#define PRESSURE3_BIT_MASK_INT_STS_INT_TMP_NO_ACTIVE   0x00
 
#define PRESSURE3_BIT_MASK_INT_STS_INT_TMP_ACTIVE   0x02
 
#define PRESSURE3_BIT_MASK_INT_STS_INT_PRS_NO_ACTIVE   0x00
 
#define PRESSURE3_BIT_MASK_INT_STS_INT_PRS_ACTIVE   0x01
 
#define PRESSURE3_BIT_MASK_FIFO_STS_FIFO_FULL_NO   0x00
 
#define PRESSURE3_BIT_MASK_FIFO_STS_FIFO_FULL_FULL   0x02
 
#define PRESSURE3_BIT_MASK_FIFO_STS_FIFO_EMPTY_NO   0x00
 
#define PRESSURE3_BIT_MASK_FIFO_STS_FIFO_EMPTY_EMPTY   0x01
 
#define PRESSURE3_BIT_MASK_RESET_SOFT_RST   0x09
 
#define PRESSURE3_BIT_MASK_TMP_COEF_SRCE_INTERNAL_SENSOR   0x00
 
#define PRESSURE3_BIT_MASK_TMP_COEF_SRCE_EXTERNAL_SENSOR   0x80
 

Typedefs

typedef uint8_t pressure3_select_t
 Communication type.
 
typedef void(* pressure3_master_io_t) (struct pressure3_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct pressure3_s pressure3_t
 Click ctx object definition.
 

Functions

void pressure3_cfg_setup (pressure3_cfg_t *cfg)
 Config Object Initialization function.
 
PRESSURE3_RETVAL pressure3_init (pressure3_t *ctx, pressure3_cfg_t *cfg)
 Initialization function.
 
void pressure3_default_cfg (pressure3_t *ctx)
 Click Default Configuration function.
 
void pressure3_generic_write (pressure3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void pressure3_generic_read (pressure3_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void pressure3_get_t_p_data (pressure3_t *ctx, float *temperature, float *presure, pressure3_coeff_t *coeff_struct)
 Get temperature pressure.
 
void pressure3_get_coefficients (pressure3_t *ctx, pressure3_coeff_t *coeff_struct)
 Get coefficients.
 
int32_t pressure3_get_measurement_data (pressure3_t *ctx, uint8_t mbs_reg_addr)
 Read the coefficients value for calculation function.
 
void pressure3_set_pressure_configuration (pressure3_t *ctx, uint8_t press_config)
 Set the pressure configuration function.
 
uint8_t pressure3_get_pressure_configuration (pressure3_t *ctx)
 Get the pressure configuration function.
 
void pressure3_set_temperature_configuration (pressure3_t *ctx, uint8_t temp_config)
 Set the temperature configuration function.
 
uint8_t pressure3_get_temperature_configuration (pressure3_t *ctx)
 Get the temperature configuration function.
 
void pressure3_set_operating_mode (pressure3_t *ctx, uint8_t operation_mode)
 Get the sensor operating mode function.
 
uint8_t pressure3_get_operating_mode (pressure3_t *ctx)
 Get the sensor operating mode function.
 
void pressure3_set_configuration (pressure3_t *ctx, uint8_t confg_data)
 Set the configuration function.
 
uint8_t pressure3_get_configuration (pressure3_t *ctx)
 Get the configuration function.
 
uint8_t pressure3_get_interrupt_status (pressure3_t *ctx)
 Get the interrupt status function.
 
uint8_t pressure3_get_fifo_status (pressure3_t *ctx)
 Get the FIFO Status function.
 
void pressure3_soft_reset (pressure3_t *ctx)
 Soft reset function.
 

Detailed Description

This file contains API for Pressure 3 Click driver.