mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-20 06:28:59 +00:00
uc8151: improvements to speed and also add flicker-free mode based on @antirez code example
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
committed by
Daniel Esteban
parent
2a621dc3b1
commit
9063f46313
@@ -0,0 +1,30 @@
|
||||
package uc8151
|
||||
|
||||
// LUTType is the look-up table for the display
|
||||
type LUTType [42]uint8
|
||||
|
||||
type LUTSet struct {
|
||||
VCOM LUTType
|
||||
WW LUTType
|
||||
BW LUTType
|
||||
WB LUTType
|
||||
BB LUTType
|
||||
}
|
||||
|
||||
func (lut *LUTType) Clear() {
|
||||
for i := range lut {
|
||||
lut[i] = 0
|
||||
}
|
||||
}
|
||||
|
||||
func (lut *LUTType) SetRow(row int, pat uint8, dur [4]uint8, rep uint8) error {
|
||||
index := row * 6
|
||||
lut[index] = pat
|
||||
lut[index+1] = dur[0]
|
||||
lut[index+2] = dur[1]
|
||||
lut[index+3] = dur[2]
|
||||
lut[index+4] = dur[3]
|
||||
lut[index+5] = rep
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user