Skip to content

Commit eaeab1a

Browse files
authored
Updated the OLED SSD1306 Demos and Drivers with Basic Functionality t… (#172)
1 parent 50af50d commit eaeab1a

File tree

9 files changed

+576
-403
lines changed

9 files changed

+576
-403
lines changed

devices/Ssd13xx/Commands/Ssd1306Commands/SetPageAddress.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ namespace Iot.Device.Ssd13xx.Commands.Ssd1306Commands
99
public enum PageAddress
1010
{
1111
/// <summary>Page0</summary>
12-
Page0 = 0x00,
12+
Page0 = 0xB0,
1313

1414
/// <summary>Page1</summary>
15-
Page1 = 0x01,
15+
Page1 = 0xB1,
1616

1717
/// <summary>Page2</summary>
18-
Page2 = 0x02,
18+
Page2 = 0xB2,
1919

2020
/// <summary>Page3</summary>
21-
Page3 = 0x03,
21+
Page3 = 0xB3,
2222

2323
/// <summary>Page4</summary>
24-
Page4 = 0x04,
24+
Page4 = 0xB4,
2525

2626
/// <summary>Page5</summary>
27-
Page5 = 0x05,
27+
Page5 = 0xB5,
2828

2929
/// <summary>Page6</summary>
30-
Page6 = 0x06,
30+
Page6 = 0xB6,
3131

3232
/// <summary>Page6</summary>
33-
Page7 = 0x07
33+
Page7 = 0xB7
3434
}
3535

3636
/// <summary>

devices/Ssd13xx/IFont.cs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
3+
namespace Iot.Device.Ssd13xx
4+
{
5+
/// <summary>
6+
/// Base class for font implementation.
7+
/// </summary>
8+
public abstract class IFont
9+
{
10+
/// <summary>
11+
/// Font width.
12+
/// </summary>
13+
public virtual byte Width { get; private set; }
14+
15+
/// <summary>
16+
/// Font height.
17+
/// </summary>
18+
public virtual byte Height { get; private set; }
19+
20+
/// <summary>
21+
/// Get the binary representation of the ASCII character from the font table.
22+
/// </summary>
23+
/// <param name="character">Character to look up.</param>
24+
/// <returns>Array of bytes representing the binary bit pattern of the character.</returns>
25+
public abstract byte[] this[char character] { get; }
26+
}
27+
}

devices/Ssd13xx/README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
# Solomon Systech SSD13xx OLED display family
1+
# SSD13xx & SSH1106 OLED display family
22

3-
The SSD1306 is a single-chip CMOS OLED/PLED driver with controller for organic/polymer light emitting diode dot-matrix graphic display system. It consists of 128 segments and 64 commons. This IC is designed for Common Cathode type OLED panel.
3+
The SSD1306/SSH1106 are a single-chip CMOS OLED/PLED driver with controllers for organic/polymer light emitting diode dot-matrix graphic display system. It consists of 128 segments and 64 commons. This IC is designed for Common Cathode type OLED panel.
44

55
## Documentation
66

7-
- [Adafruit Python SSD1306](https://github.com/adafruit/Adafruit_Python_SSD1306)
8-
- Adafruit Python SSD1306 [documentation](https://github.com/adafruit/Adafruit_Python_SSD1306/blob/master/examples/stats.py)
9-
- IoTCore SSD1306 [Driver](https://github.com/stefangordon/IoTCore-SSD1306-Driver)
7+
- IoT NanoFramework SSD1306/SSH1106 [Driver](https://github.com/nanoframework/nanoFramework.IoT.Device)
108
- SSD1306 [datasheet](https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf)
119
- SSD1327 [datasheet](https://github.com/SeeedDocument/Grove_OLED_1.12/raw/master/resources/SSD1327_datasheet.pdf)
1210

1311
### Related Devices
1412

1513
- [Adafruit PiOLED - 128x32 Monochrome OLED Add-on for Raspberry Pi](https://www.adafruit.com/product/3527)
14+
- [HiLetgo 1.3" SPI 128x64 SSH1106 OLED LCD Display LCD](https://www.amazon.com/HiLetgo-128x64-SSH1106-Display-Arduino/dp/B01N1LZT8L/ref=sr_1_2?crid=C88G1YX0AN3Q&dchild=1&keywords=ssh1106&qid=1634064423&sr=8-2)
1615
- [SunFounder 0.96" Inch Blue I2C IIC Serial 128x64 OLED LCD LED SSD1306 Modul](https://www.amazon.com/SunFounder-SSD1306-Arduino-Raspberry-Display/dp/B014KUB1SA)
1716
- [Diymall 0.96" Inch Blue and Yellow I2c IIC Serial Oled LCD LED Module 12864 128X64 for Arduino Display Raspberry PI 51 Msp420 Stim32 SCR](https://www.amazon.com/Diymall-Yellow-Arduino-Display-Raspberry/dp/B00O2LLT30)
1817

devices/Ssd13xx/Ssd1306.cs

+18-3
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,29 @@ namespace Iot.Device.Ssd13xx
1313
/// </summary>
1414
public class Ssd1306 : Ssd13xx
1515
{
16+
/// <summary>
17+
/// Default I2C bus address.
18+
/// </summary>
19+
public const byte DefaultI2cAddress = 0x3C;
20+
21+
/// <summary>
22+
/// Initializes new instance of Ssd1306 device that will communicate using I2C bus.
23+
/// A single-chip CMOS OLED/PLED driver with controller for organic/polymer
24+
/// light emitting diode dot-matrix graphic display system.
25+
/// </summary>
26+
/// <param name="i2cDevice">The I2C device used for communication.</param>
27+
public Ssd1306(I2cDevice i2cDevice) : base(i2cDevice)
28+
{
29+
}
30+
1631
/// <summary>
1732
/// Initializes new instance of Ssd1306 device that will communicate using I2C bus.
1833
/// A single-chip CMOS OLED/PLED driver with controller for organic/polymer
1934
/// light emitting diode dot-matrix graphic display system.
2035
/// </summary>
2136
/// <param name="i2cDevice">The I2C device used for communication.</param>
22-
public Ssd1306(I2cDevice i2cDevice)
23-
: base(i2cDevice)
37+
/// <param name="res">Display resolution</param>
38+
public Ssd1306(I2cDevice i2cDevice, DisplayResolution res) : base(i2cDevice, res)
2439
{
2540
}
2641

@@ -44,7 +59,7 @@ private void SendCommand(ICommand command)
4459
{
4560
SpanByte commandBytes = command?.GetBytes();
4661

47-
if (commandBytes is not { Length: >0 })
62+
if (commandBytes is not { Length: > 0 })
4863
{
4964
throw new ArgumentNullException(nameof(command), "Argument is either null or there were no bytes to send.");
5065
}

0 commit comments

Comments
 (0)