pressure11 2.0.0.0
pressure11.h File Reference

This file contains API for PRESSURE 11 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  pressure11_s
 Click ctx object definition. More...
 
struct  pressure11_cfg_t
 Click configuration structure definition. More...
 

Macros

#define PRESSURE11_MAP_MIKROBUS(cfg, mikrobus)
 
#define PRESSURE11_MASTER_I2C   0
 
#define PRESSURE11_MASTER_SPI   1
 
#define PRESSURE11_RETVAL   uint8_t
 
#define PRESSURE11_OK   0x00
 
#define PRESSURE11_INIT_ERROR   0xFF
 
#define DEVICE_ERROR   0x02
 
#define DEVICE_OK   0x00
 
#define PRESSURE11_I_AM   0xB1
 
#define PRESSURE11_REG_INTERRUPT   0x0B
 
#define PRESSURE11_REG_THS_P_L   0x0C
 
#define PRESSURE11_REG_THS_P_H   0x0D
 
#define PRESSURE11_REG_WHO_AM_I   0x0F
 
#define PRESSURE11_REG_CTRL_REG1   0x10
 
#define PRESSURE11_REG_CTRL_REG2   0x11
 
#define PRESSURE11_REG_CTRL_REG3   0x12
 
#define PRESSURE11_REG_FIFO_CTRL   0x14
 
#define PRESSURE11_REG_REF_P_XL   0x15
 
#define PRESSURE11_REG_REF_P_L   0x16
 
#define PRESSURE11_REG_REF_P_H   0x17
 
#define PRESSURE11_REG_RPDS_L   0x18
 
#define PRESSURE11_REG_RPDS_H   0x19
 
#define PRESSURE11_REG_RES_CONF   0x1A
 
#define PRESSURE11_REG_INT_SOURCE   0x25
 
#define PRESSURE11_REG_FIFO_STATUS   0x26
 
#define PRESSURE11_REG_STATUS   0x27
 
#define PRESSURE11_REG_PRESS_OUT_XL   0x28
 
#define PRESSURE11_REG_PRESS_OUT_L   0x29
 
#define PRESSURE11_REG_PRESS_OUT_H   0x2A
 
#define PRESSURE11_REG_TEMP_OUT_L   0x2B
 
#define PRESSURE11_REG_TEMP_OUT_H   0x2C
 
#define PRESSURE11_REG_LPFP_RES   0x33
 
#define PRESSURE11_CFG_INTERRUPT_AUTORIFP   0x80
 
#define PRESSURE11_CFG_INTERRUPT_RESET_ARP   0x40
 
#define PRESSURE11_CFG_INTERRUPT_AUTOZERO   0x20
 
#define PRESSURE11_CFG_INTERRUPT_RESET_AZ   0x10
 
#define PRESSURE11_CFG_INTERRUPT_DIFF_EN   0x08
 
#define PRESSURE11_CFG_INTERRUPT_LIR   0x04
 
#define PRESSURE11_CFG_INTERRUPT_PLE   0x02
 
#define PRESSURE11_CFG_INTERRUPT_PHE   0x01
 
#define PRESSURE11_CFG_INTERRUPT_DISABLE_ALL   0x00
 
#define PRESSURE11_CTRL_1_ODR_1_HZ   0x10
 
#define PRESSURE11_CTRL_1_ODR_10_HZ   0x20
 
#define PRESSURE11_CTRL_1_ODR_25_HZ   0x30
 
#define PRESSURE11_CTRL_1_ODR_50_HZ   0x40
 
#define PRESSURE11_CTRL_1_ODR_75_HZ   0x50
 
#define PRESSURE11_CTRL_1_EN_LPFP   0x08
 
#define PRESSURE11_CTRL_1_LPFP_CFG   0x04
 
#define PRESSURE11_CTRL_1_BDU   0x02
 
#define PRESSURE11_CTRL_1_SIM   0x01
 
#define PRESSURE11_CTRL_1_DISABLE_ALL   0x00
 
#define PRESSURE11_CTRL_2_BOOT   0x80
 
#define PRESSURE11_CTRL_2_FIFO_EN   0x40
 
#define PRESSURE11_CTRL_2_STOP_ON_FTH   0x20
 
#define PRESSURE11_CTRL_2_IF_ADD_INC   0x10
 
#define PRESSURE11_CTRL_2_I2C_DIS   0x08
 
#define PRESSURE11_CTRL_2_SWRESET   0x04
 
#define PRESSURE11_CTRL_2_ONE_SHOT   0x01
 
#define PRESSURE11_CTRL_2_DISABLE_ALL   0x00
 
#define PRESSURE11_CTRL_3_INT_H_L   0x80
 
#define PRESSURE11_CTRL_3_PP_OD   0x40
 
#define PRESSURE11_CTRL_3_F_FSS5   0x20
 
#define PRESSURE11_CTRL_3_F_FTH   0x10
 
#define PRESSURE11_CTRL_3_F_OVR   0x08
 
#define PRESSURE11_CTRL_3_DRDY   0x04
 
#define PRESSURE11_CTRL_3_INT_PRESS_LOW_OR_HIGH   0x03
 
#define PRESSURE11_CTRL_3_INT_PRESS_LOW   0x02
 
#define PRESSURE11_CTRL_3_INT_PRESS_HIGH   0x01
 
#define PRESSURE11_CTRL_3_DISABLE_ALL   0x00
 
#define PRESSURE11_CTRL_FIFO_BYPASS_TO_FIFO_MODE   0xE0
 
#define PRESSURE11_CTRL_FIFO_DYNAMIC_STREAM_MODE   0xC0
 
#define PRESSURE11_CTRL_FIFO_BYPASS_TO_STREAM_MODE   0x80
 
#define PRESSURE11_CTRL_FIFO_STREAM_TO_FIFO_MODE   0x60
 
#define PRESSURE11_CTRL_FIFO_STREAM_MODE   0x40
 
#define PRESSURE11_CTRL_FIFO_FIFO_MODE   0x20
 
#define PRESSURE11_CTRL_FIFO_BYPASS_MODE   0x00
 
#define PRESSURE11_INT_SOURCE_BOOT_STATUS   0x80
 
#define PRESSURE11_INT_SOURCE_IA   0x04
 
#define PRESSURE11_INT_SOURCE_PL   0x02
 
#define PRESSURE11_INT_SOURCE_PH   0x01
 
#define PRESSURE11_STATUS_FTH_FIFO   0x80
 
#define PRESSURE11_STATUS_OVR   0x40
 
#define PRESSURE11_STATUS_FIFO_32_UNREAD_SAMPLES   0x20
 
#define PRESSURE11_STATUS_FIFO_31_UNREAD_SAMPLES   0x1F
 
#define PRESSURE11_STATUS_FIFO_30_UNREAD_SAMPLES   0x1E
 
#define PRESSURE11_STATUS_FIFO_29_UNREAD_SAMPLES   0x1D
 
#define PRESSURE11_STATUS_FIFO_28_UNREAD_SAMPLES   0x1C
 
#define PRESSURE11_STATUS_FIFO_27_UNREAD_SAMPLES   0x1B
 
#define PRESSURE11_STATUS_FIFO_26_UNREAD_SAMPLES   0x1A
 
#define PRESSURE11_STATUS_FIFO_25_UNREAD_SAMPLES   0x19
 
#define PRESSURE11_STATUS_FIFO_24_UNREAD_SAMPLES   0x18
 
#define PRESSURE11_STATUS_FIFO_23_UNREAD_SAMPLES   0x17
 
#define PRESSURE11_STATUS_FIFO_22_UNREAD_SAMPLES   0x16
 
#define PRESSURE11_STATUS_FIFO_21_UNREAD_SAMPLES   0x15
 
#define PRESSURE11_STATUS_FIFO_20_UNREAD_SAMPLES   0x14
 
#define PRESSURE11_STATUS_FIFO_19_UNREAD_SAMPLES   0x13
 
#define PRESSURE11_STATUS_FIFO_18_UNREAD_SAMPLES   0x12
 
#define PRESSURE11_STATUS_FIFO_17_UNREAD_SAMPLES   0x11
 
#define PRESSURE11_STATUS_FIFO_16_UNREAD_SAMPLES   0x10
 
#define PRESSURE11_STATUS_FIFO_15_UNREAD_SAMPLES   0x0F
 
#define PRESSURE11_STATUS_FIFO_14_UNREAD_SAMPLES   0x0E
 
#define PRESSURE11_STATUS_FIFO_13_UNREAD_SAMPLES   0x0D
 
#define PRESSURE11_STATUS_FIFO_12_UNREAD_SAMPLES   0x0C
 
#define PRESSURE11_STATUS_FIFO_11_UNREAD_SAMPLES   0x0B
 
#define PRESSURE11_STATUS_FIFO_10_UNREAD_SAMPLES   0x0A
 
#define PRESSURE11_STATUS_FIFO_9_UNREAD_SAMPLES   0x09
 
#define PRESSURE11_STATUS_FIFO_8_UNREAD_SAMPLES   0x08
 
#define PRESSURE11_STATUS_FIFO_7_UNREAD_SAMPLES   0x07
 
#define PRESSURE11_STATUS_FIFO_6_UNREAD_SAMPLES   0x06
 
#define PRESSURE11_STATUS_FIFO_5_UNREAD_SAMPLES   0x05
 
#define PRESSURE11_STATUS_FIFO_4_UNREAD_SAMPLES   0x04
 
#define PRESSURE11_STATUS_FIFO_3_UNREAD_SAMPLES   0x03
 
#define PRESSURE11_STATUS_FIFO_2_UNREAD_SAMPLES   0x02
 
#define PRESSURE11_STATUS_FIFO_1_UNREAD_SAMPLES   0x01
 
#define PRESSURE11_STATUS_FIFO_EMPTY   0x00
 
#define PRESSURE11_STATUS_T_OR   0x20
 
#define PRESSURE11_STATUS_P_OR   0x10
 
#define PRESSURE11_STATUS_T_DA   0x02
 
#define PRESSURE11_STATUS_P_DA   0x01
 
#define PRESSURE11_DEVICE_SLAVE_ADDR_GND   0x5C
 
#define PRESSURE11_DEVICE_SLAVE_ADDR_VDD   0x5D
 

Typedefs

typedef uint8_t pressure11_select_t
 Communication type.
 
typedef void(* pressure11_master_io_t) (struct pressure11_s *, uint8_t, uint8_t *, uint8_t)
 Master Input/Output type.
 
typedef struct pressure11_s pressure11_t
 Click ctx object definition.
 

Functions

void pressure11_cfg_setup (pressure11_cfg_t *cfg)
 Config Object Initialization function.
 
PRESSURE11_RETVAL pressure11_init (pressure11_t *ctx, pressure11_cfg_t *cfg)
 Initialization function.
 
void pressure11_generic_write (pressure11_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void pressure11_generic_read (pressure11_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
uint8_t pressure11_check_id (pressure11_t *ctx)
 Functions for cheking commuincation with the chip and checking its ID.
 
float pressure11_get_temperature (pressure11_t *ctx)
 Functions for temperature reading.
 
float pressure11_get_pressure (pressure11_t *ctx)
 Functions for pressure reading.
 
uint8_t pressure11_get_interrupt (pressure11_t *ctx)
 Functions for read int pin.
 

Detailed Description

This file contains API for PRESSURE 11 Click driver.