pressure 2.0.0.0
pressure.h File Reference

This file contains API for Pressure 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  pressure_s
 Click context object definition. More...
 
struct  pressure_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PRESSURE_REG_REF_P_XLB   0x8
 
#define PRESSURE_REG_REF_P_LSB   0x9
 
#define PRESSURE_REG_REF_P_MSB   0xA
 
#define PRESSURE_REG_DEVICE_ID   0xF
 
#define PRESSURE_REG_RES_CFG   0x10
 
#define PRESSURE_REG_CTRL_REG1   0x20
 
#define PRESSURE_REG_CTRL_REG2   0x21
 
#define PRESSURE_REG_CTRL_REG3   0x22
 
#define PRESSURE_REG_INT_CFG   0x23
 
#define PRESSURE_REG_INT_SOURCE   0x24
 
#define PRESSURE_REG_THSH_P_LSB   0x25
 
#define PRESSURE_REG_THSH_P_MSB   0x26
 
#define PRESSURE_REG_STATUS   0x27
 
#define PRESSURE_REG_PRESS_OUT_XLB   0x28
 
#define PRESSURE_REG_PRESS_OUT_LSB   0x29
 
#define PRESSURE_REG_PRESS_OUT_MSB   0x2A
 
#define PRESSURE_REG_TEMP_OUT_LSB   0x2B
 
#define PRESSURE_REG_TEMP_OUT_MSB   0x2C
 
#define PRESSURE_REG_AMP_CTRL   0x30
 
#define PRESSURE_WHO_AM_I   0xBB
 
#define PRESSURE_SET_RES_AVG_1   0x0
 
#define PRESSURE_SET_RES_AVG_2   0x1
 
#define PRESSURE_SET_RES_AVG_4   0x2
 
#define PRESSURE_SET_RES_AVG_8   0x3
 
#define PRESSURE_SET_RES_AVG_16   0x4
 
#define PRESSURE_SET_RES_AVG_32   0x5
 
#define PRESSURE_SET_RES_AVG_64   0x6
 
#define PRESSURE_SET_RES_AVG_128   0x7
 
#define PRESSURE_SET_RES_AVG_256   0x8
 
#define PRESSURE_SET_RES_AVG_384   0x9
 
#define PRESSURE_SET_RES_AVG_512   0xA
 
#define PRESSURE_SET_PWR_UP_DEV   0x80
 
#define PRESSURE_SET_PWR_UP_INT   0x8
 
#define PRESSURE_SET_BLOCK_DATA_UPDATE   0x4
 
#define PRESSURE_SET_PWR_UP_DELTA_PRESS   0x2
 
#define PRESSURE_SET_SPI_3_WIRE   0x1
 
#define PRESSURE_SET_REBOOT_MEM_CONTENT   0x80
 
#define PRESSURE_SET_SW_RESET   0x4
 
#define PRESSURE_SET_AUTOZERO_EN   0x2
 
#define PRESSURE_SET_ONESHOT_EN   0x1
 
#define PRESSURE_SET_NORMAL_MODE   0x0
 
#define PRESSURE_SET_INT_ACT_LOW   0x80
 
#define PRESSURE_SET_INT_OPEN_DRAIN   0x40
 
#define PRESSURE_SET_INT_GND   0x0
 
#define PRESSURE_SET_INT_PRESS_HIGH   0x1
 
#define PRESSURE_SET_INT_PRESS_LOW   0x2
 
#define PRESSURE_SET_INT_P_LOW_OR_HIGH   0x3
 
#define PRESSURE_SET_INT_DATA_RDY   0x4
 
#define PRESSURE_SET_INT_TRI_STATE   0x7
 
#define PRESSURE_FLAG_MASK_P_DATA_OR   0x20
 
#define PRESSURE_FLAG_MASK_T_DATA_OR   0x10
 
#define PRESSURE_FLAG_MASK_P_DATA_RDY   0x2
 
#define PRESSURE_FLAG_MASK_T_DATA_RDY   0x1
 
#define PRESSURE_FLAG_MASK_INT_ACT   0x4
 
#define PRESSURE_FLAG_MASK_DIFF_P_LOW   0x2
 
#define PRESSURE_FLAG_MASK_DIFF_P_HIGH   0x1
 
#define PRESSURE_DATA_NUMBER_MIN   1
 
#define PRESSURE_DATA_NUMBER_MAX   49
 
#define PRESSURE_MAP_MIKROBUS(cfg, mikrobus)
 

Typedefs

typedef void(* pressure_master_transfer_t) (struct pressure_s *, uint8_t, uint8_t *, uint8_t)
 Click master transfer function definition.
 
typedef struct pressure_s pressure_t
 Click context object definition.
 

Enumerations

enum  pressure_err_t { PRESSURE_OK = 0x0 , PRESSURE_ERR_INIT_DRV = 0xFD , PRESSURE_ERR_ADDR , PRESSURE_ERR_NDATA }
 Click error code definition. More...
 
enum  pressure_drv_select_t { PRESSURE_DRV_SEL_I2C = 0 , PRESSURE_DRV_SEL_SPI }
 Click driver selector definition. More...
 
enum  pressure_odr_t {
  PRESSURE_ODR_ONE_SHOT = 0 , PRESSURE_ODR_P1HZ_T1HZ , PRESSURE_ODR_P7HZ_T1HZ , PRESSURE_ODR_P12HZ_T1HZ ,
  PRESSURE_ODR_P25HZ_T1HZ , PRESSURE_ODR_P7HZ_T7HZ , PRESSURE_ODR_P12HZ_T12HZ , PRESSURE_ODR_P25HZ_T25HZ
}
 Click output data rate definition. More...
 
enum  pressure_pwr_ctrl_t { PRESSURE_PWR_DOWN = 0 , PRESSURE_PWR_UP }
 Click power control definition. More...
 

Functions

void pressure_cfg_setup (pressure_cfg_t *cfg)
 Configuration Object Setup function.
 
pressure_err_t pressure_init (pressure_t *ctx, pressure_cfg_t *cfg)
 Click Initialization function.
 
void pressure_default_cfg (pressure_t *ctx)
 Click Default Configuration function.
 
pressure_err_t pressure_generic_single_write (pressure_t *ctx, uint8_t reg_addr, uint8_t data_in)
 Generic Single Write function.
 
pressure_err_t pressure_generic_multiple_write (pressure_t *ctx, uint8_t reg_addr, uint8_t *data_in, uint8_t n_data)
 Generic Multiple Write function.
 
pressure_err_t pressure_generic_multiple_read (pressure_t *ctx, uint8_t reg_addr, uint8_t *data_out, uint8_t n_data)
 Generic Multiple Read function.
 
uint8_t pressure_read_id (pressure_t *ctx)
 ID Read function.
 
void pressure_set_odr (pressure_t *ctx, pressure_odr_t odr)
 Output Data Rate Set function.
 
void pressure_pwr_ctrl (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Device Power Control function.
 
void pressure_pwr_ctrl_interrupt (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Interrupt Power Control function.
 
void pressure_block_data_update (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Data Update Block function.
 
void pressure_pwr_ctrl_delta_pressure (pressure_t *ctx, pressure_pwr_ctrl_t state)
 Delta Pressure Power Control function.
 
void pressure_reboot_memory (pressure_t *ctx)
 Memory Reboot function.
 
void pressure_sw_reset (pressure_t *ctx)
 Software Reset function.
 
float pressure_get_pressure (pressure_t *ctx)
 Pressure Get function.
 
float pressure_get_temperature (pressure_t *ctx)
 Temperature Get function.
 
uint8_t pressure_get_status (pressure_t *ctx, uint8_t bit_mask)
 Status Get function.
 
uint8_t pressure_get_int_pin (pressure_t *ctx)
 INT Pin Get function.
 

Detailed Description

This file contains API for Pressure Click driver.