9static const uint8_t REGISTER_ZMCO = 0x00;
10static const uint8_t REGISTER_ZPOS = 0x01;
11static const uint8_t REGISTER_MPOS = 0x03;
12static const uint8_t REGISTER_MANG = 0x05;
13static const uint8_t REGISTER_CONF = 0x07;
16static const uint8_t REGISTER_ANGLE_RAW = 0x0C;
17static const uint8_t REGISTER_ANGLE = 0x0E;
20static const uint8_t REGISTER_STATUS = 0x0B;
21static const uint8_t REGISTER_AGC = 0x1A;
22static const uint8_t REGISTER_MAGNITUDE = 0x1B;
24void AS5600Sensor::dump_config() {
25 LOG_SENSOR(
"",
"AS5600 Sensor",
this);
27 LOG_SENSOR(
" ",
"Raw Position Sensor", this->raw_position_sensor_);
28 LOG_SENSOR(
" ",
"Gain Sensor", this->gain_sensor_);
29 LOG_SENSOR(
" ",
"Magnitude Sensor", this->magnitude_sensor_);
30 LOG_SENSOR(
" ",
"Status Sensor", this->status_sensor_);
31 LOG_UPDATE_INTERVAL(
this);
35 PUBLISH_STATE(this->gain_sensor_, this->
parent_->reg(REGISTER_AGC).get());
37 if (this->magnitude_sensor_ !=
nullptr) {
40 this->magnitude_sensor_->publish_state(
value);
47 PUBLISH_STATE(this->status_sensor_, this->
parent_->read_magnet_status());
50 if (!
pos.has_value()) {
56 if (!
raw.has_value()) {
67 PUBLISH_STATE(this->raw_position_sensor_,
raw.value());
void status_set_warning()
void status_clear_warning()
AS5600Component * parent_
OutRangeMode out_of_range_mode_
void publish_state(float state)
Publish a new state to the front-end.
ESPHOME_LOG_TAG(TAG, "as5600")