Go to the documentation of this file.
35 #include "drv_digital_out.h"
36 #include "drv_digital_in.h"
37 #include "drv_i2c_master.h"
59 #define MAGNETO10_REG_STAT1 0x00
60 #define MAGNETO10_REG_X_LSB 0x01
61 #define MAGNETO10_REG_X_MSB 0x02
62 #define MAGNETO10_REG_Y_LSB 0x03
63 #define MAGNETO10_REG_Y_MSB 0x04
64 #define MAGNETO10_REG_Z_LSB 0x05
65 #define MAGNETO10_REG_Z_MSB 0x06
66 #define MAGNETO10_REG_STAT2 0x07
67 #define MAGNETO10_REG_T_LSB 0x08
68 #define MAGNETO10_REG_T_MSB 0x09
69 #define MAGNETO10_REG_CID 0x0A
70 #define MAGNETO10_REG_DID 0x0B
71 #define MAGNETO10_REG_CTRL 0x10
72 #define MAGNETO10_REG_RST 0x11
73 #define MAGNETO10_REG_OSR_DIG_FILT 0x14
74 #define MAGNETO10_REG_T_EN_DIG_FILT_Z 0x15
92 #define MAGNETO10_MODE_IDLE 0x00
93 #define MAGNETO10_MODE_SINGLE_MEAS 0x01
94 #define MAGNETO10_MODE_CONT_MEAS_10HZ 0x02
95 #define MAGNETO10_MODE_CONT_MEAS_20HZ 0x03
96 #define MAGNETO10_MODE_CONT_MEAS_50HZ 0x04
97 #define MAGNETO10_MODE_CONT_MEAS_100HZ 0x05
98 #define MAGNETO10_MODE_SELF_TEST 0x06
99 #define MAGNETO10_MODE_CONT_MEAS_200HZ 0x0A
100 #define MAGNETO10_MODE_CONT_MEAS_500HZ 0x0B
101 #define MAGNETO10_MODE_CONT_MEAS_800HZ 0x0C
102 #define MAGNETO10_MODE_CONT_MEAS_1400HZ 0x0D
103 #define MAGNETO10_MODE_POWER_DOWN 0x0F
109 #define MAGNETO10_COMPANY_ID 0x98
110 #define MAGNETO10_DEVICE_ID 0xBA
116 #define MAGNETO10_RESET 0x06
122 #define MAGNETO10_STAT1_RT 0x08
123 #define MAGNETO10_STAT1_DRDY 0x01
124 #define MAGNETO10_STAT2_DOR 0x02
125 #define MAGNETO10_STAT2_HOVF 0x01
131 #define MAGNETO10_TEMPERATURE_RES 50.0
132 #define MAGNETO10_TEMPERATURE_ENABLE 0x01
133 #define MAGNETO10_TEMPERATURE_DISABLE 0x00
134 #define MAGNETO10_TEMPERATURE_EN_MASK 0x20
140 #define MAGNETO10_MAG_FLUX_RESOLUTION 0.15
147 #define MAGNETO10_SET_DEV_ADDR 0x0C
165 #define MAGNETO10_MAP_MIKROBUS( cfg, mikrobus ) \
166 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
167 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
430 #endif // MAGNETO10_H
err_t magneto10_enable_temperature_sensor(magneto10_t *ctx, uint8_t enable)
Magneto 10 enable temperature sensor function.
err_t magneto10_mem_direct_read(magneto10_t *ctx, uint8_t *rx_buf, uint8_t rx_len)
Magneto 10 mem direct read function.
uint32_t i2c_speed
Definition: magneto10.h:195
err_t magneto10_mem_read(magneto10_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
Magneto 10 mem read function.
err_t magneto10_check_communication(magneto10_t *ctx)
Magneto 10 check communication function.
err_t magneto10_check_data_ready(magneto10_t *ctx)
Magneto 10 check data ready function.
void magneto10_cfg_setup(magneto10_cfg_t *cfg)
Magneto 10 configuration object setup function.
Magneto 10 Click context object.
Definition: magneto10.h:177
err_t magneto10_mem_write_multiple(magneto10_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
Magneto 10 mem write multiple function.
uint8_t i2c_address
Definition: magneto10.h:196
i2c_master_t i2c
Definition: magneto10.h:179
err_t magneto10_init(magneto10_t *ctx, magneto10_cfg_t *cfg)
Magneto 10 initialization function.
uint8_t slave_address
Definition: magneto10.h:182
err_t magneto10_get_temperature(magneto10_t *ctx, float *temperature)
Magneto 10 get temperature function.
err_t magneto10_set_operating_mode(magneto10_t *ctx, uint8_t mode)
Magneto 10 set operating mode function.
Magneto 10 Click configuration object.
Definition: magneto10.h:191
pin_name_t sda
Definition: magneto10.h:193
err_t magneto10_get_magnetic_flux(magneto10_t *ctx, float *x_axis, float *y_axis, float *z_axis)
Magneto 10 get magnetic flux function.
@ MAGNETO10_OK
Definition: magneto10.h:206
err_t magneto10_mem_write_single(magneto10_t *ctx, uint8_t reg, uint8_t tx_data)
Magneto 10 mem write single function.
err_t magneto10_default_cfg(magneto10_t *ctx)
Magneto 10 default configuration function.
magneto10_return_value_t
Magneto 10 Click return value data.
Definition: magneto10.h:205
pin_name_t scl
Definition: magneto10.h:192
@ MAGNETO10_ERROR
Definition: magneto10.h:207
err_t magneto10_reset(magneto10_t *ctx)
Magneto 10 reset function.