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
- type Color
- 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) SetDisplayRect(buffer [][]uint8, x int16, y int16, w int16, h int16) error
- func (d *Device) SetDisplayRectColor(buffer []uint8, x int16, y int16, w int16, h int16, c Color) error
- func (d *Device) SetEPDPixel(x int16, y int16, c Color)
- func (d *Device) SetPixel(x int16, y int16, c color.RGBA)
- func (d *Device) Size() (w, h int16)
- func (d *Device) WaitUntilIdle()
Constants ¶
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 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) SetDisplayRect ¶
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 ¶
SetEPDPixel modifies the internal buffer in a single pixel.
func (*Device) SetPixel ¶
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) WaitUntilIdle ¶
func (d *Device) WaitUntilIdle()
WaitUntilIdle waits until the display is ready