Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Sample project(s) available on GitHub
Characteristic | Locus |
---|---|
Inheritance | object > Ch1115 |
Implements | IGraphicsDisplay ISpiPeripheral IDisposable |
Inherited Members | object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString() |
Namespace | Meadow.Foundation.Displays |
Assembly | Ch1115.dll |
Syntax
public class Ch1115 : IGraphicsDisplay, ISpiPeripheral, IDisposable
Constructors
Ch1115(ISpiBus, IDigitalOutputPort?, IDigitalOutputPort, IDigitalOutputPort, int, int)
Create a new Ch1115 display object
Declaration
public Ch1115(ISpiBus spiBus, IDigitalOutputPort? chipSelectPort, IDigitalOutputPort dataCommandPort, IDigitalOutputPort resetPort, int width = 128, int height = 64)
Parameters
Type | Name | Description |
---|---|---|
ISpiBus | spiBus | SPI bus connected to display |
IDigitalOutputPort | chipSelectPort | Chip select output port |
IDigitalOutputPort | dataCommandPort | Data command output port |
IDigitalOutputPort | resetPort | Reset output port |
int | width | Width of display in pixels |
int | height | Height of display in pixels |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Ch1115(ISpiBus, IPin?, IPin, IPin, int, int)
Create a new Ch1115 object
Declaration
public Ch1115(ISpiBus spiBus, IPin? chipSelectPin, IPin dcPin, IPin resetPin, int width = 128, int height = 64)
Parameters
Type | Name | Description |
---|---|---|
ISpiBus | spiBus | SPI bus connected to display |
IPin | chipSelectPin | Chip select pin |
IPin | dcPin | Data command pin |
IPin | resetPin | Reset pin |
int | width | Width of display in pixels |
int | height | Height of display in pixels |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Fields
spiComms
SPI Communication bus used to communicate with the peripheral
Declaration
protected readonly ISpiCommunications spiComms
Field Value
Type | Description |
---|---|
ISpiCommunications |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Properties
ColorMode
The display color mode - 1 bit per pixel monochrome
Declaration
public ColorMode ColorMode { get; }
Property Value
Type | Description |
---|---|
ColorMode |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
DefaultSpiBusMode
The default SPI bus mode for the device
Declaration
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }
Property Value
Type | Description |
---|---|
SpiClockConfiguration.Mode |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
DefaultSpiBusSpeed
The default SPI bus speed for the device
Declaration
public Frequency DefaultSpiBusSpeed { get; }
Property Value
Type | Description |
---|---|
Frequency |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Height
The display height in pixels
Declaration
public int Height { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
IsDisposed
Is the object disposed
Declaration
public bool IsDisposed { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
PixelBuffer
The buffer the holds the pixel data for the display
Declaration
public IPixelBuffer PixelBuffer { get; }
Property Value
Type | Description |
---|---|
IPixelBuffer |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
SpiBusMode
The SPI bus mode for the device
Declaration
public SpiClockConfiguration.Mode SpiBusMode { get; set; }
Property Value
Type | Description |
---|---|
SpiClockConfiguration.Mode |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
SpiBusSpeed
The SPI bus speed for the device
Declaration
public Frequency SpiBusSpeed { get; set; }
Property Value
Type | Description |
---|---|
Frequency |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
SupportedColorModes
The Color mode supported by the display
Declaration
public ColorMode SupportedColorModes { get; }
Property Value
Type | Description |
---|---|
ColorMode |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Width
The display width in pixels
Declaration
public int Width { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Methods
Clear(bool)
Clear the display buffer
Declaration
public void Clear(bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
bool | updateDisplay | Immediately update the display when true |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Dispose(bool)
Dispose of the object
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | Is disposing |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
DrawPixel(int, int, Color)
Draw pixel at a location
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
int | x | Abscissa of the pixel to the set / reset |
int | y | Ordinate of the pixel to the set / reset |
Color | color | Any color = turn on pixel, black = turn off pixel |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
DrawPixel(int, int, bool)
Draw pixel at a location
Declaration
public void DrawPixel(int x, int y, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
int | x | Abscissa of the pixel to the set / reset |
int | y | Ordinate of the pixel to the set / reset |
bool | enabled | True = turn on pixel, false = turn off pixel |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Fill(Color, bool)
Fill display buffer with a color
Declaration
public void Fill(Color clearColor, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
Color | clearColor | The fill color |
bool | updateDisplay | If true, update display |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Fill(int, int, int, int, Color)
Fill with a color
Declaration
public void Fill(int x, int y, int width, int height, Color color)
Parameters
Type | Name | Description |
---|---|---|
int | x | X start position in pixels |
int | y | Y start position in pixels |
int | width | Width in pixels |
int | height | Height in pixels |
Color | color | The fill color |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
InvertDisplay(bool)
Invert the entire display (true) or return to normal mode (false).
Declaration
public void InvertDisplay(bool invert)
Parameters
Type | Name | Description |
---|---|---|
bool | invert |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
InvertPixel(int, int)
Invert a pixel at a location
Declaration
public void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
int | x | Abscissa of the pixel to the set / reset |
int | y | Ordinate of the pixel to the set / reset |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
PowerSaveMode()
Set display into power saving mode
Declaration
public void PowerSaveMode()
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
SetContrast(byte)
Set the display contrast
Declaration
public void SetContrast(byte contrast)
Parameters
Type | Name | Description |
---|---|---|
byte | contrast | The contrast value (0-63) |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Show()
Send the internal pixel buffer to display
Declaration
public void Show()
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
Show(int, int, int, int)
Update a region of the display from the offscreen buffer
Declaration
public void Show(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
int | left | Left bounds in pixels |
int | top | Top bounds in pixels |
int | right | Right bounds in pixels |
int | bottom | Bottom bounds in pixels |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
StartScrolling(ScrollDirection)
Start the display scrolling in the specified direction.
Declaration
public void StartScrolling(Ch1115.ScrollDirection direction)
Parameters
Type | Name | Description |
---|---|---|
Ch1115.ScrollDirection | direction | Direction that the display should scroll |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}
StartScrolling(ScrollDirection, byte, byte)
Start the display scrolling
Declaration
public void StartScrolling(Ch1115.ScrollDirection direction, byte startPage, byte endPage)
Parameters
Type | Name | Description |
---|---|---|
Ch1115.ScrollDirection | direction | Direction that the display should scroll |
byte | startPage | Start page for the scroll |
byte | endPage | End page for the scroll |
Remarks
In most cases setting startPage to 0x00 and endPage to 0xff will achieve an acceptable scrolling effect
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
WriteBuffer(int, int, IPixelBuffer)
Write a buffer to the display offscreen buffer
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
Type | Name | Description |
---|---|---|
int | x | The x position in pixels to write the buffer |
int | y | The y position in pixels to write the buffer |
IPixelBuffer | displayBuffer | The buffer to write |
Remarks
Ch1115 | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}