ESPHome 2025.7.1
Loading...
Searching...
No Matches
esphome::ds2484::DS2484OneWireBus Class Reference

#include <ds2484.h>

Inheritance diagram for esphome::ds2484::DS2484OneWireBus:
esphome::one_wire::OneWireBus esphome::i2c::I2CDevice esphome::Component

Public Member Functions

void setup () override
 
void dump_config () override
 
float get_setup_priority () const override
 
bool reset_device ()
 
int reset_int () override
 
void write8 (uint8_t) override
 
void write64 (uint64_t) override
 
uint8_t read8 () override
 
uint64_t read64 () override
 
void set_active_pullup (bool value)
 
void set_strong_pullup (bool value)
 
- Public Member Functions inherited from esphome::one_wire::OneWireBus
void skip ()
 Write a command to the bus that addresses all devices by skipping the ROM.
 
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.
 
- Public Member Functions inherited from esphome::i2c::I2CDevice
 I2CDevice ()=default
 we use the C++ default constructor
 
void set_i2c_address (uint8_t address)
 We store the address of the device on the bus.
 
uint8_t get_i2c_address () const
 Returns the I2C address of the object.
 
void set_i2c_bus (I2CBus *bus)
 we store the pointer to the I2CBus to use
 
I2CRegister reg (uint8_t a_register)
 calls the I2CRegister constructor
 
I2CRegister16 reg16 (uint16_t a_register)
 calls the I2CRegister16 constructor
 
ErrorCode read (uint8_t *data, size_t len)
 reads an array of bytes from the device using an I2CBus
 
ErrorCode read_register (uint8_t a_register, uint8_t *data, size_t len, bool stop=true)
 reads an array of bytes from a specific register in the I²C device
 
ErrorCode read_register16 (uint16_t a_register, uint8_t *data, size_t len, bool stop=true)
 reads an array of bytes from a specific register in the I²C device
 
ErrorCode write (const uint8_t *data, size_t len, bool stop=true)
 writes an array of bytes to a device using an I2CBus
 
ErrorCode write_register (uint8_t a_register, const uint8_t *data, size_t len, bool stop=true)
 writes an array of bytes to a specific register in the I²C device
 
ErrorCode write_register16 (uint16_t a_register, const uint8_t *data, size_t len, bool stop=true)
 write an array of bytes to a specific register in the I²C device
 
bool read_bytes (uint8_t a_register, uint8_t *data, uint8_t len)
 Compat APIs All methods below have been added for compatibility reasons.
 
bool read_bytes_raw (uint8_t *data, uint8_t len)
 
template<size_t N>
optional< std::array< uint8_t, N > > read_bytes (uint8_t a_register)
 
template<size_t N>
optional< std::array< uint8_t, N > > read_bytes_raw ()
 
bool read_bytes_16 (uint8_t a_register, uint16_t *data, uint8_t len)
 
bool read_byte (uint8_t a_register, uint8_t *data, bool stop=true)
 
optional< uint8_t > read_byte (uint8_t a_register)
 
bool read_byte_16 (uint8_t a_register, uint16_t *data)
 
bool write_bytes (uint8_t a_register, const uint8_t *data, uint8_t len, bool stop=true)
 
bool write_bytes (uint8_t a_register, const std::vector< uint8_t > &data)
 
template<size_t N>
bool write_bytes (uint8_t a_register, const std::array< uint8_t, N > &data)
 
bool write_bytes_16 (uint8_t a_register, const uint16_t *data, uint8_t len)
 
bool write_byte (uint8_t a_register, uint8_t data, bool stop=true)
 
bool write_byte_16 (uint8_t a_register, uint16_t data)
 
- Public Member Functions inherited from esphome::Component
virtual void loop ()
 This method will be called repeatedly.
 
float get_actual_setup_priority () const
 
void set_setup_priority (float priority)
 
virtual float get_loop_priority () const
 priority of loop().
 
void call ()
 
virtual void on_shutdown ()
 
virtual void on_safe_shutdown ()
 
virtual bool teardown ()
 Called during teardown to allow component to gracefully finish operations.
 
virtual void on_powerdown ()
 Called after teardown is complete to power down hardware.
 
uint8_t get_component_state () const
 
void reset_to_construction_state ()
 Reset this component back to the construction state to allow setup to run again.
 
bool is_in_loop_state () const
 Check if this component has completed setup and is in the loop state.
 
virtual void mark_failed ()
 Mark this component as failed.
 
void mark_failed (const char *message)
 
void disable_loop ()
 Disable this component's loop.
 
void enable_loop ()
 Enable this component's loop.
 
void enable_loop_soon_any_context ()
 Thread and ISR-safe version of enable_loop() that can be called from any context.
 
bool is_failed () const
 
bool is_ready () const
 
virtual bool can_proceed ()
 
bool status_has_warning () const
 
bool status_has_error () const
 
void status_set_warning (const char *message="unspecified")
 
void status_set_error (const char *message="unspecified")
 
void status_clear_warning ()
 
void status_clear_error ()
 
void status_momentary_warning (const std::string &name, uint32_t length=5000)
 
void status_momentary_error (const std::string &name, uint32_t length=5000)
 
bool has_overridden_loop () const
 
void set_component_source (const char *source)
 Set where this component was loaded from for some debug messages.
 
const char * get_component_source () const
 Get the integration where this component was declared as a string.
 
bool should_warn_of_blocking (uint32_t blocking_time)
 

Protected Member Functions

void reset_search () override
 
uint64_t search_int () override
 
bool read_status_ (uint8_t *)
 
bool wait_for_completion_ ()
 
void write8_ (uint8_t)
 
bool one_wire_triple_ (bool *branch, bool *id_bit, bool *cmp_id_bit)
 
- Protected Member Functions inherited from esphome::one_wire::OneWireBus
void dump_devices_ (const char *tag)
 log the found devices
 
bool reset_ ()
 Reset the bus, should be done before all write operations.
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
virtual void call_setup ()
 
virtual void call_dump_config ()
 
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name.
 
void set_interval (const char *name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a const char* name.
 
void set_interval (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function.
 
bool cancel_interval (const char *name)
 
void set_retry (const std::string &name, uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 Set an retry function with a unique name.
 
void set_retry (uint32_t initial_wait_time, uint8_t max_attempts, std::function< RetryResult(uint8_t)> &&f, float backoff_increase_factor=1.0f)
 
bool cancel_retry (const std::string &name)
 Cancel a retry function.
 
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name.
 
void set_timeout (const char *name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a const char* name.
 
void set_timeout (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function.
 
bool cancel_timeout (const char *name)
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call.
 
void defer (const char *name, std::function< void()> &&f)
 Defer a callback to the next loop() call with a const char* name.
 
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call.
 
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty.
 

Protected Attributes

uint64_t address_
 
uint8_t last_discrepancy_ {0}
 
bool last_device_flag_ {false}
 
bool active_pullup_ {false}
 
bool strong_pullup_ {false}
 
- Protected Attributes inherited from esphome::one_wire::OneWireBus
std::vector< uint64_t > devices_
 
- Protected Attributes inherited from esphome::i2c::I2CDevice
uint8_t address_ {0x00}
 store the address of the device on the bus
 
I2CBusbus_ {nullptr}
 pointer to I2CBus instance
 
- Protected Attributes inherited from esphome::Component
const char * component_source_ {nullptr}
 
uint16_t warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_MS}
 Warn if blocked for this many ms (max 65.5s)
 
uint8_t component_state_ {0x00}
 State of this component - each bit has a purpose: Bits 0-1: Component state (0x00=CONSTRUCTION, 0x01=SETUP, 0x02=LOOP, 0x03=FAILED) Bit 2: STATUS_LED_WARNING Bit 3: STATUS_LED_ERROR Bits 4-7: Unused - reserved for future expansion (50% of the bits are free)
 
volatile bool pending_enable_loop_ {false}
 ISR-safe flag for enable_loop_soon_any_context.
 

Detailed Description

Definition at line 12 of file ds2484.h.

Member Function Documentation

◆ dump_config()

void esphome::ds2484::DS2484OneWireBus::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 13 of file ds2484.cpp.

◆ get_setup_priority()

float esphome::ds2484::DS2484OneWireBus::get_setup_priority ( ) const
inlineoverridevirtual

Reimplemented from esphome::Component.

Definition at line 16 of file ds2484.h.

◆ one_wire_triple_()

bool esphome::ds2484::DS2484OneWireBus::one_wire_triple_ ( bool * branch,
bool * id_bit,
bool * cmp_id_bit )
protected

Definition at line 127 of file ds2484.cpp.

◆ read64()

uint64_t esphome::ds2484::DS2484OneWireBus::read64 ( )
overridevirtual

Implements esphome::one_wire::OneWireBus.

Definition at line 113 of file ds2484.cpp.

◆ read8()

uint8_t esphome::ds2484::DS2484OneWireBus::read8 ( )
overridevirtual

Implements esphome::one_wire::OneWireBus.

Definition at line 93 of file ds2484.cpp.

◆ read_status_()

bool esphome::ds2484::DS2484OneWireBus::read_status_ ( uint8_t * status)
protected

Definition at line 18 of file ds2484.cpp.

◆ reset_device()

bool esphome::ds2484::DS2484OneWireBus::reset_device ( )

Definition at line 38 of file ds2484.cpp.

◆ reset_int()

int esphome::ds2484::DS2484OneWireBus::reset_int ( )
overridevirtual

Implements esphome::one_wire::OneWireBus.

Definition at line 66 of file ds2484.cpp.

◆ reset_search()

void esphome::ds2484::DS2484OneWireBus::reset_search ( )
overrideprotectedvirtual

Implements esphome::one_wire::OneWireBus.

Definition at line 121 of file ds2484.cpp.

◆ search_int()

uint64_t IRAM_ATTR esphome::ds2484::DS2484OneWireBus::search_int ( )
overrideprotectedvirtual

Implements esphome::one_wire::OneWireBus.

Definition at line 148 of file ds2484.cpp.

◆ set_active_pullup()

void esphome::ds2484::DS2484OneWireBus::set_active_pullup ( bool value)
inline

Definition at line 25 of file ds2484.h.

◆ set_strong_pullup()

void esphome::ds2484::DS2484OneWireBus::set_strong_pullup ( bool value)
inline

Definition at line 26 of file ds2484.h.

◆ setup()

void esphome::ds2484::DS2484OneWireBus::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 7 of file ds2484.cpp.

◆ wait_for_completion_()

bool esphome::ds2484::DS2484OneWireBus::wait_for_completion_ ( )
protected

Definition at line 33 of file ds2484.cpp.

◆ write64()

void esphome::ds2484::DS2484OneWireBus::write64 ( uint64_t value)
overridevirtual

Implements esphome::one_wire::OneWireBus.

Definition at line 86 of file ds2484.cpp.

◆ write8()

void esphome::ds2484::DS2484OneWireBus::write8 ( uint8_t value)
overridevirtual

Implements esphome::one_wire::OneWireBus.

Definition at line 81 of file ds2484.cpp.

◆ write8_()

void esphome::ds2484::DS2484OneWireBus::write8_ ( uint8_t value)
protected

Definition at line 75 of file ds2484.cpp.

Field Documentation

◆ active_pullup_

bool esphome::ds2484::DS2484OneWireBus::active_pullup_ {false}
protected

Definition at line 39 of file ds2484.h.

◆ address_

uint64_t esphome::ds2484::DS2484OneWireBus::address_
protected

Definition at line 36 of file ds2484.h.

◆ last_device_flag_

bool esphome::ds2484::DS2484OneWireBus::last_device_flag_ {false}
protected

Definition at line 38 of file ds2484.h.

◆ last_discrepancy_

uint8_t esphome::ds2484::DS2484OneWireBus::last_discrepancy_ {0}
protected

Definition at line 37 of file ds2484.h.

◆ strong_pullup_

bool esphome::ds2484::DS2484OneWireBus::strong_pullup_ {false}
protected

Definition at line 40 of file ds2484.h.


The documentation for this class was generated from the following files: