mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-09-02 04:49:00 +00:00
ili9341: st7735: st7789: unify rotation support
* Unify the Rotation type, so that SetRotation can be used in
interfaces.
* Add Rotation() method to these displays, so that the current
rotation can be read.
* Change SetRotation() so that it can return an error (if the given
rotation isn't supported).
This commit is contained in:
committed by
Ron Evans
parent
59d66d1e73
commit
c689c11838
+6
-4
@@ -1,5 +1,7 @@
|
||||
package st7735
|
||||
|
||||
import "tinygo.org/x/drivers"
|
||||
|
||||
// Registers
|
||||
const (
|
||||
NOP = 0x00
|
||||
@@ -52,8 +54,8 @@ const (
|
||||
GREENTAB Model = 0
|
||||
MINI80x160 Model = 1
|
||||
|
||||
NO_ROTATION Rotation = 0
|
||||
ROTATION_90 Rotation = 1 // 90 degrees clock-wise rotation
|
||||
ROTATION_180 Rotation = 2
|
||||
ROTATION_270 Rotation = 3
|
||||
NO_ROTATION = drivers.Rotation0
|
||||
ROTATION_90 = drivers.Rotation90 // 90 degrees clock-wise rotation
|
||||
ROTATION_180 = drivers.Rotation180
|
||||
ROTATION_270 = drivers.Rotation270
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user