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"
52#include "drv_i2c_master.h"
74#define MAGNETO12_ADC_RESOLUTION 0x0FFF
75#define MAGNETO12_VREF_5V 5.0
76#define MAGNETO12_FULL_CIRCLE 360.0
77#define MAGNETO12_SATURATION_ERROR 0.04
84#define MAGNETO12_SET_DEV_ADDR 0x4D
102#define MAGNETO12_MAP_MIKROBUS( cfg, mikrobus ) \
103 cfg.an = MIKROBUS( mikrobus, MIKROBUS_AN ); \
104 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
105 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA );
void magneto12_drv_interface_selection(magneto12_cfg_t *cfg, magneto12_drv_t drv_sel)
Magneto 12 driver interface setup function.
err_t magneto12_read_raw_adc(magneto12_t *ctx, uint16_t *raw_adc)
Magneto 12 read raw ADC value function.
err_t magneto12_init(magneto12_t *ctx, magneto12_cfg_t *cfg)
Magneto 12 initialization function.
err_t magneto12_set_vref(magneto12_t *ctx, float vref)
Magneto 12 set vref function.
err_t magneto12_read_voltage(magneto12_t *ctx, float *voltage)
Magneto 12 read voltage level function.
void magneto12_cfg_setup(magneto12_cfg_t *cfg)
Magneto 12 configuration object setup function.
err_t magneto12_read_angle(magneto12_t *ctx, float *angle)
Magneto 12 read angle function.
magneto12_return_value_t
Magneto 12 Click return value data.
Definition magneto12.h:162
@ MAGNETO12_ERROR
Definition magneto12.h:164
@ MAGNETO12_OK
Definition magneto12.h:163
magneto12_drv_t
Magneto 12 Click driver selector.
Definition magneto12.h:115
@ MAGNETO12_DRV_SEL_ADC
Definition magneto12.h:116
@ MAGNETO12_DRV_SEL_I2C
Definition magneto12.h:117
Magneto 12 Click configuration object.
Definition magneto12.h:142
analog_in_resolution_t resolution
Definition magneto12.h:147
float vref
Definition magneto12.h:148
uint32_t i2c_speed
Definition magneto12.h:150
magneto12_drv_t drv_sel
Definition magneto12.h:153
pin_name_t scl
Definition magneto12.h:144
pin_name_t sda
Definition magneto12.h:145
pin_name_t an
Definition magneto12.h:143
uint8_t i2c_address
Definition magneto12.h:151
Magneto 12 Click context object.
Definition magneto12.h:126
float vref
Definition magneto12.h:132
i2c_master_t i2c
Definition magneto12.h:128
magneto12_drv_t drv_sel
Definition magneto12.h:133
uint8_t slave_address
Definition magneto12.h:130
pin_name_t chip_select
Definition magneto12.h:131
analog_in_t adc
Definition magneto12.h:127