42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_spi_master.h"
66#define MULTIMETER_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
68 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
69 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
70 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
71 cfg.a = MIKROBUS( mikrobus, MIKROBUS_AN ); \
72 cfg.b = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
73 cfg.c = MIKROBUS( mikrobus, MIKROBUS_INT )
80#define MULTIMETER_RETVAL uint8_t
82#define MULTIMETER_OK 0x00
83#define MULTIMETER_INIT_ERROR 0xFF
90#define MULTIMETER_I_CHANNEL 0x00
91#define MULTIMETER_U_CHANNEL 0x01
92#define MULTIMETER_R_CHANNEL 0x02
93#define MULTIMETER_C_CHANNEL 0x03
100#define MULTIMETER_MAX_VOLTAGE 4095.0
#define MULTIMETER_RETVAL
Definition multimeter.h:80
float multimeter_read_voltage(multimeter_t *ctx)
Read voltage function.
MULTIMETER_RETVAL multimeter_init(multimeter_t *ctx, multimeter_cfg_t *cfg)
Initialization function.
void multimeter_cfg_setup(multimeter_cfg_t *cfg)
Config Object Initialization function.
void multimeter_set_resistance_range(multimeter_t *ctx, uint8_t range)
Set resistance range function.
float multimeter_read_capacitance(multimeter_t *ctx)
Read capacitance function.
float multimeter_read_current(multimeter_t *ctx)
Read current function.
uint16_t multimeter_get_resistance_range(multimeter_t *ctx, uint8_t range)
Get resistance range function.
void multimeter_default_cfg(multimeter_t *ctx)
Click Default Configuration function.
float multimeter_read_resistance(multimeter_t *ctx)
Read resistance function.
Calibration configuration structure.
Definition multimeter.h:126
uint8_t scan_range_cfg
Definition multimeter.h:130
float curr_cal_cfg
Definition multimeter.h:129
float volt_cal_cfg
Definition multimeter.h:128
float capa_cal_cfg
Definition multimeter.h:127
Calibration structure.
Definition multimeter.h:114
float voltage_cal
Definition multimeter.h:116
float capacitance_cal
Definition multimeter.h:115
float current_cal
Definition multimeter.h:117
uint8_t scan_range
Definition multimeter.h:118
Click configuration structure definition.
Definition multimeter.h:158
calibration_cfg_t calibration_cfg
Definition multimeter.h:177
spi_master_chip_select_polarity_t cs_polarity
Definition multimeter.h:176
pin_name_t sck
Definition multimeter.h:163
spi_master_mode_t spi_mode
Definition multimeter.h:175
pin_name_t b
Definition multimeter.h:169
pin_name_t a
Definition multimeter.h:168
pin_name_t mosi
Definition multimeter.h:162
uint32_t spi_speed
Definition multimeter.h:174
pin_name_t miso
Definition multimeter.h:161
pin_name_t c
Definition multimeter.h:170
pin_name_t cs
Definition multimeter.h:164
Click ctx object definition.
Definition multimeter.h:138
digital_out_t cs
Definition multimeter.h:144
spi_master_t spi
Definition multimeter.h:148
digital_out_t a
Definition multimeter.h:141
calibration_t calibration
Definition multimeter.h:149
digital_out_t c
Definition multimeter.h:143
digital_out_t b
Definition multimeter.h:142
pin_name_t chip_select
Definition multimeter.h:150