Remarks

Hx8357b
Status
Source code GitHub
NuGet package

Code Example

public class MeadowApp : App<F7Micro, MeadowApp>
{
    Hx8357b display;
    GraphicsLibrary graphics;

    public MeadowApp ()
    {
        var config = new SpiClockConfiguration(6000, SpiClockConfiguration.Mode.Mode0);
        var spiBus = Device.CreateSpiBus(Device.Pins.SCK, Device.Pins.MOSI, Device.Pins.MISO, config);

        display = new Hx8357b(
            device: Device, 
            spiBus: spiBus,
            resetPin: Device.Pins.D00,
            dcPin: Device.Pins.D01,
            chipSelectPin: Device.Pins.D02,
            width: 320, height: 480, 
            displayColorMode: DisplayColorMode.Format16bppRgb565);

        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

Circuit Example

To wire a Hx8357b to your Meadow board, connect the following:

Hx8357b Meadow Pin
GND GND
VCC 3V3
SCL SCK
SDA MOSI
RESET D00
DC D01
CS D02

It should look like the following diagram:

Characteristic Locus
Inheritance System.Object DisplayBase TftSpiBase Hx8357d > Hx8357b
Implements System.IDisposable
Inherited Members Hx8357d.DefautColorMode Hx8357d.IsColorModeSupported(DisplayBase.DisplayColorMode) Hx8357d.SetAddressWindow(Int32, Int32, Int32, Int32) Hx8357d.SetRotation(TftSpiBase.Rotation) Hx8357d.HX8357_NOP Hx8357d.HX8357_SWRESET Hx8357d.HX8357_RDDID Hx8357d.HX8357_RDDST Hx8357d.HX8357_RDPOWMODE Hx8357d.HX8357_RDMADCTL Hx8357d.HX8357_RDCOLMOD Hx8357d.HX8357_RDDIM Hx8357d.HX8357_RDDSDR Hx8357d.HX8357_SLPIN Hx8357d.HX8357_SLPOUT Hx8357d.HX8357_INVOFF Hx8357d.HX8357_INVON Hx8357d.HX8357_DISPOFF Hx8357d.HX8357_DISPON Hx8357d.HX8357_TEON Hx8357d.HX8357_TEARLINE Hx8357d.HX8357_SETOSC Hx8357d.HX8357_SETPWR1 Hx8357d.HX8357_SETRGB Hx8357d.HX8357D_SETCOM Hx8357d.HX8357D_SETCYC Hx8357d.HX8357D_SETC Hx8357d.HX8357D_SETSTBA Hx8357d.HX8357_SETPANEL Hx8357d.HX8357D_SETGAMMA TftSpiBase.NO_OP TftSpiBase.MADCTL TftSpiBase.MADCTL_MY TftSpiBase.MADCTL_MX TftSpiBase.MADCTL_MV TftSpiBase.MADCTL_ML TftSpiBase.MADCTL_RGB TftSpiBase.MADCTL_BGR TftSpiBase.MADCTL_MH TftSpiBase.MADCTL_SS TftSpiBase.MADCTL_GS TftSpiBase.COLOR_MODE TftSpiBase.ColorMode TftSpiBase.colorMode TftSpiBase.Width TftSpiBase.Height TftSpiBase.dataCommandPort TftSpiBase.resetPort TftSpiBase.chipSelectPort TftSpiBase.spi TftSpiBase.spiDisplay TftSpiBase.spiBuffer TftSpiBase.spiReceive TftSpiBase.currentPen TftSpiBase.width TftSpiBase.height TftSpiBase.xMin TftSpiBase.xMax TftSpiBase.yMin TftSpiBase.yMax TftSpiBase.Data TftSpiBase.Command TftSpiBase.SetColorMode(DisplayBase.DisplayColorMode) TftSpiBase.Clear(Boolean) TftSpiBase.Clear(Color, Boolean) TftSpiBase.Clear(UInt16, Boolean) TftSpiBase.SetPenColor(Color) TftSpiBase.DrawPixel(Int32, Int32) TftSpiBase.DrawPixel(Int32, Int32, Boolean) TftSpiBase.DrawPixel(Int32, Int32, UInt16) TftSpiBase.DrawPixel(Int32, Int32, Color) TftSpiBase.DrawPixel(Int32, Int32, Byte, Byte, Byte) TftSpiBase.InvertPixel(Int32, Int32) TftSpiBase.InvertPixelRgb444(Int32, Int32) TftSpiBase.Show() TftSpiBase.Show(Int32, Int32, Int32, Int32) TftSpiBase.Write(Byte) TftSpiBase.Write(Byte[]) TftSpiBase.DelayMs(Int32) TftSpiBase.SendCommand(Byte) TftSpiBase.SendData(Int32) TftSpiBase.SendData(Byte) TftSpiBase.SendData(Byte[]) TftSpiBase.ClearScreen(UInt16) TftSpiBase.Dispose() DisplayBase.IgnoreOutOfBoundsPixels
Namespace Meadow.Foundation.Displays.Tft
Assembly TftSpi.dll

Syntax

public class Hx8357b : Hx8357d, IDisposable

Constructors

Hx8357b(IIODevice, ISpiBus, IPin, IPin, IPin, Int32, Int32, DisplayBase.DisplayColorMode)

Declaration
public Hx8357b(IIODevice device, ISpiBus spiBus, IPin chipSelectPin, IPin dcPin, IPin resetPin, int width = 320, int height = 480, DisplayBase.DisplayColorMode displayColorMode = DisplayBase.DisplayColorMode.Format16bppRgb565)

Parameters

Type Name Description
IIODevice device
ISpiBus spiBus
IPin chipSelectPin
IPin dcPin
IPin resetPin
System.Int32 width
System.Int32 height
DisplayBase.DisplayColorMode displayColorMode

Methods

Initialize()

Declaration
protected override void Initialize()

Overrides