Skip to content

Commit

Permalink
add support CST816S touch screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
lovyan03 committed Jun 10, 2023
1 parent 76f3ff9 commit 38fbb02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
19 changes: 8 additions & 11 deletions src/lgfx/v1/touch/Touch_CST816S.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ namespace lgfx
return _inited;
}

void IRAM_ATTR Touch_CST816S::_irq_isr(void) {
_flg_released = false;
}
//----------------------------------------------------------------------------
bool Touch_CST816S::init(void)
{
Expand Down Expand Up @@ -93,15 +90,15 @@ namespace lgfx
return true;
}

void Touch_CST816S::wakeup(void)
{
}
// void Touch_CST816S::wakeup(void)
// {
// }

void Touch_CST816S::sleep(void)
{
if (!_check_init()) return;
// _write_reg(CST816S_SLEEP_REG, CST816S_SLEEP_IN);
}
// void Touch_CST816S::sleep(void)
// {
// if (!_check_init()) return;
// // _write_reg(CST816S_SLEEP_REG, CST816S_SLEEP_IN);
// }

size_t Touch_CST816S::_read_data(uint8_t* readdata)
{
Expand Down
10 changes: 2 additions & 8 deletions src/lgfx/v1/touch/Touch_CST816S.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,22 @@ namespace lgfx

bool init(void) override;

void wakeup(void) override;

void sleep(void) override;
// void wakeup(void) override;
// void sleep(void) override;

uint_fast8_t getTouchRaw(touch_point_t* tp, uint_fast8_t count) override;

CS816S_GESTURE getGesture();

private:
enum
{
max_touch_points = 1
};

bool _flg_released = false;

bool _check_init(void);
bool _write_reg(uint8_t reg, uint8_t val);
bool _write_regs(uint8_t* val, size_t length);
bool _read_reg(uint8_t reg, uint8_t *data, size_t length);
size_t _read_data(uint8_t* data);
void _irq_isr(void);
};

//----------------------------------------------------------------------------
Expand Down

0 comments on commit 38fbb02

Please sign in to comment.