Remarks
SSD1331 | |
---|---|
Status | |
Source code | GitHub |
NuGet package |
The SSD1331 is a display controller used to drive 16bpp (RGB565) color OLED displays over SPI. These displays are commonly found with a resolution of 96x64.
Code Example
public class MeadowApp : App<F7Micro, MeadowApp>
{
Ssd1331 display;
GraphicsLibrary graphics;
public MeadowApp ()
{
var spiBus = Device.CreateSpiBus();
display = new Ssd1331(
device: Device,
spiBus: spiBus,
chipSelectPin: null,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128, height: 128);
graphics = new GraphicsLibrary(display);
graphics.CurrentFont = new Font8x8();
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, Meadow.Foundation.Color.Red);
graphics.DrawRectangle(20, 15, 40, 20, Meadow.Foundation.Color.Yellow, false);
graphics.DrawCircle(50, 50, 40, Meadow.Foundation.Color.Blue, false);
graphics.DrawText(5, 5, "Meadow F7 SPI");
graphics.Show();
}
}
Sample projects available on GitHub
Wiring Example
To wire a Ssd1331 to your Meadow board, connect the following:
Ssd1331 | Meadow Pin |
---|---|
LED- | 3V3 |
LED+ | GND |
MOSI | MOSI |
SCK | SCK |
RESET | D15 |
A0 | D14 |
CS | D13 |
VCC | 3V3 |
GND | GND |
It should look like the following diagram:
Syntax
public class Ssd1331 : TftSpiBase, IDisposable
Constructors
Ssd1331(IIODevice, ISpiBus, IPin, IPin, IPin, Int32, Int32)
Declaration
public Ssd1331(IIODevice device, ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin, int width, int height)
Parameters
Type | Name | Description |
---|---|---|
IIODevice | device | |
ISpiBus | spiBus | |
IPin | chipSelectPin | |
IPin | dcPin | |
IPin | resetPin | |
System.Int32 | width | |
System.Int32 | height |
Properties
DefautColorMode
Declaration
public override DisplayBase.DisplayColorMode DefautColorMode { get; }
Property Value
Type | Description |
---|---|
DisplayBase.DisplayColorMode |
Overrides
Methods
Initialize()
Declaration
protected override void Initialize()
Overrides
IsColorModeSupported(DisplayBase.DisplayColorMode)
Declaration
public override bool IsColorModeSupported(DisplayBase.DisplayColorMode mode)
Parameters
Type | Name | Description |
---|---|---|
DisplayBase.DisplayColorMode | mode |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
SetAddressWindow(Int32, Int32, Int32, Int32)
Declaration
protected override void SetAddressWindow(int x0, int y0, int x1, int y1)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x0 | |
System.Int32 | y0 | |
System.Int32 | x1 | |
System.Int32 | y1 |