ESPHome  2022.6.3
hmc5883l.h
Go to the documentation of this file.
1 #pragma once
2 
6 
7 namespace esphome {
8 namespace hmc5883l {
9 
15 };
16 
25 };
26 
36 };
37 
39  public:
40  void setup() override;
41  void dump_config() override;
42  float get_setup_priority() const override;
43  void update() override;
44 
45  void set_oversampling(HMC5883LOversampling oversampling) { oversampling_ = oversampling; }
46  void set_datarate(HMC5883LDatarate datarate) { datarate_ = datarate; }
47  void set_range(HMC5883LRange range) { range_ = range; }
48  void set_x_sensor(sensor::Sensor *x_sensor) { x_sensor_ = x_sensor; }
49  void set_y_sensor(sensor::Sensor *y_sensor) { y_sensor_ = y_sensor; }
50  void set_z_sensor(sensor::Sensor *z_sensor) { z_sensor_ = z_sensor; }
51  void set_heading_sensor(sensor::Sensor *heading_sensor) { heading_sensor_ = heading_sensor; }
52 
53  protected:
61  enum ErrorCode {
62  NONE = 0,
65  } error_code_;
66 };
67 
68 } // namespace hmc5883l
69 } // namespace esphome
void set_range(HMC5883LRange range)
Definition: hmc5883l.h:47
sensor::Sensor * heading_sensor_
Definition: hmc5883l.h:60
void set_datarate(HMC5883LDatarate datarate)
Definition: hmc5883l.h:46
This class simplifies creating components that periodically check a state.
Definition: component.h:266
void set_oversampling(HMC5883LOversampling oversampling)
Definition: hmc5883l.h:45
HMC5883LOversampling oversampling_
Definition: hmc5883l.h:54
enum esphome::hmc5883l::HMC5883LComponent::ErrorCode error_code_
void set_z_sensor(sensor::Sensor *z_sensor)
Definition: hmc5883l.h:50
Definition: a4988.cpp:4
Base-class for all sensors.
Definition: sensor.h:47
void set_y_sensor(sensor::Sensor *y_sensor)
Definition: hmc5883l.h:49
void set_x_sensor(sensor::Sensor *x_sensor)
Definition: hmc5883l.h:48
float get_setup_priority() const override
Definition: hmc5883l.cpp:82
void set_heading_sensor(sensor::Sensor *heading_sensor)
Definition: hmc5883l.h:51