display_st7789v.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 2019 Marc Reilly
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ST7789V_DISPLAY_DRIVER_H__
  7. #define ST7789V_DISPLAY_DRIVER_H__
  8. #include <zephyr.h>
  9. #define ST7789V_CMD_SW_RESET 0x01
  10. #define ST7789V_CMD_SLEEP_IN 0x10
  11. #define ST7789V_CMD_SLEEP_OUT 0x11
  12. #define ST7789V_CMD_INV_OFF 0x20
  13. #define ST7789V_CMD_INV_ON 0x21
  14. #define ST7789V_CMD_GAMSET 0x26
  15. #define ST7789V_CMD_DISP_OFF 0x28
  16. #define ST7789V_CMD_DISP_ON 0x29
  17. #define ST7789V_CMD_CASET 0x2a
  18. #define ST7789V_CMD_RASET 0x2b
  19. #define ST7789V_CMD_RAMWR 0x2c
  20. #define ST7789V_CMD_MADCTL 0x36
  21. #define ST7789V_MADCTL_MY_TOP_TO_BOTTOM 0x00
  22. #define ST7789V_MADCTL_MY_BOTTOM_TO_TOP 0x80
  23. #define ST7789V_MADCTL_MX_LEFT_TO_RIGHT 0x00
  24. #define ST7789V_MADCTL_MX_RIGHT_TO_LEFT 0x40
  25. #define ST7789V_MADCTL_MV_REVERSE_MODE 0x20
  26. #define ST7789V_MADCTL_MV_NORMAL_MODE 0x00
  27. #define ST7789V_MADCTL_ML 0x10
  28. #define ST7789V_MADCTL_RBG 0x00
  29. #define ST7789V_MADCTL_BGR 0x08
  30. #define ST7789V_MADCTL_MH_LEFT_TO_RIGHT 0x00
  31. #define ST7789V_MADCTL_MH_RIGHT_TO_LEFT 0x04
  32. #define ST7789V_CMD_COLMOD 0x3a
  33. #define ST7789V_COLMOD_RGB_65K (0x5 << 4)
  34. #define ST7789V_COLMOD_RGB_262K (0x6 << 4)
  35. #define ST7789V_COLMOD_FMT_12bit (3)
  36. #define ST7789V_COLMOD_FMT_16bit (5)
  37. #define ST7789V_COLMOD_FMT_18bit (6)
  38. #define ST7789V_CMD_RAMCTRL 0xb0
  39. #define ST7789V_CMD_RGBCTRL 0xb1
  40. #define ST7789V_CMD_PORCTRL 0xb2
  41. #define ST7789V_CMD_CMD2EN 0xdf
  42. #define ST7789V_CMD_DGMEN 0xba
  43. #define ST7789V_CMD_GCTRL 0xb7
  44. #define ST7789V_CMD_VCOMS 0xbb
  45. #define ST7789V_CMD_LCMCTRL 0xc0
  46. #define ST7789V_LCMCTRL_XMY 0x40
  47. #define ST7789V_LCMCTRL_XBGR 0x20
  48. #define ST7789V_LCMCTRL_XINV 0x10
  49. #define ST7789V_LCMCTRL_XMX 0x08
  50. #define ST7789V_LCMCTRL_XMH 0x04
  51. #define ST7789V_LCMCTRL_XMV 0x02
  52. #define ST7789V_CMD_VDVVRHEN 0xc2
  53. #define ST7789V_CMD_VRH 0xc3
  54. #define ST7789V_CMD_VDS 0xc4
  55. #define ST7789V_CMD_FRCTRL2 0xc6
  56. #define ST7789V_CMD_PWCTRL1 0xd0
  57. #define ST7789V_CMD_PVGAMCTRL 0xe0
  58. #define ST7789V_CMD_NVGAMCTRL 0xe1
  59. #endif