epd2in13

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package epd2in13 implements a driver for Waveshare 2.13in black and white e-paper device.

Datasheet: https://www.waveshare.com/w/upload/e/e6/2.13inch_e-Paper_Datasheet.pdf

Index

Constants

View Source
const (
	DRIVER_OUTPUT_CONTROL                = 0x01
	BOOSTER_SOFT_START_CONTROL           = 0x0C
	GATE_SCAN_START_POSITION             = 0x0F
	DEEP_SLEEP_MODE                      = 0x10
	DATA_ENTRY_MODE_SETTING              = 0x11
	SW_RESET                             = 0x12
	TEMPERATURE_SENSOR_CONTROL           = 0x1A
	MASTER_ACTIVATION                    = 0x20
	DISPLAY_UPDATE_CONTROL_1             = 0x21
	DISPLAY_UPDATE_CONTROL_2             = 0x22
	WRITE_RAM                            = 0x24
	WRITE_VCOM_REGISTER                  = 0x2C
	WRITE_LUT_REGISTER                   = 0x32
	SET_DUMMY_LINE_PERIOD                = 0x3A
	SET_GATE_TIME                        = 0x3B
	BORDER_WAVEFORM_CONTROL              = 0x3C
	SET_RAM_X_ADDRESS_START_END_POSITION = 0x44
	SET_RAM_Y_ADDRESS_START_END_POSITION = 0x45
	SET_RAM_X_ADDRESS_COUNTER            = 0x4E
	SET_RAM_Y_ADDRESS_COUNTER            = 0x4F
	TERMINATE_FRAME_READ_WRITE           = 0xFF

	NO_ROTATION  Rotation = 0
	ROTATION_90  Rotation = 1 // 90 degrees clock-wise rotation
	ROTATION_180 Rotation = 2
	ROTATION_270 Rotation = 3
)

Registers

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Width        int16 // Width is the display resolution
	Height       int16
	LogicalWidth int16    // LogicalWidth must be a multiple of 8 and same size or bigger than Width
	Rotation     Rotation // Rotation is clock-wise
}

type Device

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

func New

func New(bus machine.SPI, csPin, dcPin, rstPin, busyPin machine.Pin) Device

New returns a new epd2in13x driver. Pass in a fully configured SPI bus.

func (*Device) ClearBuffer

func (d *Device) ClearBuffer()

ClearBuffer sets the buffer to 0xFF (white)

func (*Device) ClearDisplay

func (d *Device) ClearDisplay()

ClearDisplay erases the device SRAM

func (*Device) Configure

func (d *Device) Configure(cfg Config)

Configure sets up the device.

func (*Device) DeepSleep

func (d *Device) DeepSleep()

DeepSleep puts the display into deepsleep

func (*Device) Display

func (d *Device) Display() error

Display sends the buffer to the screen.

func (*Device) DisplayRect

func (d *Device) DisplayRect(x int16, y int16, width int16, height int16) error

DisplayRect sends only an area of the buffer to the screen. The rectangle points need to be a multiple of 8 in the screen. They might not work as expected if the screen is rotated.

func (*Device) IsBusy

func (d *Device) IsBusy() bool

IsBusy returns the busy status of the display

func (*Device) Reset

func (d *Device) Reset()

Reset resets the device

func (*Device) SendCommand

func (d *Device) SendCommand(command uint8)

SendCommand sends a command to the display

func (*Device) SendData

func (d *Device) SendData(data uint8)

SendData sends a data byte to the display

func (*Device) SetLUT

func (d *Device) SetLUT(fullUpdate bool)

SetLUT sets the look up tables for full or partial updates

func (*Device) SetPixel

func (d *Device) SetPixel(x int16, y int16, c color.RGBA)

SetPixel modifies the internal buffer in a single pixel. The display have 2 colors: black and white We use RGBA(0,0,0, 255) as white (transparent) Anything else as black

func (*Device) SetRotation added in v0.3.0

func (d *Device) SetRotation(rotation Rotation)

SetRotation changes the rotation (clock-wise) of the device

func (*Device) Size

func (d *Device) Size() (w, h int16)

Size returns the current size of the display.

func (*Device) WaitUntilIdle

func (d *Device) WaitUntilIdle()

WaitUntilIdle waits until the display is ready

type Rotation added in v0.3.0

type Rotation uint8

Jump to

Keyboard shortcuts

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