ESPHome  2024.8.3
mpr121_binary_sensor.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "../mpr121.h"
6 
7 namespace esphome {
8 namespace mpr121 {
9 
10 class MPR121BinarySensor : public binary_sensor::BinarySensor, public MPR121Channel, public Parented<MPR121Component> {
11  public:
12  void set_channel(uint8_t channel) { this->channel_ = channel; }
13  void set_touch_threshold(uint8_t touch_threshold) { this->touch_threshold_ = touch_threshold; };
14  void set_release_threshold(uint8_t release_threshold) { this->release_threshold_ = release_threshold; };
15 
16  void setup() override;
17  void process(uint16_t data) override;
18 
19  protected:
20  uint8_t channel_{0};
23 };
24 
25 } // namespace mpr121
26 } // namespace esphome
void process(uint16_t data) override
void set_touch_threshold(uint8_t touch_threshold)
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
Base class for all binary_sensor-type classes.
Definition: binary_sensor.h:37
void set_release_threshold(uint8_t release_threshold)
Helper class to easily give an object a parent of type T.
Definition: helpers.h:521