![]() |
LibDriver HMC5883L
|
driver hmc5883l header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | hmc5883l_handle_s |
| hmc5883l handle structure definition More... | |
| struct | hmc5883l_info_s |
| hmc5883l information structure definition More... | |
Macros | |
| #define | DRIVER_HMC5883L_LINK_INIT(HANDLE, STRUCTURE) |
| initialize hmc5883l_handle_t structure | |
| #define | DRIVER_HMC5883L_LINK_IIC_INIT(HANDLE, FUC) |
| link iic_init function | |
| #define | DRIVER_HMC5883L_LINK_IIC_DEINIT(HANDLE, FUC) |
| link iic_deinit function | |
| #define | DRIVER_HMC5883L_LINK_IIC_READ(HANDLE, FUC) |
| link iic_read function | |
| #define | DRIVER_HMC5883L_LINK_IIC_WRITE(HANDLE, FUC) |
| link iic_write function | |
| #define | DRIVER_HMC5883L_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_HMC5883L_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
Typedefs | |
| typedef struct hmc5883l_handle_s | hmc5883l_handle_t |
| hmc5883l handle structure definition | |
| typedef struct hmc5883l_info_s | hmc5883l_info_t |
| hmc5883l information structure definition | |
Functions | |
| uint8_t | hmc5883l_info (hmc5883l_info_t *info) |
| get chip's information | |
| uint8_t | hmc5883l_init (hmc5883l_handle_t *handle) |
| initialize the chip | |
| uint8_t | hmc5883l_deinit (hmc5883l_handle_t *handle) |
| close the chip | |
| uint8_t | hmc5883l_single_read (hmc5883l_handle_t *handle, int16_t raw[3], float m_gauss[3]) |
| read data once | |
| uint8_t | hmc5883l_start_continuous_read (hmc5883l_handle_t *handle) |
| start reading data | |
| uint8_t | hmc5883l_stop_continuous_read (hmc5883l_handle_t *handle) |
| stop reading data | |
| uint8_t | hmc5883l_continuous_read (hmc5883l_handle_t *handle, int16_t raw[3], float m_gauss[3]) |
| read data continuously | |
| uint8_t | hmc5883l_set_average_sample (hmc5883l_handle_t *handle, hmc5883l_average_sample_t average_sample) |
| set the average sample rate | |
| uint8_t | hmc5883l_get_average_sample (hmc5883l_handle_t *handle, hmc5883l_average_sample_t *average_sample) |
| get the average sample rate | |
| uint8_t | hmc5883l_set_data_output_rate (hmc5883l_handle_t *handle, hmc5883l_data_output_rate_t data_rate) |
| set the data output rate | |
| uint8_t | hmc5883l_get_data_output_rate (hmc5883l_handle_t *handle, hmc5883l_data_output_rate_t *data_rate) |
| get the data output rate | |
| uint8_t | hmc5883l_set_mode (hmc5883l_handle_t *handle, hmc5883l_mode_t mode) |
| set the chip mode | |
| uint8_t | hmc5883l_get_mode (hmc5883l_handle_t *handle, hmc5883l_mode_t *mode) |
| get the chip mode | |
| uint8_t | hmc5883l_set_gain (hmc5883l_handle_t *handle, hmc5883l_gain_t gain) |
| set the chip gain | |
| uint8_t | hmc5883l_get_gain (hmc5883l_handle_t *handle, hmc5883l_gain_t *gain) |
| get the chip gain | |
| uint8_t | hmc5883l_enable_high_speed_iic (hmc5883l_handle_t *handle) |
| enable the high speed iic | |
| uint8_t | hmc5883l_disable_high_speed_iic (hmc5883l_handle_t *handle) |
| disable the high speed iic | |
| uint8_t | hmc5883l_set_reg (hmc5883l_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| set the chip register | |
| uint8_t | hmc5883l_get_reg (hmc5883l_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len) |
| get the chip register | |
driver hmc5883l 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 |
|---|---|---|---|
| 2021/03/20 | 2.0 | Shifeng Li | format the code |
| 2020/12/02 | 1.0 | Shifeng Li | first upload |
Definition in file driver_hmc5883l.h.