r_lcbi_regs.h 13.9 KB
Newer Older
时昊's avatar
时昊 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460
/*
****************************************************************************
PROJECT : LCBI driver
FILE    : $Id: r_lcbi_regs.h 3935 2014-09-23 08:52:32Z golczewskim $
============================================================================
DESCRIPTION
Register declaration for LCBI macro driver
============================================================================
                            C O P Y R I G H T
============================================================================
                           Copyright (c) 2014
                                  by
                       Renesas Electronics (Europe) GmbH.
                           Arcadiastrasse 10
                          D-40472 Duesseldorf
                               Germany
                          All rights reserved.
============================================================================
Purpose: only for testing

DISCLAIMER
This software is supplied by Renesas Electronics Corporation and is only
intended for use with Renesas products. No other uses are authorized. This
software is owned by Renesas Electronics Corporation and is protected under
all applicable laws, including copyright laws.
THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Renesas reserves the right, without notice, to make changes to this software
and to discontinue the availability of this software. By using this software,
you agree to the additional terms and conditions found by accessing the
following link:
http://www.renesas.com/disclaimer *
Copyright (C) 2011 Renesas Electronics Corporation. All rights reserved.

****************************************************************************
*/

#ifndef LCBI_REGS_H_
#define LCBI_REGS_H_

#ifdef __cplusplus
extern "C"
{
#endif

    /*******************************************************************************
      Title: LCBI Register Offsets

      Only the driver modules shall include this header.
    */

    /*******************************************************************************
      Section: Global Defines
    */

    /***********************************************************
      Constants:

      R_LCBI_CDATA_BASE    - Base Adress of the CLUT
    */

#define R_LCBI_CDATA_BASE 0x000

    /***********************************************************
      Constants: Access Registers (offsets)

      R_LCBI_DATA_A0S_W8    - Write 8-bit with A0 set
      R_LCBI_DATA_A0S_W16   - Write 16-bit with A0 set
      R_LCBI_DATA_A0S_W32   - Write 32-bit with A0 set
      R_LCBI_DATA_A0C_W8    - Write 8-bit with A0 clear
      R_LCBI_DATA_A0C_W16   - Write 16-bit with A0 clear
      R_LCBI_DATA_A0C_W32   - Write 32-bit with A0 clear
      R_LCBI_DATA_A0S_RT8   - Read 8-bit with A0 set and cycle start trigger
      R_LCBI_DATA_A0S_RT16  - Read 16-bit with A0 set and cycle start trigger
      R_LCBI_DATA_A0S_RT32  - Read 32-bit with A0 set and cycle start trigger
      R_LCBI_DATA_A0C_RT8   - Read 8-bit with A0 clear and cycle start trigger
      R_LCBI_DATA_A0C_RT16  - Read 16-bit with A0 clear and cycle start trigger
      R_LCBI_DATA_A0C_RT32  - Read 32-bit with A0 clear and cycle start trigger
      R_LCBI_DATA_R         - Read LCD Data Register
    */

#define R_LCBI_DATA_A0S_W8   0x400
#define R_LCBI_DATA_A0S_W16  0x404
#define R_LCBI_DATA_A0S_W32  0x408
#define R_LCBI_DATA_A0C_W8   0x40C
#define R_LCBI_DATA_A0C_W16  0x410
#define R_LCBI_DATA_A0C_W32  0x414
#define R_LCBI_DATA_A0S_RT8  0x418
#define R_LCBI_DATA_A0S_RT16 0x41C
#define R_LCBI_DATA_A0S_RT32 0x420
#define R_LCBI_DATA_A0C_RT8  0x424
#define R_LCBI_DATA_A0C_RT16 0x428
#define R_LCBI_DATA_A0C_RT32 0x42C
#define R_LCBI_DATA_R        0x430

    /***********************************************************
      Constants: Control Registers (offsets)

      EE_LCDBUSIF_CKSEL      - Clock Selection
      EE_LCDBUSIF_DBGMOD     - Debug Mode
      EE_LCDBUSIF_SRESET     - Software Reset
      EE_LCDBUSIF_OPMODE     - Operation Mode
      EE_LCDBUSIF_CLUTOFFS   - CLUT Table 4-bit Offset
      EE_LCDBUSIF_TCONTROL   - Transfer Control Setting
      EE_LCDBUSIF_BCYCT      - Bus Cycle Type non-TFT
      EE_LCDBUSIF_BCYC       - non-TFT Bus Cycle Spec.
      EE_LCDBUSIF_TFTPRS     - TFT Operation Prescaler
      EE_LCDBUSIF_TFTCYC0    - TFT Cycle Specification (common phases)
      EE_LCDBUSIF_TFTCYC1    - TFT Cycle Specification (vertical phases)
      EE_LCDBUSIF_TFTCYC2    - TFT Cycle Specification (horizontal phases)
      EE_LCDBUSIF_OUTLEV     - Signal Output Level Spec.
      EE_LCDBUSIF_STATUS     - TC Status Information
      EE_LCDBUSIF_STATE      - TC and TG State Information
      EE_LCDBUSIF_IRQPEN     - Pending interrupt Register
      EE_LCDBUSIF_IRQCLR     - Pending Interrupt Clear Register
    */

#define R_LCBI_CKSEL    0x440
#define R_LCBI_DBGMOD   0x444
#define R_LCBI_SRESET   0x448
#define R_LCBI_OPMODE   0x44C
#define R_LCBI_CLUTOFFS 0x450
#define R_LCBI_TCONTROL 0x454
#define R_LCBI_BCYCT    0x458
#define R_LCBI_BCYC     0x45C
#define R_LCBI_TFTPRS   0x460
#define R_LCBI_TFTCYC0  0x464
#define R_LCBI_TFTCYC1  0x468
#define R_LCBI_TFTCYC2  0x46C
#define R_LCBI_OUTLEV   0x470
#define R_LCBI_STATUS   0x474
#define R_LCBI_STATE    0x478
#define R_LCBI_IRQPEN   0x47C
#define R_LCBI_IRQCLR   0x480

    /*******************************************************************************
      Section: Global Types

      LCBI Register Definitions
    */

    /***********************************************************
      Type: r_lcbi_RegOpmodeBits_t

      Content of the operation mode control register EE_LCDBIF_OPMODE

      Members:
      Opm_ode   - operation mode
      Opm_fast  - cycle speed
      Resn      - reserved (n=1,2)

    */

    typedef struct
    {
        uint32_t Opm_ode  : 2;
        uint32_t Res1     : 2;
        uint32_t Opm_fast : 1;
        uint32_t Res2     : 27;
    } r_lcbi_RegOpmodeBits_t;

    /***********************************************************
      Union: r_lcbi_RegOpmode_t

      Simplifies Bit and double word access to register EE_LCDBIF_OPMODE

      Members:
      Bits   - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegOpmodeBits_t Bits;
        uint32_t               DWord;
    } r_lcbi_RegOpmode_t;

    /***********************************************************
      Type: r_lcbi_RegTconBits_t

      Content of the data transfer control register EE_LCDBIF_TCONTROL

      Members:
      Dtc_c  - Direct/Indirect transfer
      Dtc_p  - 4-/8-bit palette for CLUT operation
      Dtc_m  - transfer mode (8-, 9-, 16-, 18-bit transfer mode)
      Dtc_s  - Bit shifting
      Resn    - Reserved (n=1,2)

    */

    typedef struct
    {
        uint32_t Dtc_c : 1;
        uint32_t Dtc_p : 1;
        uint32_t Res1  : 2;
        uint32_t Dtc_m : 2;
        uint32_t Dtc_s : 2;
        uint32_t Res2  : 24;
    } r_lcbi_RegTconBits_t;

    /***********************************************************
      Union: r_lcbi_RegTcon_t

      Simplifies Bit and double word access to register EE_LCDBIF_TCONTROL

      Members:
      Bits   - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegTconBits_t Bits;
        uint32_t             DWord;
    } r_lcbi_RegTcon_t;

    /***********************************************************
      Type: r_lcbi_RegBcycBits_t

      Content of the data transfer control register EE_LCDBIF_BCYC

      Members:
      Tiad      - timing spec. of non-TFT mode
      Tidz      - timing spec. of non-TFT mode
      Tidw      - timing spec. of non-TFT mode
      Tiwr_med  - timing spec. of non-TFT mode
      Res       - reserved
    */

    typedef struct
    {
        uint32_t Tiad     : 4;
        uint32_t Tidz     : 4;
        uint32_t Tidw     : 4;
        uint32_t Res      : 4;
        uint32_t Tiwr_med : 8;
        uint32_t Tird     : 4;
    } r_lcbi_RegBcycBits_t;

    /***********************************************************
      Union: r_lcbi_RegBcyc_t

      Simplifies Bit and double word access to register EE_LCDBIF_BCYC

      Members:
      Bits  - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegBcycBits_t Bits;
        uint32_t             Dword;
    } r_lcbi_RegBcyc_t;

    /***********************************************************
      Type: r_lcbi_RegTftCyc0Bits_t

      Content of the data transfer control register EE_LCDBIF_TFTCYC0

      Members:
      Tfdhv  - Delay of active HSYNC to VSYNC
      Tfdch  - Delad of active pixel clock to HSYNC
      Tfdcd  - Delay of data to active pixel clock
      Tfdcw  - Width of active pixel clock
      Resn   - Reserved (n=1,2)

    */

    typedef struct
    {
        uint32_t Tfdhv : 8;
        uint32_t Tfdch : 8;
        uint32_t Tfdcd : 7;
        uint32_t Res1  : 1;
        uint32_t Tfdcw : 7;
        uint32_t Res2  : 1;
    } r_lcbi_RegTftCyc0Bits_t;

    /***********************************************************
      Union: r_lcbi_RegTftCyc0_t

      Simplifies Bit and double word access to register EE_LCDBIF_TFTCYC0

      Members:
      Bits  - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegTftCyc0Bits_t Bits;
        uint32_t                Dword;
    } r_lcbi_RegTftCyc0_t;

    /***********************************************************
      Type: r_lcbi_RegTftCyc1Bits_t

      Content of the data transfer control register EE_LCDBIF_TFTCYC1

      Members:
      Tfnhvs  - Width of VSYNC as a number of HSYNC pulses
      Tfnvb   - Vertical back porch time as a number of HSYNC pulses
      Tfnvc   - Amount of horizontal lines as a number of HSYNC pulses
      Tfnve   - Size of vertical end of frame as number of HSYNC pulses
    */

    typedef struct
    {
        uint32_t Tfnhvs : 8;
        uint32_t Tfnvb  : 8;
        uint32_t Tfnvc  : 10;
        uint32_t Tfnve  : 6;
    } r_lcbi_RegTftCyc1Bits_t;

    /***********************************************************
      Union: r_lcbi_RegTftCyc1_t

      Simplifies Bit and double word access to register EE_LCDBIF_TFTCYC1

      Members:
      Bits  - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegTftCyc1Bits_t Bits;
        uint32_t                Dword;
    } r_lcbi_RegTftCyc1_t;

    /***********************************************************
      Type: r_lcbi_RegTftCyc2Bits_t

      Content of the data transfer control register EE_LCDBIF_TFTCYC2

      Members:
      Tfnchs  - Width of HSYNC as a number of clocks
      Tfnhb   - Hertical back porch time as a number of clocks
      Tfnhc   - Amount of horizontal pixels as a number of clocks
      Tfnhe   - Size of horizontal end of line as number of clocks
    */

    typedef struct
    {
        uint32_t Tfnchs : 8;
        uint32_t Tfnhb  : 8;
        uint32_t Tfnhc  : 10;
        uint32_t Tfnhe  : 6;
    } r_lcbi_RegTftCyc2Bits_t;

    /***********************************************************
      Union: r_lcbi_RegTftCyc2_t

      Simplifies Bit and double word access to register EE_LCDBIF_TFTCYC2

      Members:
      Bits  - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegTftCyc2Bits_t Bits;
        uint32_t                Dword;
    } r_lcbi_RegTftCyc2_t;

    /***********************************************************
      Type: r_lcbi_RegStatusBits_t

      Content of the status register EE_LCDBIF_STATUS

      Members:
      Tc_Idle  - Idle
      Tc_Lock  - control register are locked/unlocked
      Tc_Rpg   - read access pending
      Res      - Reserved
    */

    typedef struct
    {
        uint32_t Tc_Idle : 1;
        uint32_t Tc_Lock : 1;
        uint32_t Tc_Rpg  : 1;
        uint32_t Res     : 29;
    } r_lcbi_RegStatusBits_t;

    /***********************************************************
      Union: r_lcbi_RegStatus_t

      Simplifies Bit and double word access to register EE_LCDBIF_STATUS

      Members:
      Bits  - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegStatusBits_t Bits;
        uint32_t               DWord;
    } r_lcbi_RegStatus_t;

    /***********************************************************
      Type: r_lcbi_RegStateBits_t

      Content of the status register EE_LCDBIF_STATE

      Members:
      State   - internal state of LCDBIF FSM
      TftSeq  - TFT areas
      Fwp     - FIFO write pointer value
      Frp     - FIFO read pointer value
      Ffl     - FIFO fill level value
      Res1-5  - Reserved
    */

    typedef struct
    {
        uint32_t State  : 3;
        uint32_t Res1   : 1;
        uint32_t TftSeq : 3;
        uint32_t Res2   : 1;
        uint32_t Fwp    : 4;
        uint32_t Res3   : 4;
        uint32_t Frp    : 4;
        uint32_t Res4   : 4;
        uint32_t Ffl    : 4;
        uint32_t Res5   : 4;
    } r_lcbi_RegStateBits_t;

    /***********************************************************
      Union: r_lcbi_RegState_t

      Simplifies Bit and double word access to register EE_LCDBIF_STATE

      Members:
      Bits   - Allow bit access.
      DWord  - Allow access of the whole double word.
    */

    typedef union
    {
        r_lcbi_RegStateBits_t Bits;
        uint32_t              DWord;
    } r_lcbi_RegState_t;

#ifdef __cplusplus
}
#endif

#endif /* LCBI_REGS_H_  */