|
| 1 | +// Licensed to the .NET Foundation under one or more agreements. |
| 2 | +// The .NET Foundation licenses this file to you under the MIT license. |
| 3 | + |
| 4 | +using System; |
| 5 | +using System.Device.Gpio; |
| 6 | +using System.Device.I2c; |
| 7 | +using Iot.Device.Ssd13xx.Commands; |
| 8 | + |
| 9 | +namespace Iot.Device.Ssd13xx |
| 10 | +{ |
| 11 | + /// <summary> |
| 12 | + /// A single-chip CMOS OLED/PLED driver with controller for organic/polymer |
| 13 | + /// light emitting diode dot-matrix graphic display system. |
| 14 | + /// </summary> |
| 15 | + public class Sh1106 : Ssd1306 |
| 16 | + { |
| 17 | + private byte[] _pageCmd = new byte[] |
| 18 | + { |
| 19 | + 0x00, |
| 20 | + 0xB0, |
| 21 | + 0x00, |
| 22 | + 0x10 |
| 23 | + }; |
| 24 | + |
| 25 | + /// <summary> |
| 26 | + /// Initializes a new instance of the <see cref="Sh1106" /> class. |
| 27 | + /// A single-chip CMOS OLED/PLED driver with controller for organic/polymer |
| 28 | + /// light emitting diode dot-matrix graphic display system. |
| 29 | + /// </summary> |
| 30 | + /// <param name="i2cDevice">The I2C device used for communication.</param> |
| 31 | + /// <param name="resetPin">Reset pin (some displays might be wired to share the microcontroller's |
| 32 | + /// reset pin).</param> |
| 33 | + public Sh1106(I2cDevice i2cDevice, int resetPin = -1) : base(i2cDevice, DisplayResolution.OLED128x64, DisplayOrientation.Landscape, resetPin) |
| 34 | + { |
| 35 | + SetPageCmd(_pageCmd); |
| 36 | + } |
| 37 | + |
| 38 | + /// <summary> |
| 39 | + /// Initializes a new instance of the <see cref="Sh1106" /> class. |
| 40 | + /// A single-chip CMOS OLED/PLED driver with controller for organic/polymer |
| 41 | + /// light emitting diode dot-matrix graphic display system. |
| 42 | + /// </summary> |
| 43 | + /// <param name="i2cDevice">The I2C device used for communication.</param> |
| 44 | + /// <param name="res">Display resolution.</param> |
| 45 | + /// <param name="orientation">Rotation of the display with reference to the hardware's default orientation.</param> |
| 46 | + /// <param name="resetPin">Reset pin (some displays might be wired to share the microcontroller's |
| 47 | + /// reset pin).</param> |
| 48 | + /// <param name="gpio">Gpio Controller.</param> |
| 49 | + /// <param name="shouldDispose">True to dispose the GpioController.</param> |
| 50 | + public Sh1106(I2cDevice i2cDevice, DisplayResolution res, DisplayOrientation orientation = DisplayOrientation.Landscape, int resetPin = -1, GpioController gpio = null, bool shouldDispose = true) : base(i2cDevice, res, orientation, resetPin, gpio, shouldDispose) |
| 51 | + { |
| 52 | + SetPageCmd(_pageCmd); |
| 53 | + } |
| 54 | + } |
| 55 | +} |
0 commit comments