ESPHome 2025.5.0
Loading...
Searching...
No Matches
esphome::mlx90393::MLX90393Cls Class Reference

#include <sensor_mlx90393.h>

Inheritance diagram for esphome::mlx90393::MLX90393Cls:
esphome::PollingComponent esphome::i2c::I2CDevice esphome::Component

Public Member Functions

void setup () override
 
void dump_config () override
 
float get_setup_priority () const override
 
void update () override
 
void set_drdy_gpio (GPIOPin *pin)
 
void set_x_sensor (sensor::Sensor *x_sensor)
 
void set_y_sensor (sensor::Sensor *y_sensor)
 
void set_z_sensor (sensor::Sensor *z_sensor)
 
void set_t_sensor (sensor::Sensor *t_sensor)
 
void set_oversampling (uint8_t osr)
 
void set_t_oversampling (uint8_t osr2)
 
void set_resolution (uint8_t xyz, uint8_t res)
 
void set_filter (uint8_t filter)
 
void set_gain (uint8_t gain_sel)
 
void set_temperature_compensation (bool temperature_compensation)
 
void set_hallconf (uint8_t hallconf)
 
bool transceive (const uint8_t *request, size_t request_size, uint8_t *response, size_t response_size) override
 
bool has_drdy_pin () override
 
bool read_drdy_pin () override
 
void sleep_millis (uint32_t millis) override
 
void sleep_micros (uint32_t micros) override
 
- Public Member Functions inherited from esphome::PollingComponent
 PollingComponent ()
 
 PollingComponent (uint32_t update_interval)
 Initialize this polling component with the given update interval in ms.
 
virtual void set_update_interval (uint32_t update_interval)
 Manually set the update interval in ms for this polling object.
 
void call_setup () override
 
virtual uint32_t get_update_interval () const
 Get the update interval in ms of this sensor.
 
void start_poller ()
 
void stop_poller ()
 
- 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 ()
 
uint32_t get_component_state () const
 
virtual void mark_failed ()
 Mark this component as failed.
 
void mark_failed (const char *message)
 
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)
 
- 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)
 

Protected Member Functions

bool apply_all_settings_ ()
 
uint8_t apply_setting_ (MLX90393Setting which)
 
bool verify_setting_ (MLX90393Setting which)
 
void verify_settings_timeout_ (MLX90393Setting stage)
 Regularly checks that our settings are still applied.
 
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
 
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 (uint32_t interval, std::function< void()> &&f)
 
bool cancel_interval (const std::string &name)
 Cancel an interval function.
 
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 (uint32_t timeout, std::function< void()> &&f)
 
bool cancel_timeout (const std::string &name)
 Cancel a timeout function.
 
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call.
 
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

MLX90393 mlx_
 
sensor::Sensorx_sensor_ {nullptr}
 
sensor::Sensory_sensor_ {nullptr}
 
sensor::Sensorz_sensor_ {nullptr}
 
sensor::Sensort_sensor_ {nullptr}
 
uint8_t gain_
 
uint8_t oversampling_
 
uint8_t temperature_oversampling_ {0}
 
uint8_t filter_
 
uint8_t resolutions_ [3] {0}
 
bool temperature_compensation_ {false}
 
uint8_t hallconf_ {0xC}
 
GPIOPindrdy_pin_ {nullptr}
 
- Protected Attributes inherited from esphome::PollingComponent
uint32_t update_interval_
 
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component.
 
float setup_priority_override_ {NAN}
 
const char * component_source_ {nullptr}
 
uint32_t warn_if_blocking_over_ {WARN_IF_BLOCKING_OVER_MS}
 
std::string error_message_ {}
 
- 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
 

Detailed Description

Definition at line 24 of file sensor_mlx90393.h.

Member Function Documentation

◆ apply_all_settings_()

bool esphome::mlx90393::MLX90393Cls::apply_all_settings_ ( )
protected

Definition at line 91 of file sensor_mlx90393.cpp.

◆ apply_setting_()

uint8_t esphome::mlx90393::MLX90393Cls::apply_setting_ ( MLX90393Setting which)
protected

Definition at line 58 of file sensor_mlx90393.cpp.

◆ dump_config()

void esphome::mlx90393::MLX90393Cls::dump_config ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 120 of file sensor_mlx90393.cpp.

◆ get_setup_priority()

float esphome::mlx90393::MLX90393Cls::get_setup_priority ( ) const
overridevirtual

Reimplemented from esphome::Component.

Definition at line 136 of file sensor_mlx90393.cpp.

◆ has_drdy_pin()

bool esphome::mlx90393::MLX90393Cls::has_drdy_pin ( )
override

Definition at line 46 of file sensor_mlx90393.cpp.

◆ read_drdy_pin()

bool esphome::mlx90393::MLX90393Cls::read_drdy_pin ( )
override

Definition at line 48 of file sensor_mlx90393.cpp.

◆ set_drdy_gpio()

void esphome::mlx90393::MLX90393Cls::set_drdy_gpio ( GPIOPin * pin)
inline

Definition at line 31 of file sensor_mlx90393.h.

◆ set_filter()

void esphome::mlx90393::MLX90393Cls::set_filter ( uint8_t filter)
inline

Definition at line 41 of file sensor_mlx90393.h.

◆ set_gain()

void esphome::mlx90393::MLX90393Cls::set_gain ( uint8_t gain_sel)
inline

Definition at line 42 of file sensor_mlx90393.h.

◆ set_hallconf()

void esphome::mlx90393::MLX90393Cls::set_hallconf ( uint8_t hallconf)
inline

Definition at line 46 of file sensor_mlx90393.h.

◆ set_oversampling()

void esphome::mlx90393::MLX90393Cls::set_oversampling ( uint8_t osr)
inline

Definition at line 38 of file sensor_mlx90393.h.

◆ set_resolution()

void esphome::mlx90393::MLX90393Cls::set_resolution ( uint8_t xyz,
uint8_t res )
inline

Definition at line 40 of file sensor_mlx90393.h.

◆ set_t_oversampling()

void esphome::mlx90393::MLX90393Cls::set_t_oversampling ( uint8_t osr2)
inline

Definition at line 39 of file sensor_mlx90393.h.

◆ set_t_sensor()

void esphome::mlx90393::MLX90393Cls::set_t_sensor ( sensor::Sensor * t_sensor)
inline

Definition at line 36 of file sensor_mlx90393.h.

◆ set_temperature_compensation()

void esphome::mlx90393::MLX90393Cls::set_temperature_compensation ( bool temperature_compensation)
inline

Definition at line 43 of file sensor_mlx90393.h.

◆ set_x_sensor()

void esphome::mlx90393::MLX90393Cls::set_x_sensor ( sensor::Sensor * x_sensor)
inline

Definition at line 33 of file sensor_mlx90393.h.

◆ set_y_sensor()

void esphome::mlx90393::MLX90393Cls::set_y_sensor ( sensor::Sensor * y_sensor)
inline

Definition at line 34 of file sensor_mlx90393.h.

◆ set_z_sensor()

void esphome::mlx90393::MLX90393Cls::set_z_sensor ( sensor::Sensor * z_sensor)
inline

Definition at line 35 of file sensor_mlx90393.h.

◆ setup()

void esphome::mlx90393::MLX90393Cls::setup ( )
overridevirtual

Reimplemented from esphome::Component.

Definition at line 105 of file sensor_mlx90393.cpp.

◆ sleep_micros()

void esphome::mlx90393::MLX90393Cls::sleep_micros ( uint32_t micros)
override

Definition at line 56 of file sensor_mlx90393.cpp.

◆ sleep_millis()

void esphome::mlx90393::MLX90393Cls::sleep_millis ( uint32_t millis)
override

Definition at line 55 of file sensor_mlx90393.cpp.

◆ transceive()

bool esphome::mlx90393::MLX90393Cls::transceive ( const uint8_t * request,
size_t request_size,
uint8_t * response,
size_t response_size )
override

Definition at line 32 of file sensor_mlx90393.cpp.

◆ update()

void esphome::mlx90393::MLX90393Cls::update ( )
overridevirtual

Implements esphome::PollingComponent.

Definition at line 138 of file sensor_mlx90393.cpp.

◆ verify_setting_()

bool esphome::mlx90393::MLX90393Cls::verify_setting_ ( MLX90393Setting which)
protected

Definition at line 162 of file sensor_mlx90393.cpp.

◆ verify_settings_timeout_()

void esphome::mlx90393::MLX90393Cls::verify_settings_timeout_ ( MLX90393Setting stage)
protected

Regularly checks that our settings are still applied.

Used to catch spurious chip resets.

returns true if everything is fine. false if not

Definition at line 248 of file sensor_mlx90393.cpp.

Field Documentation

◆ drdy_pin_

GPIOPin* esphome::mlx90393::MLX90393Cls::drdy_pin_ {nullptr}
protected

Definition at line 71 of file sensor_mlx90393.h.

◆ filter_

uint8_t esphome::mlx90393::MLX90393Cls::filter_
protected

Definition at line 67 of file sensor_mlx90393.h.

◆ gain_

uint8_t esphome::mlx90393::MLX90393Cls::gain_
protected

Definition at line 64 of file sensor_mlx90393.h.

◆ hallconf_

uint8_t esphome::mlx90393::MLX90393Cls::hallconf_ {0xC}
protected

Definition at line 70 of file sensor_mlx90393.h.

◆ mlx_

MLX90393 esphome::mlx90393::MLX90393Cls::mlx_
protected

Definition at line 59 of file sensor_mlx90393.h.

◆ oversampling_

uint8_t esphome::mlx90393::MLX90393Cls::oversampling_
protected

Definition at line 65 of file sensor_mlx90393.h.

◆ resolutions_

uint8_t esphome::mlx90393::MLX90393Cls::resolutions_[3] {0}
protected

Definition at line 68 of file sensor_mlx90393.h.

◆ t_sensor_

sensor::Sensor* esphome::mlx90393::MLX90393Cls::t_sensor_ {nullptr}
protected

Definition at line 63 of file sensor_mlx90393.h.

◆ temperature_compensation_

bool esphome::mlx90393::MLX90393Cls::temperature_compensation_ {false}
protected

Definition at line 69 of file sensor_mlx90393.h.

◆ temperature_oversampling_

uint8_t esphome::mlx90393::MLX90393Cls::temperature_oversampling_ {0}
protected

Definition at line 66 of file sensor_mlx90393.h.

◆ x_sensor_

sensor::Sensor* esphome::mlx90393::MLX90393Cls::x_sensor_ {nullptr}
protected

Definition at line 60 of file sensor_mlx90393.h.

◆ y_sensor_

sensor::Sensor* esphome::mlx90393::MLX90393Cls::y_sensor_ {nullptr}
protected

Definition at line 61 of file sensor_mlx90393.h.

◆ z_sensor_

sensor::Sensor* esphome::mlx90393::MLX90393Cls::z_sensor_ {nullptr}
protected

Definition at line 62 of file sensor_mlx90393.h.


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