diff options
author | Riku Isokoski <riksu9000@gmail.com> | 2021-07-15 14:11:27 +0300 |
---|---|---|
committer | Riku Isokoski <riksu9000@gmail.com> | 2021-07-15 14:11:27 +0300 |
commit | fe64176e7b8a0a7a9df733701d08762b60c2511f (patch) | |
tree | d5ef31d626486c85fd046bbeeb22af845315079d /src/drivers | |
parent | 57b339707861c5688f5d432f1506a99df6bb0fce (diff) |
New touch handler, with issues
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/Cst816s.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/drivers/Cst816s.cpp b/src/drivers/Cst816s.cpp index fd9792b3..adb984e0 100644 --- a/src/drivers/Cst816s.cpp +++ b/src/drivers/Cst816s.cpp @@ -40,6 +40,16 @@ void Cst816S::Init() { */ static constexpr uint8_t motionMask = 0b00000101; twiMaster.Write(twiAddress, 0xEC, &motionMask, 1); + + /* + [7] EnTest - Interrupt pin to test, enable automatic periodic issued after a low pulse. + [6] EnTouch - When a touch is detected, a periodic pulsed Low. + [5] EnChange - Upon detecting a touch state changes, pulsed Low. + [4] EnMotion - When the detected gesture is pulsed Low. + [0] OnceWLP - Press gesture only issue a pulse signal is low. + */ + static constexpr uint8_t irqCtl = 0b01110000; + twiMaster.Write(twiAddress, 0xFA, &irqCtl, 1); } Cst816S::TouchInfos Cst816S::GetTouchInfo() { @@ -90,4 +100,4 @@ void Cst816S::Sleep() { void Cst816S::Wakeup() { Init(); NRF_LOG_INFO("[TOUCHPANEL] Wakeup"); -}
\ No newline at end of file +} |