Remarks

Ssd1327
Status Status badge: working
Source code GitHub
Datasheet(s) GitHub
NuGet package NuGet Gallery for Meadow.Foundation.Displays.Ssd1327

Code Example

MicroGraphics graphics;

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

    var spiBus = Device.CreateSpiBus();

    var display = new Ssd1327(spiBus, Device.Pins.D02, Device.Pins.D01, Device.Pins.D00);

    display.SetContrast(60);

    graphics = new MicroGraphics(display);
    graphics.CurrentFont = new Font8x12();

    return base.Initialize();
}

public override Task Run()
{
    graphics.Clear();

    for (int i = 10; i > 0; i--)
    {   //interate across different brightnesses
        graphics.DrawText(0, i * 11, "SSD1327", Color.FromRgb(i * 0.1, i * 0.1, i * 0.1));
    }

    graphics.Show();

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

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

Ssd1327 Meadow Pin
GND GND
VCC 3V3
SCL SCK
SDA MOSI
RESET D00
DC D01
CS D02

It should look like the following diagram:

Characteristic Locus
Inheritance System.Object > Ssd1327
Namespace Meadow.Foundation.Displays
Assembly Ssd1327.dll

Syntax

public class Ssd1327 : IGraphicsDisplay

Constructors

Ssd1327(ISpiBus, IDigitalOutputPort, IDigitalOutputPort, IDigitalOutputPort)

Create a new Ssd1327 display object

Declaration
public Ssd1327(ISpiBus spiBus, IDigitalOutputPort chipSelectPort, IDigitalOutputPort dataCommandPort, IDigitalOutputPort resetPort)

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

Ssd1327(ISpiBus, IPin, IPin, IPin)

Create a new Ssd1327 object

Declaration
public Ssd1327(ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin)

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

Properties

ColorMode

The display color mode (4 bit per pixel grayscale)

Declaration
public ColorMode ColorMode { get; }

Property Value

Type Description
ColorMode

Height

The display height 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

The display width in pixels

Declaration
public int Width { get; }

Property Value

Type Description
System.Int32

Methods

Clear(Boolean)

Clear the display buffer

Declaration
public void Clear(bool updateDisplay = false)

Parameters

Type Name Description
System.Boolean updateDisplay

If true, update the display

DrawPixel(Int32, Int32, Color)

Draw pixel at a location

Declaration
public void DrawPixel(int x, int y, Color color)

Parameters

Type Name Description
System.Int32 x

x location in pixels

System.Int32 y

y location in pixels

Color color

The pixel color which will be transformed to 4bpp greyscale

DrawPixel(Int32, Int32, Boolean)

Draw pixel at a location

Declaration
public void DrawPixel(int x, int y, bool enabled)

Parameters

Type Name Description
System.Int32 x

x location in pixels

System.Int32 y

y location in pixels

System.Boolean enabled

True = turn on pixel, false = turn off pixel

DrawPixel(Int32, Int32, Byte)

Draw pixel at a location

Declaration
public void DrawPixel(int x, int y, byte gray)

Parameters

Type Name Description
System.Int32 x

x location in pixels

System.Int32 y

y location in pixels

System.Byte gray

The pixel color as a 4 bit grayscale value

Fill(Color, Boolean)

Fill display buffer with a color

Declaration
public void Fill(Color color, bool updateDisplay = false)

Parameters

Type Name Description
Color color

The fill color

System.Boolean updateDisplay

If true, update display

Fill(Int32, Int32, Int32, Int32, Color)

Fill 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 start position in pixels

System.Int32 y

Y start position in pixels

System.Int32 width

Width in pixels

System.Int32 height

Height in pixels

Color color

The fill color

Initialize()

Initalize the display

Declaration
protected void Initialize()

InvertPixel(Int32, Int32)

Invert a pixel at a location

Declaration
public void InvertPixel(int x, int y)

Parameters

Type Name Description
System.Int32 x

Abscissa of the pixel to the set / reset

System.Int32 y

Ordinate of the pixel to the set / reset

SetContrast(Byte)

Set the disply contrast

Declaration
public void SetContrast(byte contrast)

Parameters

Type Name Description
System.Byte contrast

The constrast value (0-255)

Show()

Update the display

Declaration
public void Show()

Show(Int32, Int32, Int32, Int32)

Update a region of the display from the offscreen buffer

Declaration
public void Show(int left, int top, int right, int bottom)

Parameters

Type Name Description
System.Int32 left

Left bounds in pixels

System.Int32 top

Top bounds in pixels

System.Int32 right

Right bounds in pixels

System.Int32 bottom

Bottom bounds in pixels

WriteBuffer(Int32, Int32, IPixelBuffer)

Write a buffer to the display offscreen buffer

Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)

Parameters

Type Name Description
System.Int32 x

The x position in pixels to write the buffer

System.Int32 y

The y position in pixels to write the buffer

IPixelBuffer displayBuffer

The buffer to write