luat_lcd_st7796.c 920 B

123456789101112131415161718192021222324252627282930313233
  1. #include "luat_base.h"
  2. #include "luat_lcd.h"
  3. #define LUAT_LOG_TAG "st7796"
  4. #include "luat_log.h"
  5. static const uint16_t st7796_init_cmds[] = {
  6. 0x02f0,0x03c3,
  7. 0x02f0,0x0396,
  8. /* RGB 5-6-5-bit */
  9. 0x023A,0x0355,
  10. 0x02B4,0x0301,
  11. 0x02B7,0x03C6,
  12. 0x02e8,0x0340,0x038a,0x0300,0x0300,0x0329,0x0319,0x03a5,0x0333,
  13. 0x02c1,0x0306,
  14. 0x02c2,0x03a7,
  15. 0x02c5,0x0318,
  16. 0x02e0,0x03f0,0x0309,0x030b,0x0306,0x0304,0x0315,0x032f,0x0354,0x0342,0x033c,0x0317,0x0314,0x0318,0x031b,
  17. 0x02e1,0x03f0,0x0309,0x030b,0x0306,0x0304,0x0303,0x032d,0x0343,0x0342,0x033b,0x0316,0x0314,0x0317,0x031b,
  18. 0x02f0,0x033c,
  19. 0x02f0,0x0369,
  20. };
  21. luat_lcd_opts_t lcd_opts_st7796 = {
  22. .name = "st7796",
  23. .init_cmds_len = sizeof(st7796_init_cmds)/sizeof(st7796_init_cmds[0]),
  24. .init_cmds = st7796_init_cmds,
  25. .direction0 = 0x48,
  26. .direction90 = 0x28,
  27. .direction180 = 0x88,
  28. .direction270 = 0xE8
  29. };