mirror of
https://github.com/esphome/esphome.git
synced 2025-09-11 07:42:26 +01:00
Support I2C transactions with combined reads and writes (#996)
* Support I2C transactions with combined reads and writes * Add optional send_stop parameter to I2CComponent::raw_end_transmission * Add convenience methods to I2CDevice * clang-format Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
@@ -56,8 +56,8 @@ void I2CComponent::raw_begin_transmission(uint8_t address) {
|
||||
ESP_LOGVV(TAG, "Beginning Transmission to 0x%02X:", address);
|
||||
this->wire_->beginTransmission(address);
|
||||
}
|
||||
bool I2CComponent::raw_end_transmission(uint8_t address) {
|
||||
uint8_t status = this->wire_->endTransmission();
|
||||
bool I2CComponent::raw_end_transmission(uint8_t address, bool send_stop) {
|
||||
uint8_t status = this->wire_->endTransmission(send_stop);
|
||||
ESP_LOGVV(TAG, " Transmission ended. Status code: 0x%02X", status);
|
||||
|
||||
switch (status) {
|
||||
|
Reference in New Issue
Block a user