ESPHome 2025.5.0
Loading...
Searching...
No Matches
m5stack_8angle.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace esphome {
7namespace m5stack_8angle {
8
9static const uint8_t M5STACK_8ANGLE_REGISTER_ANALOG_INPUT_12B = 0x00;
10static const uint8_t M5STACK_8ANGLE_REGISTER_ANALOG_INPUT_8B = 0x10;
11static const uint8_t M5STACK_8ANGLE_REGISTER_DIGITAL_INPUT = 0x20;
12static const uint8_t M5STACK_8ANGLE_REGISTER_RGB_24B = 0x30;
13static const uint8_t M5STACK_8ANGLE_REGISTER_FW_VERSION = 0xFE;
14
15enum AnalogBits : uint8_t {
16 BITS_8 = 8,
17 BITS_12 = 12,
18};
19
21 public:
22 void setup() override;
23 void dump_config() override;
24 float get_setup_priority() const override;
25 float read_knob_pos(uint8_t channel, AnalogBits bits = AnalogBits::BITS_8);
26 int32_t read_knob_pos_raw(uint8_t channel, AnalogBits bits = AnalogBits::BITS_8);
27 int8_t read_switch();
28
29 protected:
30 uint8_t fw_version_;
31};
32
33} // namespace m5stack_8angle
34} // namespace esphome
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:133
int32_t read_knob_pos_raw(uint8_t channel, AnalogBits bits=AnalogBits::BITS_8)
float read_knob_pos(uint8_t channel, AnalogBits bits=AnalogBits::BITS_8)
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7