42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
55#include "drv_spi_master.h"
68#define MANOMETER2_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
70 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
79#define MANOMETER2_RETVAL uint8_t
81#define MANOMETER2_OK 0x00
82#define MANOMETER2_INIT_ERROR 0xFF
89#define MANOMETER2_I2C_ADDRESS_0 0x76
90#define MANOMETER2_I2C_ADDRESS_1 0x77
97#define MANOMETER2_RESET 0x1E
98#define MANOMETER2_RESET_CMD 0xA6
99#define MANOMETER2_ADC_READ 0x00
100#define MANOMETER2_D1_CONVERT_256 0x40
101#define MANOMETER2_D1_CONVERT_512 0x42
102#define MANOMETER2_D1_CONVERT_1024 0x44
103#define MANOMETER2_D1_CONVERT_2048 0x46
104#define MANOMETER2_D1_CONVERT_4096 0x48
105#define MANOMETER2_D2_CONVERT_256 0x50
106#define MANOMETER2_D2_CONVERT_512 0x52
107#define MANOMETER2_D2_CONVERT_1024 0x54
108#define MANOMETER2_D2_CONVERT_2048 0x56
109#define MANOMETER2_D2_CONVERT_4096 0x58
110#define MANOMETER2_C1_READ 0xA2
111#define MANOMETER2_C2_READ 0xA4
112#define MANOMETER2_C3_READ 0xA6
113#define MANOMETER2_C4_READ 0xA8
114#define MANOMETER2_C5_READ 0xAA
115#define MANOMETER2_C6_READ 0xAC
116#define MANOMETER2_CONVERT_256 0
117#define MANOMETER2_CONVERT_512 1
118#define MANOMETER2_CONVERT_1024 2
119#define MANOMETER2_CONVERT_2048 3
120#define MANOMETER2_CONVERT_4096 4
127#define MANOMETER2_Q1 14
128#define MANOMETER2_Q2 16
129#define MANOMETER2_Q3 7
130#define MANOMETER2_Q4 5
131#define MANOMETER2_Q5 7
132#define MANOMETER2_Q6 21
#define MANOMETER2_RETVAL
Definition manometer2.h:79
MANOMETER2_RETVAL manometer2_init(manometer2_t *ctx, manometer2_cfg_t *cfg)
Initialization function.
void manometer2_cfg_setup(manometer2_cfg_t *cfg)
Config Object Initialization function.
float manometer2_get_temperature(manometer2_t *ctx, uint8_t oversampling_ratio)
Get temperature data function.
uint16_t manometer2_read_data(manometer2_t *ctx, uint8_t reg_address)
Generic read data function.
void manometer2_write_data(manometer2_t *ctx, uint8_t reg_address, uint8_t write_command)
Generic write data function.
void manometer2_read_coef(manometer2_t *ctx)
Function read coeffitient.
uint32_t manometer2_read_command(manometer2_t *ctx, uint8_t reg_address)
Generic read data function.
void manometer2_default_cfg(manometer2_t *ctx)
Click Default Configuration function.
void manometer2_reset(manometer2_t *ctx)
Reset.
float manometer2_get_pressure(manometer2_t *ctx, uint8_t oversampling_ratio)
Get pressure data function.
struct manometer2_s manometer2_t
Click ctx object definition.
Click configuration structure definition.
Definition manometer2.h:180
uint32_t i2c_speed
Definition manometer2.h:189
pin_name_t scl
Definition manometer2.h:183
pin_name_t sda
Definition manometer2.h:184
pin_name_t cs
Definition manometer2.h:185
uint8_t i2c_address
Definition manometer2.h:190
Definition manometer2.h:144
uint16_t coef4
Definition manometer2.h:148
uint16_t coef6
Definition manometer2.h:150
uint16_t coef2
Definition manometer2.h:146
uint16_t coef5
Definition manometer2.h:149
uint16_t coef3
Definition manometer2.h:147
uint16_t coef1
Definition manometer2.h:145
Click ctx object definition.
Definition manometer2.h:158
digital_out_t cs
Definition manometer2.h:161
spi_master_t spi
Definition manometer2.h:166
manometer2_coef_t coef
Definition manometer2.h:172
i2c_master_t i2c
Definition manometer2.h:165
uint8_t slave_address
Definition manometer2.h:170