Remarks
Epd5in65f | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initialize ...");
var display = new Epd5in65f(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.A04,
dcPin: Device.Pins.A03,
resetPin: Device.Pins.A02,
busyPin: Device.Pins.A01);
graphics = new MicroGraphics(display);
return Task.CompletedTask;
}
public override Task Run()
{
Resolver.Log.Info("Run");
graphics.Clear();
graphics.CurrentFont = new Font12x16();
graphics.DrawText(0, 0, "Meadow F7", Color.Black, scaleFactor: ScaleFactor.X2);
graphics.DrawText(0, 50, "Green", Color.Green, scaleFactor: ScaleFactor.X2);
graphics.DrawText(0, 100, "Yellow", Color.Yellow, scaleFactor: ScaleFactor.X2);
graphics.DrawText(0, 150, "Orange", Color.Orange, scaleFactor: ScaleFactor.X2);
graphics.DrawText(0, 200, "Red", Color.Red, scaleFactor: ScaleFactor.X2);
graphics.DrawText(0, 250, "Blue", Color.Blue, scaleFactor: ScaleFactor.X2);
graphics.Show();
Resolver.Log.Info("Run complete");
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Characteristic | Locus |
---|---|
Inheritance | System.Object EPaperBase > Epd5in65f |
Implements | IGraphicsDisplay |
Inherited Members | EPaperBase.commandBuffer EPaperBase.dataCommandPort EPaperBase.resetPort EPaperBase.chipSelectPort EPaperBase.busyPort EPaperBase.spiPeripheral EPaperBase.DataState EPaperBase.CommandState EPaperBase.Write(Byte) EPaperBase.Reset() EPaperBase.DelayMs(Int32) EPaperBase.SendCommand(Byte) EPaperBase.SendData(Int32) EPaperBase.SendData(Byte) EPaperBase.SendData(Byte[]) EPaperBase.WaitUntilIdle() |
Namespace | Meadow.Foundation.Displays |
Assembly | ePaperWaveShare.dll |
Syntax
public class Epd5in65f : EPaperBase, IGraphicsDisplay
Constructors
Epd5in65f(ISpiBus, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort, IDigitalInputPort)
Create a new Epd5in65f ePaper display object
Declaration
public Epd5in65f(ISpiBus spiBus, IDigitalOutputPort chipSelectPort, IDigitalOutputPort dataCommandPort, IDigitalOutputPort resetPort, IDigitalInputPort busyPort)
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 |
Epd5in65f(ISpiBus, IPin, IPin, IPin, IPin)
Create a new Epd5in65f ePaper display object
Declaration
public Epd5in65f(ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin, IPin busyPin)
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 |
Fields
imageBuffer
Buffer to hold display data
Declaration
protected readonly BufferIndexed4 imageBuffer
Field Value
Type | Description |
---|---|
BufferIndexed4 |
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 |
---|---|
System.Int32 |
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 |
---|---|
System.Int32 |
Methods
Clear()
Clear the display
Declaration
public void Clear()
Clear(Boolean)
Clear display buffer
Declaration
public void Clear(bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | updateDisplay | force display update |
DrawPixel(Int32, Int32, Color)
Draw a single pixel at the specified color
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
Color | color | The Meadow Foundation color of the pixel |
DrawPixel(Int32, Int32, Boolean)
Enable or disable a single pixel (used for 1bpp displays)
Declaration
public void DrawPixel(int x, int y, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
System.Boolean | enabled | On if true, off if false |
Fill(Color)
Clear the display
Declaration
public void Fill(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | Color to set the display |
Fill(Color, Boolean)
Clear the display
Declaration
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
Color | fillColor | The color used to fill the display buffer |
System.Boolean | updateDisplay | Update the dipslay once the buffer has been cleared when true |
Fill(Int32, Int32, Int32, Int32, 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 |
---|---|---|
System.Int32 | x | x location in pixels to start fill |
System.Int32 | y | y location in pixels to start fill |
System.Int32 | width | width in pixels to fill |
System.Int32 | height | height in pixels to fill |
Color | color | color to fill |
InvertPixel(Int32, Int32)
Invert the color of a single pixel
Declaration
public void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
Show()
Draw the display buffer to screen
Declaration
public void Show()
Show(Int32, Int32, Int32, Int32)
Transfer part of the contents of the buffer to the display bounded by left, top, right and bottom
Declaration
public void Show(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | left | |
System.Int32 | top | |
System.Int32 | right | |
System.Int32 | bottom |
Sleep()
Enter deep sleep mode call reset to wake display
Declaration
public void Sleep()
WaitForBusyState(Boolean)
Wait until the display busy state is sey
Declaration
protected virtual void WaitForBusyState(bool state)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | state |
WriteBuffer(Int32, Int32, IPixelBuffer)
Draw a buffer to the display
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | |
System.Int32 | y | |
IPixelBuffer | displayBuffer |