ESPHome 2025.8.3
Loading...
Searching...
No Matches
esphome::i2c::InternalI2CBus Class Referenceabstract

#include <i2c_bus.h>

Inheritance diagram for esphome::i2c::InternalI2CBus:
esphome::i2c::I2CBus esphome::i2c::ArduinoI2CBus esphome::i2c::IDFI2CBus

Public Member Functions

virtual int get_port () const =0
 Returns the I2C port number.
 
- Public Member Functions inherited from esphome::i2c::I2CBus
virtual ~I2CBus ()=default
 
virtual ErrorCode write_readv (uint8_t address, const uint8_t *write_buffer, size_t write_count, uint8_t *read_buffer, size_t read_count)=0
 This virtual method writes bytes to an I2CBus from an array, then reads bytes into an array of ReadBuffer.
 
ErrorCode read (uint8_t address, uint8_t *buffer, size_t len)
 
ErrorCode write (uint8_t address, const uint8_t *buffer, size_t len, bool stop=true)
 
 ESPDEPRECATED ("This method is deprecated and will be removed in ESPHome 2026.3.0. Use write_readv() instead.", "2025.9.0") ErrorCode readv(uint8_t address
 
 for (size_t i=0;i !=count;i++)
 
std::vector< uint8_t > buffer (total_len)
 
 if (err !=ERROR_OK) return err
 
 for (size_t i=0;i !=count;i++)
 
 ESPDEPRECATED ("This method is deprecated and will be removed in ESPHome 2026.3.0. Use write_readv() instead.", "2025.9.0") ErrorCode writev(uint8_t address
 

Additional Inherited Members

- Data Fields inherited from esphome::i2c::I2CBus
ReadBufferread_buffers
 
ReadBuffer size_t count
 
auto err = this->write_readv(address, nullptr, 0, buffer.data(), total_len)
 
size_t pos = 0
 
return ERROR_OK
 
const WriteBufferwrite_buffers
 
const WriteBuffer size_t count
 
const WriteBuffer size_t bool stop
 
std::vector< std::pair< uint8_t, bool > > scan_results_
 array containing scan results
 
bool scan_ {false}
 Should we scan ? Can be set in the yaml.
 

Detailed Description

Definition at line 109 of file i2c_bus.h.

Member Function Documentation

◆ get_port()

virtual int esphome::i2c::InternalI2CBus::get_port ( ) const
pure virtual

Returns the I2C port number.

Returns
the port number of the internal I2C bus

Implemented in esphome::i2c::ArduinoI2CBus, and esphome::i2c::IDFI2CBus.


The documentation for this class was generated from the following file: