drv_glcd.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*************************************************************************
  2. *
  3. * Used with ICCARM and AARM.
  4. *
  5. * (c) Copyright IAR Systems 2008
  6. *
  7. * File name : drv_glcd.h
  8. * Description : Graphical LCD driver include file
  9. *
  10. * History :
  11. * 1. Date : 6, March 2008
  12. * Author : Stanimir Bonev
  13. * Description : Create
  14. *
  15. *
  16. * $Revision: 24636 $
  17. *
  18. * @Modify: NXP MCU Application Team - NguyenCao
  19. * @Date: 04. March. 2011
  20. **************************************************************************/
  21. #include "lpc_types.h"
  22. #ifndef __GLCD_DRV_H
  23. #define __GLCD_DRV_H
  24. #ifndef EOF
  25. #define EOF (-1)
  26. #endif
  27. typedef unsigned long U32;
  28. typedef unsigned char U8;
  29. typedef unsigned long Boolean;
  30. /**
  31. * @brief A struct for Bitmap on LCD screen
  32. */
  33. typedef struct _Bmp_t
  34. {
  35. U32 H_Size;
  36. U32 V_Size;
  37. U32 BitsPP;
  38. U32 BytesPP;
  39. U32 *pPalette;
  40. U32 *pPicStream;
  41. U8 *pPicDesc;
  42. } Bmp_t, *pBmp_t;
  43. /**
  44. * @brief A struct for Font Type on LCD screen
  45. */
  46. typedef struct _FontType_t
  47. {
  48. U32 H_Size;
  49. U32 V_Size;
  50. U32 CharacterOffset;
  51. U32 CharactersNuber;
  52. U8 *pFontStream;
  53. U8 *pFontDesc;
  54. } FontType_t, *pFontType_t;
  55. typedef U32 LdcPixel_t, *pLdcPixel_t;
  56. #define C_GLCD_REFRESH_FREQ (60HZ)
  57. #define C_GLCD_H_SIZE 480
  58. #define C_GLCD_H_PULSE 2 //
  59. #define C_GLCD_H_FRONT_PORCH 5 //
  60. #define C_GLCD_H_BACK_PORCH 40 //
  61. #define C_GLCD_V_SIZE 272
  62. #define C_GLCD_V_PULSE 2
  63. #define C_GLCD_V_FRONT_PORCH 8
  64. #define C_GLCD_V_BACK_PORCH 8
  65. #define C_GLCD_PWR_ENA_DIS_DLY 10000
  66. #define C_GLCD_ENA_DIS_DLY 10000
  67. //Cursor 64x64 pixels
  68. #define CURSOR_H_SIZE 64
  69. #define CURSOR_V_SIZE 64
  70. //
  71. #define CIRCLE_R 18
  72. #define CRSR_PIX_32 0
  73. #define CRSR_PIX_64 1
  74. #define CRSR_ASYNC 0
  75. #define CRSR_FRAME_SYNC 2
  76. #define TEXT_DEF_TAB_SIZE 5
  77. #define TEXT_BEL1_FUNC()
  78. void GLCD_Init (void* VRAMBase);
  79. void GLCD_SetPallet (const U32 * pPallete);
  80. void GLCD_Ctrl (Bool bEna);
  81. void GLCD_Cursor_Cfg(int Cfg);
  82. void GLCD_Cursor_En(int cursor);
  83. void GLCD_Cursor_Dis(int cursor);
  84. void GLCD_Move_Cursor(int x, int y);
  85. void GLCD_Copy_Cursor (const U32 *pCursor, int cursor, int size);
  86. void GLCD_SetFont(pFontType_t pFont, LdcPixel_t Color, LdcPixel_t BackgndColor);
  87. void GLCD_SetWindow(U32 X_Left, U32 Y_Up,
  88. U32 X_Right, U32 Y_Down);
  89. void GLCD_TextSetPos(U32 X, U32 Y);
  90. void GLCD_TextSetTabSize(U32 Size);
  91. static void LCD_SET_WINDOW (U32 X_Left, U32 X_Right,
  92. U32 Y_Up, U32 Y_Down);
  93. static void LCD_WRITE_PIXEL (U32 Pixel);
  94. static Bool GLCD_TextCalcWindow (U32 * pXL, U32 * pXR,
  95. U32 * pYU, U32 * pYD,
  96. U32 * pH_Size, U32 * pV_Size);
  97. void GLCD_LoadPic (U32 X_Left, U32 Y_Up, Bmp_t * pBmp, U32 Mask);
  98. int _putchar (int c);
  99. #endif // __GLCD_DRV_H