Documentation ¶
Overview ¶
Package epd4in2 implements a driver for Waveshare 4.2in black and white e-paper device.
Derived from:
https://github.com/tinygo-org/drivers/tree/master/waveshare-epd https://github.com/waveshare/e-Paper/blob/master/Arduino/epd4in2/epd4in2.cpp
Datasheet: https://www.waveshare.com/wiki/4.2inch_e-Paper_Module
Index ¶
- Constants
- type Config
- type Device
- func (d *Device) ClearBuffer()
- func (d *Device) ClearDisplay()
- func (d *Device) Configure(cfg Config)
- func (d *Device) DeepSleep()
- func (d *Device) Display() error
- func (d *Device) IsBusy() bool
- func (d *Device) Reset()
- func (d *Device) SendCommand(command uint8)
- func (d *Device) SendData(data uint8)
- func (d *Device) SetLUT()
- func (d *Device) SetPixel(x int16, y int16, c color.RGBA)
- func (d *Device) SetRotation(rotation Rotation)
- func (d *Device) Size() (w, h int16)
- func (d *Device) WaitUntilIdle()
- type Rotation
Constants ¶
View Source
const ( // Display resolution EPD_WIDTH = 400 EPD_HEIGHT = 300 // EPD4IN2 commands 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 LUT_FOR_VCOM = 0x20 LUT_WHITE_TO_WHITE = 0x21 LUT_BLACK_TO_WHITE = 0x22 LUT_WHITE_TO_BLACK = 0x23 LUT_BLACK_TO_BLACK = 0x24 PLL_CONTROL = 0x30 TEMPERATURE_SENSOR_COMMAND = 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 GSST_SETTING = 0x65 GET_STATUS = 0x71 AUTO_MEASUREMENT_VCOM = 0x80 READ_VCOM_VALUE = 0x81 VCM_DC_SETTING = 0x82 PARTIAL_WINDOW = 0x90 PARTIAL_IN = 0x91 PARTIAL_OUT = 0x92 PROGRAM_MODE = 0xA0 ACTIVE_PROGRAMMING = 0xA1 READ_OTP = 0xA2 POWER_SAVING = 0xE3 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 Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) ClearBuffer ¶
func (d *Device) ClearBuffer()
ClearBuffer sets the buffer to 0xFF (white)
func (*Device) SendCommand ¶
SendCommand sends a command to the display
func (*Device) SetLUT ¶
func (d *Device) SetLUT()
SetLUT sets the look up tables for full or partial updates
func (*Device) SetPixel ¶
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 ¶
SetRotation changes the rotation (clock-wise) of the device
func (*Device) WaitUntilIdle ¶
func (d *Device) WaitUntilIdle()
WaitUntilIdle waits until the display is ready
Click to show internal directories.
Click to hide internal directories.