/// <summary>Constructs a new instance.</summary> /// <param name="rSocketNumber">The mainboard socket that has the display's R socket connected to it.</param> /// <param name="gSocketNumber">The mainboard socket that has the display's G socket connected to it.</param> /// <param name="bSocketNumber">The mainboard socket that has the display's B socket connected to it.</param> public DisplayN7(int rSocketNumber, int gSocketNumber, int bSocketNumber) : base(WpfMode.PassThrough) { var config = new DisplayModule.TimingRequirements() { UsesCommonSyncPin = true, //not the proper property, but we needed it for OutputEnableIsFixed CommonSyncPinIsActiveHigh = true, //not the proper property, but we needed it for OutputEnablePolarity HorizontalSyncPulseIsActiveHigh = true, VerticalSyncPulseIsActiveHigh = true, PixelDataIsValidOnClockRisingEdge = false, HorizontalSyncPulseWidth = 1, HorizontalBackPorch = 46, HorizontalFrontPorch = 16, VerticalSyncPulseWidth = 1, VerticalBackPorch = 23, VerticalFrontPorch = 7, MaximumClockSpeed = 24000, }; base.OnDisplayConnected("Display N7", 800, 480, DisplayOrientation.Normal, config); var rSocket = Socket.GetSocket(rSocketNumber, true, this, null); var gSocket = Socket.GetSocket(gSocketNumber, true, this, null); var bSocket = Socket.GetSocket(bSocketNumber, true, this, null); rSocket.EnsureTypeIsSupported('R', this); gSocket.EnsureTypeIsSupported('G', this); bSocket.EnsureTypeIsSupported('B', this); this.backlightPin = GTI.DigitalOutputFactory.Create(gSocket, Socket.Pin.Nine, true, this); rSocket.ReservePin(Socket.Pin.Three, this); rSocket.ReservePin(Socket.Pin.Four, this); rSocket.ReservePin(Socket.Pin.Five, this); rSocket.ReservePin(Socket.Pin.Six, this); rSocket.ReservePin(Socket.Pin.Seven, this); rSocket.ReservePin(Socket.Pin.Eight, this); rSocket.ReservePin(Socket.Pin.Nine, this); gSocket.ReservePin(Socket.Pin.Three, this); gSocket.ReservePin(Socket.Pin.Four, this); gSocket.ReservePin(Socket.Pin.Five, this); gSocket.ReservePin(Socket.Pin.Six, this); gSocket.ReservePin(Socket.Pin.Seven, this); gSocket.ReservePin(Socket.Pin.Eight, this); bSocket.ReservePin(Socket.Pin.Three, this); bSocket.ReservePin(Socket.Pin.Four, this); bSocket.ReservePin(Socket.Pin.Five, this); bSocket.ReservePin(Socket.Pin.Six, this); bSocket.ReservePin(Socket.Pin.Seven, this); bSocket.ReservePin(Socket.Pin.Eight, this); bSocket.ReservePin(Socket.Pin.Nine, this); }
/// <summary> /// Configures the module to use the 4.3" display. /// </summary> public void Configure43InchDisplay() { var config = new DisplayModule.TimingRequirements() { UsesCommonSyncPin = false, //not the proper property, but we needed it for OutputEnableIsFixed CommonSyncPinIsActiveHigh = true, //not the proper property, but we needed it for OutputEnablePolarity PixelDataIsValidOnClockRisingEdge = false, MaximumClockSpeed = 20000, HorizontalSyncPulseIsActiveHigh = false, HorizontalSyncPulseWidth = 41, HorizontalBackPorch = 2, HorizontalFrontPorch = 2, VerticalSyncPulseIsActiveHigh = false, VerticalSyncPulseWidth = 10, VerticalBackPorch = 2, VerticalFrontPorch = 2, }; base.OnDisplayConnected("Display NHVN", 480, 272, DisplayOrientation.Normal, config); }
/// <summary>Constructs a new instance.</summary> /// <param name="rSocketNumber">The mainboard socket that has the display's R socket connected to it.</param> /// <param name="gSocketNumber">The mainboard socket that has the display's G socket connected to it.</param> /// <param name="bSocketNumber">The mainboard socket that has the display's B socket connected to it.</param> /// <param name="tSocketNumber">The mainboard socket that has the display's T socket connected to it.</param> public DisplayT43(int rSocketNumber, int gSocketNumber, int bSocketNumber, int tSocketNumber) : base(WpfMode.PassThrough) { var config = new DisplayModule.TimingRequirements() { UsesCommonSyncPin = false, //not the proper property, but we needed it for OutputEnableIsFixed CommonSyncPinIsActiveHigh = true, //not the proper property, but we needed it for OutputEnablePolarity HorizontalSyncPulseIsActiveHigh = false, VerticalSyncPulseIsActiveHigh = false, PixelDataIsValidOnClockRisingEdge = false, HorizontalSyncPulseWidth = 41, HorizontalBackPorch = 2, HorizontalFrontPorch = 2, VerticalSyncPulseWidth = 10, VerticalBackPorch = 2, VerticalFrontPorch = 2, MaximumClockSpeed = 20000 }; base.OnDisplayConnected("Display T43", 480, 272, DisplayOrientation.Normal, config); var rSocket = Socket.GetSocket(rSocketNumber, true, this, null); var gSocket = Socket.GetSocket(gSocketNumber, true, this, null); var bSocket = Socket.GetSocket(bSocketNumber, true, this, null); rSocket.EnsureTypeIsSupported('R', this); gSocket.EnsureTypeIsSupported('G', this); bSocket.EnsureTypeIsSupported('B', this); this.backlightPin = GTI.DigitalOutputFactory.Create(gSocket, Socket.Pin.Nine, true, this); rSocket.ReservePin(Socket.Pin.Three, this); rSocket.ReservePin(Socket.Pin.Four, this); rSocket.ReservePin(Socket.Pin.Five, this); rSocket.ReservePin(Socket.Pin.Six, this); rSocket.ReservePin(Socket.Pin.Seven, this); rSocket.ReservePin(Socket.Pin.Eight, this); rSocket.ReservePin(Socket.Pin.Nine, this); gSocket.ReservePin(Socket.Pin.Three, this); gSocket.ReservePin(Socket.Pin.Four, this); gSocket.ReservePin(Socket.Pin.Five, this); gSocket.ReservePin(Socket.Pin.Six, this); gSocket.ReservePin(Socket.Pin.Seven, this); gSocket.ReservePin(Socket.Pin.Eight, this); bSocket.ReservePin(Socket.Pin.Three, this); bSocket.ReservePin(Socket.Pin.Four, this); bSocket.ReservePin(Socket.Pin.Five, this); bSocket.ReservePin(Socket.Pin.Six, this); bSocket.ReservePin(Socket.Pin.Seven, this); bSocket.ReservePin(Socket.Pin.Eight, this); bSocket.ReservePin(Socket.Pin.Nine, this); if (tSocketNumber == Socket.Unused) { return; } var tSocket = Socket.GetSocket(tSocketNumber, true, this, null); tSocket.EnsureTypeIsSupported('T', this); tSocket.ReservePin(Socket.Pin.Four, this); tSocket.ReservePin(Socket.Pin.Five, this); tSocket.ReservePin(Socket.Pin.Six, this); tSocket.ReservePin(Socket.Pin.Seven, this); GT.Program.BeginInvoke(new NullParamsDelegate(() => Microsoft.SPOT.Touch.Touch.Initialize(Application.Current)), null); }
/// <summary>Constructs a new instance.</summary> /// <param name="rSocketNumber">The mainboard socket that has the display's R socket connected to it.</param> /// <param name="gSocketNumber">The mainboard socket that has the display's G socket connected to it.</param> /// <param name="bSocketNumber">The mainboard socket that has the display's B socket connected to it.</param> /// <param name="i2cSocketNumber">The mainboard socket that has the display's I socket connected to it.</param> public DisplayCP7(int rSocketNumber, int gSocketNumber, int bSocketNumber, int i2cSocketNumber) : base(WpfMode.PassThrough) { var config = new DisplayModule.TimingRequirements() { UsesCommonSyncPin = true, //not the proper property, but we needed it for OutputEnableIsFixed CommonSyncPinIsActiveHigh = true, //not the proper property, but we needed it for OutputEnablePolarity HorizontalSyncPulseIsActiveHigh = true, VerticalSyncPulseIsActiveHigh = true, PixelDataIsValidOnClockRisingEdge = false, HorizontalSyncPulseWidth = 1, HorizontalBackPorch = 46, HorizontalFrontPorch = 16, VerticalSyncPulseWidth = 1, VerticalBackPorch = 23, VerticalFrontPorch = 7, MaximumClockSpeed = 24000, }; base.OnDisplayConnected("Display CP7", 800, 480, DisplayOrientation.Normal, config); var rSocket = Socket.GetSocket(rSocketNumber, true, this, null); var gSocket = Socket.GetSocket(gSocketNumber, true, this, null); var bSocket = Socket.GetSocket(bSocketNumber, true, this, null); rSocket.EnsureTypeIsSupported('R', this); gSocket.EnsureTypeIsSupported('G', this); bSocket.EnsureTypeIsSupported('B', this); this.backlightPin = GTI.DigitalOutputFactory.Create(gSocket, Socket.Pin.Nine, true, this); rSocket.ReservePin(Socket.Pin.Three, this); rSocket.ReservePin(Socket.Pin.Four, this); rSocket.ReservePin(Socket.Pin.Five, this); rSocket.ReservePin(Socket.Pin.Six, this); rSocket.ReservePin(Socket.Pin.Seven, this); rSocket.ReservePin(Socket.Pin.Eight, this); rSocket.ReservePin(Socket.Pin.Nine, this); gSocket.ReservePin(Socket.Pin.Three, this); gSocket.ReservePin(Socket.Pin.Four, this); gSocket.ReservePin(Socket.Pin.Five, this); gSocket.ReservePin(Socket.Pin.Six, this); gSocket.ReservePin(Socket.Pin.Seven, this); gSocket.ReservePin(Socket.Pin.Eight, this); bSocket.ReservePin(Socket.Pin.Three, this); bSocket.ReservePin(Socket.Pin.Four, this); bSocket.ReservePin(Socket.Pin.Five, this); bSocket.ReservePin(Socket.Pin.Six, this); bSocket.ReservePin(Socket.Pin.Seven, this); bSocket.ReservePin(Socket.Pin.Eight, this); bSocket.ReservePin(Socket.Pin.Nine, this); if (i2cSocketNumber == Socket.Unused) { return; } this.onScreenPressed = this.OnScreenPressed; this.onScreenReleased = this.OnScreenReleased; this.onHomePressed = this.OnHomePressed; this.onMenuPressed = this.OnMenuPressed; this.onBackPressed = this.OnBackPressed; this.onGestureDetected = this.OnGestureDetected; Socket i2cSocket = Socket.GetSocket(i2cSocketNumber, true, this, null); this.releaseSent = false; this.transactions = new I2CDevice.I2CTransaction[2]; this.resultBuffer = new byte[1]; this.addressBuffer = new byte[1]; this.i2cBus = GTI.I2CBusFactory.Create(i2cSocket, 0x38, 400, this); this.touchInterrupt = GTI.InterruptInputFactory.Create(i2cSocket, GT.Socket.Pin.Three, GTI.GlitchFilterMode.Off, GTI.ResistorMode.PullUp, GTI.InterruptMode.RisingAndFallingEdge, this); this.touchInterrupt.Interrupt += (a, b) => this.OnTouchEvent(); }
/// <summary>Sets the output type and resolution and the mainboard's configuration.</summary> /// <param name="resolution">The desired output type and resolution.</param> /// <remarks>This method must be called to change the resolution. Setting the processor's display configuration is not enough.</remarks> public void SetDisplayConfiguration(Resolution resolution) { switch (resolution) { case Resolution.Rca320x240: this.currentWidth = 320; this.currentHeight = 240; this.Write320x240RcaRegisters(); break; case Resolution.Rca640x480: this.currentWidth = 640; this.currentHeight = 480; this.Write640x480RcaRegisters(); break; case Resolution.Rca800x600: this.currentWidth = 800; this.currentHeight = 600; this.Write800x600RcaRegisters(); break; case Resolution.Vga320x240: this.currentWidth = 320; this.currentHeight = 240; this.Write320x240VgaRegisters(); break; case Resolution.Vga640x480: this.currentWidth = 640; this.currentHeight = 480; this.Write640x480VgaRegisters(); break; case Resolution.Vga800x600: this.currentWidth = 800; this.currentHeight = 600; this.Write800x600VgaRegisters(); break; case Resolution.RcaPal320x240: this.currentWidth = 320; this.currentHeight = 240; this.Write320x240RcaPalRegisters(); break; } var config = new DisplayModule.TimingRequirements() { PixelDataIsActiveHigh = true, //not the proper property, but we needed it for PriorityEnable UsesCommonSyncPin = false, //not the proper property, but we needed it for OutputEnableIsFixed CommonSyncPinIsActiveHigh = false, //not the proper property, but we needed it for OutputEnablePolarity HorizontalSyncPulseIsActiveHigh = true, VerticalSyncPulseIsActiveHigh = true, PixelDataIsValidOnClockRisingEdge = false, HorizontalSyncPulseWidth = 10, HorizontalBackPorch = 10, HorizontalFrontPorch = 10, VerticalSyncPulseWidth = 10, VerticalBackPorch = 10, VerticalFrontPorch = 10, MaximumClockSpeed = 10000 }; base.OnDisplayConnected("Video Out", this.currentWidth, this.currentHeight, DisplayOrientation.Normal, config); Thread.Sleep(1000); var ud = ReadRegister(0x00); if (ud != 0x55 && ud != 0x54) { this.ErrorPrint("Setting the display configuration failed."); } }