ESPHome
2024.10.2
|
#include <one_wire_bus.h>
Public Member Functions | |
virtual bool | reset ()=0 |
Reset the bus, should be done before all write operations. More... | |
virtual void | write8 (uint8_t val)=0 |
Write a word to the bus. LSB first. More... | |
virtual void | write64 (uint64_t val)=0 |
Write a 64 bit unsigned integer to the bus. LSB first. More... | |
void | skip () |
Write a command to the bus that addresses all devices by skipping the ROM. More... | |
virtual uint8_t | read8 ()=0 |
Read an 8 bit word from the bus. More... | |
virtual uint64_t | read64 ()=0 |
Read an 64-bit unsigned integer from the bus. More... | |
bool | select (uint64_t address) |
Select a specific address on the bus for the following command. More... | |
const std::vector< uint64_t > & | get_devices () |
Return the list of found devices. More... | |
void | search () |
Search for 1-Wire devices on the bus. More... | |
const LogString * | get_model_str (uint8_t model) |
Get the description string for this model. More... | |
Protected Member Functions | |
void | dump_devices_ (const char *tag) |
log the found devices More... | |
virtual void | reset_search ()=0 |
Reset the device search. More... | |
virtual uint64_t | search_int ()=0 |
Search for a 1-Wire device on the bus. Returns 0 if all devices have been found. More... | |
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 76 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 59 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.
|
pure virtual |
Reset the bus, should be done before all write operations.
Takes approximately 1ms.
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 28 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 20 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 55 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 48 of file one_wire_bus.h.