ssd1306: add Sleep() function for Displayer interface

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2024-04-21 12:26:38 +02:00
committed by Ron Evans
parent bf0b383176
commit 1095629f62
+12
View File
@@ -371,3 +371,15 @@ func (d *Device) Rotation() drivers.Rotation {
func (d *Device) SetRotation(rotation drivers.Rotation) error {
return errNotImplemented
}
// Set the sleep mode for this display. When sleeping, the panel uses a lot
// less power. The display won't show an image anymore, but the memory contents
// should be kept.
func (d *Device) Sleep(sleepEnabled bool) error {
if sleepEnabled {
d.Command(DISPLAYOFF)
} else {
d.Command(DISPLAYON)
}
return nil
}