Skip to main content

Class Ssd1327

Provides an interface to the Ssd1327 grayscale OLED display

Assembly: Ssd1327.dll
View Source
public class Ssd1327 : IGraphicsDisplay, ISpiPeripheral, IDisposable

Implements:
Meadow.Foundation.Graphics.IGraphicsDisplay, Meadow.Hardware.ISpiPeripheral, System.IDisposable

Properties

ColorMode

The display color mode (4 bit per pixel grayscale)

View Source
public ColorMode ColorMode { get; }

SupportedColorModes

The Color mode supported by the display

View Source
public ColorMode SupportedColorModes { get; }

Width

The display width in pixels

View Source
public int Width { get; }

Height

The display height in pixels

View Source
public int Height { get; }

PixelBuffer

The buffer the holds the pixel data for the display

View Source
public IPixelBuffer PixelBuffer { 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

Methods

SetContrast(byte)

Set the display contrast

View Source
public void SetContrast(byte contrast)
Parameters
TypeNameDescription
System.BytecontrastThe contrast value (0-255)

Initialize()

Initialize the display

View Source
protected void Initialize()

Clear(bool)

Clear the display buffer

View Source
public void Clear(bool updateDisplay = false)
Parameters
TypeNameDescription
System.BooleanupdateDisplayIf true, update the display

DrawPixel(int, int, Color)

Draw pixel at a location

View Source
public void DrawPixel(int x, int y, Color color)
Parameters
TypeNameDescription
System.Int32xx location in pixels
System.Int32yy location in pixels
Meadow.ColorcolorThe pixel color which will be transformed to 4bpp grayscale

DrawPixel(int, int, bool)

Draw pixel at a location

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

DrawPixel(int, int, byte)

Draw pixel at a location

View Source
public void DrawPixel(int x, int y, byte gray)
Parameters
TypeNameDescription
System.Int32xx location in pixels
System.Int32yy location in pixels
System.BytegrayThe pixel color as a 4 bit grayscale value

InvertPixel(int, int)

Invert a pixel at a location

View Source
public void InvertPixel(int x, int y)
Parameters
TypeNameDescription
System.Int32xAbscissa of the pixel to the set / reset
System.Int32yOrdinate of the pixel to the set / reset

Show(int, int, int, int)

Update a region of the display from the offscreen buffer

View Source
public void Show(int left, int top, int right, int bottom)
Parameters
TypeNameDescription
System.Int32leftLeft bounds in pixels
System.Int32topTop bounds in pixels
System.Int32rightRight bounds in pixels
System.Int32bottomBottom bounds in pixels

Show()

Update the display

View Source
public void Show()

Fill(Color, bool)

Fill display buffer with a color

View Source
public void Fill(Color color, bool updateDisplay = false)
Parameters
TypeNameDescription
Meadow.ColorcolorThe fill color
System.BooleanupdateDisplayIf true, update display

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

Fill with a color

View Source
public void Fill(int x, int y, int width, int height, Color color)
Parameters
TypeNameDescription
System.Int32xX start position in pixels
System.Int32yY start position in pixels
System.Int32widthWidth in pixels
System.Int32heightHeight in pixels
Meadow.ColorcolorThe fill color

WriteBuffer(int, int, IPixelBuffer)

Write a buffer to the display offscreen buffer

View Source
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
TypeNameDescription
System.Int32xThe x position in pixels to write the buffer
System.Int32yThe y position in pixels to write the buffer
Meadow.Foundation.Graphics.Buffers.IPixelBufferdisplayBufferThe buffer to write

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
TypeNameDescription
System.BooleandisposingIs disposing

Implements