I2C improvements and fixes (#201)

- Show I2C device name in I2C Scanner app
- Register various I2C devices from board implementations
- Fix M5Stack Core2 power status
- Fix pre-allocation issue in `hal::Device`
This commit is contained in:
Ken Van Hoeylandt
2025-02-02 17:54:36 +01:00
committed by GitHub
parent 2e61aea93c
commit c0f4738abe
13 changed files with 133 additions and 59 deletions
@@ -20,8 +20,6 @@ protected:
static constexpr TickType_t DEFAULT_TIMEOUT = 1000 / portTICK_PERIOD_MS;
Type getType() const override { return Type::I2c; }
bool readRegister8(uint8_t reg, uint8_t& result) const;
bool writeRegister8(uint8_t reg, uint8_t value) const;
bool readRegister12(uint8_t reg, float& out) const;
@@ -35,6 +33,12 @@ protected:
public:
explicit I2cDevice(i2c_port_t port, uint32_t address) : port(port), address(address) {}
Type getType() const override { return Type::I2c; }
i2c_port_t getPort() const { return port; }
uint8_t getAddress() const { return address; }
};
}