LCD driver is not necessary for TINYCLR, especially on the em-stm3210e Development Board, because the memory on the Development Board is too small, the chip 64K, outside the expansion of 128K, add up is not 172K, and we know that for the 320*240 display size, The size of the 16bit bitmap is 150K, and obviously the. Net Micro Framework provides a graphics library that is hard to run without modification, but for us to display text information on the LCD screen is also worth looking forward to, if you modify the graphics library, draw a line on the LCD, Drawing a circle and showing a single figure is never a problem.
Compared with the drivers we have developed before, LCD drive development is more cumbersome, because the LCD driver code is scattered in three directories (digression, I think for the. Net Micro Framework, the most difficult driver is the network card driver (especially WiFi drive), followed by the USB driver , LCD drives are a piece of cake compared to them.
Similar to other drivers, before the specific LCD driver, we write an LCD register in the CortexM3.h header file, so as to operate the LCD registers, which is actually a style of the. Net Micro Framework driver code.
struct CortexM3_LCD
{
//LCD /CS is CE4 - Bank 4 of NOR/SRAM Bank 1~4
static const UINT32 c_Base = 0x6C000000;
/****/ volatile UINT16 REG;
/****/ volatile UINT16 RAM;
void WriteReg(UINT8 Reg,UINT16 Value)
{
REG = Reg;
RAM = Value;
}
UINT16 ReadReg(UINT8 Reg)
{
REG = Reg;
return RAM;
}
void SetCursor(UINT16 x,UINT16 y)
{
WriteReg(32,x);
WriteReg(33,y);
}
void SetPixel(UINT16 x,UINT16 y,UINT16 c)
{
WriteReg(32,x);
WriteReg(33,y);
WriteReg(34,c);
}
void WriteRAM_Prepare()
{
REG = 34;
}
};