luat_lcd_st7735.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "luat_base.h"
  2. #include "luat_lcd.h"
  3. #define LUAT_LOG_TAG "st7735"
  4. #include "luat_log.h"
  5. static const uint16_t st7735_init_cmds[] = {
  6. 0x02B1,0x0305,0x033C,0x033C,
  7. 0x02B2,0x0305,0x033C,0x033C,
  8. 0x02B3,0x0305,0x033C,0x033C,0x0305,0x033C,0x033C,
  9. //------------------------------------End ST7735S Frame Rate---------------------------------//
  10. 0x02B4,0x0303,
  11. //------------------------------------ST7735S Power Sequence---------------------------------//
  12. 0x02C0,0x0328,0x0308,0x0304,
  13. 0x02C1,0x03C0,
  14. 0x02C2,0x030D,0x0300,
  15. 0x02C3,0x038D,0x032A,
  16. 0x02C4,0x038D,0x03EE,
  17. //---------------------------------End ST7735S Power Sequence-------------------------------------//
  18. 0x02C5,0x031A,
  19. //------------------------------------ST7735S Gamma Sequence---------------------------------//
  20. 0x02E0,0x0304,0x0322,0x0307,0x030A,0x032E,0x0330,0x0325,0x032A,0x0328,0x0326,0x032E,0x033A,0x0300,0x0301,0x0303,0x0313,
  21. 0x02E1,0x0304,0x0316,0x0306,0x030D,0x032D,0x0326,0x0323,0x0327,0x0327,0x0325,0x032D,0x033B,0x0300,0x0301,0x0304,0x0313,
  22. 0x023A,0x0305,
  23. };
  24. luat_lcd_opts_t lcd_opts_st7735 = {
  25. .name = "st7735",
  26. .init_cmds_len = sizeof(st7735_init_cmds)/sizeof(st7735_init_cmds[0]),
  27. .init_cmds = st7735_init_cmds,
  28. .direction0 = 0xC0,
  29. .direction90 = 0x70,
  30. .direction180 = 0x00,
  31. .direction270 = 0xA0,
  32. .rb_swap = 1,
  33. };