de_lark.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367
  1. /*
  2. * Copyright (c) 2020 Actions Technology Co., Ltd
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_LARK_H_
  7. #define ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_LARK_H_
  8. #include <zephyr/types.h>
  9. #include <sys/util.h>
  10. /* Reg DE_CTL */
  11. #define DE_CTL_OUT_FORMAT_SEL(x) ((uint32_t)(x) << 2)
  12. #define DE_CTL_OUT_FORMAT_RGB565 DE_CTL_OUT_FORMAT_SEL(0)
  13. #define DE_CTL_OUT_FORMAT_RGB666 DE_CTL_OUT_FORMAT_SEL(1)
  14. #define DE_CTL_OUT_FORMAT_RGB888 DE_CTL_OUT_FORMAT_SEL(2)
  15. #define DE_CTL_OUT_FORMAT_RGB888_WB_ARGB8888 DE_CTL_OUT_FORMAT_SEL(3)
  16. #define DE_CTL_OUT_COLOR_FILL_EN (0x1 << 5)
  17. #define DE_CTL_OUT_MODE_SEL(x) ((uint32_t)(x) << 8)
  18. #define DE_CTL_OUT_MODE_MASK DE_CTL_OUT_MODE_SEL(3)
  19. #define DE_CTL_OUT_MODE_DISPLAY DE_CTL_OUT_MODE_SEL(0)
  20. #define DE_CTL_OUT_MODE_DISPLAY_WB DE_CTL_OUT_MODE_SEL(1)
  21. #define DE_CTL_OUT_MODE_WB DE_CTL_OUT_MODE_SEL(2)
  22. #define DE_CTL_WB_NO_STRIDE_EN(en) ((uint32_t)(en) << 29)
  23. #define DE_CTL_TRANSFER_MODE_SEL(x) ((uint32_t)(x) << 12)
  24. #define DE_CTL_TRANSFER_MODE_MASK DE_CTL_TRANSFER_MODE_SEL(1)
  25. #define DE_CTL_TRANSFER_MODE_TRIGGER DE_CTL_TRANSFER_MODE_SEL(0)
  26. #define DE_CTL_TRANSFER_MODE_CONTINUE DE_CTL_TRANSFER_MODE_SEL(1)
  27. #define DE_FORMAT_RGB565 (0)
  28. #define DE_FORMAT_RGB666 (1)
  29. #define DE_FORMAT_RGB888 (2)
  30. #define DE_FORMAT_ARGB (3)
  31. #define DE_FORMAT_BGRA (4)
  32. #define DE_FORMAT_AX (5)
  33. #define DE_CTL_L0_EN BIT(20)
  34. #define DE_CTL_L0_HALFWORD_EN(en) ((uint32_t)(en) << 0)
  35. #define DE_CTL_L0_NO_STRIDE_EN(en) ((uint32_t)(en) << 31)
  36. #define DE_CTL_L0_FORMAT(de_fmt, rb_swap, g_swap, is_6666) \
  37. (((uint32_t)(de_fmt) << 15) | ((uint32_t)(rb_swap) << 18) | \
  38. ((uint32_t)(!(g_swap)) << 14) | ((uint32_t)(is_6666) << 19))
  39. #define DE_CTL_L0_FORMAT_RGB565 DE_CTL_L0_FORMAT(DE_FORMAT_RGB565, 0, 0, 0)
  40. #define DE_CTL_L0_FORMAT_BGR565 DE_CTL_L0_FORMAT(DE_FORMAT_RGB565, 1, 0, 0)
  41. #define DE_CTL_L0_FORMAT_RGB565_SWAP DE_CTL_L0_FORMAT(DE_FORMAT_RGB565, 0, 1, 0)
  42. #define DE_CTL_L0_FORMAT_BGR565_SWAP DE_CTL_L0_FORMAT(DE_FORMAT_RGB565, 1, 1, 0)
  43. #define DE_CTL_L0_FORMAT_RGB666 DE_CTL_L0_FORMAT(DE_FORMAT_RGB666, 0, 0, 0)
  44. #define DE_CTL_L0_FORMAT_BGRB666 DE_CTL_L0_FORMAT(DE_FORMAT_RGB666, 1, 0, 0)
  45. #define DE_CTL_L0_FORMAT_RGB888 DE_CTL_L0_FORMAT(DE_FORMAT_RGB888, 0, 0, 0)
  46. #define DE_CTL_L0_FORMAT_BGR888 DE_CTL_L0_FORMAT(DE_FORMAT_RGB888, 1, 0, 0)
  47. #define DE_CTL_L0_FORMAT_ARGB8888 DE_CTL_L0_FORMAT(DE_FORMAT_ARGB, 0, 0, 0)
  48. #define DE_CTL_L0_FORMAT_ABGR8888 DE_CTL_L0_FORMAT(DE_FORMAT_ARGB, 1, 0, 0)
  49. #define DE_CTL_L0_FORMAT_BGRA8888 DE_CTL_L0_FORMAT(DE_FORMAT_BGRA, 0, 0, 0)
  50. #define DE_CTL_L0_FORMAT_RGBA8888 DE_CTL_L0_FORMAT(DE_FORMAT_BGRA, 1, 0, 0)
  51. #define DE_CTL_L0_FORMAT_ARGB6666 DE_CTL_L0_FORMAT(DE_FORMAT_ARGB, 0, 0, 1)
  52. #define DE_CTL_L0_FORMAT_ABGR6666 DE_CTL_L0_FORMAT(DE_FORMAT_ARGB, 1, 0, 1)
  53. #define DE_CTL_L0_FORMAT_BGRA6666 DE_CTL_L0_FORMAT(DE_FORMAT_BGRA, 0, 0, 1)
  54. #define DE_CTL_L0_FORMAT_RGBA6666 DE_CTL_L0_FORMAT(DE_FORMAT_BGRA, 1, 0, 1)
  55. #define DE_CTL_L0_FORMAT_AX DE_CTL_L0_FORMAT(DE_FORMAT_AX, 0, 0, 0)
  56. #define DE_CTL_L1_EN BIT(26)
  57. #define DE_CTL_L1_HALFWORD_EN(en) ((uint32_t)(en) << 1)
  58. #define DE_CTL_L1_NO_STRIDE_EN(en) ((uint32_t)(en) << 30)
  59. #define DE_CTL_L1_COLOR_FILL_EN BIT(28)
  60. #define DE_CTL_L1_FORMAT(de_fmt, rb_swap, g_swap, is_6666) \
  61. (((uint32_t)(de_fmt) << 21) | ((uint32_t)(rb_swap) << 24) | \
  62. ((uint32_t)(!(g_swap)) << 27) | ((uint32_t)(is_6666) << 25))
  63. #define DE_CTL_L1_FORMAT_RGB565 DE_CTL_L1_FORMAT(DE_FORMAT_RGB565, 0, 0, 0)
  64. #define DE_CTL_L1_FORMAT_BGR565 DE_CTL_L1_FORMAT(DE_FORMAT_RGB565, 1, 0, 0)
  65. #define DE_CTL_L1_FORMAT_RGB565_SWAP DE_CTL_L1_FORMAT(DE_FORMAT_RGB565, 0, 1, 0)
  66. #define DE_CTL_L1_FORMAT_BGR565_SWAP DE_CTL_L1_FORMAT(DE_FORMAT_RGB565, 1, 1, 0)
  67. #define DE_CTL_L1_FORMAT_RGB666 DE_CTL_L1_FORMAT(DE_FORMAT_RGB666, 0, 0, 0)
  68. #define DE_CTL_L1_FORMAT_BGR666 DE_CTL_L1_FORMAT(DE_FORMAT_RGB666, 1, 0, 0)
  69. #define DE_CTL_L1_FORMAT_RGB888 DE_CTL_L1_FORMAT(DE_FORMAT_RGB888, 0, 0, 0)
  70. #define DE_CTL_L1_FORMAT_BGR888 DE_CTL_L1_FORMAT(DE_FORMAT_RGB888, 1, 0, 0)
  71. #define DE_CTL_L1_FORMAT_ARGB8888 DE_CTL_L1_FORMAT(DE_FORMAT_ARGB, 0, 0, 0)
  72. #define DE_CTL_L1_FORMAT_ABGR8888 DE_CTL_L1_FORMAT(DE_FORMAT_ARGB, 1, 0, 0)
  73. #define DE_CTL_L1_FORMAT_BGRA8888 DE_CTL_L1_FORMAT(DE_FORMAT_BGRA, 0, 0, 0)
  74. #define DE_CTL_L1_FORMAT_RGBA8888 DE_CTL_L1_FORMAT(DE_FORMAT_BGRA, 1, 0, 0)
  75. #define DE_CTL_L1_FORMAT_ARGB6666 DE_CTL_L1_FORMAT(DE_FORMAT_ARGB, 0, 0, 1)
  76. #define DE_CTL_L1_FORMAT_ABGR6666 DE_CTL_L1_FORMAT(DE_FORMAT_ARGB, 1, 0, 1)
  77. #define DE_CTL_L1_FORMAT_BGRA6666 DE_CTL_L1_FORMAT(DE_FORMAT_BGRA, 0, 0, 1)
  78. #define DE_CTL_L1_FORMAT_RGBA6666 DE_CTL_L1_FORMAT(DE_FORMAT_BGRA, 1, 0, 1)
  79. #define DE_CTL_L1_FORMAT_AX DE_CTL_L1_FORMAT(DE_FORMAT_AX, 0, 0, 0)
  80. #define DE_L_POS(x, y) (((uint32_t)(y) << 16) | (x))
  81. #define DE_L_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  82. #define DE_L_COLOR_GAIN(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  83. #define DE_L_COLOR_OFFSET(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  84. #define DE_L_DEF_COLOR(a, r, g, b) \
  85. (((uint32_t)(a) << 24) | ((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  86. /* Reg DE_GATE_CTL */
  87. #define DE_LAYER_GATING_EN BIT(0)
  88. #define DE_OUTPUT_GATING_EN BIT(1)
  89. #define DE_GAMMA_AHB_GATING_EN BIT(2)
  90. #define DE_PATH_GATING_EN BIT(3)
  91. #define DE_ROTATE_GATING_EN BIT(4)
  92. /* Reg DE_CTL2 */
  93. #define DE_CTL2_WB_START BIT(0)
  94. #define DE_CTL2_OUT_FIFO_RESET BIT(1)
  95. #define DE_CTL2_WB_FIFO_RESET BIT(2)
  96. #define DE_CTL2_L0_FIFO_RESET BIT(3)
  97. #define DE_CTL2_L1_FIFO_RESET BIT(4)
  98. /* Reg DE_MEM_OPT */
  99. #define DE_MEM_BURST_LEN_SEL(x) ((uint32_t)(x) << 8)
  100. #define DE_MEM_BURST_LEN_MASK DE_MEM_BURST_LEN_SEL(3)
  101. #define DE_MEM_BURST_8 DE_MEM_BURST_LEN_SEL(0)
  102. #define DE_MEM_BURST_16 DE_MEM_BURST_LEN_SEL(1)
  103. #define DE_MEM_BURST_32 DE_MEM_BURST_LEN_SEL(2)
  104. #define DE_MEM_SWITCH_EN BIT(6)
  105. #define DE_MEM_CMD_NUM_SEL(x) (((uint32_t)(x) & 0x3f) << 0)
  106. #define DE_MEM_CMD_NUM_MASK DE_MEM_CMD_NUM_SEL(0x3f)
  107. #define DE_SW_FRAME_RST_LEN(x) (((uint32_t)(x) & 0x3f) << 10)
  108. #define DE_SW_FRAME_RST_MASK DE_MEM_CMD_NUM_SEL(0x3f)
  109. /* Reg DE_IRQ_CTL */
  110. #define DE_IRQ_PRELINE BIT(0)
  111. #define DE_IRQ_L0_FIFO_UDF BIT(1) /* under flow*/
  112. #define DE_IRQ_L0_FIFO_OVF BIT(2) /* over flow*/
  113. #define DE_IRQ_L1_FIFO_UDF BIT(3)
  114. #define DE_IRQ_L1_FIFO_OVF BIT(4)
  115. #define DE_IRQ_L0_FTC BIT(5) /* frame transfer complete */
  116. #define DE_IRQ_L1_FTC BIT(6)
  117. #define DE_IRQ_WB_FIFO_UDF BIT(8)
  118. #define DE_IRQ_WB_FIFO_OVF BIT(9)
  119. #define DE_IRQ_DEV_FIFO_UDF BIT(10)
  120. #define DE_IRQ_DEV_FIFO_OVF BIT(11)
  121. #define DE_IRQ_VSYNC BIT(16)
  122. #define DE_IRQ_DEV_FIFO_HF BIT(29) /* half full */
  123. #define DE_IRQ_WB_FTC BIT(30)
  124. #define DE_IRQ_DEV_FTC BIT(31)
  125. /* Reg DE_STA */
  126. #define DE_STAT_L0_MEM_ERR BIT(0)
  127. #define DE_STAT_L1_MEM_ERR BIT(1)
  128. #define DE_STAT_L0_FIFO_EMPTY BIT(7)
  129. #define DE_STAT_L0_FIFO_FULL BIT(8)
  130. #define DE_STAT_L0_FIFO_UDF BIT(9)
  131. #define DE_STAT_L0_FIFO_OVF BIT(10)
  132. #define DE_STAT_L0_FTC BIT(11)
  133. #define DE_STAT_WB_FIFO_UDF BIT(12)
  134. #define DE_STAT_WB_FIFO_OVF BIT(13)
  135. #define DE_STAT_DEV_FIFO_UDF BIT(14)
  136. #define DE_STAT_DEV_FIFO_OVF BIT(15)
  137. #define DE_STAT_DEV_VSYNC BIT(16)
  138. #define DE_STAT_L1_FIFO_EMPTY BIT(23)
  139. #define DE_STAT_L1_FIFO_FULL BIT(24)
  140. #define DE_STAT_L1_FIFO_UDF BIT(25)
  141. #define DE_STAT_L1_FIFO_OVF BIT(26)
  142. #define DE_STAT_L1_FTC BIT(27)
  143. #define DE_STAT_PRELINE BIT(28)
  144. #define DE_STAT_DEV_FIFO_HF BIT(29)
  145. #define DE_STAT_WB_FTC BIT(30)
  146. #define DE_STAT_DEV_FTC BIT(31)
  147. /* Reg DE_ALPHA_CTL */
  148. #define DE_ALPHA_EN BIT(31)
  149. #define DE_ALPHA_COVERAGE (0x0 << 10)
  150. #define DE_ALPHA_PREMULTIPLIED (0x1 << 10)
  151. #define DE_ALPHA_PLANE_ALPHA(x) ((x) & 0xff)
  152. #define DE_ALPHA_POS(x, y) (((uint32_t)(y) << 16) | (x))
  153. #define DE_ALPHA_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  154. /* Reg DE_BG_SIZE */
  155. #define DE_BG_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  156. /* Reg DE_BG_COLOR */
  157. #define DE_BG_COLOR(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  158. /* Reg DE_FILL_COLOR */
  159. #define DE_FILL_COLOR(a, r, g, b) \
  160. (((uint32_t)(a) << 24) | ((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  161. /* Reg DE_COLOR_FILL_POS */
  162. #define DE_COLOR_FILL_POS(x, y) (((uint32_t)(y) << 16) | (x))
  163. /* Reg DE_COLOR_FILL_SIZE */
  164. #define DE_COLOR_FILL_SIZE(w, h) ((((uint32_t)(h) - 1) << 16) | ((w) - 1))
  165. /* Reg DE_A148_COLOR */
  166. #define DE_AX_TYPE_SEL(x) ((uint32_t)(x) << 24)
  167. #define DE_TYPE_A8 DE_AX_TYPE_SEL(0)
  168. #define DE_TYPE_A4 DE_AX_TYPE_SEL(1)
  169. #define DE_TYPE_A1 DE_AX_TYPE_SEL(2)
  170. #define DE_AX_COLOR(r, g, b) (((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  171. /* Reg DE_A14_CTL */
  172. #define DE_A14_FONT(size, stride, total) \
  173. (((uint32_t)((size) - 1) << 20) | ((uint32_t)((stride) - 1) << 10) | ((total) - 1))
  174. /* Reg DE_DITHER_CTL */
  175. /*
  176. * internal dither table as follows:
  177. *
  178. * int table4x4_5bit[16]={
  179. * 0, 4, 1, 5,
  180. * 6, 2, 7, 3,
  181. * 2, 6, 1, 5,
  182. * 8, 4, 7, 3,
  183. * };
  184. *
  185. * int table4x4_6bit[16]={
  186. * 0, 2, 1, 3,
  187. * 3, 1, 4, 2,
  188. * 1, 3, 0, 2,
  189. * 4, 2, 3, 1,
  190. * };
  191. *
  192. * int table8x8_5bit[64]={
  193. * 0, 12, 3, 15, 1, 13, 4, 16,
  194. * 8, 4, 11, 7, 9, 5, 12, 8,
  195. * 2, 14, 1, 13, 3, 15, 2, 14,
  196. * 10, 6, 9, 5, 11, 7, 10, 6,
  197. * 1, 13, 4, 16, 0, 12, 3, 15,
  198. * 9, 5, 12, 8, 8, 4, 11, 7,
  199. * 3, 15, 2, 14, 2, 14, 1, 13,
  200. * 11, 7, 10, 6, 10, 6, 9, 5,
  201. * };
  202. *
  203. * int table8x8_6bit[64]={
  204. * 0, 6, 2, 8, 0, 6, 2, 8,
  205. * 4, 2, 6, 4, 4, 2, 6, 4,
  206. * 1, 7, 1, 7, 1, 7, 1, 7,
  207. * 5, 3, 5, 3, 5, 3, 5, 3,
  208. * 0, 6, 2, 8, 0, 6, 2, 8,
  209. * 4, 2, 6, 4, 4, 2, 6, 4,
  210. * 1, 7, 1, 7, 1, 7, 1, 7,
  211. * 5, 3, 5, 3, 5, 3, 5, 3,
  212. * };
  213. */
  214. #define DE_DITHER_EN BIT(0)
  215. #define DE_DITHER_STRENGTH_SEL(x) ((uint32_t)(x) << 4)
  216. #define DE_DITHER_STRENGTH_4X4 DE_DITHER_STRENGTH_SEL(0)
  217. #define DE_DITHER_STRENGTH_8X8 DE_DITHER_STRENGTH_SEL(1)
  218. #define DE_DITHER_POS_EN BIT(5)
  219. #define DE_DITHER_POS(x, y) ((((uint32_t)(x) & 0x7) << 6) | (((uint32_t)(y) & 0x7) << 9))
  220. /* Reg DE_GAMMA_CTL */
  221. #define DE_GAMMA_EN BIT(16)
  222. #define DE_GAMMA_RAM_INDEX(x) ((x) & 0xff)
  223. /* Reg RT_CTL */
  224. #define RT_EN BIT(31)
  225. #define RT_FORMAT_SEL(x) ((uint32_t)(x) << 28)
  226. #define RT_FORMAT_RGB565_SWAP RT_FORMAT_SEL(0)
  227. #define RT_FORMAT_RGB565 RT_FORMAT_SEL(1)
  228. #define RT_FORMAT_ARGB8888 RT_FORMAT_SEL(2)
  229. #define RT_FILTER_SEL(x) ((uint32_t)(x) << 8)
  230. #define RT_STAT_COMPLETE BIT(7)
  231. #define RT_FILTER_LINEAR RT_FILTER_SEL(0)
  232. #define RT_FILTER_BILINEAR RT_FILTER_SEL(1)
  233. #define RT_IRQ_EN BIT(4)
  234. #define RT_COLOR_FILL_EN BIT(2)
  235. #define RT_AUTOLOAD_EN BIT(1)
  236. /* Reg RT_IMG_SIZE */
  237. #define RT_END_HEIGHT(x) ((uint32_t)(x) << 16)
  238. #define RT_IMG_WIDTH(x) ((x) & 0x1ff)
  239. /* Reg RT_IMG_START_HEIGHT */
  240. #define RT_START_HEIGHT(x) ((x) & 0x1ff)
  241. /* Reg RT_SW_X_XY & RT_SW_Y_XY */
  242. #define RT_SW_DELTA_XY(dx, dy) \
  243. (((uint32_t)(dy) & 0x3fff) << 16) | (((uint32_t)(dx) & 0x3fff))
  244. /* Reg RT_FILL_COLOR */
  245. #define RT_COLOR_ARGB_8888(a, r, g, b) \
  246. (((uint32_t)(a) << 24) | ((uint32_t)(r) << 16) | ((uint32_t)(g) << 8) | (b))
  247. #define RT_COLOR_RGB_565(r, g, b) \
  248. ((((uint32_t)(r) >> 3) << 11) | (((uint32_t)(g) >> 2) << 5) | ((b) >> 3))
  249. /**
  250. * @brief DE Module (DE)
  251. */
  252. typedef struct {
  253. volatile uint32_t POS; /*!< (@ 0x00000100) Layer Start Position Register */
  254. volatile uint32_t SIZE; /*!< (@ 0x00000104) Layer Size Register */
  255. volatile uint32_t ADDR; /*!< (@ 0x00000108) Layer Mem Start Address Register */
  256. volatile uint32_t STRIDE; /*!< (@ 0x0000010C) Layer Mem Stride Register */
  257. volatile uint32_t LENGTH; /*!< (@ 0x00000110) Layer Mem Transfer Length Register */
  258. volatile uint32_t COLOR_GAIN; /*!< (@ 0x00000114) Layer Color Gain Register */
  259. volatile uint32_t COLOR_OFFSET; /*!< (@ 0x00000118) Layer Color Offset Register */
  260. volatile uint32_t DEF_COLOR; /*!< (@ 0x0000011C) Layer Default Color Register */
  261. const volatile uint32_t RESERVED[56];
  262. } DE_LAYER_CTL_Type;
  263. typedef struct { /*!< (@ 0x4006C000) DE Structure */
  264. volatile uint32_t CTL; /*!< (@ 0x00000000) DE Control Register */
  265. volatile uint32_t GAT_CTL; /*!< (@ 0x00000004) DE Gatting Control Register */
  266. volatile uint32_t REG_UD; /*!< (@ 0x00000008) DE Layer0 Size Register */
  267. volatile uint32_t IRQ_CTL; /*!< (@ 0x0000000C) DE IRQ Control Register */
  268. volatile uint32_t BG_SIZE; /*!< (@ 0x00000010) DE BG Size Register */
  269. volatile uint32_t BG_COLOR; /*!< (@ 0x00000014) DE default color Register */
  270. volatile uint32_t MEM_OPT; /*!< (@ 0x00000018) DE Mem Opt Register */
  271. volatile uint32_t EN; /*!< (@ 0x0000001C) DE Mem Enable Register */
  272. volatile uint32_t CTL2; /*!< (@ 0x00000020) DE Control2 Register */
  273. const volatile uint32_t RESERVED1[55];
  274. DE_LAYER_CTL_Type LAYER_CTL[2]; /*!< (@ 0x00000100) DE Layer Control Register */
  275. volatile uint32_t ALPHA_CTL; /*!< (@ 0x00000300) DE Alpha Control Register */
  276. volatile uint32_t ALPHA_POS; /*!< (@ 0x00000304) Alpha Position Register */
  277. volatile uint32_t ALPHA_SIZE; /*!< (@ 0x00000308) Alpha Size Register */
  278. volatile uint32_t STA; /*!< (@ 0x0000030C) DE Status Register */
  279. volatile uint32_t GAMMA_CTL; /*!< (@ 0x00000310) DE Gamma Control Register */
  280. volatile uint32_t PATH_GAMMA_RAM; /*!< (@ 0x00000314) DE Gamma Data Path Register */
  281. volatile uint32_t DITHER_CTL; /*!< (@ 0x00000318) DE Dither Control Register */
  282. volatile uint32_t WB_MEM_ADR; /*!< (@ 0x0000031C) WriteBack Mem Start Address Register */
  283. volatile uint32_t WB_MEM_STRIDE; /*!< (@ 0x00000320) WriteBack Mem Stride Register */
  284. volatile uint32_t COLOR_FILL_POS; /*!< (@ 0x00000324) Color Fill Position Register */
  285. volatile uint32_t COLOR_FILL_SIZE; /*!< (@ 0x00000328) Fill Size Register */
  286. volatile uint32_t FILL_COLOR; /*!< (@ 0x0000032C) Fill Color Register */
  287. volatile uint32_t A148_COLOR; /*!< (@ 0x00000330) Ax Color Register */
  288. volatile uint32_t A14_CTL; /*!< (@ 0x00000334) A14 Control Register */
  289. const volatile uint32_t RESERVED2[50];
  290. volatile uint32_t RT_CTL; /*!< (@ 0x00000400) Rotate Control Register */
  291. volatile uint32_t RT_IMG_SIZE; /*!< (@ 0x00000404) Rotate Image Size Register */
  292. volatile uint32_t RT_SRC_ADDR; /*!< (@ 0x00000408) Rotate Source Mem Start Register */
  293. volatile uint32_t RT_SRC_STRIDE; /*!< (@ 0x0000040C) Rotate Source Mem Stride Register */
  294. volatile uint32_t RT_DST_ADDR; /*!< (@ 0x00000410) Rotate Dest Mem Start Register */
  295. volatile uint32_t RT_DST_STRIDE; /*!< (@ 0x00000414) Rotate Dest Mem Stride Register */
  296. volatile uint32_t RT_START_HEIGHT; /*!< (@ 0x00000418) Rotate Start Height Register */
  297. volatile uint32_t RT_SW_X_XY; /*!< (@ 0x0000041C) Rotate Source Delta X/Y along Dest X Register */
  298. volatile uint32_t RT_SW_Y_XY; /*!< (@ 0x00000420) Rotate Source Delta X/Y along Dest Y Register */
  299. volatile uint32_t RT_SW_X0; /*!< (@ 0x00000424) Rotate Source Start X mapping to Dest (0,0) Register */
  300. volatile uint32_t RT_SW_Y0; /*!< (@ 0x00000428) Rotate Source Start Y mapping to Dest (0,0) Register */
  301. volatile uint32_t RT_SW_FIRST_DIST; /*!< (@ 0x0000042C) Rotate Source First Distance Register */
  302. volatile uint32_t RT_R1M2; /*!< (@ 0x00000430) Rotate Source Outer Radius Square Register */
  303. volatile uint32_t RT_R0M2; /*!< (@ 0x00000430) Rotate Source Inner Radius Square Register */
  304. volatile uint32_t RT_FILL_COLOR; /*!< (@ 0x00000438) Rotate Fill Color Register */
  305. const volatile uint32_t RESERVED3[49];
  306. volatile uint32_t RT_RESULT_X0; /*!< (@ 0x00000500) Rotate Result of RT_SW_X0 Register */
  307. volatile uint32_t RT_RESULT_Y0; /*!< (@ 0x00000504) Rotate Result of RT_SW_Y0 Register */
  308. volatile uint32_t RT_RESULT_FIRST_DIST; /*!< (@ 0x00000508) Rotate Result of RT_SW_FIRST_DIST Register */
  309. volatile uint32_t RT_RESULT_SRC_ADDR; /*!< (@ 0x0000050C) Rotate Result of RT_SRC_ADDR Register */
  310. } __attribute__((__packed__)) DE_Type; /*!< Size = 1048 (0x418) */
  311. /**
  312. * @brief DE Command Configuration
  313. */
  314. typedef struct de_overlay_cfg {
  315. uint32_t num_ovls : 2;
  316. display_layer_t ovls[2];
  317. display_buffer_t bufs[2];
  318. display_buffer_t target;
  319. display_rect_t target_rect;
  320. } de_overlay_cfg_t;
  321. typedef struct {
  322. uint32_t ctl;
  323. uint32_t img_size;
  324. uint32_t src_addr;
  325. uint32_t src_stride;
  326. uint32_t dst_addr;
  327. uint32_t dst_stride;
  328. uint32_t start_height;
  329. uint32_t sw_x_xy;
  330. uint32_t sw_y_xy;
  331. int32_t sw_x0;
  332. int32_t sw_y0;
  333. uint32_t sw_first_dist;
  334. uint32_t r1m2;
  335. uint32_t r0m2;
  336. uint32_t fill_color;
  337. } __attribute__((__packed__)) de_rotate_cfg_t;
  338. #endif /* ZEPHYR_DRIVERS_DISPLAY_ENGINE_DE_LARK_H_ */