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
i2cDeviceI2cDeviceI2C device used to communicate with the device.
resolutionSsd13xx.DisplayResolutionScreen resolution to use for device init.
orientationDisplayOrientationOrientation of the displayn.
resetPinintReset pin (some displays might be wired to share the microcontroller's reset pin).
gpioGpioControllerGpio Controller.
shouldDisposeboolTrue 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
xintThe X coordinate on the screen.
yintThe Y coordinate on the screen.
widthintWidth of area in pixels.
heightintHeight 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
disposingboolShould 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
xintThe X coordinate on the screen.
yintThe Y coordinate on the screen.
widthintWidth in bytes.
heightintHeight in bytes.
bitmapbyte[]Bitmap to display.
sizebyteDrawing 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
xintThe X coordinate on the screen.
yintThe Y coordinate on the screen.
widthintWidth of buffer content in pixels.
heightintHeight of buffer content in pixels.
bufferbyte[]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
x0intX coordinate starting of the top left.
y0intY coordinate starting of the top left.
widthintWidth of rectabgle in pixels.
heightintHeight of rectangle in pixels.
invertedboolTurn 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
x0intX coordinate starting of the line.
y0intY coordinate starting of line.
lengthintLine length.
invertedboolTurn 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
xintThe X coordinate on the screen.
yintThe Y coordinate on the screen.
invertedboolIndicates 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
xintThe x pixel-coordinate on the screen.
yintThe y pixel-coordinate on the screen.
strstringText string to display.
sizebyteText size, normal = 1, larger use 2,3, 4 etc.
centerboolIndicates 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
x0intX coordinate starting of the line.
y0intY coordinate starting of line.
lengthintLine length.
invertedboolTurn the pixel on (true) or off (false).
SendCommand(ISharedCommand)
Send a command to the display controller.
public abstract void SendCommand(ISharedCommand command)
Parameters
commandISharedCommandThe command to send to the display controller.
SendData(SpanByte)
Send data to the display controller.
public virtual void SendData(SpanByte data)
Parameters
dataSpanByteThe 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
lengthintRequested 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
xintThe x text-coordinate on the screen.
yintThe y text-coordinate on the screen.
strstringText string to display.
sizebyteText size, normal = 1, larger use 2,3, 4 etc.
centerboolIndicates if text should be centered if possible.
- See Also