Hi all,
Today I received my FEZ Cerberus and N18 display.
After updating firmware ready to give it a try.
Took the sample from http://www.tinyclr.com/codeshare/entry/636 and copied the example program (below)
using System;
using System.Collections;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;
using Gadgeteer.Networking;
using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;
namespace N18_Test
{
public partial class Program
{
GTM.GHIElectronics.Display_N18 display_N18;
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
/*******************************************************************************************
Modules added in the Program.gadgeteer designer view are used by typing
their name followed by a period, e.g. button. or camera.
Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
button.ButtonPressed +=<tab><tab>
If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
timer.Tick +=<tab><tab>
timer.Start();
*******************************************************************************************/
display_N18 = new GTM.GHIElectronics.Display_N18(5);
display_N18.Initialize(4000);
///////////////////////////////////////////////////////////////////////////////////////////////
// Usage example #1. Simple Graphics support.
display_N18.SimpleGraphics.Clear();
display_N18.SimpleGraphics.DisplayText("Hello World!", Resources.GetFont(Resources.FontResources.NinaB), GT.Color.Red, 5, 5);
///////////////////////////////////////////////////////////////////////////////////////////////
// Usage example #2. Passing a Bitmap to the driver.
Bitmap picture = Resources.GetBitmap(Resources.BitmapResources.LogoFSE_zwarte_achtegrond );
display_N18.DrawBitmap(picture);
// Usage example #3. Passing raw bitmap information to the driver, placing it at a certain location.
byte[] newRender = new byte[100 * 100 * 4];
Bitmap pic2 = Resources.GetBitmap(Resources.BitmapResources.LogoFSE_zwarte_achtegrond);
Array.Copy(pic2.GetBitmap(), newRender, newRender.Length);
display_N18.DrawBitmapRawData(newRender, 0, 0, 100, 100);
// Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
Debug.Print("Program Started");
}
}
}
When run, the mentioned exception occurs in the driver, in the function below, at the line
GTM.Module.Mainboard.NativeBitmapConverter(/bitmapbytes/bitmapData, vram, Mainboard.BPP.BPP16_BGR_BE);
The debugger states NativeBitmapConverter() is null?
public void DrawBitmapRawData(byte[] bitmapData, uint x, uint y, uint width, uint height)
{
SetClippingArea(x, y, width-1, height-1);
{
WriteCommand(0x2C);
if(vram != null)
{
if (vram.Length != (width * height * 2))
vram = new byte[width * height * 2];
}
else
vram = new byte[width * height * 2];
GTM.Module.Mainboard.NativeBitmapConverter(/*bitmapbytes*/bitmapData, vram, Mainboard.BPP.BPP16_BGR_BE);
DataWrite(vram);
}
SetClippingArea(0, 0, Width, Height);
}
Is there a bug in the driver?