Checkpoint
This commit is contained in:
54 files changed
+6855
-526
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package ssd1xxx
|
||||
|
||||
// Config describes the OLED configuration.
|
||||
type Config struct {
|
||||
Width int
|
||||
Height int
|
||||
ExternalVCC bool
|
||||
Init []Command
|
||||
Suspend []Command
|
||||
Resume []Command
|
||||
}
|
||||
|
||||
// Command is one or more command bytes.
|
||||
type Command interface {
|
||||
Bytes() []byte
|
||||
}
|
||||
|
||||
type Register byte
|
||||
|
||||
func (r Register) Bytes() []byte { return []byte{byte(r)} }
|
||||
|
||||
type RegisterArgs struct {
|
||||
Register Register
|
||||
Args []byte
|
||||
}
|
||||
|
||||
func (r RegisterArgs) Bytes() []byte { return append([]byte{byte(r.Register)}, r.Args...) }
|
||||
|
||||
type RegisterFunc struct {
|
||||
Register Register
|
||||
Func func() []byte
|
||||
}
|
||||
|
||||
func (r RegisterFunc) Bytes() []byte {
|
||||
args := r.Func()
|
||||
return append([]byte{byte(r.Register)}, args...)
|
||||
}
|
||||
Reference in new issue
Block a user