ESPHome  2024.9.2
as5600_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/hal.h"
9 
10 namespace esphome {
11 namespace as5600 {
12 
13 class AS5600Sensor : public PollingComponent, public Parented<AS5600Component>, public sensor::Sensor {
14  public:
15  void update() override;
16  void dump_config() override;
17  float get_setup_priority() const override;
18 
19  void set_angle_sensor(sensor::Sensor *angle_sensor) { this->angle_sensor_ = angle_sensor; }
20  void set_raw_angle_sensor(sensor::Sensor *raw_angle_sensor) { this->raw_angle_sensor_ = raw_angle_sensor; }
21  void set_position_sensor(sensor::Sensor *position_sensor) { this->position_sensor_ = position_sensor; }
22  void set_raw_position_sensor(sensor::Sensor *raw_position_sensor) {
23  this->raw_position_sensor_ = raw_position_sensor;
24  }
25  void set_gain_sensor(sensor::Sensor *gain_sensor) { this->gain_sensor_ = gain_sensor; }
26  void set_magnitude_sensor(sensor::Sensor *magnitude_sensor) { this->magnitude_sensor_ = magnitude_sensor; }
27  void set_status_sensor(sensor::Sensor *status_sensor) { this->status_sensor_ = status_sensor; }
28  void set_out_of_range_mode(OutRangeMode oor_mode) { this->out_of_range_mode_ = oor_mode; }
30 
31  protected:
40 };
41 
42 } // namespace as5600
43 } // namespace esphome
sensor::Sensor * angle_sensor_
Definition: as5600_sensor.h:32
void set_angle_sensor(sensor::Sensor *angle_sensor)
Definition: as5600_sensor.h:19
This class simplifies creating components that periodically check a state.
Definition: component.h:283
void set_out_of_range_mode(OutRangeMode oor_mode)
Definition: as5600_sensor.h:28
void set_raw_position_sensor(sensor::Sensor *raw_position_sensor)
Definition: as5600_sensor.h:22
sensor::Sensor * position_sensor_
Definition: as5600_sensor.h:34
float get_setup_priority() const override
sensor::Sensor * gain_sensor_
Definition: as5600_sensor.h:36
sensor::Sensor * raw_position_sensor_
Definition: as5600_sensor.h:35
OutRangeMode get_out_of_range_mode()
Definition: as5600_sensor.h:29
sensor::Sensor * raw_angle_sensor_
Definition: as5600_sensor.h:33
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void set_gain_sensor(sensor::Sensor *gain_sensor)
Definition: as5600_sensor.h:25
void set_position_sensor(sensor::Sensor *position_sensor)
Definition: as5600_sensor.h:21
void set_magnitude_sensor(sensor::Sensor *magnitude_sensor)
Definition: as5600_sensor.h:26
Base-class for all sensors.
Definition: sensor.h:57
void set_raw_angle_sensor(sensor::Sensor *raw_angle_sensor)
Definition: as5600_sensor.h:20
sensor::Sensor * magnitude_sensor_
Definition: as5600_sensor.h:37
sensor::Sensor * status_sensor_
Definition: as5600_sensor.h:38
Helper class to easily give an object a parent of type T.
Definition: helpers.h:521
void set_status_sensor(sensor::Sensor *status_sensor)
Definition: as5600_sensor.h:27