ESPHome 2025.5.0
|
#include <one_wire_bus.h>
Public Member Functions | |
virtual void | write8 (uint8_t val)=0 |
Write a word to the bus. LSB first. | |
virtual void | write64 (uint64_t val)=0 |
Write a 64 bit unsigned integer to the bus. LSB first. | |
void | skip () |
Write a command to the bus that addresses all devices by skipping the ROM. | |
virtual uint8_t | read8 ()=0 |
Read an 8 bit word from the bus. | |
virtual uint64_t | read64 ()=0 |
Read an 64-bit unsigned integer from the bus. | |
bool | select (uint64_t address) |
Select a specific address on the bus for the following command. | |
const std::vector< uint64_t > & | get_devices () |
Return the list of found devices. | |
void | search () |
Search for 1-Wire devices on the bus. | |
const LogString * | get_model_str (uint8_t model) |
Get the description string for this model. | |
Protected Member Functions | |
void | dump_devices_ (const char *tag) |
log the found devices | |
bool | reset_ () |
Reset the bus, should be done before all write operations. | |
virtual int | reset_int ()=0 |
Bus Reset. | |
virtual void | reset_search ()=0 |
Reset the device search. | |
virtual uint64_t | search_int ()=0 |
Search for a 1-Wire device on the bus. Returns 0 if all devices have been found. | |
Protected Attributes | |
std::vector< uint64_t > | devices_ |
Definition at line 10 of file one_wire_bus.h.
|
protected |
log the found devices
Definition at line 80 of file one_wire_bus.cpp.
const std::vector< uint64_t > & esphome::one_wire::OneWireBus::get_devices | ( | ) |
Return the list of found devices.
Definition at line 18 of file one_wire_bus.cpp.
const LogString * esphome::one_wire::OneWireBus::get_model_str | ( | uint8_t | model | ) |
Get the description string for this model.
Definition at line 63 of file one_wire_bus.cpp.
|
pure virtual |
Read an 64-bit unsigned integer from the bus.
Implemented in esphome::gpio::GPIOOneWireBus.
|
pure virtual |
Read an 8 bit word from the bus.
Implemented in esphome::gpio::GPIOOneWireBus.
|
protected |
Reset the bus, should be done before all write operations.
Takes approximately 1ms.
Definition at line 20 of file one_wire_bus.cpp.
|
protectedpure virtual |
Bus Reset.
Implemented in esphome::gpio::GPIOOneWireBus.
|
protectedpure virtual |
Reset the device search.
Implemented in esphome::gpio::GPIOOneWireBus.
void esphome::one_wire::OneWireBus::search | ( | ) |
Search for 1-Wire devices on the bus.
Definition at line 35 of file one_wire_bus.cpp.
|
protectedpure virtual |
Search for a 1-Wire device on the bus. Returns 0 if all devices have been found.
Implemented in esphome::gpio::GPIOOneWireBus.
bool IRAM_ATTR esphome::one_wire::OneWireBus::select | ( | uint64_t | address | ) |
Select a specific address on the bus for the following command.
Definition at line 27 of file one_wire_bus.cpp.
void esphome::one_wire::OneWireBus::skip | ( | ) |
Write a command to the bus that addresses all devices by skipping the ROM.
Definition at line 59 of file one_wire_bus.cpp.
|
pure virtual |
Write a 64 bit unsigned integer to the bus. LSB first.
Implemented in esphome::gpio::GPIOOneWireBus.
|
pure virtual |
Write a word to the bus. LSB first.
Implemented in esphome::gpio::GPIOOneWireBus.
|
protected |
Definition at line 40 of file one_wire_bus.h.