epd2in13x

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2021 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package epd2in13x implements a driver for Waveshare 2.13in (B & C versions) tri-color e-paper device.

Datasheet: https://www.waveshare.com/w/upload/d/d3/2.13inch-e-paper-b-Specification.pdf

Index

Constants

View Source
const (
	WHITE   Color = 0
	BLACK   Color = 1
	COLORED Color = 2 // In some board it's red in others yellow

	PANEL_SETTING                  = 0x00
	POWER_SETTING                  = 0x01
	POWER_OFF                      = 0x02
	POWER_OFF_SEQUENCE_SETTING     = 0x03
	POWER_ON                       = 0x04
	POWER_ON_MEASURE               = 0x05
	BOOSTER_SOFT_START             = 0x06
	DEEP_SLEEP                     = 0x07
	DATA_START_TRANSMISSION_1      = 0x10
	DATA_STOP                      = 0x11
	DISPLAY_REFRESH                = 0x12
	DATA_START_TRANSMISSION_2      = 0x13
	VCOM_LUT                       = 0x20
	W2W_LUT                        = 0x21
	B2W_LUT                        = 0x22
	W2B_LUT                        = 0x23
	B2B_LUT                        = 0x24
	PLL_CONTROL                    = 0x30
	TEMPERATURE_SENSOR_CALIBRATION = 0x40
	TEMPERATURE_SENSOR_SELECTION   = 0x41
	TEMPERATURE_SENSOR_WRITE       = 0x42
	TEMPERATURE_SENSOR_READ        = 0x43
	VCOM_AND_DATA_INTERVAL_SETTING = 0x50
	LOW_POWER_DETECTION            = 0x51
	TCON_SETTING                   = 0x60
	RESOLUTION_SETTING             = 0x61
	GET_STATUS                     = 0x71
	AUTO_MEASURE_VCOM              = 0x80
	READ_VCOM_VALUE                = 0x81
	VCM_DC_SETTING                 = 0x82
	PARTIAL_WINDOW                 = 0x90
	PARTIAL_IN                     = 0x91
	PARTIAL_OUT                    = 0x92
	PROGRAM_MODE                   = 0xA0
	ACTIVE_PROGRAM                 = 0xA1
	READ_OTP_DATA                  = 0xA2
	POWER_SAVING                   = 0xE3
)

Registers

Variables

This section is empty.

Functions

This section is empty.

Types

type Color

type Color uint8

type Config

type Config struct {
	Width     int16
	Height    int16
	NumColors uint8
}

type Device

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

func New

func New(bus drivers.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 (if any) to the screen.

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) SetDisplayRect

func (d *Device) SetDisplayRect(buffer [][]uint8, x int16, y int16, w int16, h int16) error

SetDisplayRect sends a rectangle of data at specific coordinates to the device SRAM directly

func (*Device) SetDisplayRectColor

func (d *Device) SetDisplayRectColor(buffer []uint8, x int16, y int16, w int16, h int16, c Color) error

SetDisplayRectColor sends a rectangle of data at specific coordinates to the device SRAM directly

func (*Device) SetEPDPixel

func (d *Device) SetEPDPixel(x int16, y int16, c Color)

SetEPDPixel modifies the internal buffer in a single pixel.

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 3 colors: black, white and a third color that could be red or yellow We use RGBA(0,0,0, 255) as white (transparent) RGBA(1-255,0,0,255) as colored (red or yellow) Anything else as black

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

Jump to

Keyboard shortcuts

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