1 /* 2 * File : x1000_slcdc.h 3 * COPYRIGHT (C) 2008 - 2016, RT-Thread Development Team 4 * 5 * Change Logs: 6 * Date Author Notes 7 * 2017��3��20�� Urey the first version 8 */ 9 #ifndef _X1000_SLCDC_H_ 10 #define _X1000_SLCDC_H_ 11 12 #ifdef __cplusplus 13 extern "C" { 14 #endif 15 16 /************************************************************************* 17 * SLCD (Smart LCD Controller) 18 *************************************************************************/ 19 #define LCDC0_BASE LCD_BASE 20 21 #define SLCDC_CFG (LCDC0_BASE + 0xA0) /* SLCDC Configure Register */ 22 #define SLCDC_CTRL (LCDC0_BASE + 0xA4) /* SLCDC Control Register */ 23 #define SLCDC_STATE (LCDC0_BASE + 0xA8) /* SLCDC Status Register */ 24 #define SLCDC_DATA (LCDC0_BASE + 0xAC) /* SLCDC Data Register */ 25 26 #define SLCDC_CFG_NEW (LCDC0_BASE + 0xB8) 27 #define SLCDC_WTIME (LCDC0_BASE + 0xB0) 28 #define SLCDC_TAS (LCDC0_BASE + 0xB4) 29 #define SLCDC_SLOW_TIME (LCDC0_BASE + 0xBC) 30 31 /* SLCDC Configure Register */ 32 #define SLCDC_CFG_DWIDTH_BIT 10 33 #define SLCDC_CFG_DWIDTH_MASK (0x7 << SLCDC_CFG_DWIDTH_BIT) 34 #define SLCDC_CFG_DWIDTH_18BIT (0 << SLCDC_CFG_DWIDTH_BIT) 35 #define SLCDC_CFG_DWIDTH_16BIT (1 << SLCDC_CFG_DWIDTH_BIT) 36 #define SLCDC_CFG_DWIDTH_8BIT_x3 (2 << SLCDC_CFG_DWIDTH_BIT) 37 #define SLCDC_CFG_DWIDTH_8BIT_x2 (3 << SLCDC_CFG_DWIDTH_BIT) 38 #define SLCDC_CFG_DWIDTH_8BIT_x1 (4 << SLCDC_CFG_DWIDTH_BIT) 39 #define SLCDC_CFG_DWIDTH_24BIT (5 << SLCDC_CFG_DWIDTH_BIT) 40 #define SLCDC_CFG_DWIDTH_9BIT_x2 (7 << SLCDC_CFG_DWIDTH_BIT) 41 #define SLCDC_CFG_CWIDTH_BIT (8) 42 #define SLCDC_CFG_CWIDTH_MASK (0x3 << SLCDC_CFG_CWIDTH_BIT) 43 #define SLCDC_CFG_CWIDTH_16BIT (0 << SLCDC_CFG_CWIDTH_BIT) 44 #define SLCDC_CFG_CWIDTH_8BIT (1 << SLCDC_CFG_CWIDTH_BIT) 45 #define SLCDC_CFG_CWIDTH_18BIT (2 << SLCDC_CFG_CWIDTH_BIT) 46 #define SLCDC_CFG_CWIDTH_24BIT (3 << SLCDC_CFG_CWIDTH_BIT) 47 #define SLCDC_CFG_CS_ACTIVE_LOW (0 << 4) 48 #define SLCDC_CFG_CS_ACTIVE_HIGH (1 << 4) 49 #define SLCDC_CFG_RS_CMD_LOW (0 << 3) 50 #define SLCDC_CFG_RS_CMD_HIGH (1 << 3) 51 #define SLCDC_CFG_CLK_ACTIVE_FALLING (0 << 1) 52 #define SLCDC_CFG_CLK_ACTIVE_RISING (1 << 1) 53 #define SLCDC_CFG_TYPE_PARALLEL (0 << 0) 54 #define SLCDC_CFG_TYPE_SERIAL (1 << 0) 55 56 /* SLCD New Configure Register */ 57 #define SLCDC_NEW_CFG_DWIDTH_BIT 13 58 #define SLCDC_NEW_CFG_DWIDTH_MASK (0x7 << SLCDC_NEW_CFG_DWIDTH_BIT) 59 #define SLCDC_NEW_CFG_DWIDTH_8BIT (0 << SLCDC_NEW_CFG_DWIDTH_BIT) 60 #define SLCDC_NEW_CFG_DWIDTH_9BIT (1 << SLCDC_NEW_CFG_DWIDTH_BIT) 61 #define SLCDC_NEW_CFG_DWIDTH_16BIT (2 << SLCDC_NEW_CFG_DWIDTH_BIT) 62 #define SLCDC_NEW_CFG_DWIDTH_18BIT (3 << SLCDC_NEW_CFG_DWIDTH_BIT) 63 #define SLCDC_NEW_CFG_DWIDTH_24BIT (4 << SLCDC_NEW_CFG_DWIDTH_BIT) 64 #define SLCDC_NEW_CFG_6800_MD (1 << 11) 65 #define SLCDC_NEW_CFG_CMD_9BIT (1 << 10) /* only use in old slcd */ 66 #define SLCDC_NEW_CFG_CMD_16BIT (0 << 10) /* only use in old slcd */ 67 #define SLCDC_NEW_CFG_DTIME_BIT 8 68 #define SLCDC_NEW_CFG_DTIME_MASK (0x3 << SLCDC_NEW_CFG_DTIME_BIT) 69 #define SLCDC_NEW_CFG_DTIME_ONCE (0 << SLCDC_NEW_CFG_DTIME_BIT) 70 #define SLCDC_NEW_CFG_DTIME_TWICE (1 << SLCDC_NEW_CFG_DTIME_BIT) 71 #define SLCDC_NEW_CFG_DTIME_THREE (2 << SLCDC_NEW_CFG_DTIME_BIT) 72 #define SLCDC_NEW_CFG_CS_HIGH_IDLE (0 << 5) 73 #define SLCDC_NEW_CFG_CS_LOW_IDLE (1 << 5) 74 #define SLCDC_NEW_CFG_RS_CMD_LOW (0 << 4) 75 #define SLCDC_NEW_CFG_RS_CMD_HIGH (1 << 4) 76 #define SLCDC_NEW_CFG_CLK_ACTIVE_FALLING (0 << 3) 77 #define SLCDC_NEW_CFG_CLK_ACTIVE_RISING (1 << 3) 78 #define SLCDC_NEW_CFG_DTYPE_PARALLEL (0 << 2) 79 #define SLCDC_NEW_CFG_DTYPE_SERIAL (1 << 2) 80 #define SLCDC_NEW_CFG_CTYPE_PARALLEL (0 << 1) 81 #define SLCDC_NEW_CFG_CTYPE_SERIAL (1 << 1) 82 #define SLCDC_NEW_CFG_FMT_CONV_EN (1 << 0) 83 84 /* SLCD Control Register */ 85 #define SLCDC_CTRL_TE_INV (1 << 9) 86 #define SLCDC_CTRL_NOT_USE_TE (1 << 8) 87 #define SLCDC_CTRL_DCSI_SEL (1 << 7) 88 #define SLCDC_CTRL_MIPI_MODE (1 << 6) 89 #define SLCDC_CTRL_NEW_MODE (1 << 5) 90 #define SLCDC_CTRL_FAST_MODE (1 << 4) 91 #define SLCDC_CTRL_GATE_MASK (1 << 3) 92 #define SLCDC_CTRL_DMA_MODE (1 << 2) 93 #define SLCDC_CTRL_DMA_START (1 << 1) 94 #define SLCDC_CTRL_DMA_EN (1 << 0) 95 96 /* SLCD Status Register */ 97 #define SLCDC_STATE_BUSY (1 << 0) 98 99 /* SLCD Data Register */ 100 #define SLCDC_DATA_RS_DATA (0 << 30) 101 #define SLCDC_DATA_RS_COMMAND (1 << 30) 102 103 /************************************************************************* 104 * LCDC (LCD Controller) 105 *************************************************************************/ 106 107 #define LCDC_CFG (LCDC0_BASE + 0x00) 108 #define LCDC_CTRL (LCDC0_BASE + 0x30) 109 #define LCDC_STATE (LCDC0_BASE + 0x34) 110 #define LCDC_OSDC (LCDC0_BASE + 0x100) 111 #define LCDC_OSDCTRL (LCDC0_BASE + 0x104) 112 #define LCDC_OSDS (LCDC0_BASE + 0x108) 113 #define LCDC_BGC0 (LCDC0_BASE + 0x10C) 114 #define LCDC_BGC1 (LCDC0_BASE + 0x2C4) 115 #define LCDC_KEY0 (LCDC0_BASE + 0x110) 116 #define LCDC_KEY1 (LCDC0_BASE + 0x114) 117 #define LCDC_ALPHA (LCDC0_BASE + 0x118) 118 #define LCDC_RGBC (LCDC0_BASE + 0x90) 119 #define LCDC_VAT (LCDC0_BASE + 0x0c) 120 #define LCDC_DAH (LCDC0_BASE + 0x10) 121 #define LCDC_DAV (LCDC0_BASE + 0x14) 122 #define LCDC_XYP0 (LCDC0_BASE + 0x120) 123 #define LCDC_XYP1 (LCDC0_BASE + 0x124) 124 #define LCDC_SIZE0 (LCDC0_BASE + 0x128) 125 #define LCDC_SIZE1 (LCDC0_BASE + 0x12C) 126 #define LCDC_VSYNC (LCDC0_BASE + 0x04) 127 #define LCDC_HSYNC (LCDC0_BASE + 0x08) 128 #define LCDC_PS (LCDC0_BASE + 0x18) 129 #define LCDC_CLS (LCDC0_BASE + 0x1c) 130 #define LCDC_SPL (LCDC0_BASE + 0x20) 131 #define LCDC_REV (LCDC0_BASE + 0x24) 132 #define LCDC_IID (LCDC0_BASE + 0x38) 133 #define LCDC_DA0 (LCDC0_BASE + 0x40) 134 #define LCDC_SA0 (LCDC0_BASE + 0x44) 135 #define LCDC_FID0 (LCDC0_BASE + 0x48) 136 #define LCDC_CMD0 (LCDC0_BASE + 0x4c) 137 #define LCDC_DA1 (LCDC0_BASE + 0x50) 138 #define LCDC_SA1 (LCDC0_BASE + 0x54) 139 #define LCDC_FID1 (LCDC0_BASE + 0x58) 140 #define LCDC_CMD1 (LCDC0_BASE + 0x5c) 141 #define LCDC_OFFS0 (LCDC0_BASE + 0x60) 142 #define LCDC_PW0 (LCDC0_BASE + 0x64) 143 #define LCDC_CNUM0 (LCDC0_BASE + 0x68) 144 #define LCDC_DESSIZE0 (LCDC0_BASE + 0x6C) 145 #define LCDC_OFFS1 (LCDC0_BASE + 0x70) 146 #define LCDC_PW1 (LCDC0_BASE + 0x74) 147 #define LCDC_CNUM1 (LCDC0_BASE + 0x78) 148 #define LCDC_DESSIZE1 (LCDC0_BASE + 0x7C) 149 #define LCDC_PCFG (LCDC0_BASE + 0x2C0) 150 #define LCDC_CPOS1 (0x78) 151 #define LCDC_DUAL_CTRL (0x2c8) 152 #define LCDC_ENH_CFG (0x400) 153 #define LCDC_ENH_CSCCFG (0x404) 154 #define LCDC_ENH_LUMACFG (0x408) 155 #define LCDC_ENH_CHROCFG0 (0x40c) 156 #define LCDC_ENH_CHROCFG1 (0x410) 157 #define LCDC_ENH_DITHERCFG (0x414) 158 #define LCDC_ENH_STATUS (0x418) 159 #define LCDC_ENH_GAMMA (0x800) 160 #define LCDC_ENH_VEE (0x1000) 161 162 /* LCD Configure Register */ 163 #define LCDC_CFG_LCDPIN_BIT 31 164 #define LCDC_CFG_LCDPIN_MASK (0x1 << LCDC_CFG_LCDPIN_BIT) 165 #define LCDC_CFG_LCDPIN_LCD (0x0 << LCDC_CFG_LCDPIN_BIT) 166 #define LCDC_CFG_LCDPIN_SLCD (0x1 << LCDC_CFG_LCDPIN_BIT) 167 #define LCDC_CFG_TVEPEH (1 << 30) 168 #define LCDC_CFG_NEWDES (1 << 28) 169 #define LCDC_CFG_PALBP (1 << 27) 170 #define LCDC_CFG_TVEN (1 << 26) 171 #define LCDC_CFG_RECOVER (1 << 25) 172 #define LCDC_CFG_PSM (1 << 23) 173 #define LCDC_CFG_CLSM (1 << 22) 174 #define LCDC_CFG_SPLM (1 << 21) 175 #define LCDC_CFG_REVM (1 << 20) 176 #define LCDC_CFG_HSYNM (1 << 19) 177 #define LCDC_CFG_PCLKM (1 << 18) 178 #define LCDC_CFG_INVDAT (1 << 17) 179 #define LCDC_CFG_SYNDIR_IN (1 << 16) 180 #define LCDC_CFG_PSP (1 << 15) 181 #define LCDC_CFG_CLSP (1 << 14) 182 #define LCDC_CFG_SPLP (1 << 13) 183 #define LCDC_CFG_REVP (1 << 12) 184 #define LCDC_CFG_HSP (1 << 11) 185 #define LCDC_CFG_PCP (1 << 10) 186 #define LCDC_CFG_DEP (1 << 9) 187 #define LCDC_CFG_VSP (1 << 8) 188 #define LCDC_CFG_MODE_TFT_18BIT (1 << 7) 189 #define LCDC_CFG_MODE_TFT_16BIT (0 << 7) 190 #define LCDC_CFG_MODE_TFT_24BIT (1 << 6) 191 #define LCDC_CFG_MODE_BIT 0 192 #define LCDC_CFG_MODE_MASK (0x0f << LCDC_CFG_MODE_BIT) 193 #define LCDC_CFG_MODE_GENERIC_TFT (0 << LCDC_CFG_MODE_BIT) 194 #define LCDC_CFG_MODE_SPECIAL_TFT_1 (1 << LCDC_CFG_MODE_BIT) 195 #define LCDC_CFG_MODE_SPECIAL_TFT_2 (2 << LCDC_CFG_MODE_BIT) 196 #define LCDC_CFG_MODE_SPECIAL_TFT_3 (3 << LCDC_CFG_MODE_BIT) 197 #define LCDC_CFG_MODE_NONINTER_CCIR656 (4 << LCDC_CFG_MODE_BIT) 198 #define LCDC_CFG_MODE_INTER_CCIR656 (6 << LCDC_CFG_MODE_BIT) 199 #define LCDC_CFG_MODE_SERIAL_TFT (12 << LCDC_CFG_MODE_BIT) 200 #define LCDC_CFG_MODE_LCM (13 << LCDC_CFG_MODE_BIT) 201 /* LCD Control Register */ 202 #define LCDC_CTRL_PINMD (1 << 31) 203 #define LCDC_CTRL_BST_BIT 28 204 #define LCDC_CTRL_BST_MASK (0x7 << LCDC_CTRL_BST_BIT) 205 #define LCDC_CTRL_BST_4 (0 << LCDC_CTRL_BST_BIT) 206 #define LCDC_CTRL_BST_8 (1 << LCDC_CTRL_BST_BIT) 207 #define LCDC_CTRL_BST_16 (2 << LCDC_CTRL_BST_BIT) 208 #define LCDC_CTRL_BST_32 (3 << LCDC_CTRL_BST_BIT) 209 #define LCDC_CTRL_BST_64 (4 << LCDC_CTRL_BST_BIT) 210 #define LCDC_CTRL_RGB565 (0 << 27) 211 #define LCDC_CTRL_RGB555 (1 << 27) 212 #define LCDC_CTRL_OFUP (1 << 26) 213 #define LCDC_CTRL_PDD_BIT 16 214 #define LCDC_CTRL_PDD_MASK (0xff << LCDC_CTRL_PDD_BIT) 215 #define LCDC_CTRL_DACTE (1 << 14) 216 #define LCDC_CTRL_EOFM (1 << 13) 217 #define LCDC_CTRL_SOFM (1 << 12) 218 #define LCDC_CTRL_OFUM (1 << 11) 219 #define LCDC_CTRL_IFUM0 (1 << 10) 220 #define LCDC_CTRL_IFUM1 (1 << 9) 221 #define LCDC_CTRL_LDDM (1 << 8) 222 #define LCDC_CTRL_QDM (1 << 7) 223 #define LCDC_CTRL_BEDN (1 << 6) 224 #define LCDC_CTRL_PEDN (1 << 5) 225 #define LCDC_CTRL_DIS (1 << 4) 226 #define LCDC_CTRL_ENA (1 << 3) 227 #define LCDC_CTRL_BPP_BIT 0 228 #define LCDC_CTRL_BPP_MASK (0x07 << LCDC_CTRL_BPP_BIT) 229 #define LCDC_CTRL_BPP_1 (0 << LCDC_CTRL_BPP_BIT) 230 #define LCDC_CTRL_BPP_2 (1 << LCDC_CTRL_BPP_BIT) 231 #define LCDC_CTRL_BPP_4 (2 << LCDC_CTRL_BPP_BIT) 232 #define LCDC_CTRL_BPP_8 (3 << LCDC_CTRL_BPP_BIT) 233 #define LCDC_CTRL_BPP_16 (4 << LCDC_CTRL_BPP_BIT) 234 #define LCDC_CTRL_BPP_18_24 (5 << LCDC_CTRL_BPP_BIT) 235 #define LCDC_CTRL_BPP_CMPS_24 (6 << LCDC_CTRL_BPP_BIT) 236 #define LCDC_CTRL_BPP_30 (7 << LCDC_CTRL_BPP_BIT) 237 /* LCD Status Register */ 238 #define LCDC_STATE_QD (1 << 7) 239 #define LCDC_STATE_EOF (1 << 5) 240 #define LCDC_STATE_SOF (1 << 4) 241 #define LCDC_STATE_OFU (1 << 3) 242 #define LCDC_STATE_IFU0 (1 << 2) 243 #define LCDC_STATE_IFU1 (1 << 1) 244 #define LCDC_STATE_LDD (1 << 0) 245 /* OSD Configure Register */ 246 #define LCDC_OSDC_PREMULTI1 (1 << 23) 247 #define LCDC_OSDC_COEF_SLE1_BIT 21 248 #define LCDC_OSDC_COEF_SLE1_MASK (0x03 << LCDC_OSDC_COEF_SLE1_BIT) 249 #define LCDC_OSDC_COEF_SLE1_0 (0 << LCDC_OSDC_COEF_SLE1_BIT) 250 #define LCDC_OSDC_COEF_SLE1_1 (1 << LCDC_OSDC_COEF_SLE1_BIT) 251 #define LCDC_OSDC_COEF_SLE1_2 (2 << LCDC_OSDC_COEF_SLE1_BIT) 252 #define LCDC_OSDC_COEF_SLE1_3 (3 << LCDC_OSDC_COEF_SLE1_BIT) 253 #define LCDC_OSDC_PREMULTI0 (1 << 20) 254 #define LCDC_OSDC_COEF_SLE0_BIT 18 255 #define LCDC_OSDC_COEF_SLE0_MASK (0x03 << LCDC_OSDC_COEF_SLE0_BIT) 256 #define LCDC_OSDC_COEF_SLE0_0 (0 << LCDC_OSDC_COEF_SLE0_BIT) 257 #define LCDC_OSDC_COEF_SLE0_1 (1 << LCDC_OSDC_COEF_SLE0_BIT) 258 #define LCDC_OSDC_COEF_SLE0_2 (2 << LCDC_OSDC_COEF_SLE0_BIT) 259 #define LCDC_OSDC_COEF_SLE0_3 (3 << LCDC_OSDC_COEF_SLE0_BIT) 260 #define LCDC_OSDC_ALPHAMD1 (1 << 17) 261 #define LCDC_OSDC_SOFM1 (1 << 15) 262 #define LCDC_OSDC_EOFM1 (1 << 14) 263 #define LCDC_OSDC_SOFM0 (1 << 11) 264 #define LCDC_OSDC_EOFM0 (1 << 10) 265 #define LCDC_OSDC_DENDM (1 << 9) 266 #define LCDC_OSDC_F1EN (1 << 4) 267 #define LCDC_OSDC_F0EN (1 << 3) 268 #define LCDC_OSDC_ALPHAEN (1 << 2) 269 #define LCDC_OSDC_ALPHAMD0 (1 << 1) 270 #define LCDC_OSDC_OSDEN (1 << 0) 271 /* OSD Controll Register */ 272 #define LCDC_OSDCTRL_IPU_CLKEN (1 << 15) 273 #define LCDC_OSDCTRL_RGB0_RGB565 (0 << 5) 274 #define LCDC_OSDCTRL_RGB0_RGB555 (1 << 5) 275 #define LCDC_OSDCTRL_RGB1_RGB565 (0 << 4) 276 #define LCDC_OSDCTRL_RGB1_RGB555 (1 << 4) 277 #define LCDC_OSDCTRL_BPP_BIT 0 278 #define LCDC_OSDCTRL_BPP_MASK (0x7<<LCDC_OSDCTRL_BPP_BIT) 279 #define LCDC_OSDCTRL_BPP_15_16 (4 << LCDC_OSDCTRL_BPP_BIT) 280 #define LCDC_OSDCTRL_BPP_18_24 (5 << LCDC_OSDCTRL_BPP_BIT) 281 #define LCDC_OSDCTRL_BPP_CMPS_24 (6 << LCDC_OSDCTRL_BPP_BIT) 282 #define LCDC_OSDCTRL_BPP_30 (7 << LCDC_OSDCTRL_BPP_BIT) 283 /* OSD State Register */ 284 #define LCDC_OSDS_SOF1 (1 << 15) 285 #define LCDC_OSDS_EOF1 (1 << 14) 286 #define LCDC_OSDS_SOF0 (1 << 11) 287 #define LCDC_OSDS_EOF0 (1 << 10) 288 #define LCDC_OSDS_DEND (1 << 8) 289 /* Background 0 or Background 1 Color Register */ 290 #define LCDC_BGC_RED_OFFSET 16 291 #define LCDC_BGC_RED_MASK (0xFF << LCDC_BGC_RED_OFFSET) 292 #define LCDC_BGC_GREEN_OFFSET 8 293 #define LCDC_BGC_GREEN_MASK (0xFF << LCDC_BGC_GREEN_OFFSET) 294 #define LCDC_BGC_BLUE_OFFSET 0 295 #define LCDC_BGC_BLUE_MASK (0xFF << LCDC_BGC_BLUE_OFFSET) 296 /* Foreground 0 or Foreground 1 Color Key Register */ 297 #define LCDC_KEY_KEYEN (1 << 31) 298 #define LCDC_KEY_KEYMD (1 << 30) 299 #define LCDC_KEY_RED_OFFSET 16 300 #define LCDC_KEY_RED_MASK (0xFF << LCDC_KEY_RED_OFFSET) 301 #define LCDC_KEY_GREEN_OFFSET 8 302 #define LCDC_KEY_GREEN_MASK (0xFF << LCDC_KEY_GREEN_OFFSET) 303 #define LCDC_KEY_BLUE_OFFSET 0 304 #define LCDC_KEY_BLUE_MASK (0xFF << LCDC_KEY_BLUE_OFFSET) 305 #define LCDC_KEY_MASK (LCDC_KEY_RED_MASK | LCDC_KEY_GREEN_MASK\ 306 /* ALPHA Register */ 307 #define LCDC_ALPHA1_OFFSET 8 308 #define LCDC_ALPHA1_MASK (0xFF << LCDC_ALPHA1_OFFSET) 309 #define LCDC_ALPHA0_OFFSET 0 310 #define LCDC_ALPHA0_MASK (0xFF << LCDC_ALPHA0_OFFSET) 311 /* IPU Restart Register */ 312 #define LCDC_IPUR_IPUREN (1 << 31) 313 #define LCDC_IPUR_IPURMASK (0xFFFFFF) 314 /* RGB Control Register */ 315 #define LCDC_RGBC_RGBDM (1 << 15) 316 #define LCDC_RGBC_DMM (1 << 14) 317 #define LCDC_RGBC_RGBFMT (1 << 7) 318 #define LCDC_RGBC_ODDRGB_BIT 4 319 #define LCDC_RGBC_ODDRGB_MASK (0x7 << LCDC_RGBC_ODDRGB_BIT) 320 #define LCDC_RGBC_ODD_RGB (0 << LCDC_RGBC_ODDRGB_BIT) 321 #define LCDC_RGBC_ODD_RBG (1 << LCDC_RGBC_ODDRGB_BIT) 322 #define LCDC_RGBC_ODD_GRB (2 << LCDC_RGBC_ODDRGB_BIT) 323 #define LCDC_RGBC_ODD_GBR (3 << LCDC_RGBC_ODDRGB_BIT) 324 #define LCDC_RGBC_ODD_BRG (4 << LCDC_RGBC_ODDRGB_BIT) 325 #define LCDC_RGBC_ODD_BGR (5 << LCDC_RGBC_ODDRGB_BIT) 326 #define LCDC_RGBC_EVENRGB_BIT 0 327 #define LCDC_RGBC_EVENRGB_MASK (0x7<<LCDC_RGBC_EVENRGB_BIT) 328 #define LCDC_RGBC_EVEN_RGB 0 329 #define LCDC_RGBC_EVEN_RBG 1 330 #define LCDC_RGBC_EVEN_GRB 2 331 #define LCDC_RGBC_EVEN_GBR 3 332 #define LCDC_RGBC_EVEN_BRG 4 333 #define LCDC_RGBC_EVEN_BGR 5 334 /* Vertical Synchronize Register */ 335 #define LCDC_VSYNC_VPS_BIT 16 336 #define LCDC_VSYNC_VPS_MASK (0xfff << LCDC_VSYNC_VPS_BIT) 337 #define LCDC_VSYNC_VPE_BIT 0 338 #define LCDC_VSYNC_VPE_MASK (0xfff << LCDC_VSYNC_VPE_BIT) 339 /* Horizontal Synchronize Register */ 340 #define LCDC_HSYNC_HPS_BIT 16 341 #define LCDC_HSYNC_HPS_MASK (0xfff << LCDC_HSYNC_HPS_BIT) 342 #define LCDC_HSYNC_HPE_BIT 0 343 #define LCDC_HSYNC_HPE_MASK (0xfff << LCDC_HSYNC_HPE_BIT) 344 /* Virtual Area Setting Register */ 345 #define LCDC_VAT_HT_BIT 16 346 #define LCDC_VAT_HT_MASK (0xfff << LCDC_VAT_HT_BIT) 347 #define LCDC_VAT_VT_BIT 0 348 #define LCDC_VAT_VT_MASK (0xfff << LCDC_VAT_VT_BIT) 349 /* Display Area Horizontal Start/End Point Register */ 350 #define LCDC_DAH_HDS_BIT 16 351 #define LCDC_DAH_HDS_MASK (0xfff << LCDC_DAH_HDS_BIT) 352 #define LCDC_DAH_HDE_BIT 0 353 #define LCDC_DAH_HDE_MASK (0xfff << LCDC_DAH_HDE_BIT) 354 /* Display Area Vertical Start/End Point Register */ 355 #define LCDC_DAV_VDS_BIT 16 356 #define LCDC_DAV_VDS_MASK (0xfff << LCDC_DAV_VDS_BIT) 357 #define LCDC_DAV_VDE_BIT 0 358 #define LCDC_DAV_VDE_MASK (0xfff << LCDC_DAV_VDE_BIT) 359 /* Foreground 0 or Foreground 1 XY Position Register */ 360 #define LCDC_XYP_YPOS_BIT 16 361 #define LCDC_XYP_YPOS_MASK (0xfff << LCDC_XYP_YPOS_BIT) 362 #define LCDC_XYP_XPOS_BIT 0 363 #define LCDC_XYP_XPOS_MASK (0xfff << LCDC_XYP_XPOS_BIT) 364 /* Foreground 0 or Foreground 1 Size Register */ 365 #define LCDC_SIZE_HEIGHT_BIT 16 366 #define LCDC_SIZE_HEIGHT_MASK (0xfff << LCDC_SIZE_HEIGHT_BIT) 367 #define LCDC_SIZE_WIDTH_BIT 0 368 #define LCDC_SIZE_WIDTH_MASK (0xfff << LCDC_SIZE_WIDTH_BIT) 369 /* PS Signal Setting */ 370 #define LCDC_PS_PSS_BIT 16 371 #define LCDC_PS_PSS_MASK (0xfff << LCDC_PS_PSS_BIT) 372 #define LCDC_PS_PSE_BIT 0 373 #define LCDC_PS_PSE_MASK (0xfff << LCDC_PS_PSE_BIT) 374 /* CLS Signal Setting */ 375 #define LCDC_CLS_CLSS_BIT 16 376 #define LCDC_CLS_CLSS_MASK (0xfff << LCDC_CLS_CLSS_BIT) 377 #define LCDC_CLS_CLSE_BIT 0 378 #define LCDC_CLS_CLSE_MASK (0xfff << LCDC_CLS_CLSE_BIT) 379 /* SPL Signal Setting */ 380 #define LCDC_SPL_SPLS_BIT 16 381 #define LCDC_SPL_SPLS_MASK (0xfff << LCDC_SPL_SPLS_BIT) 382 #define LCDC_SPL_SPLE_BIT 0 383 #define LCDC_SPL_SPLE_MASK (0xfff << LCDC_SPL_SPLE_BIT) 384 /* REV Signal Setting */ 385 #define LCDC_REV_REVS_BIT 16 386 #define LCDC_REV_REVS_MASK (0xfff << LCDC_REV_REVS_BIT) 387 /* DMA Command 0 or 1 Register */ 388 #define LCDC_CMD_SOFINT (1 << 31) 389 #define LCDC_CMD_EOFINT (1 << 30) 390 #define LCDC_CMD_CMD (1 << 29) 391 #define LCDC_CMD_PAL (1 << 28) 392 #define LCDC_CMD_COMPEN (1 << 27) 393 #define LCDC_CMD_FRM_EN (1 << 26) 394 #define LCDC_CMD_FIELD_SEL (1 << 25) 395 #define LCDC_CMD_16X16BLOCK (1 << 24) 396 #define LCDC_CMD_LEN_BIT 0 397 #define LCDC_CMD_LEN_MASK (0xffffff << LCDC_CMD_LEN_BIT) 398 /* DMA Offsize Register 0,1 */ 399 #define LCDC_OFFS_BIT 0 400 #define LCDC_OFFS_OFFSIZE_MASK (0xffffff << LCDC_OFFS_BIT) 401 /* DMA Page Width Register 0,1 */ 402 #define LCDC_PW_BIT 0 403 #define LCDC_PW_PAGEWIDTH_MASK (0xffffff << LCDC_PW_BIT) 404 /* DMA Command Counter Register 0,1 */ 405 #define LCDC_CNUM_BIT 0 406 #define LCDC_CNUM_CNUM_MASK (0xff << LCDC_CNUM_BIT) 407 #define LCDC_CPOS_ALPHAMD1 (1 << 31) 408 #define LCDC_CPOS_RGB_RGB565 (0 << 30) 409 #define LCDC_CPOS_RGB_RGB555 (1 << 30) 410 #define LCDC_CPOS_BPP_BIT 27 411 #define LCDC_CPOS_BPP_MASK (0x07 << LCDC_CPOS_BPP_BIT) 412 #define LCDC_CPOS_BPP_16 (4 << LCDC_CPOS_BPP_BIT) 413 #define LCDC_CPOS_BPP_18_24 (5 << LCDC_CPOS_BPP_BIT) 414 #define LCDC_CPOS_BPP_CMPS_24 (6 << LCDC_CPOS_BPP_BIT) 415 #define LCDC_CPOS_BPP_30 (7 << LCDC_CPOS_BPP_BIT) 416 #define LCDC_CPOS_PREMULTI (1 << 26) 417 #define LCDC_CPOS_COEF_SLE_BIT 24 418 #define LCDC_CPOS_COEF_SLE_MASK (0x3 << LCDC_CPOS_COEF_SLE_BIT) 419 #define LCDC_CPOS_COEF_SLE_0 (0 << LCDC_CPOS_COEF_SLE_BIT) 420 #define LCDC_CPOS_COEF_SLE_1 (1 << LCDC_CPOS_COEF_SLE_BIT) 421 #define LCDC_CPOS_COEF_SLE_2 (2 << LCDC_CPOS_COEF_SLE_BIT) 422 #define LCDC_CPOS_COEF_SLE_3 (3 << LCDC_CPOS_COEF_SLE_BIT) 423 #define LCDC_CPOS_YPOS_BIT 12 424 #define LCDC_CPOS_YPOS_MASK (0xfff << LCDC_CPOS_YPOS_BIT) 425 #define LCDC_CPOS_XPOS_BIT 0 426 #define LCDC_CPOS_XPOS_MASK (0xfff << LCDC_CPOS_XPOS_BIT) 427 /* Foreground 0,1 Size Register */ 428 #define LCDC_DESSIZE_ALPHA_BIT 24 429 #define LCDC_DESSIZE_ALPHA_MASK (0xff << LCDC_DESSIZE_ALPHA_BIT) 430 #define LCDC_DESSIZE_HEIGHT_BIT 12 431 #define LCDC_DESSIZE_HEIGHT_MASK (0xfff << LCDC_DESSIZE_HEIGHT_BIT) 432 #define LCDC_DESSIZE_WIDTH_BIT 0 433 #define LCDC_DESSIZE_WIDTH_MASK (0xfff << LCDC_DESSIZE_WIDTH_BIT) 434 /* Priority level threshold configure Register */ 435 #define LCDC_PCFG_LCDC_PRI_MD (1 << 31) 436 #define LCDC_PCFG_HP_BST_BIT 28 437 #define LCDC_PCFG_HP_BST_MASK (0x7 << LCDC_PCFG_HP_BST_BIT) 438 #define LCDC_PCFG_HP_BST_4 (0 << LCDC_PCFG_HP_BST_BIT) 439 #define LCDC_PCFG_HP_BST_8 (1 << LCDC_PCFG_HP_BST_BIT) 440 #define LCDC_PCFG_HP_BST_16 (2 << LCDC_PCFG_HP_BST_BIT) 441 #define LCDC_PCFG_HP_BST_32 (3 << LCDC_PCFG_HP_BST_BIT) 442 #define LCDC_PCFG_HP_BST_C16 (5 << LCDC_PCFG_HP_BST_BIT) 443 #define LCDC_PCFG_HP_BST_64 (4 << LCDC_PCFG_HP_BST_BIT) 444 #define LCDC_PCFG_HP_BST_DIS (7 << LCDC_PCFG_HP_BST_BIT) 445 #define LCDC_PCFG_PCFG2_BIT 18 446 #define LCDC_PCFG_PCFG2_MASK (0x1ff << LCDC_PCFG_PCFG2_BIT) 447 #define LCDC_PCFG_PCFG1_BIT 9 448 #define LCDC_PCFG_PCFG1_MASK (0x1ff << LCDC_PCFG_PCFG1_BIT) 449 #define LCDC_PCFG_PCFG0_BIT 0 450 #define LCDC_PCFG_PCFG0_MASK (0x1ff << LCDC_PCFG_PCFG0_BIT) 451 /* Dual LCDC Channel Control register */ 452 #define LCDC_DUAL_CTRL_IPU_WR_SEL (1 << 8) 453 #define LCDC_DUAL_CTRL_TFT_SEL (1 << 6) 454 #define LCDC_DUAL_CTRL_PRI_IPU_EN (1 << 5) 455 #define LCDC_DUAL_CTRL_PRI_IPU_BIT 3 456 #define LCDC_DUAL_CTRL_PRI_IPU_MASK (0x3 << LCDC_DUAL_CTRL_PRI_IPU_BIT) 457 458 459 #ifdef __cplusplus 460 } 461 #endif 462 463 #endif /* _X1000_SLCDC_H_ */ 464