LibDriver QMC5883L
Loading...
Searching...
No Matches
driver_qmc5883l.h File Reference

driver qmc5883l header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_qmc5883l.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  qmc5883l_handle_s
 qmc5883l handle structure definition More...
struct  qmc5883l_info_s
 qmc5883l information structure definition More...

Macros

#define DRIVER_QMC5883L_LINK_INIT(HANDLE, STRUCTURE)
 initialize qmc5883l_handle_t structure
#define DRIVER_QMC5883L_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_QMC5883L_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_QMC5883L_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_QMC5883L_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_QMC5883L_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_QMC5883L_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct qmc5883l_handle_s qmc5883l_handle_t
 qmc5883l handle structure definition
typedef struct qmc5883l_info_s qmc5883l_info_t
 qmc5883l information structure definition

Enumerations

enum  qmc5883l_bool_t { QMC5883L_BOOL_FALSE = 0x00 , QMC5883L_BOOL_TRUE = 0x01 }
 qmc5883l bool enumeration definition More...
enum  qmc5883l_status_t { QMC5883L_STATUS_DOR = (1 << 2) , QMC5883L_STATUS_OVL = (1 << 1) , QMC5883L_STATUS_DRDY = (1 << 0) }
 qmc5883l status enumeration definition More...
enum  qmc5883l_mode_t { QMC5883L_MODE_STANDBY = 0x00 , QMC5883L_MODE_CONTINUOUS = 0x01 }
 qmc5883l mode enumeration definition More...
enum  qmc5883l_output_rate_t { QMC5883L_OUTPUT_RATE_10HZ = 0x00 , QMC5883L_OUTPUT_RATE_50HZ = 0x01 , QMC5883L_OUTPUT_RATE_100HZ = 0x02 , QMC5883L_OUTPUT_RATE_200HZ = 0x03 }
 qmc5883l output rate enumeration definition More...
enum  qmc5883l_full_scale_t { QMC5883L_FULL_SCALE_2GAUSS = 0x00 , QMC5883L_FULL_SCALE_8GAUSS = 0x01 }
 qmc5883l full scale enumeration definition More...
enum  qmc5883l_over_sample_t { QMC5883L_OVER_SAMPLE_512 = 0x00 , QMC5883L_OVER_SAMPLE_256 = 0x01 , QMC5883L_OVER_SAMPLE_128 = 0x02 , QMC5883L_OVER_SAMPLE_64 = 0x03 }
 qmc5883l over sample enumeration definition More...

Functions

uint8_t qmc5883l_info (qmc5883l_info_t *info)
 get chip's information
uint8_t qmc5883l_init (qmc5883l_handle_t *handle)
 initialize the chip
uint8_t qmc5883l_deinit (qmc5883l_handle_t *handle)
 close the chip
uint8_t qmc5883l_read (qmc5883l_handle_t *handle, int16_t raw[3], float m_gauss[3])
 read data
uint8_t qmc5883l_read_temperature (qmc5883l_handle_t *handle, int16_t *raw, float *deg)
 read temperature
uint8_t qmc5883l_get_status (qmc5883l_handle_t *handle, uint8_t *status)
 get status
uint8_t qmc5883l_set_mode (qmc5883l_handle_t *handle, qmc5883l_mode_t mode)
 set the chip mode
uint8_t qmc5883l_get_mode (qmc5883l_handle_t *handle, qmc5883l_mode_t *mode)
 get the chip mode
uint8_t qmc5883l_set_output_rate (qmc5883l_handle_t *handle, qmc5883l_output_rate_t rate)
 set the output rate
uint8_t qmc5883l_get_output_rate (qmc5883l_handle_t *handle, qmc5883l_output_rate_t *rate)
 get the output rate
uint8_t qmc5883l_set_full_scale (qmc5883l_handle_t *handle, qmc5883l_full_scale_t scale)
 set the full scale
uint8_t qmc5883l_get_full_scale (qmc5883l_handle_t *handle, qmc5883l_full_scale_t *scale)
 get the full scale
uint8_t qmc5883l_set_over_sample (qmc5883l_handle_t *handle, qmc5883l_over_sample_t sample)
 set the over sample
uint8_t qmc5883l_get_over_sample (qmc5883l_handle_t *handle, qmc5883l_over_sample_t *sample)
 get the over sample
uint8_t qmc5883l_set_interrupt (qmc5883l_handle_t *handle, qmc5883l_bool_t enable)
 enable or disable interrupt
uint8_t qmc5883l_get_interrupt (qmc5883l_handle_t *handle, qmc5883l_bool_t *enable)
 get interrupt status
uint8_t qmc5883l_set_pointer_roll_over (qmc5883l_handle_t *handle, qmc5883l_bool_t enable)
 enable or disable pointer roll over
uint8_t qmc5883l_get_pointer_roll_over (qmc5883l_handle_t *handle, qmc5883l_bool_t *enable)
 get pointer roll over status
uint8_t qmc5883l_soft_reset (qmc5883l_handle_t *handle)
 soft reset
uint8_t qmc5883l_set_period (qmc5883l_handle_t *handle, uint8_t fbr)
 set period
uint8_t qmc5883l_get_period (qmc5883l_handle_t *handle, uint8_t *fbr)
 get period
uint8_t qmc5883l_set_reg (qmc5883l_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t qmc5883l_get_reg (qmc5883l_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register

Detailed Description

driver qmc5883l 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.

Version
1.0.0
Author
Shifeng Li
Date
2024-07-30

history

Date Version Author Description
2024/07/30 1.0 Shifeng Li first upload

Definition in file driver_qmc5883l.h.