1 / 14

NET+OS 6.1 Training

NET+OS 6.1 Training. LCD Driver. LCD Driver. LCD Driver API in BSP Open Sequence Close Sequence ioctl Requests LCD_PANEL_INFO_TYPE FRAME_BUFFER_TYPE PALETTE_ENTRY_TYPE. LCD Driver API. open(): open a display device ioctl(): set up/change/get display device info

elenal
Download Presentation

NET+OS 6.1 Training

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. NET+OS 6.1 Training NetSilicon & Digi Confidential

  2. LCD Driver NetSilicon & Digi Confidential

  3. LCD Driver • LCD Driver API in BSP • Open Sequence • Close Sequence • ioctl Requests • LCD_PANEL_INFO_TYPE • FRAME_BUFFER_TYPE • PALETTE_ENTRY_TYPE NetSilicon & Digi Confidential

  4. LCD Driver API • open(): open a display device • ioctl(): set up/change/get display device info • close(): close a display device • read()—not implemented • write()—not implemented NetSilicon & Digi Confidential

  5. Open Sequence • Open the device fd = open ("/display/0", O_RDWR); • Set up the LCD display retval = ioctl (fd, LCD_SET_DISPLAY_TYPE, (void *)&lcdInfo); • Control enable on = 1; retval = ioctl (fd, LCD_SET_CONTROL_ENABLE, (void *)&on); • Delay according to LCD data sheet tx_thread_sleep (TFT_DELAY_TIME); • Power enable on = 1; retval = ioctl (fd, LCD_SET_POWER_ENABLE, (void *)&on); NetSilicon & Digi Confidential

  6. Close Sequence • Disable LCD power on =0; ioctl (fd, LCD_SET_POWER_ENABLE, (void *)&on); • Delay according to LCD data sheet tx_thread_sleep (TFT_DELAY_TIME); • Disable LCD control on=0; ioctl (fd, LCD_SET_CONTROL_ENABLE, (void *)&on); • Close device close (fd); NetSilicon & Digi Confidential

  7. ioctl Requests • LCD_SET_DISPLAY_TYPE • LCD_SET_CONTROL_ENABLE • LCD_SET_POWER_ENABLE • LCD_GET_PRIMARY_BUFFER • LCD_GET_CURRENT_BUFFER • LCD_SET_SWITCH_BUFFER • LCD_SET_PALETTE_ENTRY • LCD_GET_DISPLAY_WIDTH • LCD_GET_DISPLAY_HEIGHT • LCD_GET_DISPLAY_BPP • LCD_GET_DISPLAY_BYTEORDER • LCD_GET_DISPLAY_PIXELORDER • LCD_GET_DISPLAY_TYPE • LCD_GET_PALETTE_SIZE NetSilicon & Digi Confidential

  8. LCD_PANEL_INFO_TYPE typedef struct { int lcdType; int lcdColor; int lcdMono8; int lcdWidth; int lcdHeight; unsigned char lcdBpp; unsigned char lcdClockSelect; int lcdBypassPixelClockDivider; unsigned char lcdPanelClockDivisor; int lcdPixelOrder; int lcdByteOrder; int lcdRGB; unsigned char lcdHorzBackPorch; unsigned char lcdHorzFrontPorch; unsigned char lcdHorzSyncPulseWidth; unsigned char lcdVertBackPorch; unsigned char lcdVertFrontPorch; unsigned char lcdVertSyncPulseWidth; int lcdInvertOutputEnable; int lcdInvertPanelClock; int lcdInvertHorzSync; int lcdInvertVertSync; unsigned char lcdAcBiasPinFrequency; int lcdLineEndEnable; unsigned char lcdLineEndDelay; } LCD_PANEL_INFO_TYPE; NetSilicon & Digi Confidential

  9. FRAME_BUFFER_TYPE typedef struct { char* frameBuffer; int frameBufferLength; } FRAME_BUFFER_TYPE; frameBuffer can’t be in WRITE_BACK cached memory region NetSilicon & Digi Confidential

  10. PALETTE_ENTRY_TYPE typedef struct { int paletteIndex; int intensity; unsigned char red; unsigned char green; unsigned char blue; } PALETTE_ENTRY_TYPE; NetSilicon & Digi Confidential

  11. GUI API • Separate Library • Pixel API - put one pixel on the display - dcPutPixel() • Bitmap API - decode and display a bitmap file - dcDecodeBitmapHeader() - dcDisplayBmp() - dcSetUpPaletteFromBitmap NetSilicon & Digi Confidential

  12. Double Buffering • Call dcPutPixel() with an user frame buffer • Call ioctl with request LCD_SET_SWITCH_BUFFER • Call dcDisplayBmp() with an user frame buffer • Call ioctl with request LCD_SET_SWITCH_BUFFER NetSilicon & Digi Confidential

  13. For example: dcPutPixel() int dcPutPixel ( int fd, FRAME_BUFFER_TYPE *frameBuffer, int x, int y, unsigned char red, unsigned char green, unsigned char blue, int intensity); NetSilicon & Digi Confidential

  14. References • HW manual • Auto doc: LCD driver and GUI library • Examples/lcd_tft24 • Data sheets: - Sharp: LQ10D421 - Sharp: LM057QC1T01 - Grand Pacific Optoelectronics Corp: GPG240X320-NFPDELW3 - LG. Philips LCD Co. , Ltd: LCD130V01 NetSilicon & Digi Confidential

More Related