Class Pcd8544
Represents a Pcd8544 monochrome display
Assembly: Pcd8544.dll
View Source
public class Pcd8544 : IGraphicsDisplay, ISpiPeripheral, IDisposable
Implements:
Meadow.Foundation.Graphics.IGraphicsDisplay, Meadow.Hardware.ISpiPeripheral
, System.IDisposable
Properties
ColorMode
Display color mode
View Source
public ColorMode ColorMode { get; }
SupportedColorModes
The Color mode supported by the display
View Source
public ColorMode SupportedColorModes { get; }
Height
Height of display in pixels
View Source
public int Height { get; }
Width
Width of display in pixels
View Source
public int Width { get; }
PixelBuffer
The buffer the holds the pixel data for the display
View Source
public IPixelBuffer PixelBuffer { get; }
IsDisplayInverted
Is the display inverted
View Source
public bool IsDisplayInverted { get; }
DefaultSpiBusSpeed
The default SPI bus speed for the device
View Source
public Frequency DefaultSpiBusSpeed { get; }
SpiBusSpeed
The SPI bus speed for the device
View Source
public Frequency SpiBusSpeed { get; set; }
DefaultSpiBusMode
The default SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }
SpiBusMode
The SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode SpiBusMode { get; set; }
IsDisposed
Is the object disposed
View Source
public bool IsDisposed { get; }
Fields
spiComms
SPI Communication bus used to communicate with the peripheral
View Source
protected ISpiCommunications spiComms
imageBuffer
Buffer to hold display data
View Source
protected Buffer1bpp imageBuffer
commandBuffer
Buffer to hold internal command data to be sent over the SPI bus
View Source
protected Memory<byte> commandBuffer
Methods
Clear(bool)
Clear the display
View Source
public void Clear(bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | updateDisplay | If true, it will force a display update |
DrawPixel(int, int, bool)
Draw pixel at location
View Source
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 | True = turn on pixel, false = turn off pixel |
InvertPixel(int, int)
Invert pixel at a location
View Source
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 |
DrawPixel(int, int, Color)
Draw pixel at location
View Source
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 |
Meadow.Color | color | any value other than black will make the pixel visible |
Show()
Update the display
View Source
public void Show()
Show(int, int, int, int)
Update a region of the display Currently always does a full screen update for this display
View Source
public void Show(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | left | The left position in pixels |
System.Int32 | top | The top position in pixels |
System.Int32 | right | The right position in pixels |
System.Int32 | bottom | The bottom position in pixels |
InvertDisplay(bool)
Invert the entire display
View Source
public void InvertDisplay(bool inverse)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | inverse | Invert if true, normal if false |
Fill(Color, bool)
Fill with color
View Source
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | fillColor | color - converted to on/off |
System.Boolean | updateDisplay | should refresh display |
Fill(int, int, int, int, Color)
Fill region with color
View Source
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x position |
System.Int32 | y | y position |
System.Int32 | width | width of region |
System.Int32 | height | height of region |
Meadow.Color | fillColor | color - converted to on/off |
WriteBuffer(int, int, IPixelBuffer)
Draw buffer at location
View Source
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | x position in pixels |
System.Int32 | y | y position in pixels |
Meadow.Foundation.Graphics.Buffers.IPixelBuffer | displayBuffer | buffer to draw |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
Dispose(bool)
Dispose of the object
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Is disposing |
Implements
- Meadow.Foundation.Graphics.IGraphicsDisplay
Meadow.Hardware.ISpiPeripheral
System.IDisposable