Add a function to return the I2C address from an I2CDevice object (#8454)

Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com>
This commit is contained in:
Pat Satyshur
2025-05-01 13:14:29 +12:00
committed by GitHub
co-authored by Djordje Mandic
parent 9a9b91b180
commit b597565165
+4
View File
@@ -139,6 +139,10 @@ class I2CDevice {
/// @param address of the device
void set_i2c_address(uint8_t address) { address_ = address; }
/// @brief Returns the I2C address of the object.
/// @return the I2C address
uint8_t get_i2c_address() const { return this->address_; }
/// @brief we store the pointer to the I2CBus to use
/// @param bus pointer to the I2CBus object
void set_i2c_bus(I2CBus *bus) { bus_ = bus; }