pressure10 2.0.0.0
pressure10.h File Reference

This file contains API for Pressure 10 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  pressure10_status_t
 
struct  pressure10_s
 Click ctx object definition. More...
 
struct  pressure10_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PRESSURE10_MAP_MIKROBUS(cfg, mikrobus)
 
#define PRESSURE10_MASTER_I2C   0
 
#define PRESSURE10_MASTER_SPI   1
 
#define PRESSURE10_RETVAL   uint8_t
 
#define PRESSURE10_OK   0x00
 
#define PRESSURE10_INIT_ERROR   0xFF
 
#define DEVICE_OK   0
 
#define DEVICE_ERROR   1
 
#define I2C_COMMUNICATION   1
 
#define SPI_COMMUNICATION   0
 
#define PRESSURE10_DEVICE_SLAVE_ADDR_0   0x48
 
#define PRESSURE10_DEVICE_SLAVE_ADDR_1   0x49
 
#define PRESSURE10_REG_WHO_I_AM   0x00
 
#define PRESSURE10_REG_INFORMATION   0x01
 
#define PRESSURE10_REG_FIFO_STATUS   0x02
 
#define PRESSURE10_REG_STATUS   0x03
 
#define PRESSURE10_REG_PRESSURE_OUT_LOW   0x04
 
#define PRESSURE10_REG_PRESSURE_OUT_MID   0x05
 
#define PRESSURE10_REG_PRESSURE_OUT_HIGH   0x06
 
#define PRESSURE10_REG_TEMP_OUT_LOW   0x09
 
#define PRESSURE10_REG_TEMP_OUT_HIGH   0x0A
 
#define PRESSURE10_REG_DRDY_PIN_CRTL   0x0D
 
#define PRESSURE10_REG_CONTROL_1   0x0E
 
#define PRESSURE10_REG_CONTROL_2   0x0F
 
#define PRESSURE10_REG_ACTION_CONTROL_1   0x10
 
#define PRESSURE10_REG_ACTION_CONTROL_2   0x11
 
#define PRESSURE10_REG_FIFO_CONTROL   0x12
 
#define PRESSURE10_REG_AVERAGE_CONTROL   0x13
 
#define PRESSURE10_REG_I2C_DISABLE   0x15
 
#define PRESSURE10_REG_PRODUCT_NUMBER   0x1C
 
#define PRESSURE10_CMD_PRESS_DETECTION   0x20
 
#define PRESSURE10_CMD_TEMP_DETECTION   0x22
 
#define PRESSURE10_CMD_SW_RESET   0x26
 
#define PRESSURE10_CMD_PT_DETECTION   0x29
 
#define PRESSURE10_DEF_WHO_I_AM   0x49
 
#define PRESSURE10_DEF_INFO   0x31
 
#define PRESSURE10_DEF_PRODUCT_NUM   0x40
 
#define PRESSURE10_CTRLDRDY_AFEV_ENABLE   0x80
 
#define PRESSURE10_CTRLDRDY_AFEV_DISABLE   0x00
 
#define PRESSURE10_CTRLDRDY_ATDR_ENABLE   0x10
 
#define PRESSURE10_CTRLDRDY_ATDR_DISABLE   0x00
 
#define PRESSURE10_CTRLDRDY_APOR_ENABLE   0x04
 
#define PRESSURE10_CTRLDRDY_APOR_DISABLE   0x00
 
#define PRESSURE10_CTRLDRDY_APDY_ENABLE   0x01
 
#define PRESSURE10_CTRLDRDY_APDY_DISABLE   0x00
 
#define PRESSURE10_CTRL1_PDRP_LOW_ACTIVE   0x00
 
#define PRESSURE10_CTRL1_PDRP_HIGH_ACTIVE   0x10
 
#define PRESSURE10_CTRL1_PTAP_ULTRA_LOW_PWR   0x00
 
#define PRESSURE10_CTRL1_PTAP_LOW_PWR   0x01
 
#define PRESSURE10_CTRL1_PTAP_HIGH_ACCURACY   0x02
 
#define PRESSURE10_CTRL1_PTAP_ULTRA_ACCURACY   0x03
 
#define PRESSURE10_CTRL2_TMES_DISABLE   0x00
 
#define PRESSURE10_CTRL2_TMES_ENABLE   0x80
 
#define PRESSURE10_CTRL2_PMES_DISABLE   0x00
 
#define PRESSURE10_CTRL2_PMES_ENABLE   0x20
 
#define PRESSURE10_CTRL2_ODR_1HZ   0x00
 
#define PRESSURE10_CTRL2_ODR_10HZ   0x04
 
#define PRESSURE10_CTRL2_ODR_100HZ   0x08
 
#define PRESSURE10_CTRL2_ODR_200HZ   0x0C
 
#define PRESSURE10_CTRL2_MODE_REG_ACTION   0x00
 
#define PRESSURE10_CTRL2_MODE_CONT_MEAS   0x01
 
#define PRESSURE10_CTRL2_MODE_CMD_ACTION   0x02
 
#define PRESSURE10_ACTRL1_TEMP_NO_MEAS   0x00
 
#define PRESSURE10_ACTRL1_TEMP_MEAS   0x08
 
#define PRESSURE10_ACTRL1_PRESS_NO_MEAS   0x00
 
#define PRESSURE10_ACTRL1_PRESS_MEAS   0x02
 
#define PRESSURE10_ACTRL2_SW_RESET_NONE   0x00
 
#define PRESSURE10_ACTRL2_SW_RESET_EXECUTE   0x80
 
#define PRESSURE10_AVCTRL_TFRQ_ONLY_FIRST_TIME   0x00
 
#define PRESSURE10_AVCTRL_TFRQ_ONLY_EVERY_64_TIMES   0x08
 
#define PRESSURE10_AVCTRL_TFRQ_ONLY_EVERY_32_TIMES   0x10
 
#define PRESSURE10_AVCTRL_TFRQ_ONLY_EVERY_16_TIMES   0x18
 
#define PRESSURE10_AVCTRL_TFRQ_ONLY_EVERY_8_TIMES   0x20
 
#define PRESSURE10_AVCTRL_TFRQ_ONLY_EVERY_4_TIMES   0x28
 
#define PRESSURE10_AVCTRL_TFRQ_ONLY_EVERY_2_TIMES   0x30
 
#define PRESSURE10_AVCTRL_TFRQ_EVERY_TIME   0x38
 
#define PRESSURE10_AVCTRL_AVG_NONE   0x00
 
#define PRESSURE10_AVCTRL_AVG_X2   0x01
 
#define PRESSURE10_AVCTRL_AVG_X4   0x02
 
#define PRESSURE10_AVCTRL_AVG_X8   0x03
 
#define PRESSURE10_AVCTRL_AVG_X16   0x04
 
#define PRESSURE10_AVCTRL_AVG_X32   0x05
 
#define PRESSURE10_AVCTRL_AVG_X64   0x06
 
#define PRESSURE10_AVCTRL_AVG_X128   0x07
 

Typedefs

typedef uint8_t pressure10_select_t
 Communication type.
 
typedef void(* pressure10_master_io_t) (struct pressure10_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct pressure10_s pressure10_t
 Click ctx object definition.
 

Functions

void pressure10_cfg_setup (pressure10_cfg_t *cfg)
 Config Object Initialization function.
 
PRESSURE10_RETVAL pressure10_init (pressure10_t *ctx, pressure10_cfg_t *cfg)
 Initialization function.
 
void pressure10_default_cfg (pressure10_t *ctx)
 Click Default Configuration function.
 
void pressure10_generic_write (pressure10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void pressure10_generic_read (pressure10_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void pressure10_send_cmd (pressure10_t *ctx, uint8_t cmd)
 Send command.
 
uint8_t pressure10_check_communication (pressure10_t *ctx)
 Check communication.
 
void pressure10_get_status (pressure10_t *ctx, pressure10_status_t *status_obj)
 Get status function.
 
float pressure10_get_temperature (pressure10_t *ctx)
 Get Temperature data in C.
 
float pressure10_get_pressure (pressure10_t *ctx)
 Get Pressure data in mBar.
 
void pressure10_control_cfg (pressure10_t *ctx, uint8_t ctrl_reg, uint8_t wr_data)
 Set the configuration in the control registers.
 
uint8_t pressure10_get_drdy_pin (pressure10_t *ctx)
 Get DRDY pin state.
 

Detailed Description

This file contains API for Pressure 10 Click driver.