Skip to content

Commit

Permalink
Update CSTxxx sleep method
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Sep 19, 2023
1 parent ca01827 commit 88d3c37
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ void setup()
touch.setHomeButtonCallback([](void *user_data) {
Serial.println("Home key pressed!");
}, NULL);


// Unable to obtain coordinates after turning on sleep , During sleep state, the external IRQ must be set to high impedance
// CST816T sleep current = 1.1 uA
// CST226SE sleep current = 60 uA
// touch.sleep();

}

void loop()
Expand Down
14 changes: 11 additions & 3 deletions src/TouchDrvCSTXXX.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,15 +190,23 @@ class TouchDrvCSTXXX :
}
}

//2uA
void sleep()
{
writeRegister(0xD1, 0x05);
switch (__model) {
case CST816T_MODEL_ID:
writeRegister(0xE5, 0x03);
break;
case CST226SE_MODEL_ID:
writeRegister(0xD1, 0x05);
break;
default:
break;
}
}

void wakeup()
{

reset();
}

void idle()
Expand Down

0 comments on commit 88d3c37

Please sign in to comment.