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 C3DHALL8_REG_MAGNETIC_X_MSB 0x00
74#define C3DHALL8_REG_MAGNETIC_Y_MSB 0x01
75#define C3DHALL8_REG_MAGENTIC_Z_MSB 0x02
76#define C3DHALL8_REG_TEMPERATURE_MSB 0x03
77#define C3DHALL8_REG_MAGNETIC_XY_LSB 0x04
78#define C3DHALL8_REG_TEMPERATURE_Z_LSB 0x05
79#define C3DHALL8_REG_STATUS 0x06
80#define C3DHALL8_REG_LOWER_THRESHOLD_X_MSB 0x07
81#define C3DHALL8_REG_UPPER_THRESHOLD_X_MSB 0x08
82#define C3DHALL8_REG_LOWER_THRESHOLD_Y_MSB 0x09
83#define C3DHALL8_REG_UPPER_THRESHOLD_Y_MSB 0x0A
84#define C3DHALL8_REG_LOWER_THRESHOLD_Z_MSB 0x0B
85#define C3DHALL8_REG_UPPER_THRESHOLD_Z_MSB 0x0C
86#define C3DHALL8_REG_THRESHOLDS_X_LSB 0x0D
87#define C3DHALL8_REG_THRESHOLDS_Y_LSB 0x0E
88#define C3DHALL8_REG_THRESHOLDS_Z_LSB 0x0F
89#define C3DHALL8_REG_CONFIG_1 0x10
90#define C3DHALL8_REG_MOD1 0x11
91#define C3DHALL8_REG_MOD2 0x13
92#define C3DHALL8_REG_CONFIG_2 0x14
93#define C3DHALL8_REG_VERSION 0x16
111#define C3DHALL8_RX_BUFFER 0x17
118#define C3DHALL8_SET_DEV_ADDR 0x35
136#define C3DHALL8_MAP_MIKROBUS( cfg, mikrobus ) \
137 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
138 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
139 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
ismtx_return_value_t
3D Hall 8 Click return value data.
Definition c3dhall8.h:197
@ C3DHALL8_OK
Definition c3dhall8.h:198
@ C3DHALL8_ERROR
Definition c3dhall8.h:199
#define C3DHALL8_RX_BUFFER
3D Hall 8 receiver_buff length
Definition c3dhall8.h:111
err_t c3dhall8_generic_write(c3dhall8_t *ctx, uint8_t reg, uint8_t tx_buf)
3D Hall 8 I2C writing function.
err_t c3dhall8_default_cfg(c3dhall8_t *ctx)
3D Hall 8 default configuration function.
err_t c3dhall8_init(c3dhall8_t *ctx, c3dhall8_cfg_t *cfg)
3D Hall 8 initialization function.
float c3dhall8_get_xyz_magnetic_matching(c3dhall8_t *ctx, c3dhall8_data_t sensor_data)
Calculating magnetic matching.
void c3dhall8_cfg_setup(c3dhall8_cfg_t *cfg)
3D Hall 8 configuration object setup function.
float c3dhall8_get_xy_magnetic_matching(c3dhall8_t *ctx, c3dhall8_data_t sensor_data)
Calculating magnetic matching.
err_t c3dhall8_generic_read(c3dhall8_t *ctx, uint8_t reg, uint8_t *rx_buf)
3D Hall 8 I2C reading function.
void c3dhall8_read_sensor_data(c3dhall8_t *ctx, c3dhall8_data_t *sensor_data)
Reading sensor data function.
3D Hall 8 Click configuration object.
Definition c3dhall8.h:168
uint32_t i2c_speed
Definition c3dhall8.h:174
pin_name_t scl
Definition c3dhall8.h:169
pin_name_t int_pin
Definition c3dhall8.h:172
pin_name_t sda
Definition c3dhall8.h:170
uint8_t i2c_address
Definition c3dhall8.h:175
3D Hall 8 Click data object.
Definition c3dhall8.h:184
float z_axis
Definition c3dhall8.h:187
float x_axis
Definition c3dhall8.h:185
float y_axis
Definition c3dhall8.h:186
float temperature
Definition c3dhall8.h:188
3D Hall 8 Click context object.
Definition c3dhall8.h:149
digital_in_t int_pin
Definition c3dhall8.h:151
i2c_master_t i2c
Definition c3dhall8.h:154
uint8_t slave_address
Definition c3dhall8.h:157