mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 06:36:45 +00:00
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:
parent
9a9b91b180
commit
b597565165
@ -139,6 +139,10 @@ class I2CDevice {
|
|||||||
/// @param address of the device
|
/// @param address of the device
|
||||||
void set_i2c_address(uint8_t address) { address_ = address; }
|
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
|
/// @brief we store the pointer to the I2CBus to use
|
||||||
/// @param bus pointer to the I2CBus object
|
/// @param bus pointer to the I2CBus object
|
||||||
void set_i2c_bus(I2CBus *bus) { bus_ = bus; }
|
void set_i2c_bus(I2CBus *bus) { bus_ = bus; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user