barometer12 2.1.0.0
barometer12.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  barometer12_t
 Barometer 12 Click context object. More...
 
struct  barometer12_cfg_t
 Barometer 12 Click configuration object. More...
 
struct  barometer12_invpres_t
 Barometer 12 Click structure to hold pressure sensor related parameters object. More...
 

Macros

#define BAROMETER12_CMD_OP_MODE_T_FIRST_LOW_POWER   0x609C
 Barometer 12 description setting.
 
#define BAROMETER12_CMD_OP_MODE_T_FIRST_NORMAL   0x6825
 
#define BAROMETER12_CMD_OP_MODE_T_FIRST_LOW_NOISE   0x70DF
 
#define BAROMETER12_CMD_OP_MODE_T_FIRST_ULTRA_LOW_NOISE   0x7866
 
#define BAROMETER12_CMD_OP_MODE_P_FIRST_LOW_POWER   0x401A
 
#define BAROMETER12_CMD_OP_MODE_P_FIRST_NORMAL   0x48A3
 
#define BAROMETER12_CMD_OP_MODE_P_FIRST_LOW_NOISE   0x5059
 
#define BAROMETER12_CMD_OP_MODE_P_FIRST_ULTRA_LOW_NOISE   0x58E0
 
#define BAROMETER12_CMD_SOFT_RESET   0x805D
 
#define BAROMETER12_CMD_DEVICE_ID   0xEFC8
 
#define BAROMETER12_CMD_READ_OTP   0xC7F7
 
#define BAROMETER12_CMD_OTP_READ_ADDRESS_REG   0xC595
 
#define BAROMETER12_CMD_OTP_READ_ADDRESS_PARAM   0x0066
 
#define BAROMETER12_P_PA_CALIB_0   45000.0f
 Barometer 12 calculation setting.
 
#define BAROMETER12_P_PA_CALIB_1   80000.0f
 
#define BAROMETER12_P_PA_CALIB_2   96700.0f
 
#define BAROMETER12_LUT_LOWER   3670016.0f
 
#define BAROMETER12_LUT_UPPER   12058624.0f
 
#define BAROMETER12_QUADR_FACTOR   5.960464477539063e-8f
 
#define BAROMETER12_OFFSET_FACTOR   2048.0f
 
#define BAROMETER12_TEMPERATURE_COEF_1   45.0f
 
#define BAROMETER12_TEMPERATURE_COEF_2   175.0f
 
#define BAROMETER12_TEMPERATURE_COEF_3   65536.0f
 
#define BAROMETER12_OP_MODE_LOW_POWER   0
 Barometer 12 description setting.
 
#define BAROMETER12_OP_MODE_NORMAL   1
 
#define BAROMETER12_OP_MODE_LOW_NOISE   2
 
#define BAROMETER12_OP_MODE_ULTRA_LOW_NOISE   3
 
#define BAROMETER12_DEVICE_ADDRESS   0x63
 Barometer 12 device address setting.
 
#define BAROMETER12_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  barometer12_return_value_t { BAROMETER12_OK = 0 , BAROMETER12_ERROR = -1 }
 Barometer 12 Click return value data. More...
 

Functions

void barometer12_cfg_setup (barometer12_cfg_t *cfg)
 Barometer 12 configuration object setup function.
 
err_t barometer12_init (barometer12_t *ctx, barometer12_cfg_t *cfg)
 Barometer 12 initialization function.
 
err_t barometer12_default_cfg (barometer12_t *ctx)
 Barometer 12 default configuration function.
 
err_t barometer12_generic_write (barometer12_t *ctx, uint16_t cmd, uint16_t *data_in, uint8_t len)
 Barometer 12 I2C writing function.
 
err_t barometer12_generic_read (barometer12_t *ctx, uint16_t cmd, uint16_t *data_out, uint8_t len)
 Barometer 12 I2C reading function.
 
err_t barometer12_set_command (barometer12_t *ctx, uint16_t cmd)
 Barometer 12 set command function.
 
err_t barometer12_soft_reset (barometer12_t *ctx)
 Barometer 12 software reset function.
 
err_t barometer12_get_device_id (barometer12_t *ctx, uint16_t *device_id)
 Barometer 12 get device ID function.
 
err_t barometer12_set_up_otp_read (barometer12_t *ctx)
 Barometer 12 set up OTP read function.
 
err_t barometer12_get_otp (barometer12_t *ctx, uint16_t *otp_data)
 Barometer 12 get OTP function.
 
err_t barometer12_inv_invpres_calib (barometer12_t *ctx, barometer12_invpres_t *cfg_data)
 Barometer 12 inverse process data function.
 
err_t barometer12_get_raw_data (barometer12_t *ctx, uint16_t measurement_comd, uint32_t *pressure, uint16_t *temperature)
 Barometer 12 get RAW data function.
 
err_t barometer12_get_press_and_temp (barometer12_t *ctx, float *pressure, float *temperature)
 Barometer 12 get pressure and temperature function.
 

Detailed Description

This file contains API for Barometer 12 Click Driver.

Enumeration Type Documentation

◆ barometer12_return_value_t

Barometer 12 Click return value data.

Predefined enum values for driver return values.

Enumerator
BAROMETER12_OK 
BAROMETER12_ERROR