". Net Micro Framework portingkit–13" LCD Driver Development

Source: Internet
Author: User
Tags volatile

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;
   }
};

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.