39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
78#define BAROMETER12_CMD_OP_MODE_T_FIRST_LOW_POWER 0x609C
79#define BAROMETER12_CMD_OP_MODE_T_FIRST_NORMAL 0x6825
80#define BAROMETER12_CMD_OP_MODE_T_FIRST_LOW_NOISE 0x70DF
81#define BAROMETER12_CMD_OP_MODE_T_FIRST_ULTRA_LOW_NOISE 0x7866
82#define BAROMETER12_CMD_OP_MODE_P_FIRST_LOW_POWER 0x401A
83#define BAROMETER12_CMD_OP_MODE_P_FIRST_NORMAL 0x48A3
84#define BAROMETER12_CMD_OP_MODE_P_FIRST_LOW_NOISE 0x5059
85#define BAROMETER12_CMD_OP_MODE_P_FIRST_ULTRA_LOW_NOISE 0x58E0
86#define BAROMETER12_CMD_SOFT_RESET 0x805D
87#define BAROMETER12_CMD_DEVICE_ID 0xEFC8
88#define BAROMETER12_CMD_READ_OTP 0xC7F7
89#define BAROMETER12_CMD_OTP_READ_ADDRESS_REG 0xC595
90#define BAROMETER12_CMD_OTP_READ_ADDRESS_PARAM 0x0066
96#define BAROMETER12_P_PA_CALIB_0 45000.0f
97#define BAROMETER12_P_PA_CALIB_1 80000.0f
98#define BAROMETER12_P_PA_CALIB_2 96700.0f
99#define BAROMETER12_LUT_LOWER 3670016.0f
100#define BAROMETER12_LUT_UPPER 12058624.0f
101#define BAROMETER12_QUADR_FACTOR 5.960464477539063e-8f
102#define BAROMETER12_OFFSET_FACTOR 2048.0f
103#define BAROMETER12_TEMPERATURE_COEF_1 45.0f
104#define BAROMETER12_TEMPERATURE_COEF_2 175.0f
105#define BAROMETER12_TEMPERATURE_COEF_3 65536.0f
111#define BAROMETER12_OP_MODE_LOW_POWER 0
112#define BAROMETER12_OP_MODE_NORMAL 1
113#define BAROMETER12_OP_MODE_LOW_NOISE 2
114#define BAROMETER12_OP_MODE_ULTRA_LOW_NOISE 3
121#define BAROMETER12_DEVICE_ADDRESS 0x63
139#define BAROMETER12_MAP_MIKROBUS( cfg, mikrobus ) \
140 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
141 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
183 float sensor_constants[ 4 ];
184 float p_pa_calib[ 3 ];
barometer12_return_value_t
Barometer 12 Click return value data.
Definition barometer12.h:197
@ BAROMETER12_OK
Definition barometer12.h:198
@ BAROMETER12_ERROR
Definition barometer12.h:199
err_t barometer12_set_up_otp_read(barometer12_t *ctx)
Barometer 12 set up OTP read 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_press_and_temp(barometer12_t *ctx, float *pressure, float *temperature)
Barometer 12 get pressure and temperature function.
err_t barometer12_default_cfg(barometer12_t *ctx)
Barometer 12 default configuration function.
err_t barometer12_get_device_id(barometer12_t *ctx, uint16_t *device_id)
Barometer 12 get device ID 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_set_command(barometer12_t *ctx, uint16_t cmd)
Barometer 12 set command 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_soft_reset(barometer12_t *ctx)
Barometer 12 software reset function.
err_t barometer12_init(barometer12_t *ctx, barometer12_cfg_t *cfg)
Barometer 12 initialization function.
void barometer12_cfg_setup(barometer12_cfg_t *cfg)
Barometer 12 configuration object setup 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_otp(barometer12_t *ctx, uint16_t *otp_data)
Barometer 12 get OTP function.
Barometer 12 Click configuration object.
Definition barometer12.h:165
uint32_t i2c_speed
Definition barometer12.h:169
pin_name_t scl
Definition barometer12.h:166
pin_name_t sda
Definition barometer12.h:167
uint8_t i2c_address
Definition barometer12.h:170
Barometer 12 Click structure to hold pressure sensor related parameters object.
Definition barometer12.h:181
float lut_lower
Definition barometer12.h:185
float offst_factor
Definition barometer12.h:188
float quadr_factor
Definition barometer12.h:187
float lut_upper
Definition barometer12.h:186
uint16_t op_mode
Definition barometer12.h:182
Barometer 12 Click context object.
Definition barometer12.h:151
i2c_master_t i2c
Definition barometer12.h:153
uint8_t slave_address
Definition barometer12.h:156