mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-04 15:07:46 +00:00
epd2in13: add Sleep method like other displays
For details, see: https://github.com/tinygo-org/drivers/pull/548
This commit is contained in:
committed by
Ron Evans
parent
14994a3f31
commit
2c2da5c7bb
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user