ESPHome  2024.11.1
m5stack_8angle.h
Go to the documentation of this file.
1 #pragma once
2 
5 
6 namespace esphome {
7 namespace m5stack_8angle {
8 
9 static const uint8_t M5STACK_8ANGLE_REGISTER_ANALOG_INPUT_12B = 0x00;
10 static const uint8_t M5STACK_8ANGLE_REGISTER_ANALOG_INPUT_8B = 0x10;
11 static const uint8_t M5STACK_8ANGLE_REGISTER_DIGITAL_INPUT = 0x20;
12 static const uint8_t M5STACK_8ANGLE_REGISTER_RGB_24B = 0x30;
13 static const uint8_t M5STACK_8ANGLE_REGISTER_FW_VERSION = 0xFE;
14 
15 enum 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
float read_knob_pos(uint8_t channel, AnalogBits bits=AnalogBits::BITS_8)
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
int32_t read_knob_pos_raw(uint8_t channel, AnalogBits bits=AnalogBits::BITS_8)
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133