Skip to main content

Meadow.Foundation.Displays.Pcd8544

Pcd8544
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Displays.Pcd8544

The PCD8544 display, also known as a Nokia 5110 LCD, is a single color 84x84 LCD display. Data is sent to the display via SPI. The also typically also include an LED backlight controlled via a single pin.

These displays have excellent visibility in daylight, even without the backlight, making them a good choice for builds with low-power restrictions and require visibility is bright light or daylight.

Code Example

MicroGraphics graphics;

public override Task Initialize()
{
Resolver.Log.Info("Initializing...");

var display = new Pcd8544
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D01,
dcPin: Device.Pins.D00,
resetPin: Device.Pins.D02
);

graphics = new MicroGraphics(display);

return base.Initialize();
}

public override Task Run()
{
graphics.Clear(true);
graphics.CurrentFont = new Font8x12();
graphics.DrawText(0, 0, "PCD8544");
graphics.DrawRectangle(5, 14, 30, 10, true);

graphics.Show();

return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

To wire a PCD8544 to your Meadow board, connect the following:

PCD8544Meadow Pin
GNDGND
LIGHTGND
VCC3V3
CLKSCK
DINCOPI
DCD00
CED01
RSTD02

SevenSegment displays

Class Pcd8544

Represents a Pcd8544 monochrome display

Assembly: Pcd8544.dll
View Source
Declaration
public class Pcd8544 : IPixelDisplay, IDisplay, ISpiPeripheral, IDisposable

Implements:
Meadow.Peripherals.Displays.IPixelDisplay, Meadow.Peripherals.Displays.IDisplay, Meadow.Hardware.ISpiPeripheral, System.IDisposable

Properties

ColorMode

The currently set color mode for the display

View Source
Declaration
public ColorMode ColorMode { get; }

SupportedColorModes

The Color mode supported by the display

View Source
Declaration
public ColorMode SupportedColorModes { get; }

Height

Height of the display in pixels

View Source
Declaration
public int Height { get; }

Width

Width of the display in pixels

View Source
Declaration
public int Width { get; }

PixelBuffer

Provide a buffer that matches this display's color depth, height, and width This should be the buffer that is sent to the device when Show is called

View Source
Declaration
public IPixelBuffer PixelBuffer { get; }

IsDisplayInverted

Is the display inverted

View Source
Declaration
public bool IsDisplayInverted { get; }

DefaultSpiBusSpeed

The default SPI bus speed for the device

View Source
Declaration
public Frequency DefaultSpiBusSpeed { get; }

SpiBusSpeed

The SPI bus speed for the device

View Source
Declaration
public Frequency SpiBusSpeed { get; set; }

DefaultSpiBusMode

The default SPI bus mode for the device

View Source
Declaration
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }

SpiBusMode

The SPI bus mode for the device

View Source
Declaration
public SpiClockConfiguration.Mode SpiBusMode { get; set; }

IsDisposed

Is the object disposed

View Source
Declaration
public bool IsDisposed { get; }

Fields

spiComms

SPI Communication bus used to communicate with the peripheral

View Source
Declaration
protected ISpiCommunications spiComms

imageBuffer

Buffer to hold display data

View Source
Declaration
protected Buffer1bpp imageBuffer

Methods

Clear(bool)

Clear the display

View Source
Declaration
public void Clear(bool updateDisplay = false)
Parameters
TypeNameDescription
System.BooleanupdateDisplayIf true, it will force a display update

DrawPixel(int, int, bool)

Draw pixel at location

View Source
Declaration
public void DrawPixel(int x, int y, bool enabled)
Parameters
TypeNameDescription
System.Int32xx position in pixels
System.Int32yy position in pixels
System.BooleanenabledTrue = turn on pixel, false = turn off pixel

InvertPixel(int, int)

Invert pixel at a location

View Source
Declaration
public void InvertPixel(int x, int y)
Parameters
TypeNameDescription
System.Int32xx position in pixels
System.Int32yy position in pixels

DrawPixel(int, int, Color)

Draw pixel at location

View Source
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters
TypeNameDescription
System.Int32xx position in pixels
System.Int32yy position in pixels
Meadow.Colorcolorany value other than black will make the pixel visible

Show()

Update the display

View Source
Declaration
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
Declaration
public void Show(int left, int top, int right, int bottom)
Parameters
TypeNameDescription
System.Int32leftThe left position in pixels
System.Int32topThe top position in pixels
System.Int32rightThe right position in pixels
System.Int32bottomThe bottom position in pixels

InvertDisplay(bool)

Invert the entire display

View Source
Declaration
public void InvertDisplay(bool inverse)
Parameters
TypeNameDescription
System.BooleaninverseInvert if true, normal if false

Fill(Color, bool)

Fill with color

View Source
Declaration
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
TypeNameDescription
Meadow.ColorfillColorcolor - converted to on/off
System.BooleanupdateDisplayshould refresh display

Fill(int, int, int, int, Color)

Fill region with color

View Source
Declaration
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
TypeNameDescription
System.Int32xx position
System.Int32yy position
System.Int32widthwidth of region
System.Int32heightheight of region
Meadow.ColorfillColorcolor - converted to on/off

WriteBuffer(int, int, IPixelBuffer)

Draw buffer at location

View Source
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
TypeNameDescription
System.Int32xx position in pixels
System.Int32yy position in pixels
Meadow.Peripherals.Displays.IPixelBufferdisplayBufferbuffer to draw

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
Declaration
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Implements

  • Meadow.Peripherals.Displays.IPixelDisplay
  • Meadow.Peripherals.Displays.IDisplay
  • Meadow.Hardware.ISpiPeripheral
  • System.IDisposable