Skip to content

Commit d308561

Browse files
committed
fix(as5600): refactor casing + include
1 parent 67da3e9 commit d308561

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/components/i2c/controller.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ static const std::map<std::string, FnCreateI2CSensorDriver> I2cFactorySensor = {
5858
const char *driver_name) -> drvBase * {
5959
return new drvAhtx0(i2c, addr, mux_channel, driver_name);
6060
}},
61+
{"as5600",
62+
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
63+
const char *driver_name) -> drvBase * {
64+
return new drvAs5600(i2c, addr, mux_channel, driver_name);
65+
}},
6166
{"dht20",
6267
[](TwoWire *i2c, uint16_t addr, uint32_t mux_channel,
6368
const char *driver_name) -> drvBase * {
@@ -417,6 +422,7 @@ static const std::unordered_map<uint16_t, std::vector<const char *>>
417422
"vl53l4cx", "vl6180x"}},
418423
{0x2A, {"nau7802"}},
419424
{0x2C, {"qmc5883p"}},
425+
{0x36, {"as5600"}},
420426
{0x38, {"aht20", "max17048"}},
421427
{0x39, {"tsl2591"}},
422428
{0x3A, {"mlx90632"}},

src/components/i2c/controller.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "model.h"
2020
// I2C Drivers
2121
#include "drivers/drvAdt7410.h"
22+
#include "drivers/drvAs5600.h"
2223
#include "drivers/drvAhtx0.h"
2324
#include "drivers/drvBase.h" ///< Base i2c input driver class
2425
#include "drivers/drvBh1750.h"

src/components/i2c/drivers/drvAS5600.h renamed to src/components/i2c/drivers/drvAs5600.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/*!
2222
@brief Class that provides a driver interface for an AS5600 sensor.
2323
*/
24-
class drvAS5600 : public drvBase {
24+
class drvAs5600 : public drvBase {
2525
public:
2626
/*******************************************************************************/
2727
/*!
@@ -36,7 +36,7 @@ class drvAS5600 : public drvBase {
3636
The name of the driver.
3737
*/
3838
/*******************************************************************************/
39-
drvAS5600(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel,
39+
drvAs5600(TwoWire *i2c, uint16_t sensorAddress, uint32_t mux_channel,
4040
const char *driver_name)
4141
: drvBase(i2c, sensorAddress, mux_channel, driver_name) {
4242
_as5600 = nullptr;
@@ -48,7 +48,7 @@ class drvAS5600 : public drvBase {
4848
@brief Destructor for an AS5600 sensor.
4949
*/
5050
/*******************************************************************************/
51-
~drvAS5600() {
51+
~drvAs5600() {
5252
if (_as5600) {
5353
delete _as5600;
5454
_as5600 = nullptr;

0 commit comments

Comments
 (0)