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_analog_in.h"
73#define CURRENTSENS2_CONV_FACTOR 12.5f
74#define CURRENTSENS2_NUM_CONVERSIONS 10
75#define CURRENTSENS2_NUM_OF_PASSES_1 1
76#define CURRENTSENS2_NUM_OF_PASSES_2 2
77#define CURRENTSENS2_NUM_OF_PASSES_3 3
95#define CURRENTSENS2_MAP_MIKROBUS( cfg, mikrobus ) \
96 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
97 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
currentsens2_return_value_t
Current Sens 2 Click return value data.
Definition currentsens2.h:136
@ CURRENTSENS2_ERROR
Definition currentsens2.h:138
@ CURRENTSENS2_OK
Definition currentsens2.h:137
void currentsens2_cfg_setup(currentsens2_cfg_t *cfg)
Current Sens 2 configuration object setup function.
err_t currentsens2_tare(currentsens2_t *ctx)
Current Sens 2 tare function.
err_t currentsens2_read_an_pin_value(currentsens2_t *ctx, uint16_t *data_out)
Current Sens 2 read AN pin value function.
err_t currentsens2_get_current(currentsens2_t *ctx, float *current)
Current Sens 2 read current function.
void currentsens2_set_prim_turn_no(currentsens2_t *ctx, uint8_t turns)
Current Sens 2 set number of primary coil turns function.
err_t currentsens2_read_an_pin_vol(currentsens2_t *ctx, float *data_out)
Current Sens 2 read AN pin voltage level function.
uint8_t currentsens2_get_int_pin(currentsens2_t *ctx)
Current Sens 2 get int pin state function.
err_t currentsens2_init(currentsens2_t *ctx, currentsens2_cfg_t *cfg)
Current Sens 2 initialization function.
Current Sens 2 Click configuration object.
Definition currentsens2.h:122
analog_in_resolution_t resolution
Definition currentsens2.h:126
float vref
Definition currentsens2.h:127
pin_name_t int_pin
Definition currentsens2.h:124
pin_name_t an
Definition currentsens2.h:123
Current Sens 2 Click context object.
Definition currentsens2.h:107
uint8_t no_of_turns
Definition currentsens2.h:113
digital_in_t int_pin
Definition currentsens2.h:108
analog_in_t adc
Definition currentsens2.h:110
float zero_val
Definition currentsens2.h:112