lcd_5110_solution.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. * lcd_5110_solution.h
  3. *
  4. * Created on: 2012-2-2
  5. * Author: Administrator
  6. */
  7. #ifndef LCD_5110_SOLUTION_H_
  8. #define LCD_5110_SOLUTION_H_
  9. #include "main.h"
  10. //#include<unistd.h>
  11. //#include"system.h"
  12. //#include"altera_avalon_pio_regs.h"
  13. #include"alt_types.h"
  14. #include"Font6_8.h"
  15. #include"Icon10_8.h"
  16. #include"Font8_16.h"
  17. #include"Font16_16.h"
  18. #include"Bitmap.h"
  19. /*Private define-------------------------*/
  20. #define POINT_COLOR RED
  21. #define BACK_COLOR 0xFFFF
  22. /*--------16λÑÕɫֵ---------------*/
  23. #define WHITE 0xFFFF
  24. #define BLACK 0x0000
  25. #define BLUE 0x001F
  26. #define RED 0xF800
  27. #define MAGENTA 0xF81F
  28. #define GREEN 0x07E0
  29. #define CYAN 0x7FFF
  30. #define YELLOW 0xFFE0
  31. #define BROWN 0XBC40 //רɫ
  32. #define BRRED 0XFC07 //רºìÉ«
  33. #define GRAY 0X8430 //»ÒÉ«
  34. #define LGRAY 0XC618 //dz»ÒÉ«
  35. extern char n5110_string[6][14];
  36. //write a byte
  37. void LcdWrite(alt_u8 data,alt_u8 d_c);
  38. //initial the 5110
  39. void InitLcd(void);
  40. //set the position of x axis and y axis
  41. void SetXY(alt_u8 x,alt_u8 y);
  42. //clear screen
  43. void LcdClearAll();
  44. //write a char(6*8),don't need coordinates
  45. void WriteChar(alt_u8 value);
  46. //write a char(6*8),need coordinates
  47. void PutChar(alt_u8 value,alt_u8 x,alt_u8 y);
  48. //write a string(6*8),don't need coordinates
  49. void WriteStr(char * str);
  50. //write a string(6*8),need coordinates,auto line breaks
  51. void PutStr(char * str,alt_u8 x,alt_u8 y);
  52. //draw a sign(6*8),don't need coordinates
  53. void WriteSign(char * sign);
  54. //draw a sign(6*8),need coordinates
  55. void DrawSign(char * sign,alt_u8 x,alt_u8 y);
  56. //draw a sign(10*8),don't need coordinates
  57. void WriteIcon(char * icon);
  58. //draw a sign(10*8),need coordinates,x is between 0 and 74
  59. void DrawIcon(char * icon,alt_u8 x,alt_u8 y);
  60. //write a char(8*16)
  61. void WriteChar_8_16(alt_u8 value,alt_u8 x,alt_u8 y);
  62. //write a string(8*16),auto line breaks,x is between 0 and 76
  63. void WriteStr_8_16(char * str,alt_u8 x,alt_u8 y);
  64. //write a Chinese character(16*16)
  65. void WriteHanzi(char * Hanzi,alt_u8 x,alt_u8 y);
  66. //write a Chinese sentence(16*16),auto line breaks,x is between 0 and 58
  67. void WriteHanziStr(char * Hanzi,alt_u8 x,alt_u8 y,alt_u8 num);
  68. //draw a picture(84*48),don't need coordinates
  69. void DrawPicture(char bitmap[]);
  70. //draw a picture(width*height(a multiple of 8)),need coordinates
  71. void DrawBitmap(char bitmap[],alt_u8 x,alt_u8 y,alt_u8 width,alt_u8 height);
  72. void RefreshLCD ( void );
  73. void LCD_ShowString(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor);
  74. void GUI_Put(u16 x, u16 y, u8 *str,u32 PenColor, u32 BackColor);
  75. #endif /* LCD_5110_SOLUTION_H_ */