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

Syntax

public class ST7565 : DisplayBase

Constructors

View Source

ST7565(IIODevice, ISpiBus, IPin, IPin, IPin, UInt32, UInt32)

Create a new ST7565 object using the default parameters for

Declaration
public ST7565(IIODevice device, ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin, uint width = 128U, uint height = 64U)

Parameters

Type Name Description
IIODevice device
ISpiBus spiBus
IPin chipSelectPin
IPin dcPin
IPin resetPin
System.UInt32 width
System.UInt32 height

Fields

View Source

Command

Declaration
protected const bool Command = false

Field Value

Type Description
System.Boolean
View Source

ContrastHigh

Declaration
public const uint ContrastHigh = 34U

Field Value

Type Description
System.UInt32
View Source

ContrastLow

Declaration
public const uint ContrastLow = 15U

Field Value

Type Description
System.UInt32
View Source

ContrastMedium

Declaration
public const uint ContrastMedium = 24U

Field Value

Type Description
System.UInt32
View Source

currentPen

Declaration
protected Color currentPen

Field Value

Type Description
Color
View Source

Data

Declaration
protected const bool Data = true

Field Value

Type Description
System.Boolean
View Source

dataCommandPort

Declaration
protected IDigitalOutputPort dataCommandPort

Field Value

Type Description
IDigitalOutputPort
View Source

pageBuffer

Declaration
protected byte[] pageBuffer

Field Value

Type Description
System.Byte[]
View Source

pageReference

Declaration
protected int[] pageReference

Field Value

Type Description
System.Int32[]
View Source

pageSize

Declaration
protected const int pageSize = 128

Field Value

Type Description
System.Int32
View Source

resetPort

Declaration
protected IDigitalOutputPort resetPort

Field Value

Type Description
IDigitalOutputPort
View Source

spiPerihperal

SPI object

Declaration
protected ISpiPeripheral spiPerihperal

Field Value

Type Description
ISpiPeripheral
View Source

StartColumnOffset

Declaration
protected const int StartColumnOffset = 0

Field Value

Type Description
System.Int32

Properties

View Source

ColorMode

Declaration
public override DisplayColorMode ColorMode { get; }

Property Value

Type Description
DisplayColorMode
View Source

Height

Declaration
public override uint Height { get; }

Property Value

Type Description
System.UInt32
View Source

Width

Declaration
public override uint Width { get; }

Property Value

Type Description
System.UInt32

Methods

View Source

Clear(Boolean)

Clear the display buffer.

Declaration
public override void Clear(bool updateDisplay = false)

Parameters

Type Name Description
System.Boolean updateDisplay

Immediately update the display when true.

View Source

DrawBitmap(Int32, Int32, Int32, Int32, Byte[], BitmapMode)

Copy a bitmap to the display.

Declaration
public override void DrawBitmap(int x, int y, int width, int height, byte[] bitmap, BitmapMode bitmapMode)

Parameters

Type Name Description
System.Int32 x

Abscissa of the top left corner of the bitmap.

System.Int32 y

Ordinate of the top left corner of the bitmap.

System.Int32 width

Width of the bitmap in bytes.

System.Int32 height

Height of the bitmap in bytes.

System.Byte[] bitmap

Bitmap to transfer

BitmapMode bitmapMode

How should the bitmap be transferred to the display?

Remarks

Currently, this method only supports copying the bitmap over the contents of the display buffer.

View Source

DrawBitmap(Int32, Int32, Int32, Int32, Byte[], Color)

Declaration
public override void DrawBitmap(int x, int y, int width, int height, byte[] bitmap, Color color)

Parameters

Type Name Description
System.Int32 x
System.Int32 y
System.Int32 width
System.Int32 height
System.Byte[] bitmap
Color color
View Source

DrawPixel(Int32, Int32)

Draw pixel using current pen

Declaration
public override void DrawPixel(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.

View Source

DrawPixel(Int32, Int32, Color)

Coordinates start with index 0

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

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.

Color color

Any color = turn on pixel, black = turn off pixel

View Source

DrawPixel(Int32, Int32, Boolean)

Coordinates start with index 0

Declaration
public override void DrawPixel(int x, int y, bool colored)

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.

System.Boolean colored

True = turn on pixel, false = turn off pixel

View Source

InvertDisplay(Boolean)

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

Declaration
public void InvertDisplay(bool cmd)

Parameters

Type Name Description
System.Boolean cmd
View Source

PowerSaveMode()

Declaration
public void PowerSaveMode()
View Source

SetContrast(UInt32)

Declaration
public void SetContrast(uint contrast)

Parameters

Type Name Description
System.UInt32 contrast
View Source

SetPenColor(Color)

Declaration
public override void SetPenColor(Color pen)

Parameters

Type Name Description
Color pen
View Source

Show()

Send the internal pixel buffer to display.

Declaration
public override void Show()
View Source

StartScrolling(ST7565.ScrollDirection)

Start the display scrollling in the specified direction.

Declaration
public void StartScrolling(ST7565.ScrollDirection direction)

Parameters

Type Name Description
ST7565.ScrollDirection direction

Direction that the display should scroll.

View Source

StartScrolling(ST7565.ScrollDirection, Byte, Byte)

Start the display scrolling.

Declaration
public void StartScrolling(ST7565.ScrollDirection direction, byte startPage, byte endPage)

Parameters

Type Name Description
ST7565.ScrollDirection direction

Direction that the display should scroll.

System.Byte startPage

Start page for the scroll.

System.Byte endPage

End oage for the scroll.

Remarks

In most cases setting startPage to 0x00 and endPage to 0xff will achieve an acceptable scrolling effect.

View Source

StopScrolling()

Turn off scrolling.

Declaration
public void StopScrolling()

Remarks

Datasheet states that scrolling must be turned off before changing the scroll direction in order to prevent RAM corruption.