30#include "../SensorBuildOpt.h"
31#if !SENSORLIB_EXCLUDE_TOUCH_CHSC5816
37 uint8_t CHSC5816_REG_SLEEP[] = {
38 0x20, 0x00, 0x00, 0x00,
39 0xF8, 0x16, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
40 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xE9
55 uint8_t numPoints = buffer[1];
60 const uint16_t
x = buffer[2] | ((buffer[5] & 0x0F) << 8);
61 const uint16_t
y = buffer[3] | (((buffer[5] >> 4) & 0x0F) << 8);
63 const uint8_t eventFlag = (buffer[6] & 0x0F);
64 const uint8_t
id = (buffer[6] >> 4) & 0x0F;
78bool TouchDrvCHSC5816::initImpl(uint8_t)
82 uint8_t buffer[16] = {0};
104 if (buffer[0] == 0x43 && buffer[1] == 0x48 && buffer[2] == 0x53 && buffer[3] == 0x43) {
constexpr size_t arraySize(const T(&arr)[N])
Returns the number of elements in a C‑style array at compile time.
#define SENSORLIB_LOG_E(...)
#define SENSORLIB_LOG_D(...)
SensorPressure pressure(bhy)
std::unique_ptr< SensorHal > hal
int writeBuff(uint8_t *buf, size_t len)
int writeThenRead(const uint8_t *write_buffer, size_t write_len, uint8_t *read_buffer, size_t read_len)
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 uint32_t REG_POINT_EVENT
static constexpr uint8_t MAX_FINGER_NUM
const TouchPoints & getTouchPoints() override
Get the touch points.
void sleep() override
Puts the touch driver to sleep.
uint32_t _chipID
Chip identification value.
virtual void updateXY(TouchPoints &points) const
Apply coordinate transformations (swap, scale, mirror) to all touch points.
TouchPoints _touchPoints
Touch points data.
uint8_t _maxTouchPoints
Maximum supported touch points.
Container for touch point data and optional gesture information.
bool addPoint(uint16_t x, uint16_t y, uint16_t pressure=0, uint8_t id=0, uint8_t event=0)
Adds a touch point to the container.
void clear()
Clears all stored touch points and gesture.