Lcd companion boards support (VKLCD50RTA & VKLCD70RT)

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DisplayBace.h Source File

DisplayBace.h

00001 /*******************************************************************************
00002 * DISCLAIMER
00003 * This software is supplied by Renesas Electronics Corporation and is only
00004 * intended for use with Renesas products. No other uses are authorized. This
00005 * software is owned by Renesas Electronics Corporation and is protected under
00006 * all applicable laws, including copyright laws.
00007 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
00008 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
00009 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
00010 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
00011 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
00012 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
00013 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
00014 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
00015 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
00016 * Renesas reserves the right, without notice, to make changes to this software
00017 * and to discontinue the availability of this software. By using this software,
00018 * you agree to the additional terms and conditions found by accessing the
00019 * following link:
00020 * http://www.renesas.com/disclaimer
00021 * Copyright (C) 2012 - 2015 Renesas Electronics Corporation. All rights reserved.
00022 *******************************************************************************/
00023 /**************************************************************************//**
00024  * @file         DisplayBase.h
00025  * @brief        Display driver wrapper class for RGA
00026 ******************************************************************************/
00027 
00028 #ifndef MBED_DISPLAYBASE_H
00029 #define MBED_DISPLAYBASE_H
00030 
00031 #include "pinmap.h"
00032 
00033 /*! @class DisplayBase
00034  *  @brief Display driver wrapper class for RGA
00035  */
00036 class DisplayBase
00037 {
00038 
00039 public:
00040     /*! @enum video_input_channel_t
00041         @brief Video input channel select
00042      */
00043     typedef enum {
00044         VIDEO_INPUT_CHANNEL_0  = 0, /*!< Video input channel 0 */
00045         VIDEO_INPUT_CHANNEL_1       /*!< Video input channel 1 */
00046     } video_input_channel_t;
00047 
00048     /*! @enum video_adc_vinsel_t
00049         @brief Input pin control
00050      */
00051     typedef enum {
00052         VIDEO_ADC_VINSEL_VIN1  = 0, /*!< VIN1 input            */
00053         VIDEO_ADC_VINSEL_VIN2       /*!< VIN2 input            */
00054     } video_adc_vinsel_t;
00055 
00056     /*! @enum graphics_layer_t
00057         @brief Graphics layer select
00058      */
00059     typedef enum {
00060         GRAPHICS_LAYER_0  = 0,           /*!< Graphics layer 0         */
00061         GRAPHICS_LAYER_1 ,               /*!< Graphics layer 1         */
00062         GRAPHICS_LAYER_2 ,               /*!< Graphics layer 2         */
00063         GRAPHICS_LAYER_3                 /*!< Graphics layer 3         */
00064     } graphics_layer_t;
00065 
00066     /*! @enum graphics_error_t
00067         @brief Error codes
00068      */
00069     typedef enum {
00070         GRAPHICS_OK  = 0,                   /*!< Normal termination       */
00071         GRAPHICS_VDC5_ERR  = -1,            /*!< VDC5 driver error        */
00072         GRAPHICS_FORMA_ERR  = -2,           /*!< Not support format       */
00073         GRAPHICS_LAYER_ERR  = -3,           /*!< Invalid layer ID error   */
00074         GRAPHICS_CHANNLE_ERR  = -4,         /*!< Invalid channel error */
00075         GRAPHICS_VIDEO_NTSC_SIZE_ERR  = -5, /*!< Video write size(vw) error */
00076         GRAPHICS_VIDEO_PAL_SIZE_ERR  = -6,  /*!< Video Write size(vw) error */
00077         GRAPHICS_PARAM_RANGE_ERR  = -7      /*!< Parameter range error */
00078     } graphics_error_t;
00079 
00080     /*! @enum graphics_format_t
00081         @brief Graphics layer read format selects
00082     */
00083     typedef enum {
00084         GRAPHICS_FORMAT_YCBCR422  = 0,      /*!< YCbCr422 (2byte / px)  */
00085         GRAPHICS_FORMAT_RGB565 ,            /*!< RGB565   (2byte / px)  */
00086         GRAPHICS_FORMAT_RGB888 ,            /*!< RGB888   (4byte / px)  */
00087         GRAPHICS_FORMAT_ARGB8888 ,          /*!< ARGB8888 (4byte / px)  */
00088         GRAPHICS_FORMAT_ARGB4444            /*!< ARGB4444 (2byte / px)  */
00089     } graphics_format_t;
00090 
00091     /*! @enum video_format_t
00092         @brief Video writing format selects
00093      */
00094     typedef enum {
00095         VIDEO_FORMAT_YCBCR422  = 0,      /*!< YCbCr422 (2byte / px)    */
00096         VIDEO_FORMAT_RGB565 ,            /*!< RGB565   (2byte / px)    */
00097         VIDEO_FORMAT_RGB888              /*!< RGB888   (4byte / px)    */
00098     } video_format_t;
00099 
00100     /*! @enum wr_rd_swa_t
00101         @brief Frame buffer swap setting
00102      */
00103     typedef enum {
00104         WR_RD_WRSWA_NON  = 0,           /*!< Not swapped: 1-2-3-4-5-6-7-8 */
00105         WR_RD_WRSWA_8BIT ,              /*!< Swapped in 8-bit units: 2-1-4-3-6-5-8-7 */
00106         WR_RD_WRSWA_16BIT ,             /*!< Swapped in 16-bit units: 3-4-1-2-7-8-5-6 */
00107         WR_RD_WRSWA_16_8BIT ,           /*!< Swapped in 16-bit units + 8-bit units: 4-3-2-1-8-7-6-5 */
00108         WR_RD_WRSWA_32BIT ,             /*!< Swapped in 32-bit units: 5-6-7-8-1-2-3-4 */
00109         WR_RD_WRSWA_32_8BIT ,           /*!< Swapped in 32-bit units + 8-bit units: 6-5-8-7-2-1-4-3 */
00110         WR_RD_WRSWA_32_16BIT ,          /*!< Swapped in 32-bit units + 16-bit units: 7-8-5-6-3-4-1-2 */
00111         WR_RD_WRSWA_32_16_8BIT ,        /*!< Swapped in 32-bit units + 16-bit units + 8-bit units: 8-7-6-5-4-3-2-1 */
00112     } wr_rd_swa_t;
00113 
00114     /*! @enum lcd_tcon_pin_t
00115         @brief LCD tcon output pin selects
00116      */
00117     typedef enum {
00118         LCD_TCON_PIN_NON  = -1,          /*!< Not using output         */
00119         LCD_TCON_PIN_0 ,                 /*!< LCD_TCON0                */
00120         LCD_TCON_PIN_1 ,                 /*!< LCD_TCON1                */
00121         LCD_TCON_PIN_2 ,                 /*!< LCD_TCON2                */
00122         LCD_TCON_PIN_3 ,                 /*!< LCD_TCON3                */
00123         LCD_TCON_PIN_4 ,                 /*!< LCD_TCON4                */
00124     } lcd_tcon_pin_t;
00125 
00126     /*! @enum lcd_outformat_t
00127         @brief LCD output format selects
00128      */
00129     typedef enum {
00130         LCD_OUTFORMAT_RGB888  = 0,       /*!< RGB888 or LVDS           */
00131         LCD_OUTFORMAT_RGB666 ,           /*!< RGB666                   */
00132         LCD_OUTFORMAT_RGB565             /*!< RGB565                   */
00133     } lcd_outformat_t;
00134 
00135     /*! @enum edge_t
00136         @brief Edge of a signal
00137      */
00138     typedef enum {
00139         EDGE_RISING     = 0,             /*!< Rising edge              */
00140         EDGE_FALLING    = 1              /*!< Falling edge             */
00141     } edge_t;
00142 
00143     /*! @enum lcd_type_t
00144         @brief LCD type
00145      */
00146     typedef enum {
00147         LCD_TYPE_LVDS  = 0,              /*!< LVDS control                */
00148         LCD_TYPE_PARALLEL_RGB            /*!< RGB parallel signal control */
00149     } lcd_type_t;
00150 
00151     /*! @enum sig_pol_t
00152         @brief Polarity of a signal
00153      */
00154     typedef enum {
00155         SIG_POL_NOT_INVERTED  = 0,       /*!< Not inverted             */
00156         SIG_POL_INVERTED                 /*!< Inverted                 */
00157     } sig_pol_t;
00158 
00159     /*! @enum int_type_t
00160         @brief Interrupt type
00161      */
00162     typedef enum {
00163         INT_TYPE_S0_VI_VSYNC  = 0,      /*!< Vsync signal input to scaler 0 */
00164         INT_TYPE_S0_LO_VSYNC ,          /*!< Vsync signal output from scaler 0 */
00165         INT_TYPE_S0_VSYNCERR ,          /*!< Missing Vsync signal for scaler 0 */
00166         INT_TYPE_VLINE ,                /*!< Specified line signal for panel output in graphics 3 */
00167         INT_TYPE_S0_VFIELD ,            /*!< Field end signal for recording function in scaler 0 */
00168         INT_TYPE_IV1_VBUFERR ,          /*!< Frame buffer write overflow signal for scaler 0 */
00169         INT_TYPE_IV3_VBUFERR ,          /*!< Frame buffer read underflow signal for graphics 0 */
00170         INT_TYPE_IV5_VBUFERR ,          /*!< Frame buffer read underflow signal for graphics 2 */
00171         INT_TYPE_IV6_VBUFERR ,          /*!< Frame buffer read underflow signal for graphics 3 */
00172         INT_TYPE_S0_WLINE ,             /*!< Write specification line signal input to scaling-down control block in scaler 0 */
00173         INT_TYPE_S1_VI_VSYNC ,          /*!< Vsync signal input to scaler 1 */
00174         INT_TYPE_S1_LO_VSYNC ,          /*!< Vsync signal output from scaler 1 */
00175         INT_TYPE_S1_VSYNCERR ,          /*!< Missing Vsync signal for scaler 1 */
00176         INT_TYPE_S1_VFIELD ,            /*!< Field end signal for recording function in scaler 1 */
00177         INT_TYPE_IV2_VBUFERR ,          /*!< Frame buffer write overflow signal for scaler 1 */
00178         INT_TYPE_IV4_VBUFERR ,          /*!< Frame buffer read underflow signal for graphics 1 */
00179         INT_TYPE_S1_WLINE ,             /*!< Write specification line signal input to scaling-down control block in scaler 1 */
00180         INT_TYPE_OIR_VI_VSYNC ,         /*!< Vsync signal input to output image generator */
00181         INT_TYPE_OIR_LO_VSYNC ,         /*!< Vsync signal output from output image generator */
00182         INT_TYPE_OIR_VLINE ,            /*!< Specified line signal for panel output in output image generator */
00183         INT_TYPE_OIR_VFIELD ,           /*!< Field end signal for recording function in output image generator */
00184         INT_TYPE_IV7_VBUFERR ,          /*!< Frame buffer write overflow signal for output image generator */
00185         INT_TYPE_IV8_VBUFERR ,          /*!< Frame buffer read underflow signal for graphics (OIR) */
00186         INT_TYPE_NUM                    /*!< The number of VDC5 interrupt types */
00187     } int_type_t;
00188 
00189     /*! @enum graphics_video_col_sys_t
00190         @brief Video color system
00191      */
00192     typedef enum {
00193         COL_SYS_NTSC_358        = 0,        /*!< NTSC-3.58 */
00194         COL_SYS_NTSC_443        = 1,        /*!< NTSC-4.43 */
00195         COL_SYS_PAL_443         = 2,        /*!< PAL-4.43 */
00196         COL_SYS_PAL_M           = 3,        /*!< PAL-M */
00197         COL_SYS_PAL_N           = 4,        /*!< PAL-N */
00198         COL_SYS_SECAM           = 5,        /*!< SECAM */
00199         COL_SYS_NTSC_443_60     = 6,        /*!< NTSC-4.43 (60Hz) */
00200         COL_SYS_PAL_60          = 7,        /*!< PAL-60 */
00201     } graphics_video_col_sys_t;
00202 
00203     /*! @enum video_input_sel_t
00204         @brief External Input select
00205      */
00206     typedef enum {
00207         INPUT_SEL_VDEC      = 0,            /*!< Video decoder output signals */
00208         INPUT_SEL_EXT       = 1             /*!< Signals supplied via the external input pins */
00209     } video_input_sel_t;
00210 
00211     /*! @enum video_extin_format_t
00212        @brief External input format select
00213     */
00214     typedef enum {
00215         VIDEO_EXTIN_FORMAT_RGB888  = 0,   /*!< RGB888 Not support */
00216         VIDEO_EXTIN_FORMAT_RGB666 ,       /*!< RGB666 */
00217         VIDEO_EXTIN_FORMAT_RGB565 ,       /*!< RGB565 */
00218         VIDEO_EXTIN_FORMAT_BT656 ,        /*!< BT6556 */
00219         VIDEO_EXTIN_FORMAT_BT601 ,        /*!< BT6501 */
00220         VIDEO_EXTIN_FORMAT_YCBCR422 ,     /*!< YCbCr422 */
00221         VIDEO_EXTIN_FORMAT_YCBCR444 ,     /*!< YCbCr444 Not support */
00222     } video_extin_format_t;
00223 
00224     /*! @enum onoff_t
00225         @brief On/off
00226      */
00227     typedef enum {
00228         OFF     = 0,            /*!< Off */
00229         ON      = 1             /*!< On */
00230     } onoff_t;
00231 
00232     /*! @enum extin_input_line_t
00233         @brief Number of lines for BT.656 external input
00234      */
00235     typedef enum {
00236         EXTIN_LINE_525      = 0,    /*!< 525 lines */
00237         EXTIN_LINE_625      = 1     /*!< 625 lines */
00238     } extin_input_line_t;
00239 
00240     /*! @enum extin_h_pos_t
00241         @brief Y/Cb/Y/Cr data string start timing
00242      */
00243     typedef enum {
00244         EXTIN_H_POS_CBYCRY  = 0,    /*!< Cb/Y/Cr/Y (BT656/601), Cb/Cr (YCbCr422) */
00245         EXTIN_H_POS_YCRYCB ,        /*!< Y/Cr/Y/Cb (BT656/601), setting prohibited (YCbCr422) */
00246         EXTIN_H_POS_CRYCBY ,        /*!< Cr/Y/Cb/Y (BT656/601), setting prohibited (YCbCr422) */
00247         EXTIN_H_POS_YCBYCR ,        /*!< Y/Cb/Y/Cr (BT656/601), Cr/Cb (YCbCr422) */
00248         EXTIN_H_POS_NUM
00249     } extin_h_pos_t;
00250 
00251     typedef enum
00252     {
00253         SLIDE_OUT_RIGHT  = 0,    /*!<    -->     */
00254         SLIDE_IN_RIGHT ,         /*!<    <--     */
00255         SLIDE_OUT_BOTTOM ,       /*!<    \/      */
00256         SLIDE_IN_BOTTOM ,        /*!<    /\      */
00257         SLIDE_OUT_LEFT ,         /*!<    <--     */
00258         SLIDE_IN_LEFT ,          /*!<    -->     */
00259         SLIDE_OUT_TOP ,          /*!<    \/      */
00260         SLIDE_IN_TOP ,           /*!<    /\      */
00261         SLIDE_NONE ,             /*!<    .       */
00262     } slide_t ;
00263 
00264     /*! @struct rect_t
00265         @brief The relative position within the graphics display area
00266      */
00267     typedef struct {
00268         unsigned short vs ;          /*!< Vertical start pos       */
00269         unsigned short vw ;          /*!< Vertical width (height)  */
00270         unsigned short hs ;          /*!< Horizontal start pos     */
00271         unsigned short hw ;          /*!< Horizontal width         */
00272     } rect_t;
00273 
00274     /*! @struct lcd_config_t
00275         @brief LCD configuration
00276      */
00277     typedef struct {
00278         lcd_type_t      lcd_type ;               /*!< LVDS or Pararel RGB                      */
00279         double          intputClock ;            /*!< P1  clk [MHz] ex. 66.67f                 */
00280         double          outputClock ;            /*!< LCD clk [MHz] ex. 33.33f                 */
00281 
00282         lcd_outformat_t lcd_outformat ;          /*!< Output format select */
00283         edge_t          lcd_edge ;               /*!< Output phase control of LCD_DATA23 to LCD_DATA0 pin */
00284 
00285         unsigned short  h_toatal_period ;        /*!< Free-running Hsync period                */
00286         unsigned short  v_toatal_period ;        /*!< Free-running Vsync period                */
00287         unsigned short  h_disp_widht ;           /*!< LCD display area size, horizontal width  */
00288         unsigned short  v_disp_widht ;           /*!< LCD display area size, vertical width    */
00289         unsigned short  h_back_porch ;           /*!< LCD display horizontal back porch period */
00290         unsigned short  v_back_porch ;           /*!< LCD display vertical back porch period   */
00291 
00292         lcd_tcon_pin_t  h_sync_port ;            /*!< TCONn or Not use(-1)                     */
00293         sig_pol_t       h_sync_port_polarity ;   /*!< Polarity inversion control of signal     */
00294         unsigned short  h_sync_width ;           /*!< Hsync width                              */
00295 
00296         lcd_tcon_pin_t  v_sync_port ;            /*!< TCONn or Not use(-1)                     */
00297         sig_pol_t       v_sync_port_polarity ;   /*!< Polarity inversion control of signal     */
00298         unsigned short  v_sync_width ;           /*!< Vsync width  */
00299 
00300         lcd_tcon_pin_t  de_port ;                /*!< TCONn or Not use(-1)                     */
00301         sig_pol_t       de_port_polarity ;       /*!< Polarity inversion control of signal     */
00302     } lcd_config_t;
00303 
00304     /*! @struct video_ext_in_config_t
00305         @brief Digital Video Input configuration
00306      */
00307     typedef struct {
00308         video_extin_format_t     inp_format ;    /*!< External Input Format Select                                */
00309         edge_t                   inp_pxd_edge ;  /*!< Clock Edge Select for Capturing External Input Video Image  */
00310         edge_t                   inp_vs_edge ;   /*!< Clock Edge Select for Capturing External Input Vsync Signal */
00311         edge_t                   inp_hs_edge ;   /*!< Clock Edge Select for Capturing External Input Hsync Signal */
00312         onoff_t                  inp_endian_on ; /*!< External Input B/R Signal Swap On/Off Control               */
00313         onoff_t                  inp_swap_on ;   /*!< External Input Bit Endian Change On/Off Control             */
00314         sig_pol_t                inp_vs_inv ;    /*!< External Input Vsync Signal DV_VSYNC Inversion Control      */
00315         sig_pol_t                inp_hs_inv ;    /*!< External Input Hsync Signal DV_HSYNC Inversion Control      */
00316         extin_input_line_t       inp_f525_625 ;  /*!< Number of lines for BT.656 external input */
00317         extin_h_pos_t            inp_h_pos ;     /*!< Y/Cb/Y/Cr data string start timing to Hsync reference */
00318         unsigned short           cap_vs_pos ;    /*!< Capture start position from Vsync */
00319         unsigned short           cap_hs_pos ;    /*!< Capture start position form Hsync */
00320         unsigned short           cap_width ;     /*!< Capture width  */
00321         unsigned short           cap_height ;    /*!< Capture height should be a multiple of 4.*/
00322     } video_ext_in_config_t;
00323 
00324     /** Constructor method of display base object
00325      */
00326     DisplayBase( void );
00327 
00328     /** Graphics initialization processing<br>
00329      *  If not using display, set NULL in parameter.
00330      *  @param[in]    lcd_config          : LCD configuration
00331      *  @retval       Error code
00332      */
00333     graphics_error_t Graphics_init( lcd_config_t * lcd_config );
00334 
00335     /** Graphics Video initialization processing<br>
00336      *  If setting INPUT_SEL_VDEC in video_input_sel parameter, set NULL in video_ext_in_config parameter.
00337      *  @param[in]    video_input_sel     : Input select
00338      *  @param[in]    video_ext_in_config : Video configuration
00339      *  @retval       error code
00340      */
00341     graphics_error_t Graphics_Video_init( video_input_sel_t video_input_sel, video_ext_in_config_t * video_ext_in_config );
00342 
00343     /** LCD output port initialization processing
00344      *  @param[in]    pin                 : Pin assign for LCD output
00345      *  @param[in]    pin_count           : Total number of pin assign
00346      *  @retval       Error code
00347      */
00348     graphics_error_t Graphics_Lcd_Port_Init( PinName *pin, unsigned int pin_count );
00349 
00350     /** LVDS output port initialization processing
00351      *  @param[in]    pin                 : Pin assign for LVDS output
00352      *  @param[in]    pin_count           : Total number of pin assign
00353      *  @retval       Error code
00354      */
00355     graphics_error_t Graphics_Lvds_Port_Init( PinName *pin, unsigned int pin_count );
00356 
00357     /** Digital video input port initialization processing
00358      *  @param[in]    pin                 : Pin assign for digital video input port
00359      *  @param[in]    pin_count           : Total number of pin assign
00360      *  @retval       Error code
00361      */
00362     graphics_error_t Graphics_Dvinput_Port_Init( PinName *pin, unsigned int pin_count );
00363 
00364     /**  Interrupt callback setup
00365      *  This function performs the following processing:
00366      *  - Enables the interrupt when the pointer to the corresponding interrupt callback function is specified.<br>
00367      *  - Registers the specified interrupt callback function.<br>
00368      *  - Disables the interrupt when the pointer to the corresponding interrupt callback function is not specified.<br>
00369      *  @param[in]    Graphics_Irq_Handler_Set : VDC5 interrupt type
00370      *  @param[in]    num                      : Interrupt line number
00371      *  @param[in]    callback                 : Interrupt callback function pointer
00372      *  @retval       Error code
00373      */
00374     graphics_error_t Graphics_Irq_Handler_Set( int_type_t Graphics_Irq_Handler_Set, unsigned short num, void (* callback)(int_type_t)  );
00375 
00376     /** Start the graphics surface read process
00377      *  @param[in]    layer_id            : Graphics layer ID <br />
00378      *      - GRAPHICS_LAYER_0 : Layer 0
00379      *      - GRAPHICS_LAYER_1 : Layer 1
00380      *      - GRAPHICS_LAYER_2 : Layer 2
00381      *      - GRAPHICS_LAYER_3 : Layer 3
00382      *  @retval       Error code
00383      */
00384     graphics_error_t Graphics_Start( graphics_layer_t layer_id );
00385 
00386     /** Stop the graphics surface read process
00387      *  @param[in]    layer_id            : Graphics layer ID <br />
00388      *      - GRAPHICS_LAYER_0 : Layer 0
00389      *      - GRAPHICS_LAYER_1 : Layer 1
00390      *      - GRAPHICS_LAYER_2 : Layer 2
00391      *      - GRAPHICS_LAYER_3 : Layer 3
00392      *  @retval       Error code
00393      */
00394     graphics_error_t Graphics_Stop( graphics_layer_t layer_id );
00395 
00396     /** Start the video surface write process
00397      *  @param[in]    video_input_channel : Video input channel <br />
00398      *      - VIDEO_INPUT_CHANNEL_0 : Video channel 0
00399      *      - VIDEO_INPUT_CHANNEL_1 : Video channel 1
00400      *  @retval       Error code
00401      */
00402     graphics_error_t Video_Start ( video_input_channel_t video_input_channel );
00403 
00404     /** Stop the video surface write process
00405      *  @param[in]    video_input_channel : Video input channel <br />
00406      *      - VIDEO_INPUT_CHANNEL_0 : Video channel 0
00407      *      - VIDEO_INPUT_CHANNEL_1 : Video channel 1
00408      *  @retval       Error code
00409      */
00410     graphics_error_t Video_Stop ( video_input_channel_t video_input_channel );
00411 
00412     /** Graphics surface read process setting
00413      *  @param[in]    layer_id            : Graphics layer ID <br />
00414      *      - GRAPHICS_LAYER_0 : Layer 0
00415      *      - GRAPHICS_LAYER_1 : Layer 1
00416      *      - GRAPHICS_LAYER_2 : Layer 2
00417      *      - GRAPHICS_LAYER_3 : Layer 3
00418      *  @param[in]    framebuff           : Base address of the frame buffer(Not set NULL)
00419      *  @param[in]    fb_stride           : Line offset address of the frame buffer[byte]  <br />
00420      *      Frame buffer stride should be set to a multiple of 32 or 128
00421      *      in accordance with the frame buffer burst transfer mode.
00422      *  @param[in]    gr_format           : Format of the frame buffer read signal <br />
00423      *      - VIDEO_FORMAT_YCBCR422 : YCBCR422 (2byte/px)
00424      *      - VIDEO_FORMAT_RGB565   : RGB565 (2byte/px)
00425      *      - VIDEO_FORMAT_RGB888   : RGB888 (4byte/px)
00426      *      - VIDEO_FORMAT_ARGB8888 : ARGB8888 (4byte/px)
00427      *  @param[in]    wr_rd_swa : frame buffer swap setting <br />
00428      *      -    WR_RD_WRSWA_NON        : Not swapped: 1-2-3-4-5-6-7-8
00429      *      -    WR_RD_WRSWA_8BIT       : Swapped in 8-bit units: 2-1-4-3-6-5-8-7
00430      *      -    WR_RD_WRSWA_16BIT      : Swapped in 16-bit units: 3-4-1-2-7-8-5-6
00431      *      -    WR_RD_WRSWA_16_8BIT    : Swapped in 16-bit units + 8-bit units: 4-3-2-1-8-7-6-5
00432      *      -    WR_RD_WRSWA_32BIT      : Swapped in 32-bit units: 5-6-7-8-1-2-3-4
00433      *      -    WR_RD_WRSWA_32_8BIT    : Swapped in 32-bit units + 8-bit units: 6-5-8-7-2-1-4-3
00434      *      -    WR_RD_WRSWA_32_16BIT   : Swapped in 32-bit units + 16-bit units: 7-8-5-6-3-4-1-2
00435      *      -    WR_RD_WRSWA_32_16_8BIT : Swapped in 32-bit units + 16-bit units + 8-bit units: 8-7-6-5-4-3-2-1
00436      *  @param[in]    gr_rect             : Graphics display area
00437      *  @retval       Error code
00438      */
00439     graphics_error_t Graphics_Read_Setting (
00440         graphics_layer_t    layer_id,
00441         void              * framebuff,
00442         unsigned int        fb_stride,
00443         graphics_format_t   gr_format,
00444         wr_rd_swa_t         wr_rd_swa,
00445         rect_t            * gr_rect );
00446 
00447     /** Graphics surface read buffer change process
00448      *  @param[in]    layer_id            : Graphics layer ID <br />
00449      *      - GRAPHICS_LAYER_0 : Layer 0
00450      *      - GRAPHICS_LAYER_1 : Layer 1
00451      *      - GRAPHICS_LAYER_2 : Layer 2
00452      *      - GRAPHICS_LAYER_3 : Layer 3
00453      *  @param[in]    framebuff           : Base address of the frame buffer(Not set NULL)
00454      *  @retval       Error code
00455      */
00456     graphics_error_t Graphics_Read_Change (
00457         graphics_layer_t    layer_id,
00458         void             *  framebuff);
00459 
00460     /** Graphics surface read buffer change process
00461      *  @param[in]    layer_id            : Graphics layer ID <br />
00462      *      - GRAPHICS_LAYER_0 : Layer 0
00463      *      - GRAPHICS_LAYER_1 : Layer 1
00464      *      - GRAPHICS_LAYER_2 : Layer 2
00465      *      - GRAPHICS_LAYER_3 : Layer 3
00466      *  @param[in]    framebuff           : Base address of the frame buffer(Not set NULL)
00467      *  @param[in]    fb_stride           : stride of the framebuff
00468      *  @param[in]    slide_dir           : slide direction
00469      *  @retval       Error code
00470      */
00471     graphics_error_t Graphics_Read_Change_More (
00472         graphics_layer_t    layer_id,
00473         void             *  framebuff,
00474         unsigned int        fb_stride,
00475         slide_t           *  slide_dir);
00476 
00477     /** Video surface write process setting
00478      *  @param[in]    video_input_channel : Video input channel <br />
00479      *                If using digital input, this parameter is not referenced. <br />
00480      *      - VIDEO_INPUT_CHANNEL_0 : Video channel 0
00481      *      - VIDEO_INPUT_CHANNEL_1 : Video channel 1
00482      *  @param[in]    col_sys             : Analog video signal color system <br />
00483      *                If using digital input, this parameter is not referenced. <br />
00484      *      - COL_SYS_NTSC_358    : NTSC-3.58
00485      *      - COL_SYS_NTSC_443    : NTSC-4.43
00486      *      - COL_SYS_PAL_443     : PAL-4.43
00487      *      - COL_SYS_PAL_M       : PAL-M
00488      *      - COL_SYS_PAL_N       : PAL-N
00489      *      - COL_SYS_SECAM       : SECAM
00490      *      - COL_SYS_NTSC_443_60 : NTSC-4.43 (60Hz)
00491      *      - COL_SYS_PAL_60      : PAL-60
00492      *  @param[in]    framebuff           : Base address of the frame buffer(Not set NULL)
00493      *  @param[in]    fb_stride           : Line offset address of the frame buffer[byte]  <br />
00494      *      Frame buffer stride should be set to a multiple of 32 or 128
00495      *      in accordance with the frame buffer burst transfer mode.
00496      *  @param[in]    video_format        : Frame buffer video-signal writing format <br />
00497      *      - VIDEO_FORMAT_YCBCR422 : YCBCR422 (2byte/px)
00498      *      - VIDEO_FORMAT_RGB565   : RGB565 (2byte/px)
00499      *      - VIDEO_FORMAT_RGB888   : RGB888 (4byte/px)
00500      *  @param[in]    wr_rd_swa : frame buffer swap setting  <br />
00501      *      -    WR_RD_WRSWA_NON        : Not swapped: 1-2-3-4-5-6-7-8
00502      *      -    WR_RD_WRSWA_8BIT       : Swapped in 8-bit units: 2-1-4-3-6-5-8-7
00503      *      -    WR_RD_WRSWA_16BIT      : Swapped in 16-bit units: 3-4-1-2-7-8-5-6
00504      *      -    WR_RD_WRSWA_16_8BIT    : Swapped in 16-bit units + 8-bit units: 4-3-2-1-8-7-6-5
00505      *      -    WR_RD_WRSWA_32BIT      : Swapped in 32-bit units: 5-6-7-8-1-2-3-4
00506      *      -    WR_RD_WRSWA_32_8BIT    : Swapped in 32-bit units + 8-bit units: 6-5-8-7-2-1-4-3
00507      *      -    WR_RD_WRSWA_32_16BIT   : Swapped in 32-bit units + 16-bit units: 7-8-5-6-3-4-1-2
00508      *      -    WR_RD_WRSWA_32_16_8BIT : Swapped in 32-bit units + 16-bit units + 8-bit units: 8-7-6-5-4-3-2-1
00509      *  @param[in]    video_write_buff_vw : Output height[px] <br />
00510      *      - NTSC format : Max height is 480[px]
00511      *      - PAL format  : Max height is 520[px]
00512      *  @param[in]    video_write_buff_hw : Output width[px] <br />
00513      *      - Max width : 800[px]
00514      *  @param[in]    video_adc_vinsel : Input pin control <br />
00515      *      - VIDEO_ADC_VINSEL_VIN1 : VIN1 input
00516      *      - VIDEO_ADC_VINSEL_VIN2 : VIN2 input
00517      *  @retval       Error code
00518      */
00519     graphics_error_t Video_Write_Setting (
00520         video_input_channel_t       video_input_channel,
00521         graphics_video_col_sys_t    col_sys,
00522         void                      * framebuff,
00523         unsigned int                fb_stride,
00524         video_format_t              video_format,
00525         wr_rd_swa_t                 wr_rd_swa,
00526         unsigned short              video_write_buff_vw,
00527         unsigned short              video_write_buff_hw,
00528         video_adc_vinsel_t          video_adc_vinsel = VIDEO_ADC_VINSEL_VIN1  );
00529 
00530     /** Video surface write buffer change process
00531      *  @param[in]    video_input_channel : Video input channel <br />
00532      *      - VIDEO_INPUT_CHANNEL_0 : Video channel 0
00533      *      - VIDEO_INPUT_CHANNEL_1 : Video channel 1
00534      *  @param[in]    framebuff           : Base address of the frame buffer(Not set NULL)
00535      *  @param[in]    fb_stride           : Line offset address of the frame buffer <br />
00536      *      Frame buffer stride should be set to a multiple of 32 or 128
00537      *      in accordance with the frame buffer burst transfer mode.
00538      *  @retval       Error code
00539      */
00540     graphics_error_t Video_Write_Change (
00541         video_input_channel_t    video_input_channel,
00542         void                   * framebuff,
00543         uint32_t                 fb_stride );
00544 
00545 protected:
00546     lcd_config_t          _lcd_config;
00547     video_input_sel_t     _video_input_sel;
00548     video_ext_in_config_t _video_ext_in_config;
00549 };
00550 
00551 
00552 #endif /* MBED_DISPLAYBASE_H */
00553