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 LINHALL2_VOLTAGE_AT_0_MT 1.65f
74#define LINHALL2_SENSITIVITY 0.015f
80#define LINHALL2_ENABLE_DEVICE 0x01
81#define LINHALL2_DISABLE_DEVICE 0x00
99#define LINHALL2_MAP_MIKROBUS( cfg, mikrobus ) \
100 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
101 cfg.en = MIKROBUS( mikrobus, MIKROBUS_RST )
void linhall2_cfg_setup(linhall2_cfg_t *cfg)
LIN Hall 2 configuration object setup function.
err_t linhall2_read_an_pin_value(linhall2_t *ctx, uint16_t *data_out)
LIN Hall 2 read AN pin value function.
err_t linhall2_read_an_pin_voltage(linhall2_t *ctx, float *data_out)
LIN Hall 2 read AN pin voltage level function.
err_t linhall2_init(linhall2_t *ctx, linhall2_cfg_t *cfg)
LIN Hall 2 initialization function.
void linhal2_set_en_pin(linhall2_t *ctx, uint8_t pin_state)
LIN Hall 2 set EN pin state function.
err_t linhal2_get_flux_density(linhall2_t *ctx, float *data_out)
LIN Hall 2 read flux density function.
linhall2_return_value_t
LIN Hall 2 Click return value data.
Definition linhall2.h:137
@ LINHALL2_OK
Definition linhall2.h:138
@ LINHALL2_ERROR
Definition linhall2.h:139
LIN Hall 2 Click configuration object.
Definition linhall2.h:123
analog_in_resolution_t resolution
Definition linhall2.h:127
float vref
Definition linhall2.h:128
pin_name_t en
Definition linhall2.h:125
pin_name_t an
Definition linhall2.h:124
LIN Hall 2 Click context object.
Definition linhall2.h:111
digital_out_t en
Definition linhall2.h:112
analog_in_t adc
Definition linhall2.h:114