/// <summary> /// This sets the LCD configuration. If the value GT.Mainboard.LCDConfiguration.HeadlessConfig (=null) is specified, no display support should be active. /// If a non-null value is specified but the property LCDControllerEnabled is false, the LCD controller should be disabled if present, /// though the Bitmap width/height for WPF should be modified to the Width and Height parameters. This must reboot if the LCD configuration changes require a reboot. /// </summary> /// <param name="lcdConfig">The LCD Configuration</param> public override void SetLCDConfiguration(GT.Mainboard.LCDConfiguration lcdConfig) { if (lcdConfig.LCDControllerEnabled == false) { GHIOSHW.LCDController.Configurations config = new GHIOSHW.LCDController.Configurations(); config.Width = lcdConfig.Width; config.Height = lcdConfig.Height; // removed //config.PixelClockDivider = 0xFF; // added config.PixelClockRateKHz = 0; //Reset board if needed if (GHIOSHW.LCDController.Set(config)) { Debug.Print("Updating display configuration. THE MAINBOARD WILL NOW REBOOT."); Debug.Print("To continue debugging, you will need to restart debugging manually (Ctrl-Shift-F5)"); // A new configuration was set, so we must reboot Microsoft.SPOT.Hardware.PowerState.RebootDevice(false); } } else { GHIOSHW.LCDController.Configurations config = new GHIOSHW.LCDController.Configurations(); config.Height = lcdConfig.Height; config.HorizontalBackPorch = lcdConfig.HorizontalBackPorch; config.HorizontalFrontPorch = lcdConfig.HorizontalFrontPorch; config.HorizontalSyncPolarity = lcdConfig.HorizontalSyncPolarity; config.HorizontalSyncPulseWidth = lcdConfig.HorizontalSyncPulseWidth; config.OutputEnableIsFixed = lcdConfig.OutputEnableIsFixed; config.OutputEnablePolarity = lcdConfig.OutputEnablePolarity; // Removed //config.PixelClockDivider = lcdConfig.PixelClockDivider; // Added config.PixelClockRateKHz = (uint)((100000) / ((lcdConfig.PixelClockDivider + 1) * 2)); config.PixelPolarity = lcdConfig.PixelPolarity; config.PriorityEnable = lcdConfig.PriorityEnable; config.VerticalBackPorch = lcdConfig.VerticalBackPorch; config.VerticalFrontPorch = lcdConfig.VerticalFrontPorch; config.VerticalSyncPolarity = lcdConfig.VerticalSyncPolarity; config.VerticalSyncPulseWidth = lcdConfig.VerticalSyncPulseWidth; config.Width = lcdConfig.Width; //Reset board if needed if (GHIOSHW.LCDController.Set(config)) { Debug.Print("Updating display configuration. THE MAINBOARD WILL NOW REBOOT."); Debug.Print("To continue debugging, you will need to restart debugging manually (Ctrl-Shift-F5)"); Microsoft.SPOT.Hardware.PowerState.RebootDevice(false); } } }
/// <summary> /// This sets the LCD configuration. If the value GT.Mainboard.LCDConfiguration.HeadlessConfig (=null) is specified, no display support should be active. /// If a non-null value is specified but the property LCDControllerEnabled is false, the LCD controller should be disabled if present, /// though the Bitmap width/height for WPF should be modified to the Width and Height parameters. This must reboot if the LCD configuration changes require a reboot. /// </summary> /// <param name="lcdConfig">The LCD Configuration</param> public override void SetLCDConfiguration(GT.Mainboard.LCDConfiguration lcdConfig) { var config = new Configuration.LCD.Configurations(); if (lcdConfig.LCDControllerEnabled) { config.Height = lcdConfig.Height; config.HorizontalBackPorch = lcdConfig.HorizontalBackPorch; config.HorizontalFrontPorch = lcdConfig.HorizontalFrontPorch; config.HorizontalSyncPolarity = lcdConfig.HorizontalSyncPolarity; config.HorizontalSyncPulseWidth = lcdConfig.HorizontalSyncPulseWidth; config.OutputEnableIsFixed = lcdConfig.OutputEnableIsFixed; config.OutputEnablePolarity = lcdConfig.OutputEnablePolarity; config.PixelClockRateKHz = (uint)(133000 / lcdConfig.PixelClockDivider); config.PixelPolarity = lcdConfig.PixelPolarity; config.VerticalBackPorch = lcdConfig.VerticalBackPorch; config.VerticalFrontPorch = lcdConfig.VerticalFrontPorch; config.VerticalSyncPolarity = lcdConfig.VerticalSyncPolarity; config.VerticalSyncPulseWidth = lcdConfig.VerticalSyncPulseWidth; config.Width = lcdConfig.Width; } else { config = Configuration.LCD.HeadlessConfig; config.Width = lcdConfig.Width; config.Height = lcdConfig.Height; config.PixelClockRateKHz = 0; } if (Configuration.LCD.Set(config)) { Debug.Print("Updating display configuration. THE MAINBOARD WILL NOW REBOOT."); Debug.Print("To continue debugging, you will need to restart debugging manually (Ctrl-Shift-F5)"); Microsoft.SPOT.Hardware.PowerState.RebootDevice(false); } }
/// <summary> /// This sets the LCD configuration. If the value GT.Mainboard.LCDConfiguration.HeadlessConfig (=null) is specified, no display support should be active. /// If a non-null value is specified but the property LCDControllerEnabled is false, the LCD controller should be disabled if present, /// though the Bitmap width/height for WPF should be modified to the Width and Height parameters. This must reboot if the LCD configuration changes require a reboot. /// </summary> /// <param name="lcdConfig">The LCD Configuration</param> public override void SetLCDConfiguration(GT.Mainboard.LCDConfiguration lcdConfig) { if (lcdConfig.LCDControllerEnabled == false) { //Configuration.LCD.Set(Configuration.LCD.HeadlessConfig); var config = new Configuration.LCD.Configurations(); config = Configuration.LCD.HeadlessConfig; config.Width = lcdConfig.Width; config.Height = lcdConfig.Height; // removed //config.PixelClockDivider = 0xFF; // added config.PixelClockRateKHz = 0; if (Configuration.LCD.Set(config)) { Debug.Print("Updating display configuration. THE MAINBOARD WILL NOW REBOOT."); Debug.Print("To continue debugging, you will need to restart debugging manually (Ctrl-Shift-F5)"); // A new configuration was set, so we must reboot Microsoft.SPOT.Hardware.PowerState.RebootDevice(false); } } else { var config = new Configuration.LCD.Configurations(); //if (lcdConfig.LCDControllerEnabled == false) //{ // // EMX firmware has PixelClockDivider 0xFF as special value meaning "don't run" // config.PixelClockDivider = 0xff; //} config.Height = lcdConfig.Height; config.HorizontalBackPorch = lcdConfig.HorizontalBackPorch; config.HorizontalFrontPorch = lcdConfig.HorizontalFrontPorch; config.HorizontalSyncPolarity = lcdConfig.HorizontalSyncPolarity; config.HorizontalSyncPulseWidth = lcdConfig.HorizontalSyncPulseWidth; config.OutputEnableIsFixed = lcdConfig.OutputEnableIsFixed; config.OutputEnablePolarity = lcdConfig.OutputEnablePolarity; // removed //config.PixelClockDivider = lcdConfig.PixelClockDivider; // added config.PixelClockRateKHz = (uint)(72000 / lcdConfig.PixelClockDivider); config.PixelPolarity = lcdConfig.PixelPolarity; // removed //config.PriorityEnable = lcdConfig.PriorityEnable; config.VerticalBackPorch = lcdConfig.VerticalBackPorch; config.VerticalFrontPorch = lcdConfig.VerticalFrontPorch; config.VerticalSyncPolarity = lcdConfig.VerticalSyncPolarity; config.VerticalSyncPulseWidth = lcdConfig.VerticalSyncPulseWidth; config.Width = lcdConfig.Width; if (Configuration.LCD.Set(config)) { Debug.Print("Updating display configuration. THE MAINBOARD WILL NOW REBOOT."); Debug.Print("To continue debugging, you will need to restart debugging manually (Ctrl-Shift-F5)"); // A new configuration was set, so we must reboot Microsoft.SPOT.Hardware.PowerState.RebootDevice(false); } } }
/// <summary> /// This sets the LCD configuration. If the value GT.Mainboard.LCDConfiguration.HeadlessConfig (=null) is specified, no display support should be active. /// If a non-null value is specified but the property LCDControllerEnabled is false, the LCD controller should be disabled if present, /// though the Bitmap width/height for WPF should be modified to the Width and Height parameters. /// </summary> /// <param name="lcdConfig">The LCD Configuration</param> public override void SetLCD(GT.Mainboard.LCDConfiguration lcdConfig) { }