![]() |
LibDriver MAG3110
|
driver mag3110 header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | mag3110_handle_s |
| mag3110 handle structure definition More... | |
| struct | mag3110_info_s |
| mag3110 information structure definition More... | |
Macros | |
| #define | DRIVER_MAG3110_LINK_INIT(HANDLE, STRUCTURE) |
| initialize mag3110_handle_t structure | |
| #define | DRIVER_MAG3110_LINK_IIC_INIT(HANDLE, FUC) |
| link iic_init 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_IIC_WRITE(HANDLE, FUC) |
| link iic_write function | |
| #define | DRIVER_MAG3110_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_MAG3110_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
Typedefs | |
| typedef struct mag3110_handle_s | mag3110_handle_t |
| mag3110 handle structure definition | |
| typedef struct mag3110_info_s | mag3110_info_t |
| mag3110 information structure definition | |
Functions | |
| uint8_t | mag3110_info (mag3110_info_t *info) |
| get chip's information | |
| uint8_t | mag3110_init (mag3110_handle_t *handle) |
| initialize the chip | |
| uint8_t | mag3110_deinit (mag3110_handle_t *handle) |
| close the chip | |
| uint8_t | mag3110_read (mag3110_handle_t *handle, int16_t raw[3], float ut[3]) |
| read data | |
| uint8_t | mag3110_reset (mag3110_handle_t *handle) |
| reset | |
| uint8_t | mag3110_read_die_temperature (mag3110_handle_t *handle, int8_t *raw, float *degree) |
| read die temperature | |
| uint8_t | mag3110_get_data_ready_status (mag3110_handle_t *handle, uint8_t *status) |
| get data ready status | |
| uint8_t | mag3110_get_mode_status (mag3110_handle_t *handle, mag3110_mode_status_t *mode) |
| get mode status | |
| uint8_t | mag3110_set_offset_x (mag3110_handle_t *handle, uint16_t offset) |
| set offset x | |
| uint8_t | mag3110_get_offset_x (mag3110_handle_t *handle, uint16_t *offset) |
| get offset x | |
| uint8_t | mag3110_set_offset_y (mag3110_handle_t *handle, uint16_t offset) |
| set offset y | |
| uint8_t | mag3110_get_offset_y (mag3110_handle_t *handle, uint16_t *offset) |
| get offset y | |
| uint8_t | mag3110_set_offset_z (mag3110_handle_t *handle, uint16_t offset) |
| set offset z | |
| uint8_t | mag3110_get_offset_z (mag3110_handle_t *handle, uint16_t *offset) |
| get offset z | |
| 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_get_rate_over_sample (mag3110_handle_t *handle, mag3110_rate_over_sample_t *rate_over_sample) |
| get rate over sample | |
| uint8_t | mag3110_set_fast_read_mode (mag3110_handle_t *handle, mag3110_bool_t enable) |
| enable or disable fast read 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_trigger_mode (mag3110_handle_t *handle, mag3110_bool_t enable) |
| enable or disable trigger mode | |
| 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_mode (mag3110_handle_t *handle, mag3110_mode_t *mode) |
| get mode | |
| 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_disable_offset_correction (mag3110_handle_t *handle, mag3110_bool_t enable) |
| enable or disable offset correction | |
| uint8_t | mag3110_get_disable_offset_correction (mag3110_handle_t *handle, mag3110_bool_t *enable) |
| get offset correction status | |
| 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_set_reg (mag3110_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| set the chip register | |
| uint8_t | mag3110_get_reg (mag3110_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| get the chip register | |
driver mag3110 header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2025/08/18 | 1.0 | Shifeng Li | first upload |
Definition in file driver_mag3110.h.