waveshare2in13v2

package
v3.6.8 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package waveshare2in13v2 controls Waveshare 2in13v2 e-paper display.

Datasheets

https://www.waveshare.com/w/upload/d/d5/2.13inch_e-Paper_Specification.pdf

Product page:

2.13 Inch version 2: https://www.waveshare.com/wiki/2.13inch_e-Paper_HAT

Index

Constants

This section is empty.

Variables

View Source
var EPD2in13v2 = Opts{
	Width:  122,
	Height: 250,
	FullUpdate: LUT{
		0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
		0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00,
		0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
		0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

		0x03, 0x03, 0x00, 0x00, 0x02,
		0x09, 0x09, 0x00, 0x00, 0x02,
		0x03, 0x03, 0x00, 0x00, 0x02,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,

		0x15, 0x41, 0xA8, 0x32, 0x30, 0x0A,
	},
	PartialUpdate: LUT{
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

		0x0A, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,
		0x00, 0x00, 0x00, 0x00, 0x00,

		0x15, 0x41, 0xA8, 0x32, 0x30, 0x0A,
	},
}

EPD2in13v2 cointains display configuration for the Waveshare 2in13v2.

Functions

This section is empty.

Types

type Dev

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

Dev defines the handler which is used to access the display.

func New

func New(p spi.Port, dc, cs, rst gpio.PinOut, busy gpio.PinIO, opts *Opts) (*Dev, error)

New creates new handler which is used to access the display.

func NewHat

func NewHat(p spi.Port, opts *Opts) (*Dev, error)

NewHat creates new handler which is used to access the display. Default Waveshare Hat configuration is used.

func (*Dev) Bounds

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

Bounds returns the bounds for the configurated display.

func (*Dev) Clear

func (d *Dev) Clear(color byte) error

Clear clears the display.

func (*Dev) ColorModel

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

ColorModel returns a 1Bit color model.

func (*Dev) Draw

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

Draw draws the given image to the display.

func (*Dev) DrawPartial

func (d *Dev) DrawPartial(dstRect image.Rectangle, src image.Image, srcPts image.Point) error

DrawPartial draws the given image to the display. Display will update only changed pixel.

func (*Dev) Halt

func (d *Dev) Halt() error

Halt clears the display.

func (*Dev) Init

func (d *Dev) Init(partialUpdate PartialUpdate) error

Init will initialize the display with the partial-update or full-update mode.

func (*Dev) String

func (d *Dev) String() string

String returns a string containing configuration information.

type LUT

type LUT []byte

LUT contains the waveform that is used to program the display.

type Opts

type Opts struct {
	Width         int
	Height        int
	FullUpdate    LUT
	PartialUpdate LUT
}

Opts definies the structure of the display configuration.

type PartialUpdate

type PartialUpdate bool

PartialUpdate defines if the display should do a full update or just a partial update.

const (
	// Full should update the complete display.
	Full PartialUpdate = false
	// Partial should update only partial parts of the display.
	Partial PartialUpdate = true
)

Jump to

Keyboard shortcuts

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