pressure5 2.0.0.0
pressure5.h File Reference

This file contains API for Pressure 5 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  pressure5_s
 Click ctx object definition. More...
 
struct  pressure5_cfg_t
 Click configuration structure definition. More...
 
struct  pressure5_nvm_par_t
 
struct  pressure5_par_coeff_t
 

Macros

#define PRESSURE5_MAP_MIKROBUS(cfg, mikrobus)
 
#define PRESSURE5_MASTER_I2C   0
 
#define PRESSURE5_MASTER_SPI   1
 
#define PRESSURE5_RETVAL   uint8_t
 
#define PRESSURE5_OK   0x00
 
#define PRESSURE5_INIT_ERROR   0xFF
 
#define PRESSURE5_REG_DEVICE_ID   0x00
 
#define PRESSURE5_REG_ERROR   0x02
 
#define PRESSURE5_REG_PRESSURE_DATA_0   0x04
 
#define PRESSURE5_REG_PRESSURE_DATA_1   0x05
 
#define PRESSURE5_REG_PRESSURE_DATA_2   0x06
 
#define PRESSURE5_REG_TEMPERATURE_DATA_0   0x07
 
#define PRESSURE5_REG_TEMPERATURE_DATA_1   0x08
 
#define PRESSURE5_REG_TEMPERATURE_DATA_2   0x09
 
#define PRESSURE5_REG_SENSOR_TIME_0   0x0C
 
#define PRESSURE5_REG_SENSOR_TIME_1   0x0D
 
#define PRESSURE5_REG_SENSOR_TIME_2   0x0E
 
#define PRESSURE5_REG_EVENT   0x10
 
#define PRESSURE5_REG_INT_STATUS   0x11
 
#define PRESSURE5_REG_FIFO_LENGTH   0x13
 
#define PRESSURE5_REG_FIFO_DATA   0x14
 
#define PRESSURE5_REG_FIFO_WATERMARK_0   0x15
 
#define PRESSURE5_REG_FIFO_WATERMARK_1   0x16
 
#define PRESSURE5_REG_FIFO_CONFIG_1   0x17
 
#define PRESSURE5_REG_FIFO_CONFIG_2   0x18
 
#define PRESSURE5_REG_INT_CTRL   0x19
 
#define PRESSURE5_REG_IF_CONFIG   0x1A
 
#define PRESSURE5_REG_POWER_CTRL   0x1B
 
#define PRESSURE5_REG_OSR   0x1C
 
#define PRESSURE5_REG_ODR   0x1D
 
#define PRESSURE5_REG_CONFIGURATION   0x1F
 
#define PRESSURE5_REG_COMMAND   0x7E
 
#define PRESSURE5_FCFG_FIFO_ENABLE   0x01
 
#define PRESSURE5_FCFG_FIFO_DISABLE   0x00
 
#define PRESSURE5_FCFG_FIFO_STOP_ON_FULL_ENABLE   0x02
 
#define PRESSURE5_FCFG_FIFO_STOP_ON_FULL_DISABLE   0x00
 
#define PRESSURE5_FCFG_FIFO_TIME_ENABLE   0x04
 
#define PRESSURE5_FCFG_FIFO_TIME_DISABLE   0x00
 
#define PRESSURE5_FCFG_FIFO_PRESSURE_STORE_ENABLE   0x08
 
#define PRESSURE5_FCFG_FIFO_PRESSURE_STORE_DISABLE   0x00
 
#define PRESSURE5_FCFG_FIFO_TEMP_STORE_ENABLE   0x10
 
#define PRESSURE5_FCFG_FIFO_TEMP_STORE_DISABLE   0x00
 
#define PRESSURE5_INTCFG_INT_OUTPUT_PUSH_PULL   0x00
 
#define PRESSURE5_INTCFG_INT_OUTPUT_OPEN_DRAIN   0x01
 
#define PRESSURE5_INTCFG_INT_LEVEL_ACTIVE_HIGH   0x02
 
#define PRESSURE5_INTCFG_INT_LEVEL_ACTIVE_LOW   0x00
 
#define PRESSURE5_INTCFG_INT_LATCH_ENABLE   0x04
 
#define PRESSURE5_INTCFG_INT_LATCH_DISABLE   0x00
 
#define PRESSURE5_INTCFG_FIFO_WTM_ENABLE   0x08
 
#define PRESSURE5_INTCFG_FIFO_WTM_DISABLE   0x00
 
#define PRESSURE5_INTCFG_FIFO_FULL_ENABLE   0x10
 
#define PRESSURE5_INTCFG_FIFO_FULL_DISABLE   0x00
 
#define PRESSURE5_INTCFG_DATA_READY_ENABLE   0x20
 
#define PRESSURE5_INTCFG_DATA_READY_DISABLE   0x00
 
#define PRESSURE5_IFCFG_SPI_4_WIRE   0x00
 
#define PRESSURE5_IFCFG_SPI_3_WIRE   0x01
 
#define PRESSURE5_IFCFG_I2C_WATCHDOG_ENABLE   0x02
 
#define PRESSURE5_IFCFG_I2C_WATCHDOG_DISABLE   0x00
 
#define PRESSURE5_IFCFG_I2C_WATCHDOG_SHORT_1p25ms   0x00
 
#define PRESSURE5_IFCFG_I2C_WATCHDOG_LONG_40ms   0x04
 
#define PRESSURE5_PCTRL_PRESSURE_SENSOR_DISABLE   0x00
 
#define PRESSURE5_PCTRL_PRESSURE_SENSOR_ENABLE   0x01
 
#define PRESSURE5_PCTRL_TEMP_SENSOR_DISABLE   0x00
 
#define PRESSURE5_PCTRL_TEMP_SENSOR_ENABLE   0x02
 
#define PRESSURE5_PCTRL_MODE_SLEEP   0x00
 
#define PRESSURE5_PCTRL_MODE_FORCED   0x10
 
#define PRESSURE5_PCTRL_MODE_NORMAL   0x30
 
#define PRESSURE5_OSR_PRESSURE_x1   0x00
 
#define PRESSURE5_OSR_PRESSURE_x2   0x01
 
#define PRESSURE5_OSR_PRESSURE_x4   0x02
 
#define PRESSURE5_OSR_PRESSURE_x8   0x03
 
#define PRESSURE5_OSR_PRESSURE_x16   0x04
 
#define PRESSURE5_OSR_PRESSURE_x32   0x05
 
#define PRESSURE5_OSR_TEMP_x1   0x00 >> 1
 
#define PRESSURE5_OSR_TEMP_x2   0x10 >> 1
 
#define PRESSURE5_OSR_TEMP_x4   0x20 >> 1
 
#define PRESSURE5_OSR_TEMP_x8   0x30 >> 1
 
#define PRESSURE5_OSR_TEMP_x16   0x40 >> 1
 
#define PRESSURE5_OSR_TEMP_x32   0x50 >> 1
 
#define PRESSURE5_ODR_200   0x00
 
#define PRESSURE5_ODR_100   0x01
 
#define PRESSURE5_ODR_50   0x02
 
#define PRESSURE5_ODR_25   0x03
 
#define PRESSURE5_ODR_12p5   0x04
 
#define PRESSURE5_ODR_6p25   0x05
 
#define PRESSURE5_ODR_3p1   0x06
 
#define PRESSURE5_ODR_1p5   0x07
 
#define PRESSURE5_ODR_0p75   0x08
 
#define PRESSURE5_ODR_0p39   0x09
 
#define PRESSURE5_ODR_0p2   0x0A
 
#define PRESSURE5_ODR_0p1   0x0B
 
#define PRESSURE5_ODR_0p05   0x0C
 
#define PRESSURE5_ODR_0p02   0x0D
 
#define PRESSURE5_ODR_0p01   0x0E
 
#define PRESSURE5_ODR_0p006   0x0F
 
#define PRESSURE5_ODR_0p003   0x10
 
#define PRESSURE5_ODR_0p0015   0x11
 
#define PRESSURE5_CFG_FILTER_COEFF_0   0x00
 
#define PRESSURE5_CFG_FILTER_COEFF_1   0x01 << 1
 
#define PRESSURE5_CFG_FILTER_COEFF_3   0x02 << 1
 
#define PRESSURE5_CFG_FILTER_COEFF_7   0x03 << 1
 
#define PRESSURE5_CFG_FILTER_COEFF_15   0x04 << 1
 
#define PRESSURE5_CFG_FILTER_COEFF_31   0x05 << 1
 
#define PRESSURE5_CFG_FILTER_COEFF_63   0x06 << 1
 
#define PRESSURE5_CFG_FILTER_COEFF_127   0x07 << 1
 
#define PRESSURE5_CMD_EXTMODE_EN_MIDDLE   0x34
 
#define PRESSURE5_CMD_FIFO_FLUSH   0xB0
 
#define PRESSURE5_CMD_SOFTWARE_RESET   0xB6
 
#define PRESSURE5_DEVICE_SLAVE_ADDR_GND   0x76
 
#define PRESSURE5_DEVICE_SLAVE_ADDR_VCC   0x77
 
#define PRESSURE5_TEMPERATURE_RAW_DATA   0x07
 
#define PRESSURE5_PRESSURE_RAW_DATA   0x04
 
#define PRESSURE5_DEVICE_ID   0x50
 

Typedefs

typedef uint8_t pressure5_select_t
 Communication type.
 
typedef void(* pressure5_master_io_t) (struct pressure5_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct pressure5_s pressure5_t
 Click ctx object definition.
 

Functions

void pressure5_cfg_setup (pressure5_cfg_t *cfg)
 Config Object Initialization function.
 
PRESSURE5_RETVAL pressure5_init (pressure5_t *ctx, pressure5_cfg_t *cfg)
 Initialization function.
 
void pressure5_default_cfg (pressure5_t *ctx)
 Click Default Configuration function.
 
void pressure5_generic_write (pressure5_t *ctx, uint8_t reg, uint8_t reg_data)
 Generic write function.
 
uint8_t pressure5_generic_read (pressure5_t *ctx, uint8_t reg)
 Generic read function.
 
void pressure5_read (pressure5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Function for read more bytes from register.
 
uint8_t pressure5_get_interrupt_state (pressure5_t *ctx)
 Get Interrupt pin state.
 
void pressure5_software_reset (pressure5_t *ctx)
 Software Reset.
 
uint32_t pressure5_get_raw_data (pressure5_t *ctx, uint8_t data_addr)
 Get (Temperature or Pressure) Raw data.
 
void pressure5_update_coefficient (pressure5_t *ctx)
 Update calibration coefficients.
 
float pressure5_get_temperature_data (pressure5_t *ctx)
 Get Temperature data in C.
 
float pressure5_get_pressure_data (pressure5_t *ctx)
 Get Pressure data in mBar.
 

Detailed Description

This file contains API for Pressure 5 Click driver.