epd2in66b: Waveshare 2.66inch E-Paper Display Module (B) for Raspberry Pi Pico (#673)

epd2in66b: add working driver

Co-authored-by: Thomas Richner <thomas.richner@oviva.com>
This commit is contained in:
Thomas
2024-06-10 13:16:45 +02:00
committed by GitHub
parent 7d983647ad
commit 4a0bcba87c
6 changed files with 499 additions and 1 deletions
+34
View File
@@ -0,0 +1,34 @@
//go:build pico
package epd2in66b
import (
"machine"
)
// DefaultConfig contains the default config for the https://www.waveshare.com/wiki/Pico-ePaper-2.66 module
var DefaultConfig = Config{
DataPin: machine.GP8,
ChipSelectPin: machine.GP9,
ResetPin: machine.GP12,
BusyPin: machine.GP13,
}
// NewPicoModule allocates a new device backed by the https://www.waveshare.com/wiki/Pico-ePaper-2.66 module
// This will also configure the SPI1 bus and configure the device with the DefaultConfig
func NewPicoModule() (Device, error) {
spi := machine.SPI1
if err := spi.Configure(machine.SPIConfig{
Frequency: Baudrate,
}); err != nil {
return Device{}, err
}
dev := New(spi)
if err := dev.Configure(DefaultConfig); err != nil {
return dev, err
}
return dev, nil
}