lcd_console.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-11-09 bigmagic first version
  9. */
  10. #ifndef __LCD_CONSOLE_H__
  11. #define __LCD_CONSOLE_H__
  12. #include <rtthread.h>
  13. #define RGB(r, g, b) ((((r))<<16) | (((g))<<8) | ((b)))
  14. #define COLOR_BLACK RGB(0, 0, 0)
  15. #define COLOR_GREEN RGB(0, 255, 0)
  16. #define COLOR_CYAN RGB(0, 255, 255)
  17. #define COLOR_RED RGB(255, 0, 0)
  18. #define COLOR_YELLOW RGB(255, 255, 0)
  19. #define COLOR_WHITE RGB(255, 255, 255)
  20. #define CONSOLE_WHITE_32 COLOR_WHITE
  21. #define CONSOLE_BLACK_32 COLOR_BLACK
  22. #define CONSOLE_GREEN_32 COLOR_GREEN
  23. #define CONSOLE_CYAN_32 COLOR_CYAN
  24. #define CONSOLE_RED_32 COLOR_RED
  25. #define RGB16(r, g, b) ((((r))<<11) | (((g))<<5) | ((b)))
  26. #define CONSOLE_YELLOW_16 RGB16(0x1f,0x3f,0)
  27. #define CONSOLE_WHITE_16 RGB16(0x1f,0x3f,0x1f)
  28. #define CONSOLE_BLACK_16 RGB16(0,0,0)
  29. #define CONSOLE_GREEN_16 RGB16(0,0x3f,0)
  30. #define CONSOLE_CYAN_16 RGB16(0,0x3f,0x1f)
  31. #define CONSOLE_RED_16 RGB16(0x1f,0,0)
  32. typedef struct
  33. {
  34. rt_uint32_t width;
  35. rt_uint32_t height;
  36. rt_uint32_t vwidth;
  37. rt_uint32_t vheight;
  38. rt_uint32_t pitch;
  39. rt_uint32_t depth;
  40. rt_uint32_t fore;
  41. rt_uint32_t back;
  42. rt_uint32_t x;
  43. rt_uint32_t y;
  44. rt_uint32_t vaddr;
  45. rt_uint32_t paddr;
  46. rt_uint32_t size;
  47. } fb_t;
  48. void fb_print(char *s);
  49. int lcd_console_init(void);
  50. #endif//CONSOLE