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"
74#define BAROMETER5_CMD_RESET 0x1E
75#define BAROMETER5_CMD_CONV_D1_OSR_256 0x40
76#define BAROMETER5_CMD_CONV_D1_OSR_512 0x42
77#define BAROMETER5_CMD_CONV_D1_OSR_1024 0x44
78#define BAROMETER5_CMD_CONV_D1_OSR_2048 0x46
79#define BAROMETER5_CMD_CONV_D1_OSR_4096 0x48
80#define BAROMETER5_CMD_CONV_D2_OSR_256 0x50
81#define BAROMETER5_CMD_CONV_D2_OSR_512 0x52
82#define BAROMETER5_CMD_CONV_D2_OSR_1024 0x54
83#define BAROMETER5_CMD_CONV_D2_OSR_2048 0x56
84#define BAROMETER5_CMD_CONV_D2_OSR_4096 0x58
85#define BAROMETER5_CMD_ADC_READ 0x00
86#define BAROMETER5_CMD_PROM_READ_START 0xA0
104#define BAROMETER5_RATIO_256 0x00
105#define BAROMETER5_RATIO_512 0x01
106#define BAROMETER5_RATIO_1024 0x02
107#define BAROMETER5_RATIO_2048 0x03
108#define BAROMETER5_RATIO_4096 0x04
115#define BAROMETER5_SET_DEV_ADDR 0x76
133#define BAROMETER5_MAP_MIKROBUS( cfg, mikrobus ) \
134 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
135 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
barometer5_return_value_t
Barometer 5 Click return value data.
Definition barometer5.h:187
@ BAROMETER5_OK
Definition barometer5.h:188
@ BAROMETER5_ERROR
Definition barometer5.h:189
err_t barometer5_get_temperature(barometer5_t *ctx, float *temperature)
Barometer 5 get temperature data function.
err_t barometer5_get_pressure(barometer5_t *ctx, float *pressure)
Barometer 5 get pressure data function.
err_t barometer5_generic_read(barometer5_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Barometer 5 I2C reading function.
err_t barometer5_generic_write(barometer5_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Barometer 5 I2C writing function.
err_t barometer5_default_cfg(barometer5_t *ctx)
Barometer 5 default configuration function.
err_t barometer5_get_calibration_data(barometer5_t *ctx)
Barometer 5 get calibration data function.
err_t barometer5_get_raw_data(barometer5_t *ctx, uint32_t *temp_data, uint32_t *press_data)
Barometer 5 get raw data function.
err_t barometer5_calculate_altitude(barometer5_t *ctx, float *altitude)
Barometer 5 calculate altitude function.
void barometer5_cfg_setup(barometer5_cfg_t *cfg)
Barometer 5 configuration object setup function.
err_t barometer5_set_ratio(barometer5_t *ctx, uint8_t temp_ratio, uint8_t press_ratio)
Barometer 5 set data ratio function.
err_t barometer5_get_data(barometer5_t *ctx, float *temperature, float *pressure)
Barometer 5 get data function.
err_t barometer5_init(barometer5_t *ctx, barometer5_cfg_t *cfg)
Barometer 5 initialization function.
err_t barometer5_sw_reset(barometer5_t *ctx)
Barometer 5 software reset function.
err_t barometer5_set_command(barometer5_t *ctx, uint8_t cmd)
Barometer 5 set command function.
Barometer 5 Click configuration object.
Definition barometer5.h:171
uint32_t i2c_speed
Definition barometer5.h:175
float sea_level_pressure
Definition barometer5.h:178
pin_name_t scl
Definition barometer5.h:172
pin_name_t sda
Definition barometer5.h:173
uint8_t i2c_address
Definition barometer5.h:176
Barometer 5 Click context object.
Definition barometer5.h:145
uint16_t press_tcs_c3
Definition barometer5.h:156
uint16_t press_sens_c1
Definition barometer5.h:154
float sea_lvl_pressure
Definition barometer5.h:152
uint16_t press_tempsens_c6
Definition barometer5.h:159
uint16_t press_tco_c4
Definition barometer5.h:157
i2c_master_t i2c
Definition barometer5.h:147
uint8_t ratio_temp
Definition barometer5.h:161
uint16_t press_tref_c5
Definition barometer5.h:158
uint8_t slave_address
Definition barometer5.h:150
uint16_t press_off_c2
Definition barometer5.h:155
uint8_t ratio_press
Definition barometer5.h:162