48 lines
1.4 KiB
C++
48 lines
1.4 KiB
C++
#ifndef LOW_LEVEL_TOUCH_FT6336U_H
|
|
#define LOW_LEVEL_TOUCH_FT6336U_H
|
|
|
|
#include "low_level_touch.h"
|
|
#include "../lib/ft6336u/ft6336u.h"
|
|
|
|
// FT6336U Touch Driver Implementation
|
|
class LowLevelTouchFT6336U : public LowLevelTouch {
|
|
private:
|
|
int screen_width;
|
|
int screen_height;
|
|
bool swap_xy;
|
|
bool invert_x;
|
|
bool invert_y;
|
|
bool initialized;
|
|
|
|
public:
|
|
LowLevelTouchFT6336U(int width, int height, bool swap_xy = false,
|
|
bool invert_x = false, bool invert_y = false);
|
|
virtual ~LowLevelTouchFT6336U();
|
|
|
|
// Core operations
|
|
bool init() override;
|
|
bool read_touch(TouchData* data) override;
|
|
bool is_touched() override;
|
|
|
|
// Touch properties
|
|
int get_screen_width() const override { return screen_width; }
|
|
int get_screen_height() const override { return screen_height; }
|
|
TouchType get_type() const override { return TOUCH_TYPE_FT6336U; }
|
|
uint8_t get_max_touch_points() const override { return 2; }
|
|
|
|
// Device information
|
|
uint8_t get_chip_id() override;
|
|
uint8_t get_firmware_version() override;
|
|
|
|
// Coordinate transformation
|
|
void set_coordinate_transform(bool swap_xy, bool invert_x, bool invert_y) override;
|
|
|
|
// Interrupt callback
|
|
void set_interrupt_callback(void (*callback)(unsigned int gpio, uint32_t events)) override;
|
|
|
|
// Test/diagnostic
|
|
bool test_communication() override;
|
|
};
|
|
|
|
#endif // LOW_LEVEL_TOUCH_FT6336U_H
|