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"
67#define ALTITUDE4_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
76#define ALTITUDE4_RETVAL uint8_t
78#define ALTITUDE4_OK 0x00
79#define ALTITUDE4_INIT_ERROR 0xFF
86#define ALTITUDE4_SLAVE_ADDRESS 0x27
88#define ALTITUDE4_START_CMD_MODE 0xA9
89#define ALTITUDE4_EXIT_CMD_MODE 0xA8
90#define ALTITUDE4_INC_MEM_PAGE_CNT 0x5E
91#define ALTITUDE4_CREATE_MEM_PAGE_CHECKSUM 0xAA
92#define ALTITUDE4_SENS_DATA 0xAC
96#define FRNDINT( x ) ( ( double ) ( long ) ( x ) )
#define ALTITUDE4_RETVAL
Definition altitude4.h:76
void altitude4_generic_write(altitude4_t *ctx, uint8_t reg, uint8_t *w_buf, uint8_t len)
Generic write function.
void altitude4_cfg_setup(altitude4_cfg_t *cfg)
Config Object Initialization function.
void altitude4_generic_read(altitude4_t *ctx, uint8_t reg, uint8_t *r_buf, uint8_t len)
Generic read function.
uint8_t altitude4_read_sensor(altitude4_t *ctx, altitude4_sensor_t *sens_data)
Read sensor function.
ALTITUDE4_RETVAL altitude4_init(altitude4_t *ctx, altitude4_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition altitude4.h:135
uint32_t i2c_speed
Definition altitude4.h:143
pin_name_t scl
Definition altitude4.h:138
pin_name_t sda
Definition altitude4.h:139
uint8_t i2c_address
Definition altitude4.h:144
Sensor object definition.
Definition altitude4.h:109
float altitude
Definition altitude4.h:112
float pressure
Definition altitude4.h:110
float temperature
Definition altitude4.h:111
Click ctx object definition.
Definition altitude4.h:120
i2c_master_t i2c
Definition altitude4.h:123
uint8_t slave_address
Definition altitude4.h:127
Definition altitude4.h:154
unsigned sign
Definition altitude4.h:158
unsigned hmant
Definition altitude4.h:156
unsigned char mant[2]
Definition altitude4.h:155
unsigned exp
Definition altitude4.h:157
Floating point union definition.
Definition altitude4.h:152
double fl
Definition altitude4.h:162