Skip to main content

Meadow.Foundation.Displays.St7565

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

Code Example

MicroGraphics graphics;

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

    var sT7565 = new St7565
    (
        spiBus: Device.CreateSpiBus(),
        chipSelectPin: Device.Pins.D02,
        dcPin: Device.Pins.D00,
        resetPin: Device.Pins.D01,
        width: 128,
        height: 64
    );

    graphics = new MicroGraphics(sT7565);
    graphics.CurrentFont = new Font8x8();

    return base.Initialize();
}

public override Task Run()
{
    graphics.Clear();
    graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
    graphics.DrawRectangle(20, 15, 40, 20, true);
    graphics.DrawText(5, 5, "ST7565");
    graphics.Show();

    return base.Run();
}

Sample project(s) available on GitHub

Wiring Example

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

ST7565Meadow Pin
LEDAGND
GNDGND
VCC3V3
SDAMOSI
SCLSCK
A0D00
RSTD01
CSD02

Wiring a Ssd1681 to a Meadow F7

Class St7565

Provide an interface to the ST7565 family of displays

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

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

Properties

ColorMode

The display color mode - 1 bit per pixel monochrome

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

InvertDisplay(bool)

Invert the entire display (true) or return to normal mode (false).

View Source
public void InvertDisplay(bool cmd)
Parameters
TypeName
System.Booleancmd

PowerSaveMode()

Set display into power saving mode

View Source
public void PowerSaveMode()

SetContrast(byte)

Set the display contrast

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

Show()

Send the internal pixel buffer to display

View Source
public void Show()

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

Clear(bool)

Clear the display buffer

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

DrawPixel(int, int, Color)

Draw pixel at a location

View Source
public void DrawPixel(int x, int y, Color color)
Parameters
TypeNameDescription
System.Int32xAbscissa of the pixel to the set / reset
System.Int32yOrdinate of the pixel to the set / reset
Meadow.ColorcolorAny color = turn on pixel, black = turn off pixel

DrawPixel(int, int, bool)

Draw pixel at a location

View Source
public void DrawPixel(int x, int y, bool enabled)
Parameters
TypeNameDescription
System.Int32xAbscissa of the pixel to the set / reset
System.Int32yOrdinate of the pixel to the set / reset
System.BooleanenabledTrue = turn on pixel, false = turn off pixel

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

StartScrolling(ScrollDirection)

Start the display scrolling in the specified direction.

View Source
public void StartScrolling(St7565.ScrollDirection direction)
Parameters
TypeNameDescription
Meadow.Foundation.Displays.St7565.ScrollDirectiondirectionDirection that the display should scroll

StartScrolling(ScrollDirection, byte, byte)

Start the display scrolling

View Source
public void StartScrolling(St7565.ScrollDirection direction, byte startPage, byte endPage)
Parameters
TypeNameDescription
Meadow.Foundation.Displays.St7565.ScrollDirectiondirectionDirection that the display should scroll
System.BytestartPageStart page for the scroll
System.ByteendPageEnd page for the scroll

StopScrolling()

Turn off scrolling

View Source
public void StopScrolling()

Fill(Color, bool)

Fill display buffer with a color

View Source
public void Fill(Color clearColor, bool updateDisplay = false)
Parameters
TypeNameDescription
Meadow.ColorclearColorThe 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