epd2in13: add Sleep method like other displays

For details, see: https://github.com/tinygo-org/drivers/pull/548
This commit is contained in:
Ayke van Laethem
2023-11-06 18:23:23 +01:00
committed by Ron Evans
parent 14994a3f31
commit 2c2da5c7bb
+11
View File
@@ -131,6 +131,17 @@ func (d *Device) DeepSleep() {
d.WaitUntilIdle()
}
// Set the sleep mode of the panel. The display will still show its contents,
// but will go into a lower-power state.
func (d *Device) Sleep(sleepEnabled bool) error {
if sleepEnabled {
d.DeepSleep()
} else {
d.Reset()
}
return nil
}
// SendCommand sends a command to the display
func (d *Device) SendCommand(command uint8) {
d.sendDataCommand(true, command)