Project Description.NET Micro Framework (NETMF) implementation of a driver for Vizic Smart GPU Software Version 2
This is a .NET Micro Framework implementation of the Vizic Smart GPU Driver, Software Version 2.0
Provided completely free for non-commercial use.
Additional Information:
Advantages over simple serial commands:
- Touch Events like Drag, Position Down, Position Up and Special Buttons
- Brightness, Foreground Color, Background Color and many others implemented as properties
- Supports Sleep Mode
- Supports Scene Mode (useful for animations)
- Seamless RGB to 16-bit color conversion
- All values are normalized: For example, brightness can go from 0 to 255; color values can go from 0 to 255.
- Well-documented with simple examples
This driver was developed and tested on the Netduino+ 2, but it is not using hardware-specific calls so a FEZ Hydra would be appropriate too. Minor modification would even allow for the driver to run on the Raspberry Pi GPIO.Example Usage:
public static class SampleTouchEvents
{
static public void RunSample(VizicBaudRates baudRate)
{
var lcd = new VizicSmartGpu();
lcd.BaudRate = baudRate;
// wire up the events
lcd.TouchData += lcd_TouchData;
lcd.TouchPositionDrag += lcd_TouchPositionDrag;
// Enable the touch eventing thread
lcd.TouchEventingEnabled = true;
}
static void lcd_TouchPositionDrag(object sender, VizicDragEventArgs e)
{
var lcd = sender as VizicSmartGpu;
if (lcd.SleepMode == false)
lcd.DrawLine(e.Start.X, e.Start.Y, e.End.X, e.End.Y);
}
static void lcd_TouchData(object sender, VizicTouchEventArgs e)
{
if (e.Data.ResponseType == VizicTouchResponseTypes.PositionData)
return;
var lcd = sender as VizicSmartGpu;
if (lcd.SleepMode) lcd.SleepMode = false;
if (e.Data.ResponseType == VizicTouchResponseTypes.HomeIcon)
lcd.ClearScreen();
if (e.Data.ResponseType == VizicTouchResponseTypes.SongIcon)
lcd.SDShowImage(0, 0, "bug24");
if (e.Data.ResponseType == VizicTouchResponseTypes.TelephoneIcon)
DrawImageFromBytes(lcd);
if (e.Data.ResponseType == VizicTouchResponseTypes.MessageIcon)
lcd.SleepMode = true;
if (e.Data.ResponseType == VizicTouchResponseTypes.BookIcon)
lcd.SleepMode = false;
}
}