drivers: tinygo.org/x/drivers/waveshare-epd/epd2in13 Index | Files

package epd2in13

import "tinygo.org/x/drivers/waveshare-epd/epd2in13"

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

Package Files

epd2in13.go registers.go

Constants

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

type Config Uses

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 Uses

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

func New Uses

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 Uses

func (d *Device) ClearBuffer()

ClearBuffer sets the buffer to 0xFF (white)

func (*Device) ClearDisplay Uses

func (d *Device) ClearDisplay()

ClearDisplay erases the device SRAM

func (*Device) Configure Uses

func (d *Device) Configure(cfg Config)

Configure sets up the device.

func (*Device) DeepSleep Uses

func (d *Device) DeepSleep()

DeepSleep puts the display into deepsleep

func (*Device) Display Uses

func (d *Device) Display() error

Display sends the buffer to the screen.

func (*Device) DisplayRect Uses

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 Uses

func (d *Device) IsBusy() bool

IsBusy returns the busy status of the display

func (*Device) Reset Uses

func (d *Device) Reset()

Reset resets the device

func (*Device) SendCommand Uses

func (d *Device) SendCommand(command uint8)

SendCommand sends a command to the display

func (*Device) SendData Uses

func (d *Device) SendData(data uint8)

SendData sends a data byte to the display

func (*Device) SetLUT Uses

func (d *Device) SetLUT(fullUpdate bool)

SetLUT sets the look up tables for full or partial updates

func (*Device) SetPixel Uses

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 Uses

func (d *Device) SetRotation(rotation Rotation)

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

func (*Device) Size Uses

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

Size returns the current size of the display.

func (*Device) WaitUntilIdle Uses

func (d *Device) WaitUntilIdle()

WaitUntilIdle waits until the display is ready

type Rotation Uses

type Rotation uint8

Package epd2in13 imports 4 packages (graph) and is imported by 1 packages. Updated 2019-07-17. Refresh now. Tools for package owners.

The go get command cannot install this package because of the following issues: