r_lcbi_api.h 27.4 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 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119
/*
****************************************************************************
PROJECT : VLIB macro driver
FILE    : $Id: r_lcbi_api.h 4366 2014-11-19 09:43:51Z golczewskim $
============================================================================
DESCRIPTION
Generic part of the 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_API_H_
#define LCBI_API_H_

#ifdef __cplusplus
extern "C"
{
#endif

    /*******************************************************************************
      Title: LCBI Driver API

      An application using LCBI should only need to include this r_lcbi_api.h
    */

    /*******************************************************************************
      Section: Global Constants
    */

    /*******************************************************************************
      Constant:  R_LCBI_VERSION_HI and R_LCBI_VERSION_LO

      Driver version information
    */

#define R_LCBI_VERSION_HI 0
#define R_LCBI_VERSION_LO 1

/*******************************************************************************
  Section: Global Types
*/
/***********************************************************
  Define: LCBI
*/
#define LCBI_NUM 0

/* status registers */
#define LCBI_BUFFER_UNDERRUN    (0x00000200u)
#define LCBI_BUFFER_OVERFLOW    (0x00000100u)
#define LCBI_IRQPEN_OFFSET_ADDR (0x47Cu)

/* fill register address */
#define LCBI_DATA_A0S_W8  (0xfffb0400u)
#define LCBI_DATA_A0S_W16 (0xfffb0404u)
#define LCBI_DATA_A0S_W32 (0xfffb0408u)

#define DISPLAY_NAME   "NEC_QVGA_TOUCH_240x320"
#define DISPLAY_WIDTH  240
#define DISPLAY_STRIDE (DISPLAY_WIDTH + 16)
#define DISPLAY_HEIGHT 320
#define DISPLAY_BPP    4

    /*******************************************************************************
      Enum: r_lcbi_Error_t

      LCBI macro driver error code.

      If an error occures these enums give information about the
      reason.

      Values:
      R_LCBI_ERR_OK           - No error
      R_LCBI_ERR_NG           - Unspecified error
    */

    typedef enum
    {
        R_LCBI_ERR_OK = 0x0,
        R_LCBI_ERR_FIFOOVERF,
        R_LCBI_ERR_FIFOUNDR,
        R_LCBI_ERR_NG,
        R_LCBI_ERR_RANGE,
        R_LCBI_ERR_LOCKED,
        R_LCBI_ERR_NOTLOCKED
    } r_lcbi_Error_t;

    /*******************************************************************************
      Enum: r_lcbi_Interrupt_t

      Lcbi macro interrupt type.

      List of all available interrupts for this macro.

      Values:
      R_LCBI_INT_RDY        - Ready Interrupt
      R_LCBI_INT_EMPT       - Empty Interrupt
      R_LCBI_INT_QTR        - Quarter Interrupt
      R_LCBI_INT_HALF       - Half Interrupt
      R_LCBI_INT_3QTR       - Three-Quarter Interrupt
      R_LCBI_INT_FULL       - Full
      R_LCBI_INT_NUM        - Delimiter
    */

    typedef enum
    {
        R_LCBI_INT_RDY,
        R_LCBI_INT_EMPT,
        R_LCBI_INT_QTR,
        R_LCBI_INT_HALF,
        R_LCBI_INT_3QTR,
        R_LCBI_INT_FULL,
        R_LCBI_INT_NUM
    } r_lcbi_Interrupt_t;

    /***********************************************************
      Enum: r_lcbi_BusCycle_Type_t

      External bus interface mode.

      Values:
      R_LCBI_BUSCYCLE_RAM    - Control signals are ~WR and ~RD
      R_LCBI_BUSCYCLE_ETYPE     - Control signals are E and R/W
    */

    typedef enum
    {
        R_LCBI_BUSCYCLE_RAM = 0,
        R_LCBI_BUSCYCLE_ETYPE
    } r_lcbi_BusCycle_Type_t;

    /***********************************************************
      Enum: r_lcbi_WM_t

      LCBI working mode.

      Values:
      R_LCBI_WM_STOP         - LCBI Stopped
      R_LCBI_WM_NONTFT       - non-TFT mode
      R_LCBI_WM_TFT          - TFT mode
      R_LCBI_WM_CLUT_DEF     - CLUT definition mode
    */

    typedef enum
    {
        R_LCBI_WM_STOP = 0,
        R_LCBI_WM_NONTFT,
        R_LCBI_WM_TFT,
        R_LCBI_WM_CLUT_DEF,
    } r_lcbi_WM_t;

    /***********************************************************
      Enum: r_lcbi_BusCycle_Speed_t

      LCDBIF bus cycle speed

      Values:
      R_LCBI_BUSCYCLE_SLOW  - slow bus cycle mode
      R_LCBI_BUSCYCLE_FAST  - fast bus cycle mode
    */

    typedef enum
    {
        R_LCBI_BUSCYCLE_SLOW = 0,
        R_LCBI_BUSCYCLE_FAST
    } r_lcbi_BusCycle_Speed_t;

    /***********************************************************
      Enum: r_lcbi_TransferMode_t

      direct and indirect access mode

      Values:
      R_LCBI_DIRECT    - Direct reading and writing mode
      R_LCBI_INDIRECT  - Indirect writing mode
    */

    typedef enum
    {
        R_LCBI_DIRECT = 0,
        R_LCBI_INDIRECT
    } r_lcbi_TransferMode_t;

    /***********************************************************
      Enum: r_lcbi_INDPalette_t

      Palette bits in indirect access mode

      Values:
      R_LCBI_IND_8BP  - 8-Bit palette for CLUT operation
      R_LCBI_IND_4BP  - 4-Bit palette for CLUT operation
    */

    typedef enum
    {
        R_LCBI_IND_8BP = 0,
        R_LCBI_IND_4BP
    } r_lcbi_INDPalette_t;

    /***********************************************************
      Enum: r_lcbi_AccessBit_t

      Access mode (8, 9, 16, 18-bit access mode)

      Values:
      R_LCBI_8BIT   - 8-bit mode
      R_LCBI_16BIT  - 16-bit mode
      R_LCBI_9BIT   - 9-bit mode
      R_LCBI_18BIT  - 18-bit mode
    */

    typedef enum
    {
        R_LCBI_8BIT = 0,
        R_LCBI_16BIT,
        R_LCBI_9BIT,
        R_LCBI_18BIT
    } r_lcbi_AccessBit_t;

    /***********************************************************
      Enum: r_lcbi_ShiftBit_t

      Shift bits, depending on these bits, values are transferred
      on certain ranges on LCD Bus.

      Values:
      R_LCBI_SHIFT0
      R_LCBI_SHIFT1
      R_LCBI_SHIFT2
      R_LCBI_SHIFT3
    */

    typedef enum
    {
        R_LCBI_SHIFT0 = 0,
        R_LCBI_SHIFT1,
        R_LCBI_SHIFT2,
        R_LCBI_SHIFT3
    } r_lcbi_ShiftBit_t;

    /***********************************************************
      Enum: r_lcbi_TransferCtrl_t

      transfer mode

      Values:
      R_LCBI_D_8BIT_S0
      R_LCBI_D_8BIT_S1
      R_LCBI_D_8BIT_S2
      R_LCBI_D_8BIT_S3
      R_LCBI_D_9BIT
      R_LCBI_D_16BIT_S1
      R_LCBI_D_16BIT_S2
      R_LCBI_D_18BIT
      R_LCBI_IND_9BIT_4BP
      R_LCBI_IND_9BIT_8BP
      R_LCBI_IND_18BIT_4BP
      R_LCBI_IND_18BIT_8BP
    */

    typedef enum
    {
        R_LCBI_D_8BIT_S0     = 0x00000000,
        R_LCBI_D_8BIT_S1     = 0x00000040,
        R_LCBI_D_8BIT_S2     = 0x00000080,
        R_LCBI_D_8BIT_S3     = 0x000000C0,
        R_LCBI_D_9BIT        = 0x00000020,
        R_LCBI_D_16BIT_S1    = 0x00000050,
        R_LCBI_D_16BIT_S2    = 0x00000090,
        R_LCBI_D_18BIT       = 0x00000030,
        R_LCBI_IND_9BIT_4BP  = 0x00000023,
        R_LCBI_IND_9BIT_8BP  = 0x00000021,
        R_LCBI_IND_18BIT_4BP = 0x00000033,
        R_LCBI_IND_18BIT_8BP = 0x00000031
    } r_lcbi_TransferCtrl_t;

    /***********************************************************
      Enum: r_lcbi_CLKDIV_t

      set the (LCBI internal) clock divider

      Values:
      R_LCBI_CLKDIV_1  - clock division 1/1
      R_LCBI_CLKDIV_2  - clock division 1/2
      R_LCBI_CLKDIV_4  - clock division 1/4
      R_LCBI_CLKDIV_8  - clock division 1/8
      R_LCBI_CLKDIV_16  - clock division 1/16
      R_LCBI_CLKDIV_32  - clock division 1/32
      R_LCBI_CLKDIV_64  - clock division 1/64
    */

    typedef enum
    {
        R_LCBI_CLKDIV_1 = 0x00,
        R_LCBI_CLKDIV_2,
        R_LCBI_CLKDIV_4,
        R_LCBI_CLKDIV_8,
        R_LCBI_CLKDIV_16,
        R_LCBI_CLKDIV_32,
        R_LCBI_CLKDIV_64
    } r_lcbi_CLKDIV_t;

    /***********************************************************
      Enum: r_lcbi_Output_Active_t

      set the active level

      Values:
      R_LCBI_XX_ACTIVELOW  - active low for signal
      R_LCBI_XX_ACTIVELOW  - active high
        -> signals in TFT-mode:     HS (hsync), VS (vsync), DE (data enable)
        -> signals in non TFT-mode: RDZE (RD strobe / E-Type mode)
    */

    typedef enum
    {
        R_LCBI_ACTIVE_DEFAULT = 0x00000000,

        R_LCBI_HS_ACTIVELOW  = 0x00000000,
        R_LCBI_HS_ACTIVEHIGH = (1ul << 8u),
        R_LCBI_VS_ACTIVELOW  = 0x00000000,
        R_LCBI_VS_ACTIVEHIGH = (1ul << 9u),
        R_LCBI_DE_ACTIVELOW  = 0x00000000,
        R_LCBI_DE_ACTIVEHIGH = (1ul << 10u),

        R_LCBI_RDZE_ACTIVELOW  = 0x00000000,
        R_LCBI_RDZE_ACTIVEHIGH = (1ul << 3u)
    } r_lcbi_Output_Active_t;

    /***********************************************************
      Type: r_lcbi_Parameter_t

      LCDBIF macro configuration data

      Members:
      WorkMode   - see <r_lcbi_WM_t>
      CycleSpeed - see <r_lcbi_Bus_Cycle_Speed_t>
      CycleType  - see <r_lcbi_Bus_Cycle_Type_t>
      TransMode  - see <r_lcbi_Transfer_Mode_t>
      IndPalette - see <r_lcbi_IND_Palette_t>
      AccessBit  - see <r_lcbi_AccessBit_t>
      ShiftBit   - see <r_lcbi_ShiftBit_t>
    */

    typedef struct
    {
        r_lcbi_WM_t             WorkMode;
        r_lcbi_BusCycle_Speed_t CycleSpeed;
        r_lcbi_BusCycle_Type_t  CycleType;
        r_lcbi_TransferMode_t   TransMode;
        r_lcbi_INDPalette_t     IndPalette;
        r_lcbi_AccessBit_t      AccessBit;
        r_lcbi_ShiftBit_t       ShiftBit;
    } r_lcbi_Parameter_t;

    /*******************************************************************************
      Section: Global API Functions
    */

    /*******************************************************************************
      Function: R_LCBI_GetVersionStr

      Get the driver version number in human readable form (string).

      Parameters:
      void

      Returns:
      ReceiveString     - Pointer to receive string destination

    */

    const int8_t *R_LCBI_GetVersionStr(void);

    /*******************************************************************************
      Function: R_LCBI_GetMajorVersion

      Get the driver major version number.

      Parameters:
      void

      Returns:
         - Major version number

    */

    const uint16_t R_LCBI_GetMajorVersion(void);

    /*******************************************************************************
      Function: R_LCBI_GetMinorVersion

      Get the driver minor version number.

      Parameters:
      void

      Returns:
         - Minor version number

    */

    const uint16_t R_LCBI_GetMinorVersion(void);

    /*******************************************************************************
      Function: R_LCBI_Init

      Driver init function.

      Parameters:
      Unit          - Macro instance number

      Returns:
      see: <r_lcbi_Error_t>
    */

    r_lcbi_Error_t R_LCBI_Init(uint32_t Unit);

    /*******************************************************************************
      Function: R_LCBI_DeInit

      Driver deinit function.

      Parameters:
      Unit       - Macro Instance number

      Returns:
      see: <r_lcbi_Error_t>
    */

    r_lcbi_Error_t R_LCBI_DeInit(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_GetFIFOFillLevel

      Get the Fifo fill level value

      Parameters:
      Unit  - Instance number

      Returns:
      The fifo fill level value
    */

    uint8_t R_LCBI_GetFIFOFillLevel(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_SetWorkingParam

      Set working mode parameters for LCDBIF

      Parameters:
      Unit  - Instance number
      Param - see <r_lcbi_Parameter_t>

      Returns:
      void
    */

    void R_LCBI_SetWorkingParam(uint32_t Unit, r_lcbi_Parameter_t *Param);

    /***********************************************************
      Function: R_LCBI_SetTConParam

      Set transfer control parameter for LCDBIF

      Parameters:
      Unit  - Instance number
      Param - see <r_lcbi_Parameter_t>

      Returns:
      void  -
    */

    void R_LCBI_SetTConParam(uint32_t Unit, r_lcbi_Parameter_t *Param);

    /***********************************************************
      Function: R_LCBI_StopLcdBIF

      Stop the LCDBIF

      Parameters:
      Unit  - Instance number

      Returns:
      void  -
    */

    void R_LCBI_StopLcdBIF(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_Check_TC_LOCK

      check the status of control registers (locked or unlocked)

      Parameters:
      Unit      - Instance number

      Returns:
      0  - control registers are unlocked
      1  - control registers are locked
    */

    uint8_t R_LCBI_Check_TcLock(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_IsReadPending

      check the if there is a read access is pending

      Parameters:
      Unit  - Instance number

      Returns:
      void  -
    */

    uint8_t R_LCBI_IsReadPending(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_WaitTransferring

      wait until LCDBIF is idle

      Parameters:
      Unit      - Instance number

      Returns:
      void  -
    */

    void R_LCBI_WaitTransferring(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_SetBusCycle

      Select the bus transfer type in non-TFT operation mode.

      Parameters:
      Unit  - Instance number
      BusCycle - bus cycle type, see <r_lcbi_Bus_Cycle_Type_t>

      Returns:
      void  -
    */

    void R_LCBI_SetBusCycle(uint32_t Unit, r_lcbi_BusCycle_Type_t BusCycle);

    /***********************************************************
      Function: R_LCBI_SetClock

      Select the clock source for the LCDBIF, an internal clocking
      is derived from this setting.

      Parameters:
      Unit  - Instance number
      ClockDiv - clock divider parameter

      Returns:
      void  -
    */

    void R_LCBI_SetClock(
        uint32_t        Unit,
        r_lcbi_CLKDIV_t ClockDiv);

    /***********************************************************
      Function: ee_LcdBIF_InvertOutput

      Set the output level of LCD bus signals active high or low

      Parameters:
      Unit  - Instance number
      Val   - value to be write into the output level control register

      Returns:
      void  -
    */

    void R_LCBI_InvertOutput(
        uint32_t               Unit,
        r_lcbi_Output_Active_t Val);

    /***********************************************************
      Function: R_LCBI_SetNonTFTCycleSpec

      Define the bus cycle of non_TFT Modes by specifying the timing
      steps in number of LCDBIF operation clocks.

      Parameters:
      Unit       - Instance number
      NonTFTSpec - Non TFT Mode bus cycle specification

      Returns:
      void  -
    */

    void R_LCBI_SetNonTFTCycleSpec(
        uint32_t Unit,
        uint32_t NonTFTSpec);

    /***********************************************************
      Function: R_LCBI_SetTFTPrescaler

      Set prescaler for the pixel clock in TFT operation mode

      Parameters:
      Unit   - Instance number
      TFTPRS - TFT pixel clock prescaler value

      Returns:
      void  -
    */

    void R_LCBI_SetTFTPrescaler(
        uint32_t Unit,
        uint32_t TFTPrs);

    /***********************************************************
      Function: R_LCBI_SetTFTCycleC

      Define the bus cycle of TFT operation mode (common phases)

      Parameters:
      Unit      - Instance number
      TFTCycleC - TFT cycle timing specification

      Returns:
      void  -
    */

    void R_LCBI_SetTFTCycleC(
        uint32_t Unit,
        uint32_t TFTCycleC);

    /***********************************************************
      Function: R_LCBI_SetTFTCycleV

      Define the bus cycle of TFT operation mode (vertical phases)

      Parameters:
      Unit      - Instance number
      TFTCycleV - TFT cycle timing specification

      Returns:
      void  -
    */

    void R_LCBI_SetTFTCycleV(
        uint32_t Unit,
        uint32_t TFTCycleV);

    /***********************************************************
      Function: R_LCBI_SetTFTCycleH

      Define the bus cycle of TFT operation mode (horizontal phases)

      Parameters:
      Unit      - Instance number
      TFTCycleH - TFT cycle timing specification

      Returns:
      void  -
    */

    void R_LCBI_SetTFTCycleH(
        uint32_t Unit,
        uint32_t TFTCycleH);

    /***********************************************************
      Function: R_LCBI_WaitWorkModeStable

      Pool the operation mode and ensure it has gone to zero

      Parameters:
      Unit - Instance number

      Returns:
      void  -
    */

    void R_LCBI_WaitWorkModeStable(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_WriteData8_A0S

      Write 8-bit with A0 set

      Parameters:
      Unit      - Instance number
      Data      - Data to be written

      Returns:
      void  -
    */

    void R_LCBI_WriteData8_A0S(uint32_t Unit, uint8_t Data);

    /***********************************************************
      Function: R_LCBI_WriteData8_A0C

      Write 8-bit with A0 clear

      Parameters:
      Unit      - Instance number
      Data      - Data to be written

      Returns:
      void  -
    */

    void R_LCBI_WriteData8_A0C(uint32_t Unit, uint8_t Data);

    /***********************************************************
      Function: R_LCBI_WriteData16_A0S

      Write 16-bit with A0 set

      Parameters:
      Unit      - Instance number
      Data      - Data to be written

      Returns:
      void  -
    */

    void R_LCBI_WriteData16_A0S(uint32_t Unit, uint16_t Data);

    /***********************************************************
      Function: R_LCBI_WriteData16_A0C

      Write 16-bit with A0 clear

      Parameters:
      Unit      - Instance number
      Data      - Data to be written

      Returns:
      void  -
    */

    void R_LCBI_WriteData16_A0C(uint32_t Unit, uint16_t Data);

    /***********************************************************
      Function: R_LCBI_WriteData32_A0S

      Write 32-bit with A0 set

      Parameters:
      Unit      - Instance number
      Data      - Data to be written

      Returns:
      void  -
    */

    void R_LCBI_WriteData32_A0S(uint32_t Unit, uint32_t Data);

    /***********************************************************
      Function: R_LCBI_WriteData32_A0C

      Write 32-bit with A0 clear

      Parameters:
      Unit      - Instance number
      Data      - Data to be written

      Returns:
      void  -
    */

    void R_LCBI_WriteData32_A0C(uint32_t Unit, uint32_t Data);

    /***********************************************************
      Function: R_LCBI_ReadData8_A0S

      Read 8-bit with cycle start trigger and A0 set

      Parameters:
      Unit - Instance number

      Returns:
      8-bit data read from LCDBIF
    */

    uint8_t R_LCBI_ReadData8_A0S(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_ReadData8_A0C

      Read 8-bit with cycle start trigger and A0 clear

      Parameters:
      Unit - Instance number

      Returns:
      8-bit data read from LCDBIF
    */

    uint8_t R_LCBI_ReadData8_A0C(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_ReadData16_A0S

      Read 16-bit with cycle start trigger and A0 set

      Parameters:
      Unit - Instance number

      Returns:
      16-bit data read from LCDBIF
    */

    uint16_t R_LCBI_ReadData16_A0S(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_ReadData16_A0C

      Read 16-bit with cycle start trigger and A0 clear

      Parameters:
      Unit - Instance number

      Returns:
      16-bit data read from LCDBIF
    */

    uint16_t R_LCBI_ReadData16_A0C(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_ReadData32_A0S

      Read 32-bit with cycle start trigger and A0 set

      Parameters:
      Unit - Instance number

      Returns:
      32-bit data read from LCDBIF
    */

    uint32_t R_LCBI_ReadData32_A0S(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_ReadData32_A0C

      Read 32-bit with cycle start trigger and A0 clear

      Parameters:
      Unit - Instance number

      Returns:
      32-bit data read from LCDBIF
    */

    uint32_t R_LCBI_ReadData32_A0C(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_WriteCLUT

      Define the Color Lookup Table

      Parameters:
      Unit   - Instance number
      Offset - Offset Address of the target register
      Data   - data to be written in the CLUT

      Returns:
      void  -
    */

    void R_LCBI_WriteCLUT(
        uint32_t Unit,
        uint32_t Offset,
        uint32_t Data);

    /***********************************************************
      Function: R_LCBI_ReadCLUT

      Read the Color Lookup Table

      Parameters:
      Unit   - Instance number
      Offset - Offset Address of the target register

      Returns:
      content of the register in CLUT with defined Offset
    */

    uint32_t R_LCBI_ReadCLUT(
        uint32_t Unit,
        uint32_t Offset);

    /***********************************************************
      Function: R_LCBI_ResetLcdBIF

      Reset the LCDBIF

      Parameters:
      Unit - Instance number

      Returns:
      void  -
    */

    void R_LCBI_ResetLcdBIF(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_GetRegister

      Get the content of a register

      Parameters:
      Unit - Instance number
      Addr - Offset address of the target register

      Returns:
      Content of the target register
    */

    uint32_t R_LCBI_GetRegister(uint32_t Unit, uint32_t Addr);

    /***********************************************************
      Function: R_LCBI_GetWorkingMode

      Get the working mode of LCDBIF

      Parameters:
      Unit - Instance number

      Returns:
      Working mode
    */

    uint8_t R_LCBI_GetWorkingMode(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_SetCLUTOffset

      Set the 4-bit offset of CLUT address.

      Parameters:
      Unit   - Instance number
      Offset - Offset of CLUT address

      Returns:
      void  -
    */

    void R_LCBI_SetCLUTOffset(uint32_t Unit, uint32_t Offset);

    /***********************************************************
      Function: R_LCBI_GetFSMState

      Get the state of the internal FSM

      Parameters:
      Unit  - Instance number

      Returns:
      state of the internal FSM
    */

    uint8_t R_LCBI_GetFSMState(uint32_t Unit);

    /***********************************************************
      Function: R_LCBI_WriteReg

      Write a register

      Parameters:
      Unit   - Instance number
      Data   - data to be written
      Offset - offset address of the register

      Returns:
      void  -
    */

    void R_LCBI_WriteReg(uint32_t Unit, uint32_t Data, uint32_t Offset);

    /*******************************************************************************
      Group: LCBI Error and ISR Functions
    */

    /*******************************************************************************
      Function: R_LCBI_SetErrorCallback

      Set a user function as error handler.

      When the driver detects any error, it will call this function.

      Parameters:
      ErrorCallback - Pointer to a user function

      Returns:
      void
    */

    void R_LCBI_SetErrorCallback(void (*ErrorCallback)(uint32_t Unit, uint32_t Error));

    /*******************************************************************************
      Function: R_LCBI_SetIsrCallback

      Assign a user callback for the given interrupt of a unit.

      The function will be called after the driver ISR has
      processed the interrupt.

      Parameters:
      Unit          - Instance number
      Interrupt       - What interrupt,  see: <r_lcbi_Interrupt_t>
      Isr           - Isr function pointer

      Returns:
      see: <r_lcbi_Error_t>
    */

    r_lcbi_Error_t R_LCBI_SetIsrCallback(uint32_t Unit, r_lcbi_Interrupt_t Interrupt, void (*Isr)(void));

    /***********************************************************
      Function: R_LCBI_Isr

      Device interrupt service routine.

      This function shall be called by device interrupt handler
      (xxxxxx_isr.c) and can be found in lcbi\src\lcbi_isr.c.

      Parameters:
      Unit       - Instance number
      Interrupt  - Interrupt type. see<r_lcbi_Interrupt_t>

      Returns:
      void  -
    */

    void R_LCBI_Isr(uint32_t Unit, r_lcbi_Interrupt_t Interrupt);

    /*******************************************************************************
      Function: R_LCBI_EnableInt

      Enable the LCBI interrupt 'Interrupt'.

      Parameters:
      Unit       - Instance number
      Interrupt  - Interrupt type see: <r_lcbi_Interrupt_t>

      Returns:
      void
    */

    void R_LCBI_EnableInt(uint32_t Unit, r_lcbi_Interrupt_t Interrupt);

    /*******************************************************************************
      Function: R_LCBI_DisableInt

      Disable the LCBI interrupt 'Interrupt'.

      Parameters:
      Unit       - Instance number
      Interrupt  - Interrupt type see: <r_lcbi_Interrupt_t>

      Returns:
      void
    */

    void R_LCBI_DisableInt(uint32_t Unit, r_lcbi_Interrupt_t Interrupt);

    /*******************************************************************************
      Function: R_LCBI_GetClock

      Get the macro clock frequency of the LCBI

      Parameters:
      Unit       - Instance number

      Returns:
      void
    */

    uint32_t R_LCBI_GetClock(uint32_t Unit);

#ifdef __cplusplus
}
#endif

#endif /* LCBI_API_H_  */