Example #1
0
 /// <summary>
 /// Sets the LCD controller configuration to use.
 /// </summary>
 /// <remarks>
 /// Should throw an ArgumentException if there is no LCD functionality on this mainboard, except if Mainboard_LCDConfiguration.HeadlessConfig (or null) is provided.
 /// </remarks>
 /// <param name="lcdConfig">the LCD configuration to use</param>
 public abstract void SetLCDConfiguration(LCDConfiguration lcdConfig);
Example #2
0
 /// <summary>
 /// Sets the liquid crystal display (LCD) configuration to use.
 /// </summary>
 /// <remarks>
 /// Should throw an ArgumentException if there is no LCD functionality on this mainboard, except if Mainboard_LCDConfiguration.HeadlessConfig (or null) is provided.
 /// </remarks>
 /// <param name="lcdConfig">the LCD configuration to use</param>
 public abstract void SetLCD(LCDConfiguration lcdConfig);
Example #3
0
 public FEZTouch(LCDConfiguration lcdConfig, TouchConfiguration touchConfig)
 {
     InitLCD(lcdConfig);
     InitTouch(touchConfig);
 }
Example #4
0
            private void InitLCD(LCDConfiguration lcdConfig)
            {
                pp = new ParallelPort(lcdConfig.dataPins, lcdConfig.writePin, lcdConfig.readPin);
                lcdReset = new OutputPort(lcdConfig.reset, true);
                lcdCS = new OutputPort(lcdConfig.chipSelect, true);
                lcdRS = new OutputPort(lcdConfig.RS, true);
                backLight = new OutputCompare(lcdConfig.backLight, true, 2);

                lcdReset.Write(true);
                Thread.Sleep(5);
                lcdReset.Write(false);
                Thread.Sleep(5);
                lcdReset.Write(true);
                Thread.Sleep(5);

                lcdCS.Write(false);

                //************* Start Initial Sequence **********//
                WriteRegister(0x0001, 0x0100); // set SS and SM bit
                WriteRegister(0x0002, 0x0200); // set 1 line inversion
                WriteRegister(0x0003, 0x0030); // set GRAM write direction and BGR=0.
                WriteRegister(0x0004, 0x0000); // Resize register
                WriteRegister(0x0008, 0x0207); // set the back porch and front porch
                WriteRegister(0x0009, 0x0000); // set non-display area refresh cycle ISC[3:0]
                WriteRegister(0x000A, 0x0000); // FMARK function
                WriteRegister(0x000C, 0x0000); // RGB interface setting
                WriteRegister(0x000D, 0x0000); // Frame marker Position
                WriteRegister(0x000F, 0x0000); // RGB interface polarity
                //*************Power On sequence ****************//
                WriteRegister(0x0010, 0x0000); // SAP, BT[3:0], AP, DSTB, SLP, STB
                WriteRegister(0x0011, 0x0007); // DC1[2:0], DC0[2:0], VC[2:0]
                WriteRegister(0x0012, 0x0000); // VREG1OUT voltage
                WriteRegister(0x0013, 0x0000); // VDV[4:0] for VCOM amplitude
                WriteRegister(0x0007, 0x0001);
                Thread.Sleep(200); // Dis-charge capacitor power voltage
                WriteRegister(0x0010, 0x1690); // SAP, BT[3:0], AP, DSTB, SLP, STB
                WriteRegister(0x0011, 0x0227); // Set DC1[2:0], DC0[2:0], VC[2:0]
                Thread.Sleep(50); // Delay 50ms
                WriteRegister(0x0012, 0x000D); // 0012
                Thread.Sleep(50); // Delay 50ms
                WriteRegister(0x0013, 0x1200); // VDV[4:0] for VCOM amplitude
                WriteRegister(0x0029, 0x000A); // 04  VCM[5:0] for VCOMH
                WriteRegister(0x002B, 0x000D); // Set Frame Rate
                Thread.Sleep(50); // Delay 50ms
                WriteRegister(0x0020, 0x0000); // GRAM horizontal Address
                WriteRegister(0x0021, 0x0000); // GRAM Vertical Address
                // ----------- Adjust the Gamma Curve ----------//
                WriteRegister(0x0030, 0x0000);
                WriteRegister(0x0031, 0x0404);
                WriteRegister(0x0032, 0x0003);
                WriteRegister(0x0035, 0x0405);
                WriteRegister(0x0036, 0x0808);
                WriteRegister(0x0037, 0x0407);
                WriteRegister(0x0038, 0x0303);
                WriteRegister(0x0039, 0x0707);
                WriteRegister(0x003C, 0x0504);
                WriteRegister(0x003D, 0x0808);
                //------------------ Set GRAM area ---------------//
                WriteRegister(0x0050, 0x0000); // Horizontal GRAM Start Address
                WriteRegister(0x0051, 0x00EF); // Horizontal GRAM End Address
                WriteRegister(0x0052, 0x0000); // Vertical GRAM Start Address
                WriteRegister(0x0053, 0x013F); // Vertical GRAM Start Address
                WriteRegister(0x0060, 0xA700); // Gate Scan Line
                WriteRegister(0x0061, 0x0001); // NDL,VLE, REV

                WriteRegister(0x006A, 0x0000); // set scrolling line
                //-------------- Partial Display Control ---------//
                WriteRegister(0x0080, 0x0000);
                WriteRegister(0x0081, 0x0000);
                WriteRegister(0x0082, 0x0000);
                WriteRegister(0x0083, 0x0000);
                WriteRegister(0x0084, 0x0000);
                WriteRegister(0x0085, 0x0000);
                //-------------- Panel Control -------------------//
                WriteRegister(0x0090, 0x0010);
                WriteRegister(0x0092, 0x0000);
                WriteRegister(0x0007, 0x0133); // 262K color and display ON

                lcdCS.Write(true);
            }
Example #5
0
 public FEZTouch(LCDConfiguration lcdConfig)
 {
     InitLCD(lcdConfig);
 }