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_spi_master.h"
67#define C3DHALL6_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
79#define C3DHALL6_ERROR -1
86#define C3DHALL6_CHANNEL_0 0x00
87#define C3DHALL6_CHANNEL_1 0x40
88#define C3DHALL6_CHANNEL_2 0x80
89#define C3DHALL6_CHANNEL_3 0xC0
96#define C3DHALL6_DIE_A 0x01
97#define C3DHALL6_DIE_B 0x02
104#define SINGLE_PI_CONST 3.14
105#define HALF_PI_CONST 1.57
void c3dhall6_default_cfg(c3dhall6_t *ctx)
Click Default Configuration function.
void c3dhall6_get_angle_rad(c3dhall6_t *ctx, uint8_t die, float *angle_value)
GGetting angle value function.
void c3dhall6_set_reference_values(c3dhall6_t *ctx, c3dhall6_aux_ref_t ref_val)
Setting reference values function.
void c3dhall6_get_volt(c3dhall6_t *ctx, uint8_t channel_no, float *channel_voltage)
Getting voltage on each channel function.
void c3dhall6_get_adc_value(c3dhall6_t *ctx, uint8_t channel_no, uint16_t *adc_value)
Getting ADC value on each channel function.
err_t c3dhall6_init(c3dhall6_t *ctx, c3dhall6_cfg_t *cfg)
Initialization function.
void c3dhall6_get_angle_deg(c3dhall6_t *ctx, uint8_t die, float *angle_value)
GGetting angle value function.
void c3dhall6_cfg_setup(c3dhall6_cfg_t *cfg)
Config Object Initialization function.
Definition c3dhall6.h:116
uint16_t aux_ch1
Definition c3dhall6.h:118
uint16_t aux_ch2
Definition c3dhall6.h:119
uint16_t aux_ch0
Definition c3dhall6.h:117
uint16_t aux_ch3
Definition c3dhall6.h:120
Definition c3dhall6.h:125
float aux_float_ch1
Definition c3dhall6.h:127
float aux_float_ch0
Definition c3dhall6.h:126
float aux_float_ch3
Definition c3dhall6.h:129
float aux_float_ch2
Definition c3dhall6.h:128
Definition c3dhall6.h:134
float aux_ref_adc_ch0
Definition c3dhall6.h:135
float aux_ref_adc_ch2
Definition c3dhall6.h:137
float aux_ref_adc_ch3
Definition c3dhall6.h:138
float aux_ref_volt
Definition c3dhall6.h:139
float aux_ref_adc_ch1
Definition c3dhall6.h:136
Click configuration structure definition.
Definition c3dhall6.h:162
spi_master_chip_select_polarity_t cs_polarity
Definition c3dhall6.h:172
pin_name_t sck
Definition c3dhall6.h:166
spi_master_mode_t spi_mode
Definition c3dhall6.h:171
pin_name_t mosi
Definition c3dhall6.h:165
uint32_t spi_speed
Definition c3dhall6.h:170
pin_name_t miso
Definition c3dhall6.h:164
c3dhall6_aux_ref_t dev_aux_ref
Definition c3dhall6.h:174
pin_name_t cs
Definition c3dhall6.h:167
Click ctx object definition.
Definition c3dhall6.h:147
spi_master_t spi
Definition c3dhall6.h:149
c3dhall6_aux_ref_t device_aux_ref
Definition c3dhall6.h:152
c3dhall6_aux_ch_t device_aux_ch
Definition c3dhall6.h:153
c3dhall6_aux_float_ch_t device_float_ch
Definition c3dhall6.h:154
pin_name_t chip_select
Definition c3dhall6.h:150