Table of Contents

Class Ssd13xx

Namespace
Iot.Device.Ssd13xx
Assembly
Iot.Device.Ssd13xx.dll

Represents base class for SSD13xx OLED displays.

public abstract class Ssd13xx
Inheritance
Ssd13xx
Derived

Constructors

Ssd13xx(I2cDevice, DisplayResolution, DisplayOrientation, int, GpioController, bool)

Initializes a new instance of the Ssd13xx class.

public Ssd13xx(I2cDevice i2cDevice, Ssd13xx.DisplayResolution resolution = DisplayResolution.OLED128x64, DisplayOrientation orientation = DisplayOrientation.Landscape, int resetPin = -1, GpioController gpio = null, bool shouldDispose = true)

Parameters

i2cDevice I2cDevice

I2C device used to communicate with the device.

resolution Ssd13xx.DisplayResolution

Screen resolution to use for device init.

orientation DisplayOrientation

Orientation of the displayn.

resetPin int

Reset pin (some displays might be wired to share the microcontroller's reset pin).

gpio GpioController

Gpio Controller.

shouldDispose bool

True to dispose the GpioController.

Properties

Font

Gets or sets Font to use.

public IFont Font { get; set; }

Property Value

IFont

Height

Gets or sets Screen Resolution Height in Pixels.

public int Height { get; set; }

Property Value

int

Orientation

Gets or sets Screen rotation. 0 = no rotation, 1 = 90, 2 = 180, 3 = 270.

public DisplayOrientation Orientation { get; set; }

Property Value

DisplayOrientation

Pages

Gets or sets Screen data pages.

public byte Pages { get; set; }

Property Value

byte

Width

Gets or sets Screen Resolution Width in Pixels.

public int Width { get; set; }

Property Value

int

_i2cDevice

Gets or sets underlying I2C device.

protected I2cDevice _i2cDevice { get; set; }

Property Value

I2cDevice

Methods

ClearDirectAligned(int, int, int, int)

Clears portion of display via writing 0x00 directly to display buffer. Y and height must be byte aligned because bytes will be written without any logical operations on existing content.

public void ClearDirectAligned(int x, int y, int width, int height)

Parameters

x int

The X coordinate on the screen.

y int

The Y coordinate on the screen.

width int

Width of area in pixels.

height int

Height of area in pixels.

ClearScreen()

Clears the screen.

public void ClearScreen()

Display()

Displays the information on the screen using page mode.

public void Display()

Dispose()

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

public void Dispose()

Dispose(bool)

Cleanup resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

Should dispose managed resources.

DrawBitmap(int, int, int, int, byte[], byte)

Displays the 1 bit bit map.

public void DrawBitmap(int x, int y, int width, int height, byte[] bitmap, byte size = 1)

Parameters

x int

The X coordinate on the screen.

y int

The Y coordinate on the screen.

width int

Width in bytes.

height int

Height in bytes.

bitmap byte[]

Bitmap to display.

size byte

Drawing size, normal = 1, larger use 2,3 etc.

DrawDirectAligned(int, int, int, int, byte[])

Copies buffer content directly to display buffer. Y and height must be byte aligned because buffer will be copied without any logical operations on existing content.

public void DrawDirectAligned(int x, int y, int width, int height, byte[] buffer)

Parameters

x int

The X coordinate on the screen.

y int

The Y coordinate on the screen.

width int

Width of buffer content in pixels.

height int

Height of buffer content in pixels.

buffer byte[]

Data to copy. Buffer size must be equal to height * width / 8.

DrawFilledRectangle(int, int, int, int, bool)

Draws a rectangle that is solid/filled.

public void DrawFilledRectangle(int x0, int y0, int width, int height, bool inverted = true)

Parameters

x0 int

X coordinate starting of the top left.

y0 int

Y coordinate starting of the top left.

width int

Width of rectabgle in pixels.

height int

Height of rectangle in pixels.

inverted bool

Turn the pixel on (true) or off (false).

DrawHorizontalLine(int, int, int, bool)

Draws a horizontal line.

public void DrawHorizontalLine(int x0, int y0, int length, bool inverted = true)

Parameters

x0 int

X coordinate starting of the line.

y0 int

Y coordinate starting of line.

length int

Line length.

inverted bool

Turn the pixel on (true) or off (false).

DrawPixel(int, int, bool)

Draws a pixel on the screen.

public void DrawPixel(int x, int y, bool inverted = true)

Parameters

x int

The X coordinate on the screen.

y int

The Y coordinate on the screen.

inverted bool

Indicates if color to be used turn the pixel on, or leave off.

DrawString(int, int, string, byte, bool)

Writes a text message on the screen with font in use.

public void DrawString(int x, int y, string str, byte size = 1, bool center = false)

Parameters

x int

The x pixel-coordinate on the screen.

y int

The y pixel-coordinate on the screen.

str string

Text string to display.

size byte

Text size, normal = 1, larger use 2,3, 4 etc.

center bool

Indicates if text should be centered if possible.

See Also

DrawVerticalLine(int, int, int, bool)

Draws a vertical line.

public void DrawVerticalLine(int x0, int y0, int length, bool inverted = true)

Parameters

x0 int

X coordinate starting of the line.

y0 int

Y coordinate starting of line.

length int

Line length.

inverted bool

Turn the pixel on (true) or off (false).

SendCommand(ISharedCommand)

Send a command to the display controller.

public abstract void SendCommand(ISharedCommand command)

Parameters

command ISharedCommand

The command to send to the display controller.

SendData(SpanByte)

Send data to the display controller.

public virtual void SendData(SpanByte data)

Parameters

data SpanByte

The data to send to the display controller.

SliceGenericBuffer(int)

Acquires span of specific length pointing to the command buffer. If length of the command buffer is too small it will be reallocated.

protected SpanByte SliceGenericBuffer(int length)

Parameters

length int

Requested length.

Returns

SpanByte

Span of bytes pointing to the command buffer.

SliceGenericBuffer(int, int)

Acquires span of specific length at specific position in command buffer. If length of the command buffer is too small it will be reallocated.

protected SpanByte SliceGenericBuffer(int start, int length)

Parameters

start int

Start index of the requested span.

length int

Requested length.

Returns

SpanByte

Span of bytes pointing to the command buffer.

Write(int, int, string, byte, bool)

Writes a text message on the screen with font in use.

public void Write(int x, int y, string str, byte size = 1, bool center = false)

Parameters

x int

The x text-coordinate on the screen.

y int

The y text-coordinate on the screen.

str string

Text string to display.

size byte

Text size, normal = 1, larger use 2,3, 4 etc.

center bool

Indicates if text should be centered if possible.

See Also