drivers: Index | Files

package epd2in13

import ""

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



Package Files

epd2in13.go registers.go


const (
    DRIVER_OUTPUT_CONTROL                = 0x01
    GATE_SCAN_START_POSITION             = 0x0F
    DEEP_SLEEP_MODE                      = 0x10
    DATA_ENTRY_MODE_SETTING              = 0x11
    SW_RESET                             = 0x12
    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_COUNTER            = 0x4E
    SET_RAM_Y_ADDRESS_COUNTER            = 0x4F

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


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: