inky

package
v0.0.0-...-3ec9b05 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: BSD-2-Clause Imports: 10 Imported by: 0

README

This is a copy from: periph.io/x/periph/experimental/devices/inky

This is here because it seems `go mod` cannot load it.

TODO: Delete this as soon as I figure out why this is the case.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color int

Color is used to define which model of inky is being used, and also for setting the border color.

const (
	Black Color = iota
	Red
	Yellow
	White
)

Valid Color.

type Dev

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

Dev is a handle to an Inky.

func New

func New(p spi.Port, dc gpio.PinOut, reset gpio.PinOut, busy gpio.PinIn, o *Opts) (*Dev, error)

New opens a handle to an Inky pHAT.

func (*Dev) Bounds

func (d *Dev) Bounds() image.Rectangle

Bounds implements display.Drawer

func (*Dev) ColorModel

func (d *Dev) ColorModel() color.Model

ColorModel implements display.Drawer Maps white to white, black to black and anything else as red. Red is used as a placeholder for the display's third color, i.e., red or yellow.

func (*Dev) Draw

func (d *Dev) Draw(dstRect image.Rectangle, src image.Image, srcPtrs image.Point) error

Draw implements display.Drawer

func (*Dev) Halt

func (d *Dev) Halt() error

Halt implements conn.Resource

func (*Dev) SetBorder

func (d *Dev) SetBorder(c Color)

SetBorder changes the border color. This will not take effect until the next Draw().

func (*Dev) String

func (d *Dev) String() string

String implements conn.Resource.

type Model

type Model int

Model lists the supported e-ink display models.

const (
	PHAT Model = iota
)

Supported Model.

type Opts

type Opts struct {
	// Model being used.
	Model Model
	// Model color.
	ModelColor Color
	// Initial border color. Will be set on the first Draw().
	BorderColor Color
}

Opts is the options to specify which device is being controlled and its default settings.

Jump to

Keyboard shortcuts

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