Class Ssd13xx
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
I2cDeviceI2C device used to communicate with the device.
resolution
Ssd13xx.DisplayResolutionScreen resolution to use for device init.
orientation
DisplayOrientationOrientation of the displayn.
resetPin
intReset pin (some displays might be wired to share the microcontroller's reset pin).
gpio
GpioControllerGpio Controller.
shouldDispose
boolTrue to dispose the GpioController.
Properties
Font
Gets or sets Font to use.
public IFont Font { get; set; }
Property Value
Height
Gets or sets Screen Resolution Height in Pixels.
public int Height { get; set; }
Property Value
Orientation
Gets or sets Screen rotation. 0 = no rotation, 1 = 90, 2 = 180, 3 = 270.
public DisplayOrientation Orientation { get; set; }
Property Value
Pages
Gets or sets Screen data pages.
public byte Pages { get; set; }
Property Value
Width
Gets or sets Screen Resolution Width in Pixels.
public int Width { get; set; }
Property Value
_i2cDevice
Gets or sets underlying I2C device.
protected I2cDevice _i2cDevice { get; set; }
Property Value
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
intThe X coordinate on the screen.
y
intThe Y coordinate on the screen.
width
intWidth of area in pixels.
height
intHeight 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
boolShould 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
intThe X coordinate on the screen.
y
intThe Y coordinate on the screen.
width
intWidth in bytes.
height
intHeight in bytes.
bitmap
byte[]Bitmap to display.
size
byteDrawing 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
intThe X coordinate on the screen.
y
intThe Y coordinate on the screen.
width
intWidth of buffer content in pixels.
height
intHeight 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
intX coordinate starting of the top left.
y0
intY coordinate starting of the top left.
width
intWidth of rectabgle in pixels.
height
intHeight of rectangle in pixels.
inverted
boolTurn 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
intX coordinate starting of the line.
y0
intY coordinate starting of line.
length
intLine length.
inverted
boolTurn 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
intThe X coordinate on the screen.
y
intThe Y coordinate on the screen.
inverted
boolIndicates 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
intThe x pixel-coordinate on the screen.
y
intThe y pixel-coordinate on the screen.
str
stringText string to display.
size
byteText size, normal = 1, larger use 2,3, 4 etc.
center
boolIndicates 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
intX coordinate starting of the line.
y0
intY coordinate starting of line.
length
intLine length.
inverted
boolTurn the pixel on (true) or off (false).
SendCommand(ISharedCommand)
Send a command to the display controller.
public abstract void SendCommand(ISharedCommand command)
Parameters
command
ISharedCommandThe command to send to the display controller.
SendData(SpanByte)
Send data to the display controller.
public virtual void SendData(SpanByte data)
Parameters
data
SpanByteThe 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
intRequested 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
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
intThe x text-coordinate on the screen.
y
intThe y text-coordinate on the screen.
str
stringText string to display.
size
byteText size, normal = 1, larger use 2,3, 4 etc.
center
boolIndicates if text should be centered if possible.
- See Also