JM9 XRCU Board 0.1.1
Libraries API Reference
Loading...
Searching...
No Matches
Qmc5883l.h
Go to the documentation of this file.
1
8
9#ifndef QMC5883L_H
10#define QMC5883L_H
11
12#include <Arduino.h>
13#include <Wire.h>
14
15#include <General_compass.h>
16
21class Qmc5883l : public General_compass {
22 private:
26 const uint32_t port;
27
31 uint8_t i2c_address;
32
36 static const uint8_t DEFAULT_I2C_ADDRESS;
37
41 static const uint32_t I2C_FREQ;
42
46 double raw_to_uT (const int16_t raw);
47
48 public:
53 Qmc5883l (const uint32_t init_port);
54
62 bool begin (const uint8_t init_i2c_address = DEFAULT_I2C_ADDRESS);
63
72 bool begin (const Compass_cal_vals_t compass_cal_values, const uint8_t init_i2c_address = DEFAULT_I2C_ADDRESS);
73
74 // low-level functions
75
80 bool reset ();
81
86 bool update ();
87
95 int16_t get_raw_temp ();
96
101 uint8_t id ();
102
107 bool is_mag_present ();
108};
109
110#endif // #ifndef QMC5883L_H
General_compass()
Creates a General_compass object.
Definition General_compass.cpp:13
int16_t get_raw_temp()
Gets the raw temperature reading.
Definition Qmc5883l.cpp:119
Qmc5883l(const uint32_t init_port)
Creates a new Qmc5883l object.
Definition Qmc5883l.cpp:43
bool begin(const uint8_t init_i2c_address=DEFAULT_I2C_ADDRESS)
Configures the settings of the I2C bus and the QMC5883L magnetometer.
Definition Qmc5883l.cpp:55
bool update()
Fetches and updates new data from the compass.
Definition Qmc5883l.cpp:90
bool is_mag_present()
Checks for the presence of the HMC5883L magnetometer on the I2C bus.
Definition Qmc5883l.cpp:141
bool reset()
Software-resets the QMC5883L.
Definition Qmc5883l.cpp:81
uint8_t id()
Reads the identification register.
Definition Qmc5883l.cpp:131
Calibration values of a compass.
Definition General_compass.h:43