epd

package module
v0.0.0-...-e223d76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2018 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

epd

Interface to ePaper HAT

INSTALL

This assumes you are using RaspberryPi Zero W(H)

Install go for armv6l

curl https://dl.google.com/go/go1.10.1.linux-armv6l.tar.gz | sudo tar xz -C /usr/local

Add the path to Go in your environment, such as /etc/profile

export PATH=$PATH:/usr/local/go/bin

Fetch this repository

If you have not already done so, create ~/go, which will host all of your Go code. If you know what you are doing, use git to clone the library. Otherwise, use go get

go get github.com/lestrrat-go/epd

Install dependencies

This may take a while, because, well, you're running on a RP Zero

cd ~/go/src/github.com/lestrrat-go/epd
go get -u ./...

Run the tests

cd ~/go/src/github.com/lestrrat-go/epd
go test .

Documentation

Index

Constants

View Source
const (
	Width  uint8 = 128 // hardcoded for 2.13 inch ePaper for now
	Height uint8 = 250
)
View Source
const (
	OffsetSET = 7
	OffsetCLR = 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command byte
const (
	DriverOutputControl            Command = 0x01
	BoosterSoftStartControl        Command = 0x0C
	GateScanStartPosition          Command = 0x0F
	DeepSleepMode                  Command = 0x10
	DataEntryModeSetting           Command = 0x11
	SwReset                        Command = 0x12
	TemperatuteSendorControl       Command = 0x1A
	MasterActivation               Command = 0x20
	DisplayUpdateControl1          Command = 0x21
	DisplayUpdateControl2          Command = 0x22
	WriteRAM                       Command = 0x24
	WriteVCOMRegister              Command = 0x2C
	WriteLUTRegister               Command = 0x32
	SetDummyLinePeriod             Command = 0x3A
	SetGateTime                    Command = 0x3B
	BorderWaveformControl          Command = 0x3C
	SetRamXAddressStartEndPosition Command = 0x44
	SetRamYAddressStartEndPosition Command = 0x45
	SetRamXAddressCounter          Command = 0x4E
	SetRamYAddressCounter          Command = 0x4F
	TerminateFrameReadWrite        Command = 0xFF
)

func (Command) Byte

func (cmd Command) Byte() byte

func (Command) String

func (i Command) String() string

type EPD

type EPD struct {
	// contains filtered or unexported fields
}

func New

func New() *EPD

func (*EPD) ClearFrameMemory

func (e *EPD) ClearFrameMemory(color byte)

func (*EPD) DisplayFrame

func (e *EPD) DisplayFrame()

func (*EPD) Reinitialize

func (e *EPD) Reinitialize()

func (*EPD) Reset

func (e *EPD) Reset()

func (*EPD) SendCommand

func (e *EPD) SendCommand(cmd Command, args ...byte)

func (*EPD) SendData

func (e *EPD) SendData(data ...byte)

SendData sends data through SPI. Arbitrary number of bytes can be passed to this method, and they will be each sent in succession

func (*EPD) SetFrameMemory

func (e *EPD) SetFrameMemory(im image.Image, x, y uint8)

func (*EPD) SetLUT

func (e *EPD) SetLUT(lut []byte)

func (*EPD) SetMemoryArea

func (e *EPD) SetMemoryArea(startX, startY, endX, endY uint8)

func (*EPD) SetMemoryPointer

func (e *EPD) SetMemoryPointer(x, y uint8)

func (*EPD) WaitUntilIdle

func (e *EPD) WaitUntilIdle(ctx context.Context) error

Directories

Path Synopsis
eg
clear-screen command
load-image command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址