barometer13 2.1.0.0
barometer13.h File Reference

This file contains API for Barometer 13 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  barometer13_s
 Barometer 13 Click context object. More...
 
struct  barometer13_cfg_t
 Barometer 13 Click configuration object. More...
 

Macros

#define BAROMETER13_REG_CHIP_ID   0x01
 Barometer 13 description register.
 
#define BAROMETER13_REG_REV_ID   0x02
 
#define BAROMETER13_REG_CHIP_STATUS   0x11
 
#define BAROMETER13_REG_DRIVE_CONFIG   0x13
 
#define BAROMETER13_REG_INT_CONFIG   0x14
 
#define BAROMETER13_REG_INT_SOURCE   0x15
 
#define BAROMETER13_REG_FIFO_CONFIG   0x16
 
#define BAROMETER13_REG_FIFO_COUNT   0x17
 
#define BAROMETER13_REG_FIFO_SEL   0x18
 
#define BAROMETER13_REG_TEMP_DATA_XLSB   0x1D
 
#define BAROMETER13_REG_TEMP_DATA_LSB   0x1E
 
#define BAROMETER13_REG_TEMP_DATA_MSB   0x1F
 
#define BAROMETER13_REG_PRESS_DATA_XLSB   0x20
 
#define BAROMETER13_REG_PRESS_DATA_LSB   0x21
 
#define BAROMETER13_REG_PRESS_DATA_MSB   0x22
 
#define BAROMETER13_REG_INT_STATUS   0x27
 
#define BAROMETER13_REG_STATUS   0x28
 
#define BAROMETER13_REG_FIFO_DATA   0x29
 
#define BAROMETER13_REG_NVM_ADDR   0x2B
 
#define BAROMETER13_REG_NVM_DATA_LSB   0x2C
 
#define BAROMETER13_REG_NVM_DATA_MSB   0x2D
 
#define BAROMETER13_REG_DSP_CONFIG   0x30
 
#define BAROMETER13_REG_DSP_IIR   0x31
 
#define BAROMETER13_REG_OOR_THR_P_LSB   0x32
 
#define BAROMETER13_REG_OOR_THR_P_MSB   0x33
 
#define BAROMETER13_REG_OOR_RANGE   0x34
 
#define BAROMETER13_REG_OOR_CONFIG   0x35
 
#define BAROMETER13_REG_OSR_CONFIG   0x36
 
#define BAROMETER13_REG_ODR_CONFIG   0x37
 
#define BAROMETER13_REG_OSR_EFF   0x38
 
#define BAROMETER13_REG_CMD   0x7E
 
#define BAROMETER13_CHIP_ID   0x51
 Barometer 13 identification and revision ID data values.
 
#define BAROMETER13_REV_ID   0x32
 
#define BAROMETER13_INT_ENABLE   0x08
 Barometer 13 interrupt configuration register data values.
 
#define BAROMETER13_INT_DISABLE   0x00
 
#define BAROMETER13_INT_OPEN_DRAIN   0x04
 
#define BAROMETER13_INT_PUSH_PULL   0x00
 
#define BAROMETER13_INT_ACTIVE_HIGH   0x02
 
#define BAROMETER13_INT_ACTIVE_LOW   0x00
 
#define BAROMETER13_INT_LATCHED   0x01
 
#define BAROMETER13_INT_PULSED   0x00
 
#define BAROMETER13_OOR_P_EN   0x08
 Barometer 13 interrupt source selection data values.
 
#define BAROMETER13_FIFO_THS_EN   0x04
 
#define BAROMETER13_FIFO_FULL_EN   0x02
 
#define BAROMETER13_DRDY_DATA_EN   0x01
 
#define BAROMETER13_DRDY_DATA_DIS   0x00
 
#define BAROMETER13_INT_STATUS_POR   0x10
 Barometer 13 interrupt status register data values.
 
#define BAROMETER13_INT_STATUS_OOR_P   0x08
 
#define BAROMETER13_INT_STATUS_FIFO_THS   0x04
 
#define BAROMETER13_INT_STATUS_FIFO_FULL   0x02
 
#define BAROMETER13_INT_STATUS_DRDY_DATA_REG   0x01
 
#define BAROMETER13_OOR_SEL_IIR_P   0x80
 Barometer 13 DSP configuration data values.
 
#define BAROMETER13_FIFO_SEL_IIR_P   0x40
 
#define BAROMETER13_SHDW_SEL_IIR_P   0x20
 
#define BAROMETER13_FIFO_SEL_IIR_T   0x10
 
#define BAROMETER13_SHDW_SEL_IIR_T   0x08
 
#define BAROMETER13_IIR_FLUSH_FORCED_EN   0x04
 
#define BAROMETER13_DSP_CFG_RESERVED_BITS   0x03
 
#define BAROMETER13_SET_IIR_P_BYPASS   0x00
 Barometer 13 DSP configuration data values.
 
#define BAROMETER13_SET_IIR_P_FLT_COEF_1   0x08
 
#define BAROMETER13_SET_IIR_P_FLT_COEF_3   0x10
 
#define BAROMETER13_SET_IIR_P_FLT_COEF_7   0x18
 
#define BAROMETER13_SET_IIR_P_FLT_COEF_15   0x20
 
#define BAROMETER13_SET_IIR_P_FLT_COEF_31   0x28
 
#define BAROMETER13_SET_IIR_P_FLT_COEF_63   0x30
 
#define BAROMETER13_SET_IIR_P_FLT_COEF_127   0x38
 
#define BAROMETER13_SET_IIR_T_BYPASS   0x00
 
#define BAROMETER13_SET_IIR_T_FLT_COEF_1   0x01
 
#define BAROMETER13_SET_IIR_T_FLT_COEF_3   0x02
 
#define BAROMETER13_SET_IIR_T_FLT_COEF_7   0x03
 
#define BAROMETER13_SET_IIR_T_FLT_COEF_15   0x04
 
#define BAROMETER13_SET_IIR_T_FLT_COEF_31   0x05
 
#define BAROMETER13_SET_IIR_T_FLT_COEF_63   0x06
 
#define BAROMETER13_SET_IIR_T_FLT_COEF_127   0x07
 
#define BAROMETER13_PRESS_EN   0x40
 Barometer 13 over-sampling rate (OSR) configuration data values.
 
#define BAROMETER13_OSR_P_1X   0x00
 
#define BAROMETER13_OSR_P_2X   0x08
 
#define BAROMETER13_OSR_P_4X   0x10
 
#define BAROMETER13_OSR_P_8X   0x18
 
#define BAROMETER13_OSR_P_16X   0x20
 
#define BAROMETER13_OSR_P_32X   0x28
 
#define BAROMETER13_OSR_P_64X   0x30
 
#define BAROMETER13_OSR_P_128X   0x38
 
#define BAROMETER13_OSR_T_1X   0x00
 
#define BAROMETER13_OSR_T_2X   0x01
 
#define BAROMETER13_OSR_T_4X   0x02
 
#define BAROMETER13_OSR_T_8X   0x03
 
#define BAROMETER13_OSR_T_16X   0x04
 
#define BAROMETER13_OSR_T_32X   0x05
 
#define BAROMETER13_OSR_T_64X   0x06
 
#define BAROMETER13_OSR_T_128X   0x07
 
#define BAROMETER13_DEEP_DIS   0x80
 Barometer 13 output data rate (ODR) configuration data values.
 
#define BAROMETER13_ODR_240_HZ   0x00
 
#define BAROMETER13_ODR_218_537_HZ   0x04
 
#define BAROMETER13_ODR_199_111_HZ   0x08
 
#define BAROMETER13_ODR_179_2_HZ   0x0C
 
#define BAROMETER13_ODR_160_HZ   0x10
 
#define BAROMETER13_ODR_149_333_HZ   0x14
 
#define BAROMETER13_ODR_140_HZ   0x18
 
#define BAROMETER13_ODR_129_855_HZ   0x1C
 
#define BAROMETER13_ODR_120_HZ   0x20
 
#define BAROMETER13_ODR_110_164_HZ   0x24
 
#define BAROMETER13_ODR_100_299_HZ   0x28
 
#define BAROMETER13_ODR_89p6_HZ   0x2C
 
#define BAROMETER13_ODR_80_HZ   0x30
 
#define BAROMETER13_ODR_70_HZ   0x34
 
#define BAROMETER13_ODR_60_HZ   0x38
 
#define BAROMETER13_ODR_50_056_HZ   0x3C
 
#define BAROMETER13_ODR_45_025_HZ   0x40
 
#define BAROMETER13_ODR_40_HZ   0x44
 
#define BAROMETER13_ODR_35_HZ   0x48
 
#define BAROMETER13_ODR_30_HZ   0x4C
 
#define BAROMETER13_ODR_25_005_HZ   0x50
 
#define BAROMETER13_ODR_20_HZ   0x54
 
#define BAROMETER13_ODR_15_HZ   0x58
 
#define BAROMETER13_ODR_10_HZ   0x5C
 
#define BAROMETER13_ODR_5_HZ   0x60
 
#define BAROMETER13_ODR_4_HZ   0x64
 
#define BAROMETER13_ODR_3_HZ   0x68
 
#define BAROMETER13_ODR_2_HZ   0x6C
 
#define BAROMETER13_ODR_1_HZ   0x70
 
#define BAROMETER13_ODR_0_5_HZ   0x74
 
#define BAROMETER13_ODR_0_25_HZ   0x78
 
#define BAROMETER13_ODR_0_125_HZ   0x7C
 
#define BAROMETER13_PWR_MODE_STANDBY   0x00
 
#define BAROMETER13_PWR_MODE_NORMAL   0x01
 
#define BAROMETER13_PWR_MODE_FORCE   0x02
 
#define BAROMETER13_PWR_MODE_NON_STOP   0x03
 
#define BAROMETER13_INT_STATE_HIGH   0x01
 Barometer 13 states of the interrupt.
 
#define BAROMETER13_INT_STATE_LOW   0x00
 
#define BAROMETER13_PRESS_DATA_RES   64.0f
 Barometer 13 pressure and temperature resolution.
 
#define BAROMETER13_TEMP_DATA_RES   65536.0f
 
#define BAROMETER13_PA_TO_MBAR   100.0f
 
#define BAROMETER13_DEVICE_ADDRESS_1   0x46
 Barometer 13 device address setting.
 
#define BAROMETER13_DEVICE_ADDRESS_0   0x47
 
#define BAROMETER13_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define BAROMETER13_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define BAROMETER13_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* barometer13_master_io_t) (struct barometer13_s *, uint8_t, uint8_t *, uint8_t)
 Barometer 13 Click driver interface.
 
typedef struct barometer13_s barometer13_t
 Barometer 13 Click context object.
 

Enumerations

enum  barometer13_drv_t { BAROMETER13_DRV_SEL_SPI , BAROMETER13_DRV_SEL_I2C }
 Barometer 13 Click driver selector. More...
 
enum  barometer13_return_value_t { BAROMETER13_OK = 0 , BAROMETER13_ERROR = -1 }
 Barometer 13 Click return value data. More...
 

Functions

void barometer13_cfg_setup (barometer13_cfg_t *cfg)
 Barometer 13 configuration object setup function.
 
void barometer13_drv_interface_sel (barometer13_cfg_t *cfg, barometer13_drv_t drv_sel)
 Barometer 13 driver interface setup function.
 
err_t barometer13_init (barometer13_t *ctx, barometer13_cfg_t *cfg)
 Barometer 13 initialization function.
 
err_t barometer13_default_cfg (barometer13_t *ctx)
 Barometer 13 default configuration function.
 
err_t barometer13_generic_write (barometer13_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Barometer 13 data writing function.
 
err_t barometer13_generic_read (barometer13_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Barometer 13 data reading function.
 
err_t barometer13_reg_write (barometer13_t *ctx, uint8_t reg, uint8_t data_in)
 Barometer 13 register data writing function.
 
err_t barometer13_reg_read (barometer13_t *ctx, uint8_t reg, uint8_t *data_out)
 Barometer 13 register data reading function.
 
err_t barometer13_get_device_id (barometer13_t *ctx, uint8_t *chip_id, uint8_t *rev_id)
 Barometer 13 get device ID function.
 
err_t barometer13_set_int_cfg (barometer13_t *ctx, uint8_t int_en, uint8_t int_od, uint8_t int_pol, uint8_t int_mode)
 Barometer 13 set the interrupt config function.
 
err_t barometer13_set_drdy_data (barometer13_t *ctx, uint8_t en_drdy_data)
 Barometer 13 set data ready function.
 
err_t barometer13_get_int_status (barometer13_t *ctx, uint8_t *int_status)
 Barometer 13 get interrupt status function.
 
err_t barometer13_set_shdw_sel (barometer13_t *ctx, uint8_t shdw_sel_iir_p, uint8_t shdw_sel_iir_t)
 Barometer 13 set shadow IIR selection function.
 
err_t barometer13_set_lpf_band_flt (barometer13_t *ctx, uint8_t set_iir_p, uint8_t set_iir_t)
 Barometer 13 set LPF band filter function.
 
err_t barometer13_set_osr (barometer13_t *ctx, uint8_t osr_p, uint8_t osr_t)
 Barometer 13 set over-sampling rate function.
 
err_t barometer13_press_enable (barometer13_t *ctx)
 Barometer 13 enable pressure data function.
 
err_t barometer13_set_odr (barometer13_t *ctx, uint8_t odr)
 Barometer 13 set the output data rate function.
 
err_t barometer13_set_pwr_mode (barometer13_t *ctx, uint8_t pwr_mode)
 Barometer 13 set power mode configuration function.
 
err_t barometer13_get_raw_data (barometer13_t *ctx, int32_t *press_data, int32_t *temp_data)
 Barometer 13 get raw data function.
 
err_t barometer13_get_measurement (barometer13_t *ctx, float *pressure, float *temperature)
 Barometer 13 get the measurement data function.
 
err_t barometer13_get_pressure (barometer13_t *ctx, float *pressure)
 Barometer 13 get the pressure data function.
 
uint8_t barometer13_get_interrupt (barometer13_t *ctx)
 Barometer 13 get the interrupt function.
 

Detailed Description

This file contains API for Barometer 13 Click Driver.

Typedef Documentation

◆ barometer13_master_io_t

typedef err_t(* barometer13_master_io_t) (struct barometer13_s *, uint8_t, uint8_t *, uint8_t)

Barometer 13 Click driver interface.

Definition of driver interface of Barometer 13 Click driver. Driver serial interface.

◆ barometer13_t

typedef struct barometer13_s barometer13_t

Barometer 13 Click context object.

Context object definition of Barometer 13 Click driver.

Enumeration Type Documentation

◆ barometer13_drv_t

Barometer 13 Click driver selector.

Selects target driver interface of Barometer 13 Click driver.

Enumerator
BAROMETER13_DRV_SEL_SPI 

SPI driver descriptor.

BAROMETER13_DRV_SEL_I2C 

I2C driver descriptor.

◆ barometer13_return_value_t

Barometer 13 Click return value data.

Predefined enum values for driver return values.

Enumerator
BAROMETER13_OK 
BAROMETER13_ERROR