drv_lcd.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2019-03-07 ZYH first version
  9. */
  10. #ifndef DRV_LCD_H__
  11. #define DRV_LCD_H__
  12. int rt_hw_lcd_init(void);
  13. //POINT_COLOR
  14. #define WHITE 0xFFFF
  15. #define BLACK 0x0000
  16. #define BLUE 0x001F
  17. #define BRED 0XF81F
  18. #define GRED 0XFFE0
  19. #define GBLUE 0X07FF
  20. #define RED 0xF800
  21. #define MAGENTA 0xF81F
  22. #define GREEN 0x07E0
  23. #define CYAN 0x7FFF
  24. #define YELLOW 0xFFE0
  25. #define BROWN 0XBC40
  26. #define BRRED 0XFC07
  27. #define GRAY 0X8430
  28. #define GRAY175 0XAD75
  29. #define GRAY151 0X94B2
  30. #define GRAY187 0XBDD7
  31. #define GRAY240 0XF79E
  32. typedef enum _lcd_dir
  33. {
  34. DIR_XY_RLUD = 0x00,
  35. DIR_YX_RLUD = 0x20,
  36. DIR_XY_LRUD = 0x40,
  37. DIR_YX_LRUD = 0x60,
  38. DIR_XY_RLDU = 0x80,
  39. DIR_YX_RLDU = 0xA0,
  40. DIR_XY_LRDU = 0xC0,
  41. DIR_YX_LRDU = 0xE0,
  42. DIR_XY_MASK = 0x20,
  43. DIR_MASK = 0xE0,
  44. } lcd_dir_t;
  45. /* for mpy machine.lcd */
  46. void lcd_display_on(void);
  47. void lcd_display_off(void);
  48. void lcd_clear(int color);
  49. void lcd_draw_point_color(int x, int y, int color);
  50. void lcd_show_string(int x, int y, int size, const char *data);
  51. void lcd_draw_line(int x1, int y1, int x2, int y2);
  52. void lcd_draw_rectangle(int x1, int y1, int x2, int y2);
  53. void lcd_draw_circle(int x1, int y1, int r);
  54. void lcd_set_color(int back, int fore);
  55. void lcd_show_image(int x, int y, int length, int wide, const unsigned char *buf);
  56. int lcd_init(void);
  57. void lcd_set_direction(lcd_dir_t dir);
  58. #endif