luat_lcd_st7735s.c 958 B

1234567891011121314151617181920212223242526272829303132
  1. #include "luat_base.h"
  2. #include "luat_lcd.h"
  3. #define LUAT_LOG_TAG "st7735s"
  4. #include "luat_log.h"
  5. static const uint16_t st7735s_init_cmds[] = {
  6. 0x02B1,0x0305,0x033C,0x033C,
  7. 0x02B2,0x0305,0x033C,0x033C,
  8. 0x02B3,0x0305,0x033C,0x033C,0x0305,0x033C,0x033C,
  9. 0x02B4,0x0303,
  10. 0x02C0,0x03AB,0x030B,0x0304,
  11. 0x02C1,0x03C5,
  12. 0x02C2,0x030D,0x0300,
  13. 0x02C3,0x038D,0x036A,
  14. 0x02C4,0x038D,0x03EE,
  15. 0x02C5,0x030F,
  16. 0x02E0,0x0307,0x030E,0x0308,0x0307,0x0310,0x0307,0x0302,0x0307,0x0309,0x030F,0x0325,0x0336,0x0300,0x0308,0x0304,0x0310,
  17. 0x02E1,0x030A,0x030D,0x0308,0x0307,0x030F,0x0307,0x0302,0x0307,0x0309,0x030F,0x0325,0x0335,0x0300,0x0309,0x0304,0x0310,
  18. 0x02FC,0x0380,
  19. 0x023A,0x0305,
  20. };
  21. luat_lcd_opts_t lcd_opts_st7735s = {
  22. .name = "st7735s",
  23. .init_cmds_len = sizeof(st7735s_init_cmds)/sizeof(st7735s_init_cmds[0]),
  24. .init_cmds = st7735s_init_cmds,
  25. .direction0 = 0x08,
  26. .direction90 = 0xC8,
  27. .direction180 = 0x78,
  28. .direction270 = 0xA8
  29. };