ESPHome
2023.5.5
|
#include <esp_one_wire.h>
Public Member Functions | |
ESPOneWire (InternalGPIOPin *pin) | |
bool | reset () |
Reset the bus, should be done before all write operations. More... | |
void | write_bit (bool bit) |
Write a single bit to the bus, takes about 70µs. More... | |
bool | read_bit () |
Read a single bit from the bus, takes about 70µs. More... | |
void | write8 (uint8_t val) |
Write a word to the bus. LSB first. More... | |
void | write64 (uint64_t val) |
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... | |
uint8_t | read8 () |
Read an 8 bit word from the bus. More... | |
uint64_t | read64 () |
Read an 64-bit unsigned integer from the bus. More... | |
void | select (uint64_t address) |
Select a specific address on the bus for the following command. More... | |
void | reset_search () |
Reset the device search. More... | |
uint64_t | search () |
Search for a 1-Wire device on the bus. Returns 0 if all devices have been found. More... | |
std::vector< uint64_t > | search_vec () |
Helper that wraps search in a std::vector. More... | |
Protected Member Functions | |
uint8_t * | rom_number8_ () |
Helper to get the internal 64-bit unsigned rom number as a 8-bit integer pointer. More... | |
Protected Attributes | |
ISRInternalGPIOPin | pin_ |
uint8_t | last_discrepancy_ {0} |
bool | last_device_flag_ {false} |
uint64_t | rom_number_ {0} |
Definition at line 12 of file esp_one_wire.h.
|
explicit |
Definition at line 13 of file esp_one_wire.cpp.
uint64_t IRAM_ATTR esphome::dallas::ESPOneWire::read64 | ( | ) |
Read an 64-bit unsigned integer from the bus.
Definition at line 129 of file esp_one_wire.cpp.
uint8_t IRAM_ATTR esphome::dallas::ESPOneWire::read8 | ( | ) |
Read an 8 bit word from the bus.
Definition at line 122 of file esp_one_wire.cpp.
bool HOT IRAM_ATTR esphome::dallas::ESPOneWire::read_bit | ( | ) |
Read a single bit from the bus, takes about 70µs.
Definition at line 65 of file esp_one_wire.cpp.
bool HOT IRAM_ATTR esphome::dallas::ESPOneWire::reset | ( | ) |
Reset the bus, should be done before all write operations.
Takes approximately 1ms.
Definition at line 15 of file esp_one_wire.cpp.
void IRAM_ATTR esphome::dallas::ESPOneWire::reset_search | ( | ) |
Reset the device search.
Definition at line 140 of file esp_one_wire.cpp.
|
inlineprotected |
Helper to get the internal 64-bit unsigned rom number as a 8-bit integer pointer.
Definition at line 249 of file esp_one_wire.cpp.
uint64_t IRAM_ATTR esphome::dallas::ESPOneWire::search | ( | ) |
Search for a 1-Wire device on the bus. Returns 0 if all devices have been found.
Definition at line 145 of file esp_one_wire.cpp.
std::vector< uint64_t > esphome::dallas::ESPOneWire::search_vec | ( | ) |
Helper that wraps search in a std::vector.
Definition at line 235 of file esp_one_wire.cpp.
void IRAM_ATTR esphome::dallas::ESPOneWire::select | ( | uint64_t | address | ) |
Select a specific address on the bus for the following command.
Definition at line 136 of file esp_one_wire.cpp.
void IRAM_ATTR esphome::dallas::ESPOneWire::skip | ( | ) |
Write a command to the bus that addresses all devices by skipping the ROM.
Definition at line 245 of file esp_one_wire.cpp.
void IRAM_ATTR esphome::dallas::ESPOneWire::write64 | ( | uint64_t | val | ) |
Write a 64 bit unsigned integer to the bus. LSB first.
Definition at line 116 of file esp_one_wire.cpp.
void IRAM_ATTR esphome::dallas::ESPOneWire::write8 | ( | uint8_t | val | ) |
Write a word to the bus. LSB first.
Definition at line 110 of file esp_one_wire.cpp.
void HOT IRAM_ATTR esphome::dallas::ESPOneWire::write_bit | ( | bool | bit | ) |
Write a single bit to the bus, takes about 70µs.
Definition at line 43 of file esp_one_wire.cpp.
|
protected |
Definition at line 63 of file esp_one_wire.h.
|
protected |
Definition at line 62 of file esp_one_wire.h.
|
protected |
Definition at line 61 of file esp_one_wire.h.
|
protected |
Definition at line 64 of file esp_one_wire.h.