Skip to content

Commit 284263a

Browse files
committed
chore(qmc5883p): doxygen
1 parent 9520701 commit 284263a

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/components/i2c/drivers/WipperSnapper_I2C_Driver_QMC5883P.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,31 @@
99
#include <Adafruit_QMC5883P.h>
1010
#include <math.h>
1111

12+
13+
/*!
14+
* @brief Constructor for a QMC5883P sensor.
15+
* @param i2c
16+
* The I2C interface.
17+
* @param sensorAddress
18+
* The 7-bit I2C address of the sensor.
19+
*/
1220
WipperSnapper_I2C_Driver_QMC5883P::WipperSnapper_I2C_Driver_QMC5883P(
1321
TwoWire *i2c, uint16_t sensorAddress)
1422
: WipperSnapper_I2C_Driver(i2c, sensorAddress) {}
1523

24+
/*!
25+
* @brief Destructor for a QMC5883P sensor.
26+
*/
1627
WipperSnapper_I2C_Driver_QMC5883P::~WipperSnapper_I2C_Driver_QMC5883P() {
1728
if (_qmc) {
1829
delete _qmc;
1930
}
2031
}
2132

33+
/*!
34+
* @brief Initializes the QMC5883P sensor and begins I2C.
35+
* @return True if initialized successfully, False otherwise.
36+
*/
2237
bool WipperSnapper_I2C_Driver_QMC5883P::begin() {
2338
_qmc = new Adafruit_QMC5883P();
2439
if (!_qmc->begin(_sensorAddress, _i2c)) {
@@ -41,6 +56,12 @@ bool WipperSnapper_I2C_Driver_QMC5883P::begin() {
4156
return true;
4257
}
4358

59+
/*!
60+
* @brief Get the magnetometer's sensor event.
61+
* @param magEvent
62+
* Pointer to the magnetometer sensor event.
63+
* @return True if the event was obtained successfully, False otherwise.
64+
*/
4465
bool WipperSnapper_I2C_Driver_QMC5883P::getEventRaw(sensors_event_t *magEvent) {
4566
if (!_qmc->isDataReady()) {
4667
return false;

src/components/i2c/drivers/WipperSnapper_I2C_Driver_QMC5883P.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313

1414
class Adafruit_QMC5883P; // forward
1515

16+
/**************************************************************************/
17+
/*!
18+
@brief Class that provides a driver interface for a QMC5883P sensor.
19+
*/
20+
/**************************************************************************/
1621
class WipperSnapper_I2C_Driver_QMC5883P : public WipperSnapper_I2C_Driver {
1722
public:
1823
WipperSnapper_I2C_Driver_QMC5883P(TwoWire *i2c, uint16_t sensorAddress);
@@ -22,7 +27,7 @@ class WipperSnapper_I2C_Driver_QMC5883P : public WipperSnapper_I2C_Driver {
2227
bool getEventRaw(sensors_event_t *magEvent);
2328

2429
private:
25-
Adafruit_QMC5883P *_qmc = nullptr;
30+
Adafruit_QMC5883P *_qmc = nullptr; ///< Pointer to the QMC5883P sensor object
2631
};
2732

2833
#endif // WipperSnapper_I2C_Driver_QMC5883P_H

0 commit comments

Comments
 (0)