SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
touch/TouchDrvCHSC5816.hpp
Go to the documentation of this file.
1
30#pragma once
31
32#include "../SensorBuildOpt.h"
33#if !SENSORLIB_EXCLUDE_TOUCH_CHSC5816
34
35#include "TouchDrvInterface.hpp"
36
37static constexpr uint8_t CHSC5816_SLAVE_ADDRESS = (0x2E);
38
40{
41public:
46 TouchDrvCHSC5816() = default;
47
52 ~TouchDrvCHSC5816() = default;
53
61 void sleep() override;
62
68 const TouchPoints &getTouchPoints() override;
69
75 const char *getModelName() override;
76
77private:
78
79 bool initImpl(uint8_t) override;
80
81protected:
82 static constexpr uint32_t REG_BOOT_STATE = 0x20000018;
83 static constexpr uint32_t REG_IMG_HEAD = 0x20000014;
84 static constexpr uint32_t REG_POINT_EVENT = 0x2000002C;
85 static constexpr uint32_t REG_POINT = 0x2000002E;
86 static constexpr uint8_t MAX_FINGER_NUM = (1);
87 static constexpr uint8_t BYTES_PER_POINT = (5);
88 static constexpr uint8_t POINT_BUFFER_SIZE = (MAX_FINGER_NUM * BYTES_PER_POINT + 3);
89 static constexpr uint8_t COMMAND_SIZE = (4);
90};
91
92#endif
static constexpr uint32_t REG_BOOT_STATE
static constexpr uint8_t COMMAND_SIZE
const char * getModelName() override
Get the model name.
static constexpr uint8_t POINT_BUFFER_SIZE
static constexpr uint8_t BYTES_PER_POINT
static constexpr uint32_t REG_IMG_HEAD
static constexpr uint32_t REG_POINT_EVENT
static constexpr uint8_t MAX_FINGER_NUM
static constexpr uint32_t REG_POINT
TouchDrvCHSC5816()=default
Constructor for the touch driver.
const TouchPoints & getTouchPoints() override
Get the touch points.
void sleep() override
Puts the touch driver to sleep.
~TouchDrvCHSC5816()=default
Destructor for the touch driver.
Abstract base class for touch screen drivers.
Container for touch point data and optional gesture information.