Syntax
public abstract class EPaperMonoBase : EPaperBase, ISpiPeripheral, IDisposable, IGraphicsDisplay
Constructors
EPaperMonoBase(ISpiBus, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalInputPort, int, int)
Create a new ePaper display object
Declaration
public EPaperMonoBase(ISpiBus spiBus, IDigitalOutputPort chipSelectPort, IDigitalOutputPort dataCommandPort, IDigitalOutputPort resetPort, IDigitalInputPort busyPort, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
ISpiBus | spiBus | SPI bus connected to display |
IDigitalOutputPort | chipSelectPort | Chip select output port |
IDigitalOutputPort | dataCommandPort | Data command output port |
IDigitalOutputPort | resetPort | Reset output port |
IDigitalInputPort | busyPort | Busy input port |
int | width | Width of display in pixels |
int | height | Height of display in pixels |
EPaperMonoBase(ISpiBus, IPin, IPin, IPin, IPin, int, int)
Create a new ePaper display object
Declaration
public EPaperMonoBase(ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin, IPin busyPin, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
ISpiBus | spiBus | SPI bus connected to display |
IPin | chipSelectPin | Chip select pin |
IPin | dcPin | Data command pin |
IPin | resetPin | Reset pin |
IPin | busyPin | Busy pin |
int | width | Width of display in pixels |
int | height | Height of display in pixels |
Fields
imageBuffer
Buffer to hold display data
Declaration
protected readonly Buffer1bppV imageBuffer
Field Value
Type | Description |
---|---|
Buffer1bppV |
Properties
ColorMode
Display color mode
Declaration
public ColorMode ColorMode { get; }
Property Value
Type | Description |
---|---|
ColorMode |
DisabledColor
The color to draw when a pixel is disabled
Declaration
public Color DisabledColor { get; }
Property Value
Type | Description |
---|---|
Color |
EnabledColor
The color to draw when a pixel is enabled
Declaration
public Color EnabledColor { get; }
Property Value
Type | Description |
---|---|
Color |
Height
Height of display in pixels
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
int |
PixelBuffer
The buffer the holds the pixel data for the display
Declaration
public IPixelBuffer PixelBuffer { get; }
Property Value
Type | Description |
---|---|
IPixelBuffer |
SupportedColorModes
The Color mode supported by the display
Declaration
public ColorMode SupportedColorModes { get; }
Property Value
Type | Description |
---|---|
ColorMode |
Width
Width of display in pixels
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
int |
Methods
Clear(bool)
Clear display buffer
Declaration
public void Clear(bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
bool | updateDisplay | force display update |
Clear(bool, bool)
Clear the display
Declaration
public void Clear(bool enabled, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
bool | enabled | Set the display to the enabled or disabled color (defaults are black and white) |
bool | updateDisplay | Update the display once the buffer has been cleared when true |
DisplayFrame()
Display frame buffer
Declaration
public virtual void DisplayFrame()
DrawPixel(int, int, Color)
Draw a single pixel
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
int | x | x location |
int | y | y location |
Color | color | Color of pixel |
DrawPixel(int, int, bool)
Draw a single pixel
Declaration
public void DrawPixel(int x, int y, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
int | x | x location |
int | y | y location |
bool | enabled | Turn the pixel on (true) or off (false) |
Fill(Color, bool)
Clear the display
Declaration
public void Fill(Color color, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Color to set the display (not used on ePaper displays) |
bool | updateDisplay | Update the display once the buffer has been cleared when true |
Fill(int, int, int, int, Color)
Fill the display buffer with a color
Declaration
public void Fill(int x, int y, int width, int height, Color color)
Parameters
Type | Name | Description |
---|---|---|
int | x | x location in pixels to start fill |
int | y | y location in pixels to start fill |
int | width | width in pixels to fill |
int | height | height in pixels to fill |
Color | color | color to fill |
Initialize()
Initialize display
Declaration
protected abstract void Initialize()
InvertPixel(int, int)
Invert color of pixel
Declaration
public void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | x coordinate of pixel |
int | y | y coordinate of pixel |
SendCommand(Command)
Set command to display
Declaration
protected void SendCommand(EPaperMonoBase.Command command)
Parameters
Type | Name | Description |
---|---|---|
EPaperMonoBase.Command | command | command |
SetFrameMemory(byte[])
Set frame buffer memory of display (full screen)
Declaration
public virtual void SetFrameMemory(byte[] buffer)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | The image buffer |
SetFrameMemory(byte[], int, int, int, int)
Set frame buffer memory of display
Declaration
public virtual void SetFrameMemory(byte[] buffer, int x, int y, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
byte[] | buffer | buffer |
int | x | x location |
int | y | y location |
int | width | width in pixels |
int | height | height in pixels |
Show()
Draw the display buffer to screen
Declaration
public virtual void Show()
Show(int, int, int, int)
Draw the display buffer to screen
Declaration
public virtual void Show(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
int | left | |
int | top | |
int | right | |
int | bottom |
Sleep()
Set display to sleep mode
Declaration
protected virtual void Sleep()
WriteBuffer(int, int, IPixelBuffer)
Draw a buffer at a specific location
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
Type | Name | Description |
---|---|---|
int | x | x location in pixels |
int | y | y location in pixels |
IPixelBuffer | displayBuffer |