/// <summary> /// Initiate the TFT: /// <list type="bullet"> /// <item><description>Instantiate driver for a ILI9341</description></item> /// <item><description>Clear the screen</description></item> /// <item><description>Seton the backlight</description></item> /// <item><description>Fill the font structure</description></item> /// <item><description>Abstract board info in stand alone text</description></item> /// </list> /// </summary> private static void InitDisplay() { // Initiate our little driver tft = new LCD(Orientation.Landscape); // Well, clear the screen tft.ClearScreen(); // Backlight is always on, on STM32F429 tft.BackLight = true; // Get a helper font font = new HelpersFont(DejaVuMono8.Bitmaps, DejaVuMono8.Descriptors, DejaVuMono8.Height, DejaVuMono8.FontSpace); // Break apart the system build string all = SystemInfo.OEMString; idx1 = all.IndexOf('@'); idx2 = all.IndexOf("built"); idx3 = all.IndexOf("ChibiOS"); who = all.Substring(0, idx1 - 1).Trim(); what = all.Substring(idx1 + 1, idx2 - (idx1 + 1)).Trim(); with = all.Substring(idx3).Trim(); ver = SystemInfo.Version.ToString(); }
/// <summary> /// Display some standard board info /// </summary> private static void DisplayBoardInfo() { // Well, clear the screen tft.ClearScreen(); // And let us know who we are tft.DrawString(10, 10, "Hello World of nanoFramework", Color565.White, Color565.Black, font); tft.DrawString(10, 40, "System . " + who, Color565.White, Color565.Black, font); tft.DrawString(10, 55, "Board . . " + what, Color565.White, Color565.Black, font); tft.DrawString(10, 70, "RTOS . . " + with, Color565.White, Color565.Black, font); tft.DrawString(10, 85, "HAL . . . " + ver, Color565.White, Color565.Black, font); // Get the used memory _used = _avail - Debug.GC(false); // Put it on screen tft.DrawString(10, 110, "Memory:", Color565.White, Color565.Black, font); tft.DrawString(25, 125, "Maximum . . " + _avail.ToString(), Color565.White, Color565.Black, font); tft.DrawString(25, 140, "Used . . . " + _used.ToString(), Color565.White, Color565.Black, font); }