54 uint16_t offset_check;
138 offset = rand() % 0x7FFFU;
161 offset = rand() % 0x7FFFU;
184 offset = rand() % 0x7FFFU;
1049 ut = (float)(rand() % 1000);
1069 ut = -(float)(rand() % 1000);
driver mag3110 register test header file
uint8_t mag3110_set_rate_over_sample(mag3110_handle_t *handle, mag3110_rate_over_sample_t rate_over_sample)
set rate over sample
uint8_t mag3110_info(mag3110_info_t *info)
get chip's information
uint8_t mag3110_get_data_ready_status(mag3110_handle_t *handle, uint8_t *status)
get data ready status
uint8_t mag3110_set_trigger_mode(mag3110_handle_t *handle, mag3110_bool_t enable)
enable or disable trigger mode
uint8_t mag3110_get_offset_z(mag3110_handle_t *handle, uint16_t *offset)
get offset z
struct mag3110_handle_s mag3110_handle_t
mag3110 handle structure definition
uint8_t mag3110_get_trigger_mode(mag3110_handle_t *handle, mag3110_bool_t *enable)
get trigger mode status
uint8_t mag3110_set_mode(mag3110_handle_t *handle, mag3110_mode_t mode)
set mode
uint8_t mag3110_get_fast_read_mode(mag3110_handle_t *handle, mag3110_bool_t *enable)
get fast read mode status
uint8_t mag3110_set_disable_offset_correction(mag3110_handle_t *handle, mag3110_bool_t enable)
enable or disable offset correction
mag3110_bool_t
mag3110 bool enumeration definition
uint8_t mag3110_deinit(mag3110_handle_t *handle)
close the chip
uint8_t mag3110_init(mag3110_handle_t *handle)
initialize the chip
uint8_t mag3110_set_offset_y(mag3110_handle_t *handle, uint16_t offset)
set offset y
uint8_t mag3110_set_offset_x(mag3110_handle_t *handle, uint16_t offset)
set offset x
struct mag3110_info_s mag3110_info_t
mag3110 information structure definition
uint8_t mag3110_get_offset_y(mag3110_handle_t *handle, uint16_t *offset)
get offset y
uint8_t mag3110_get_rate_over_sample(mag3110_handle_t *handle, mag3110_rate_over_sample_t *rate_over_sample)
get rate over sample
uint8_t mag3110_get_offset_x(mag3110_handle_t *handle, uint16_t *offset)
get offset x
uint8_t mag3110_get_mode_status(mag3110_handle_t *handle, mag3110_mode_status_t *mode)
get mode status
mag3110_rate_over_sample_t
mag3110 rate over sample enumeration definition
uint8_t mag3110_set_automatic_magnetic_sensor_reset(mag3110_handle_t *handle, mag3110_bool_t enable)
enable or disable automatic magnetic sensor reset
uint8_t mag3110_set_fast_read_mode(mag3110_handle_t *handle, mag3110_bool_t enable)
enable or disable fast read mode
uint8_t mag3110_offset_convert_to_register(mag3110_handle_t *handle, float ut, uint16_t *reg)
convert the offset to the register raw data
uint8_t mag3110_offset_convert_to_data(mag3110_handle_t *handle, uint16_t reg, float *ut)
convert the register raw data to the offset threshold
uint8_t mag3110_get_mode(mag3110_handle_t *handle, mag3110_mode_t *mode)
get mode
uint8_t mag3110_reset(mag3110_handle_t *handle)
reset
uint8_t mag3110_get_disable_offset_correction(mag3110_handle_t *handle, mag3110_bool_t *enable)
get offset correction status
uint8_t mag3110_set_offset_z(mag3110_handle_t *handle, uint16_t offset)
set offset z
mag3110_mode_status_t
mag3110 mode status enumeration definition
mag3110_mode_t
mag3110 mode enumeration definition
@ MAG3110_RATE_5HZ_OVER_SAMPLE_16
@ MAG3110_RATE_2P5HZ_OVER_SAMPLE_32
@ MAG3110_RATE_2P5HZ_OVER_SAMPLE_16
@ MAG3110_RATE_10HZ_OVER_SAMPLE_64
@ MAG3110_RATE_20HZ_OVER_SAMPLE_32
@ MAG3110_RATE_1P25HZ_OVER_SAMPLE_16
@ MAG3110_RATE_0P08HZ_OVER_SAMPLE_128
@ MAG3110_RATE_1P25HZ_OVER_SAMPLE_64
@ MAG3110_RATE_0P63HZ_OVER_SAMPLE_128
@ MAG3110_RATE_0P31HZ_OVER_SAMPLE_32
@ MAG3110_RATE_10HZ_OVER_SAMPLE_16
@ MAG3110_RATE_0P16HZ_OVER_SAMPLE_64
@ MAG3110_RATE_2P5HZ_OVER_SAMPLE_128
@ MAG3110_RATE_10HZ_OVER_SAMPLE_32
@ MAG3110_RATE_0P63HZ_OVER_SAMPLE_64
@ MAG3110_RATE_1P25HZ_OVER_SAMPLE_32
@ MAG3110_RATE_20HZ_OVER_SAMPLE_64
@ MAG3110_RATE_2P5HZ_OVER_SAMPLE_64
@ MAG3110_RATE_1P25HZ_OVER_SAMPLE_128
@ MAG3110_RATE_0P31HZ_OVER_SAMPLE_128
@ MAG3110_RATE_20HZ_OVER_SAMPLE_16
@ MAG3110_RATE_0P63HZ_OVER_SAMPLE_32
@ MAG3110_RATE_0P63HZ_OVER_SAMPLE_16
@ MAG3110_RATE_5HZ_OVER_SAMPLE_128
@ MAG3110_RATE_5HZ_OVER_SAMPLE_32
@ MAG3110_RATE_40HZ_OVER_SAMPLE_32
@ MAG3110_RATE_10HZ_OVER_SAMPLE_128
@ MAG3110_RATE_5HZ_OVER_SAMPLE_64
@ MAG3110_RATE_40HZ_OVER_SAMPLE_16
@ MAG3110_RATE_0P16HZ_OVER_SAMPLE_128
@ MAG3110_RATE_0P31HZ_OVER_SAMPLE_64
@ MAG3110_RATE_80HZ_OVER_SAMPLE_16
uint8_t mag3110_interface_iic_deinit(void)
interface iic bus deinit
void mag3110_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t mag3110_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t mag3110_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t mag3110_interface_iic_init(void)
interface iic bus init
void mag3110_interface_debug_print(const char *const fmt,...)
interface print format data
#define DRIVER_MAG3110_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_MAG3110_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_MAG3110_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_MAG3110_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_MAG3110_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_MAG3110_LINK_INIT(HANDLE, STRUCTURE)
initialize mag3110_handle_t structure
#define DRIVER_MAG3110_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
uint8_t mag3110_register_test(void)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v