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"
52#include "drv_spi_master.h"
75#define BAROMETER6_TEMP_TXD0 0xFC
76#define BAROMETER6_TEMP_TXD1 0xFB
77#define BAROMETER6_TEMP_TXD2 0xFA
78#define BAROMETER6_PRESS_TXD0 0xF9
79#define BAROMETER6_PRESS_TXD1 0xF8
80#define BAROMETER6_PRESS_TXD2 0xF7
81#define BAROMETER6_IO_SETUP 0xF5
82#define BAROMETER6_CTRL_MESS 0xF4
83#define BAROMETER6_DEVICE_STAT 0xF3
84#define BAROMETER6_I2C_SET 0xF2
85#define BAROMETER6_IIR_CNT 0XF1
86#define BAROMETER6_RESET 0XE0
87#define BAROMETER6_CHIP_ID 0XD1
88#define BAROMETER6_COE_B00_A0_EX 0XB8
89#define BAROMETER6_COE_A2_0 0XB7
90#define BAROMETER6_COE_A2_1 0XB6
91#define BAROMETER6_COE_A1_0 0XB5
92#define BAROMETER6_COE_A1_1 0XB4
93#define BAROMETER6_COE_A0_0 0XB3
94#define BAROMETER6_COE_A0_1 0XB2
95#define BAROMETER6_COE_BP3_0 0XB1
96#define BAROMETER6_COE_BP3_1 0XB0
97#define BAROMETER6_COE_B21_0 0XAF
98#define BAROMETER6_COE_B21_1 0XAE
99#define BAROMETER6_COE_B12_0 0XAD
100#define BAROMETER6_COE_B12_1 0XAC
101#define BAROMETER6_COE_BP2_0 0XAB
102#define BAROMETER6_COE_BP2_1 0XAA
103#define BAROMETER6_COE_B11_0 0XA9
104#define BAROMETER6_COE_B11_1 0XA8
105#define BAROMETER6_COE_BP1_0 0XA7
106#define BAROMETER6_COE_BP1_1 0XA6
107#define BAROMETER6_COE_BT2_0 0XA5
108#define BAROMETER6_COE_BT2_1 0XA4
109#define BAROMETER6_COE_BT1_0 0XA3
110#define BAROMETER6_COE_BT1_1 0XA2
111#define BAROMETER6_COE_B00_0 0XA1
112#define BAROMETER6_COE_B00_1 0XA0
135#define BAROMETER6_CMD_RESET 0xE6
141#define BAROMETER6_AVG_SKIP 0x00
142#define BAROMETER6_AVG_1 0x01
143#define BAROMETER6_AVG_2 0x02
144#define BAROMETER6_AVG_4 0x03
145#define BAROMETER6_AVG_8 0x04
146#define BAROMETER6_AVG_16 0x05
147#define BAROMETER6_AVG_32 0x06
148#define BAROMETER6_AVG_64 0x07
154#define BAROMETER6_SLEEP_MODE 0x00
155#define BAROMETER6_FORCED_MODE_1 0x01
156#define BAROMETER6_FORCED_MODE_2 0x02
157#define BAROMETER6_NORMAL_MODE 0x03
163#define BAROMETER6_DATA_NOT_READY 0x00
164#define BAROMETER6_DATA_READY 0x01
170#define BAROMETER6_STANDBY_1ms 0x00
171#define BAROMETER6_STANDBY_5ms 0x01
172#define BAROMETER6_STANDBY_50ms 0x02
173#define BAROMETER6_STANDBY_250ms 0x03
174#define BAROMETER6_STANDBY_500ms 0x04
175#define BAROMETER6_STANDBY_1s 0x05
176#define BAROMETER6_STANDBY_2s 0x06
177#define BAROMETER6_STANDBY_4s 0x07
183#define BAROMETER6_ID_VALUE 0x5C
190#define BAROMETER6_SET_DEV_ADDR_LOW 0x70
191#define BAROMETER6_SET_DEV_ADDR_HIGH 0x56
201#define BAROMETER6_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
202#define BAROMETER6_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
220#define BAROMETER6_MAP_MIKROBUS( cfg, mikrobus ) \
221 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
222 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
223 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
224 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
225 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
226 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
227 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
barometer6_drv_t
Barometer 6 Click driver selector.
Definition barometer6.h:236
@ BAROMETER6_DRV_SEL_I2C
Definition barometer6.h:238
@ BAROMETER6_DRV_SEL_SPI
Definition barometer6.h:237
struct barometer6_s barometer6_t
Barometer 6 Click context object.
barometer6_return_value_t
Barometer 6 Click return value data.
Definition barometer6.h:312
@ BAROMETER6_OK
Definition barometer6.h:313
@ BAROMETER6_ERROR
Definition barometer6.h:314
err_t(* barometer6_master_io_t)(struct barometer6_s *, uint8_t, uint8_t *, uint8_t)
Barometer 6 Click driver interface.
Definition barometer6.h:246
void barometer6_read_raw_temp(barometer6_t *ctx, int32_t *data_out)
Barometer 6 read raw temperature function.
void barometer6_read_temperature_value(barometer6_t *ctx, float *temp_out)
Barometer 6 get temperature value function.
void barometer6_read_raw_pressure(barometer6_t *ctx, float *data_out)
Barometer 6 read raw pressure function.
void barometer6_read_preassure_value(barometer6_t *ctx, float *press_out)
Barometer 6 get preassure mBar function.
void barometer6_read_preassure_data(barometer6_t *ctx, float *press_out)
Barometer 6 get preassure data function.
void barometer6_get_conp_coef(barometer6_t *ctx, uint8_t reg, float a_coef, float s_coef, float *data_out)
Barometer 6 calculate conpensation coefficients data function.
void barometer6_default_cfg(barometer6_t *ctx)
Barometer 6 default configuration function.
void barometer6_read_conp_coef(barometer6_t *ctx, uint8_t reg, int16_t *data_out)
Barometer 6 read conpensation coefficients data function.
void barometer6_read_id(barometer6_t *ctx, uint8_t *data_out)
Barometer 6 Id reading function.
void barometer6_set_mode(barometer6_t *ctx, uint8_t mode)
Barometer 6 set operation mode function.
uint8_t barometer6_check_ready(barometer6_t *ctx)
Barometer 6 check if data is ready function.
void barometer6_get_conpesation_coe(barometer6_t *ctx)
Barometer 6 get all conpensation coefficients data function.
void barometer6_software_reset(barometer6_t *ctx)
Barometer 6 software reset function.
void barometer6_hardware_reset(barometer6_t *ctx)
Barometer 6 hardware reset function.
void barometer6_get_a0_b00_coef(barometer6_t *ctx, float *coef_a0, float *coef_b00)
Barometer 6 calculate a0 and b00 conpensation coefficients data function.
void barometer6_read_register(barometer6_t *ctx, uint8_t reg, uint16_t *data_out)
Barometer 6 data reading function.
void barometer6_get_temperature_data(barometer6_t *ctx, float *temp_out)
Barometer 6 get temperature data function.
void barometer6_write_register(barometer6_t *ctx, uint8_t reg, uint8_t data_in)
Barometer 6 data writing function.
err_t barometer6_generic_write(barometer6_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Barometer 6 data writing function.
void barometer6_set_standby_time(barometer6_t *ctx, uint8_t t_standby)
Barometer 6 set standby time function.
void barometer6_cfg_setup(barometer6_cfg_t *cfg)
Barometer 6 configuration object setup function.
void barometer6_set_avrege(barometer6_t *ctx, uint8_t temp_avg, uint8_t pressure_avg)
Barometer 6 set average data function.
err_t barometer6_generic_read(barometer6_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Barometer 6 data reading function.
void barometer6_drv_interface_selection(barometer6_cfg_t *cfg, barometer6_drv_t drv_sel)
Barometer 6 driver interface setup function.
err_t barometer6_init(barometer6_t *ctx, barometer6_cfg_t *cfg)
Barometer 6 initialization function.
This file contains SPI specific macros, functions, etc.
Barometer 6 Click configuration object.
Definition barometer6.h:287
uint32_t i2c_speed
Definition barometer6.h:296
spi_master_chip_select_polarity_t cs_polarity
Definition barometer6.h:301
pin_name_t sck
Definition barometer6.h:292
spi_master_mode_t spi_mode
Definition barometer6.h:300
pin_name_t mosi
Definition barometer6.h:291
uint32_t spi_speed
Definition barometer6.h:299
pin_name_t scl
Definition barometer6.h:288
pin_name_t miso
Definition barometer6.h:290
pin_name_t sda
Definition barometer6.h:289
barometer6_drv_t drv_sel
Definition barometer6.h:303
pin_name_t rst
Definition barometer6.h:294
pin_name_t cs
Definition barometer6.h:293
uint8_t i2c_address
Definition barometer6.h:297
Barometer 6 Click context object.
Definition barometer6.h:253
spi_master_t spi
Definition barometer6.h:257
float coef_b00
Definition barometer6.h:270
float coef_a0
Definition barometer6.h:266
float coef_a1
Definition barometer6.h:267
float coef_b21
Definition barometer6.h:277
barometer6_master_io_t write_f
Definition barometer6.h:263
float coef_bt1
Definition barometer6.h:271
float coef_bp3
Definition barometer6.h:278
float coef_bp1
Definition barometer6.h:272
float coef_a2
Definition barometer6.h:268
i2c_master_t i2c
Definition barometer6.h:256
barometer6_master_io_t read_f
Definition barometer6.h:264
float coef_bp2
Definition barometer6.h:275
digital_out_t rst
Definition barometer6.h:254
float coef_bt2
Definition barometer6.h:274
uint8_t slave_address
Definition barometer6.h:259
float coef_b11
Definition barometer6.h:273
float coef_b12
Definition barometer6.h:276
pin_name_t chip_select
Definition barometer6.h:260
barometer6_drv_t drv_sel
Definition barometer6.h:261