mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-18 21:53:56 +00:00
ssd1306: add Sleep() function for Displayer interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -371,3 +371,15 @@ func (d *Device) Rotation() drivers.Rotation {
|
|||||||
func (d *Device) SetRotation(rotation drivers.Rotation) error {
|
func (d *Device) SetRotation(rotation drivers.Rotation) error {
|
||||||
return errNotImplemented
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user