From bf0b383176a48e9c3d9d3694cfb902fcf3c77897 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sun, 21 Apr 2024 12:19:58 +0200 Subject: [PATCH] ssd1306: add rotation functions for Displayer interface Signed-off-by: deadprogram --- ssd1306/ssd1306.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ssd1306/ssd1306.go b/ssd1306/ssd1306.go index fdf168f..955a364 100644 --- a/ssd1306/ssd1306.go +++ b/ssd1306/ssd1306.go @@ -15,8 +15,9 @@ import ( ) var ( - errBufferSize = errors.New("invalid size buffer") - errOutOfRange = errors.New("out of screen range") + errBufferSize = errors.New("invalid size buffer") + errOutOfRange = errors.New("out of screen range") + errNotImplemented = errors.New("not implemented") ) type ResetValue [2]byte @@ -359,3 +360,14 @@ func (d *Device) DrawBitmap(x, y int16, bitmap pixel.Image[pixel.Monochrome]) er return nil } + +// Rotation returns the currently configured rotation. +func (d *Device) Rotation() drivers.Rotation { + return drivers.Rotation0 +} + +// SetRotation changes the rotation of the device (clock-wise). +// Would have to be implemented in software for this device. +func (d *Device) SetRotation(rotation drivers.Rotation) error { + return errNotImplemented +}