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_i2c_master.h"
73#define C3DHALL9_REG_EEPROM_02 0x02
74#define C3DHALL9_REG_EEPROM_03 0x03
75#define C3DHALL9_REG_EEPROM_0D 0x0D
76#define C3DHALL9_REG_EEPROM_0E 0x0E
77#define C3DHALL9_REG_EEPROM_0F 0x0F
78#define C3DHALL9_REG_VOLATILE_27 0x27
79#define C3DHALL9_REG_VOLATILE_28 0x28
80#define C3DHALL9_REG_VOLATILE_29 0x29
98#define C3DHALL9_EEPROM_02_ENABLE_Z 0x00000100ul
99#define C3DHALL9_EEPROM_02_ENABLE_Y 0x00000080ul
100#define C3DHALL9_EEPROM_02_ENABLE_X 0x00000040ul
101#define C3DHALL9_VOLATILE_27_ACTIVE_MODE 0x00000000ul
102#define C3DHALL9_VOLATILE_27_SLEEP_MODE 0x00000001ul
103#define C3DHALL9_VOLATILE_27_LOW_POWER_MODE 0x00000002ul
104#define C3DHALL9_VOLATILE_27_I2C_SINGLE 0x00000000ul
105#define C3DHALL9_VOLATILE_27_I2C_FAST_LOOP 0x00000004ul
106#define C3DHALL9_VOLATILE_27_I2C_FULL_LOOP 0x00000008ul
112#define C3DHALL9_12BIT_RESOLUTION 0x1000
113#define C3DHALL9_SIGN_BIT 0x0800
114#define C3DHALL9_DATA_READY_BIT 0x0080
115#define C3DHALL9_GAUSS_RESOLUTION 4
116#define C3DHALL9_TEMPERATURE_MULTIPLIER 302
117#define C3DHALL9_TEMPERATURE_SUBTRACTOR 1702
118#define C3DHALL9_TEMPERATURE_SUBTRACTOR 1702
119#define C3DHALL9_HALF_CICRLE_DEGREES 180.0
120#define C3DHALL9_MATH_TWO_PI 6.28318530717958
127#define C3DHALL9_SET_DEV_ADDR 0x60
145#define C3DHALL9_MAP_MIKROBUS( cfg, mikrobus ) \
146 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
147 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
148 cfg.en = MIKROBUS( mikrobus, MIKROBUS_CS ); \
149 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
c3dhall9_return_value_t
3D Hall 9 Click return value data.
Definition c3dhall9.h:196
@ C3DHALL9_OK
Definition c3dhall9.h:197
@ C3DHALL9_ERROR
Definition c3dhall9.h:198
err_t c3dhall9_read_register(c3dhall9_t *ctx, uint8_t reg, uint32_t *data_out)
3D Hall 9 I2C reading function.
void c3dhall9_disable_chip(c3dhall9_t *ctx)
3D Hall 9 disable chip function.
err_t c3dhall9_read_data(c3dhall9_t *ctx, c3dhall9_data_t *data_out)
3D Hall 9 read data function.
uint8_t c3dhall9_get_int_pin(c3dhall9_t *ctx)
3D Hall 9 get int pin function.
err_t c3dhall9_default_cfg(c3dhall9_t *ctx)
3D Hall 9 default configuration function.
void c3dhall9_enable_chip(c3dhall9_t *ctx)
3D Hall 9 enable chip function.
void c3dhall9_cfg_setup(c3dhall9_cfg_t *cfg)
3D Hall 9 configuration object setup function.
err_t c3dhall9_write_register(c3dhall9_t *ctx, uint8_t reg, uint32_t data_in)
3D Hall 9 I2C writing function.
err_t c3dhall9_init(c3dhall9_t *ctx, c3dhall9_cfg_t *cfg)
3D Hall 9 initialization function.
3D Hall 9 Click configuration object.
Definition c3dhall9.h:179
uint32_t i2c_speed
Definition c3dhall9.h:186
pin_name_t scl
Definition c3dhall9.h:180
pin_name_t en
Definition c3dhall9.h:183
pin_name_t int_pin
Definition c3dhall9.h:184
pin_name_t sda
Definition c3dhall9.h:181
uint8_t i2c_address
Definition c3dhall9.h:187
3D Hall 9 Click data object.
Definition c3dhall9.h:207
float z_axis
Definition c3dhall9.h:210
float angle_xz
Definition c3dhall9.h:212
float angle_xy
Definition c3dhall9.h:211
float x_axis
Definition c3dhall9.h:208
float y_axis
Definition c3dhall9.h:209
float angle_yz
Definition c3dhall9.h:213
float temperature
Definition c3dhall9.h:214
3D Hall 9 Click context object.
Definition c3dhall9.h:159
digital_in_t int_pin
Definition c3dhall9.h:164
i2c_master_t i2c
Definition c3dhall9.h:167
digital_out_t en
Definition c3dhall9.h:161
uint8_t slave_address
Definition c3dhall9.h:170