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 VACCUM_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
69 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
70 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN )
77#define VACCUM_RETVAL uint8_t
80#define VACCUM_INIT_ERROR 0xFF
#define VACCUM_RETVAL
Definition vacuum.h:77
void vacuum_default_cfg(vacuum_t *ctx)
Click Default Configuration function.
VACCUM_RETVAL vacuum_init(vacuum_t *ctx, vacuum_cfg_t *cfg)
Initialization function.
void vacuum_calibration(vacuum_t *ctx)
Sensor calibration.
float vacuum_get_pressure(vacuum_t *ctx)
Function for converting ADC value to pressure data.
void vacuum_cfg_setup(vacuum_cfg_t *cfg)
Config Object Initialization function.
uint16_t vacuum_read_data(vacuum_t *ctx)
Function for reads 12 bit ADC data.
float vacuum_get_percentage_of_vacuum(vacuum_t *ctx)
Function for converting ADC value to percentage of Vacuum.
float vacuum_get_voltage(vacuum_t *ctx)
Voltage reading function.
Click configuration structure definition.
Definition vacuum.h:114
uint32_t i2c_speed
Definition vacuum.h:126
pin_name_t scl
Definition vacuum.h:117
pin_name_t sda
Definition vacuum.h:118
pin_name_t an
Definition vacuum.h:122
uint8_t i2c_address
Definition vacuum.h:127
Click ctx object definition.
Definition vacuum.h:94
uint16_t pressure
Definition vacuum.h:106
i2c_master_t i2c
Definition vacuum.h:101
uint8_t slave_address
Definition vacuum.h:105
digital_out_t an
Definition vacuum.h:97