ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
m5stack_8angle.h
Go to the documentation of this file.
1#pragma once
2
5
7
8static const uint8_t M5STACK_8ANGLE_REGISTER_ANALOG_INPUT_12B = 0x00;
9static const uint8_t M5STACK_8ANGLE_REGISTER_ANALOG_INPUT_8B = 0x10;
10static const uint8_t M5STACK_8ANGLE_REGISTER_DIGITAL_INPUT = 0x20;
11static const uint8_t M5STACK_8ANGLE_REGISTER_RGB_24B = 0x30;
12static const uint8_t M5STACK_8ANGLE_REGISTER_FW_VERSION = 0xFE;
13
14enum AnalogBits : uint8_t {
15 BITS_8 = 8,
16 BITS_12 = 12,
17};
18
20 public:
21 void setup() override;
22 void dump_config() override;
23 float read_knob_pos(uint8_t channel, AnalogBits bits = AnalogBits::BITS_8);
24 int32_t read_knob_pos_raw(uint8_t channel, AnalogBits bits = AnalogBits::BITS_8);
25 int8_t read_switch();
26
27 protected:
28 uint8_t fw_version_;
29};
30
31} // namespace esphome::m5stack_8angle
This Class provides the methods to read/write bytes from/to an i2c device.
Definition i2c.h:132
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)