ESPHome 2025.7.1
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 ErrorCode read (uint8_t address, uint8_t *buffer, size_t len)
 Creates a ReadBuffer and calls the virtual readv() method to read bytes into this buffer.
 
virtual ErrorCode readv (uint8_t address, ReadBuffer *buffers, size_t count)=0
 This virtual method reads bytes from an I2CBus into an array of ReadBuffer.
 
virtual ErrorCode write (uint8_t address, const uint8_t *buffer, size_t len)
 
virtual ErrorCode write (uint8_t address, const uint8_t *buffer, size_t len, bool stop)
 Creates a WriteBuffer and calls the writev() method to send the bytes from this buffer.
 
virtual ErrorCode writev (uint8_t address, WriteBuffer *buffers, size_t cnt)
 
virtual ErrorCode writev (uint8_t address, WriteBuffer *buffers, size_t count, bool stop)=0
 This virtual method writes bytes to an I2CBus from an array of WriteBuffer.
 

Additional Inherited Members

- Protected Member Functions inherited from esphome::i2c::I2CBus
void i2c_scan_ ()
 Scans the I2C bus for devices.
 
- Protected Attributes inherited from esphome::i2c::I2CBus
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 111 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: