Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of gr-peach-opencv-project-sd-card by
DisplayBase.cpp
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 #include <string.h> 00024 #include "DisplayBace.h" 00025 #include "gr_peach_vdc5.h" 00026 00027 /**************************************************************************//** 00028 * @brief Constructor of the DisplayBase class 00029 * @param[in] None 00030 * @retval None 00031 ******************************************************************************/ 00032 DisplayBase::DisplayBase( void ) 00033 { 00034 /* Lcd setting (default) */ 00035 _lcd_config.lcd_type = LCD_TYPE_PARALLEL_RGB ; /* LVDS or Pararel RGB */ 00036 _lcd_config.intputClock = 66.67f; /* P1 clk [MHz] ex. 66.67 */ 00037 _lcd_config.outputClock = 40.00f; /* LCD clk [MHz] ex. 33.33 */ 00038 00039 _lcd_config.lcd_outformat = LCD_OUTFORMAT_RGB888 ; /* Output format select */ 00040 _lcd_config.lcd_edge = EDGE_FALLING ; /* Output phase control of LCD_DATA23 to LCD_DATA0 pin */ 00041 00042 _lcd_config.h_toatal_period = (800u + 40u + 128u+ 88u); /* Free-running Hsync period */ 00043 _lcd_config.v_toatal_period = (600u + 1u + 4u + 23u); /* Free-running Vsync period */ 00044 _lcd_config.h_disp_widht = 800u; /* LCD display area size, horizontal width */ 00045 _lcd_config.v_disp_widht = 600u; /* LCD display area size, vertical width */ 00046 _lcd_config.h_back_porch = (128u+ 88u); /* LCD display horizontal back porch period */ 00047 _lcd_config.v_back_porch = (4u + 23u); /* LCD display vertical back porch period */ 00048 00049 _lcd_config.h_sync_port = LCD_TCON_PIN_0 ; /* TCONn or Not use(-1) */ 00050 _lcd_config.h_sync_port_polarity = SIG_POL_NOT_INVERTED ; /* Polarity inversion control of signal */ 00051 _lcd_config.h_sync_width = 128u; /* Hsync width */ 00052 00053 _lcd_config.v_sync_port = LCD_TCON_PIN_1 ; /* TCONn or Not use(-1) */ 00054 _lcd_config.v_sync_port_polarity = SIG_POL_NOT_INVERTED ; /* Polarity inversion control of signal */ 00055 _lcd_config.v_sync_width = 4u; /* Vsync width */ 00056 00057 _lcd_config.de_port = LCD_TCON_PIN_NON ; /* TCONn or Not use(-1) */ 00058 _lcd_config.de_port_polarity = SIG_POL_NOT_INVERTED ; /* Polarity inversion control of signal */ 00059 00060 /* Digital video input setting (default) */ 00061 _video_input_sel = INPUT_SEL_VDEC ; /* Video decoder output signals */ 00062 _video_ext_in_config.inp_format = VIDEO_EXTIN_FORMAT_BT601 ; 00063 _video_ext_in_config.inp_pxd_edge = EDGE_RISING ; /* Clock edge select for capturing data */ 00064 _video_ext_in_config.inp_vs_edge = EDGE_RISING ; /* Clock edge select for capturing Vsync signals */ 00065 _video_ext_in_config.inp_hs_edge = EDGE_RISING ; /* Clock edge select for capturing Hsync signals */ 00066 _video_ext_in_config.inp_endian_on = OFF ; /* External input bit endian change on/off */ 00067 _video_ext_in_config.inp_swap_on = OFF ; /* External input B/R signal swap on/off */ 00068 _video_ext_in_config.inp_vs_inv = SIG_POL_NOT_INVERTED ; /* External input DV_VSYNC inversion control */ 00069 _video_ext_in_config.inp_hs_inv = SIG_POL_INVERTED ; /* External input DV_HSYNC inversion control */ 00070 _video_ext_in_config.inp_f525_625 = EXTIN_LINE_525 ; /* Number of lines for BT.656 external input */ 00071 _video_ext_in_config.inp_h_pos = EXTIN_H_POS_CRYCBY ; /* Y/Cb/Y/Cr data string start timing to Hsync reference */ 00072 _video_ext_in_config.cap_vs_pos = 6u; /* Capture start position from Vsync */ 00073 _video_ext_in_config.cap_hs_pos = 302u; /* Capture start position form Hsync */ 00074 _video_ext_in_config.cap_width = 640u; /* Capture width */ 00075 _video_ext_in_config.cap_height = 468u; /* Capture height should be a multiple of 4 */ 00076 } /* End of constructor method () */ 00077 00078 /**************************************************************************//** 00079 * @brief Graphics initialization processing 00080 * @param[in] lcd_config : LCD configuration 00081 * @retval error code 00082 ******************************************************************************/ 00083 DisplayBase::graphics_error_t 00084 DisplayBase::Graphics_init( lcd_config_t * lcd_config ) 00085 { 00086 if( lcd_config != NULL ) { 00087 _lcd_config.lcd_type = lcd_config->lcd_type ; /* LVDS or Pararel RGB */ 00088 _lcd_config.intputClock = lcd_config->intputClock ; /* P1 clk [MHz] ex. 66.67 */ 00089 _lcd_config.outputClock = lcd_config->outputClock ; /* LCD clk [MHz] ex. 33.33 */ 00090 00091 _lcd_config.lcd_outformat = lcd_config->lcd_outformat ; /* Output format select */ 00092 _lcd_config.lcd_edge = lcd_config->lcd_edge ; /* Output phase control of LCD_DATA23 to LCD_DATA0 pin */ 00093 00094 _lcd_config.h_toatal_period = lcd_config->h_toatal_period ; /* Free-running Hsync period */ 00095 _lcd_config.v_toatal_period = lcd_config->v_toatal_period ; /* Free-running Vsync period */ 00096 _lcd_config.h_disp_widht = lcd_config->h_disp_widht ; /* LCD display area size, horizontal width */ 00097 _lcd_config.v_disp_widht = lcd_config->v_disp_widht ; /* LCD display area size, vertical width */ 00098 _lcd_config.h_back_porch = lcd_config->h_back_porch ; /* LCD display horizontal back porch period */ 00099 _lcd_config.v_back_porch = lcd_config->v_back_porch ; /* LCD display vertical back porch period */ 00100 00101 _lcd_config.h_sync_port = lcd_config->h_sync_port ; /* TCONn or Not use(-1) */ 00102 _lcd_config.h_sync_port_polarity = lcd_config->h_sync_port_polarity ;/* Polarity inversion control of signal */ 00103 _lcd_config.h_sync_width = lcd_config->h_sync_width ; /* Hsync width */ 00104 00105 _lcd_config.v_sync_port = lcd_config->v_sync_port ; /* TCONn or Not use(-1) */ 00106 _lcd_config.v_sync_port_polarity = lcd_config->v_sync_port_polarity ;/* Polarity inversion control of signal */ 00107 _lcd_config.v_sync_width = lcd_config->v_sync_width ; /* Vsync width */ 00108 00109 _lcd_config.de_port = lcd_config->de_port ; /* TCONn or Not use(-1) */ 00110 _lcd_config.de_port_polarity = lcd_config->de_port_polarity ; /* Polarity inversion control of signal */ 00111 } 00112 00113 return (graphics_error_t)DRV_Graphics_Init( (drv_lcd_config_t *)&_lcd_config ); 00114 } /* End of method Graphics_init() */ 00115 00116 /**************************************************************************//** 00117 * @brief Graphics Video initialization processing 00118 * @param[in] video_input_sel : Input select 00119 * @param[in] video_ext_in_config : Digtal video input configuration 00120 * @retval error code 00121 ******************************************************************************/ 00122 DisplayBase::graphics_error_t 00123 DisplayBase::Graphics_Video_init( video_input_sel_t video_input_sel, video_ext_in_config_t * video_ext_in_config ) 00124 { 00125 graphics_error_t error = GRAPHICS_OK ; 00126 00127 if( _video_input_sel == INPUT_SEL_VDEC || _video_input_sel == INPUT_SEL_EXT ) { 00128 _video_input_sel = video_input_sel; 00129 } else { 00130 error = GRAPHICS_PARAM_RANGE_ERR ; 00131 } 00132 00133 if( error == GRAPHICS_OK ) { 00134 if( video_ext_in_config != NULL ) { 00135 /* Signals supplied via the external input pins */ 00136 /* if using Video decoder output signals, not using value. */ 00137 _video_ext_in_config.inp_format = video_ext_in_config->inp_format ; 00138 _video_ext_in_config.inp_pxd_edge = video_ext_in_config->inp_pxd_edge ; 00139 _video_ext_in_config.inp_vs_edge = video_ext_in_config->inp_vs_edge ; 00140 _video_ext_in_config.inp_hs_edge = video_ext_in_config->inp_hs_edge ; 00141 _video_ext_in_config.inp_endian_on = video_ext_in_config->inp_endian_on ; 00142 _video_ext_in_config.inp_swap_on = video_ext_in_config->inp_swap_on ; 00143 _video_ext_in_config.inp_vs_inv = video_ext_in_config->inp_vs_inv ; 00144 _video_ext_in_config.inp_hs_inv = video_ext_in_config->inp_hs_inv ; 00145 _video_ext_in_config.inp_f525_625 = video_ext_in_config->inp_f525_625 ; 00146 _video_ext_in_config.inp_h_pos = video_ext_in_config->inp_h_pos ; 00147 _video_ext_in_config.cap_vs_pos = video_ext_in_config->cap_vs_pos ; 00148 _video_ext_in_config.cap_hs_pos = video_ext_in_config->cap_hs_pos ; 00149 _video_ext_in_config.cap_width = video_ext_in_config->cap_width ; 00150 _video_ext_in_config.cap_height = video_ext_in_config->cap_height ; 00151 } 00152 } 00153 return (graphics_error_t)DRV_Graphics_Video_init( (drv_video_input_sel_t )video_input_sel, 00154 (drv_video_ext_in_config_t *)&_video_ext_in_config ); 00155 } /* End of method Graphics_Video_init() */ 00156 00157 /**************************************************************************//** 00158 * @brief LCD I/O initialization processing 00159 * @param[in] pin : Pointer of the pin assignment 00160 * @param[in] pin_count : Total number of the pin assignment 00161 * @retval error code 00162 ******************************************************************************/ 00163 DisplayBase::graphics_error_t 00164 DisplayBase::Graphics_Lcd_Port_Init( PinName *pin, unsigned int pin_count ) 00165 { 00166 return (graphics_error_t)DRV_Graphics_Lcd_Port_Init( pin, pin_count ); 00167 } /* End of method Graphics_Lcd_Port_Init() */ 00168 00169 /**************************************************************************//** 00170 * @brief LVDS I/O port initialization processing 00171 * @param[in] pin : Pointer of the pin assignment 00172 * @param[in] pin_count : Total number of the pin assignment 00173 * @retval error code 00174 ******************************************************************************/ 00175 DisplayBase::graphics_error_t 00176 DisplayBase::Graphics_Lvds_Port_Init( PinName *pin, unsigned int pin_count ) 00177 { 00178 return (graphics_error_t)DRV_Graphics_Lvds_Port_Init( pin, pin_count ); 00179 } /* End of method Graphics_Lvds_Port_Init() */ 00180 00181 /**************************************************************************//** 00182 * @brief Digital video input I/O port initialization processing 00183 * @param[in] pin : Pointer of the pin assignment 00184 * @param[in] pin_count : Total number of the pin assignment 00185 * @retval error code 00186 ******************************************************************************/ 00187 DisplayBase::graphics_error_t 00188 DisplayBase::Graphics_Dvinput_Port_Init( PinName *pin, unsigned int pin_count ) 00189 { 00190 return (graphics_error_t)DRV_Graphics_Dvinput_Port_Init( pin, pin_count ); 00191 } /* End of method Graphics_Dvinput_Port_Init() */ 00192 00193 /**************************************************************************//** 00194 * @brief IRQ interrupt handler setting 00195 * @param[in] irq : VDC5 interrupt type 00196 * @param[in] num : Interrupt line number 00197 * @param[in] * callback : Interrupt callback function pointer 00198 * @retval error code 00199 ******************************************************************************/ 00200 DisplayBase::graphics_error_t 00201 DisplayBase::Graphics_Irq_Handler_Set( int_type_t irq, unsigned short num, void (* callback)(int_type_t) ) 00202 { 00203 return (graphics_error_t)DRV_Graphics_Irq_Handler_Set( (vdc5_int_type_t )irq, num, (void (*)(vdc5_int_type_t ))callback ); 00204 } /* End of method Graphics_Irq_Handler_Set() */ 00205 00206 /**************************************************************************//** 00207 * @brief Graphics surface read start processing 00208 * @param[in] layer_id : Graphics layer ID 00209 * @retval error code 00210 ******************************************************************************/ 00211 DisplayBase::graphics_error_t 00212 DisplayBase::Graphics_Start( graphics_layer_t layer_id ) 00213 { 00214 return (graphics_error_t)DRV_Graphics_Start( (drv_graphics_layer_t)layer_id ); 00215 } /* End of method Graphics_Start() */ 00216 00217 /**************************************************************************//** 00218 * @brief Graphics surface read stop processing 00219 * @param[in] layer_id : Graphics layer ID 00220 * @retval error code 00221 ******************************************************************************/ 00222 DisplayBase::graphics_error_t 00223 DisplayBase::Graphics_Stop( graphics_layer_t layer_id ) 00224 { 00225 return (graphics_error_t)DRV_Graphics_Stop( (drv_graphics_layer_t)layer_id ); 00226 } /* End of method Graphics_Stop() */ 00227 00228 /**************************************************************************//** 00229 * @brief Video surface write start processing 00230 * @param[in] video_input_channel : Video input channel 00231 * @retval error code 00232 ******************************************************************************/ 00233 DisplayBase::graphics_error_t 00234 DisplayBase::Video_Start( video_input_channel_t video_input_channel ) 00235 { 00236 graphics_error_t error = GRAPHICS_OK ; 00237 00238 /* Digital video inputs : supporting video_input_channel 0 only. */ 00239 if( _video_input_sel == INPUT_SEL_EXT && video_input_channel == VIDEO_INPUT_CHANNEL_1 ) { 00240 error = GRAPHICS_PARAM_RANGE_ERR ; 00241 } 00242 00243 if( error == GRAPHICS_OK ) { 00244 error = (graphics_error_t)DRV_Video_Start( (drv_video_input_channel_t)video_input_channel ); 00245 } 00246 return error; 00247 } /* End of method Video_Start() */ 00248 00249 /**************************************************************************//** 00250 * @brief Video surface write stop processing 00251 * @param[in] video_input_channel : Video input channel 00252 * @retval error code 00253 ******************************************************************************/ 00254 DisplayBase::graphics_error_t 00255 DisplayBase::Video_Stop( video_input_channel_t video_input_channel ) 00256 { 00257 graphics_error_t error = GRAPHICS_OK ; 00258 00259 /* Digital video inputs : supporting video_input_channel 0 only. */ 00260 if( _video_input_sel == INPUT_SEL_EXT && video_input_channel == VIDEO_INPUT_CHANNEL_1 ) { 00261 error = GRAPHICS_PARAM_RANGE_ERR ; 00262 } 00263 00264 if( error == GRAPHICS_OK ) { 00265 error = (graphics_error_t)DRV_Video_Stop( 00266 (drv_video_input_channel_t)video_input_channel ); 00267 } 00268 return error; 00269 } /* End of method Video_Stop() */ 00270 00271 /**************************************************************************//** 00272 * @brief Graphics surface read process setting 00273 * 00274 * Description:<br> 00275 * This function supports the following 4 image format. 00276 * YCbCr422, RGB565, RGB888, ARGB8888 00277 * @param[in] layer_id : Graphics layer ID 00278 * @param[in] framebuff : Base address of the frame buffer 00279 * @param[in] fb_stride : Line offset address of the frame buffer 00280 * @param[in] gr_format : Format of the frame buffer read signal 00281 * @param[in] wr_rd_swa : frame buffer swap setting 00282 * - WR_RD_WRSWA_NON : Not swapped: 1-2-3-4-5-6-7-8 00283 * - WR_RD_WRSWA_8BIT : Swapped in 8-bit units: 2-1-4-3-6-5-8-7 00284 * - WR_RD_WRSWA_16BIT : Swapped in 16-bit units: 3-4-1-2-7-8-5-6 00285 * - WR_RD_WRSWA_16_8BIT : Swapped in 16-bit units + 8-bit units: 4-3-2-1-8-7-6-5 00286 * - WR_RD_WRSWA_32BIT : Swapped in 32-bit units: 5-6-7-8-1-2-3-4 00287 * - WR_RD_WRSWA_32_8BIT : Swapped in 32-bit units + 8-bit units: 6-5-8-7-2-1-4-3 00288 * - WR_RD_WRSWA_32_16BIT : Swapped in 32-bit units + 16-bit units: 7-8-5-6-3-4-1-2 00289 * - 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 00290 * @param[in] gr_rect : Graphics display area 00291 * @retval Error code 00292 ******************************************************************************/ 00293 DisplayBase::graphics_error_t 00294 DisplayBase::Graphics_Read_Setting( 00295 graphics_layer_t layer_id, 00296 void * framebuff, 00297 unsigned int fb_stride, 00298 graphics_format_t gr_format, 00299 wr_rd_swa_t wr_rd_swa, 00300 rect_t * gr_rect ) 00301 { 00302 rect_t rect; 00303 00304 rect.hs = gr_rect->hs + _lcd_config.h_back_porch ; 00305 rect.vs = gr_rect->vs + _lcd_config.v_back_porch ; 00306 rect.hw = gr_rect->hw ; 00307 rect.vw = gr_rect->vw ; 00308 00309 return (graphics_error_t)DRV_Graphics_Read_Setting( 00310 (drv_graphics_layer_t)layer_id, 00311 framebuff, 00312 fb_stride, 00313 (drv_graphics_format_t)gr_format, 00314 (drv_wr_rd_swa_t)wr_rd_swa, 00315 (drv_rect_t *)&rect ); 00316 } /* End of method Graphics_Read_Setting() */ 00317 00318 /**************************************************************************//** 00319 * @brief Graphics surface read process changing 00320 * 00321 * Description:<br> 00322 * This function is used to swap buffers. 00323 * 00324 * @param[in] layer_id : Graphics layer ID 00325 * @param[in] framebuff : Base address of the frame buffer 00326 * @retval Error code 00327 ******************************************************************************/ 00328 DisplayBase::graphics_error_t 00329 DisplayBase::Graphics_Read_Change ( graphics_layer_t layer_id, void * framebuff) 00330 { 00331 return (graphics_error_t)DRV_Graphics_Read_Change( 00332 (drv_graphics_layer_t)layer_id, framebuff ); 00333 } /* End of method Graphics_Read_Change() */ 00334 00335 /**************************************************************************//** 00336 * @brief Video surface write process setting 00337 * This function set the video write process. Input form is weave 00338 * (progressive) mode fixed. 00339 * This function supports the following 3 image format. 00340 * YCbCr422, RGB565, RGB888 00341 * @param[in] video_input_ch : Video input channel 00342 * @param[in] col_sys : Analog video signal color system 00343 * @param[in] adc_vinsel : Video input pin 00344 * @param[in] framebuff : Base address of the frame buffer 00345 * @param[in] fb_stride [byte] : Line offset address of the frame buffer 00346 * @param[in] video_format : Frame buffer video-signal writing format 00347 * - VIDEO_FORMAT_YCBCR422 : YCBCR422 (2byte/px) 00348 * - VIDEO_FORMAT_RGB565 : RGB565 (2byte/px) 00349 * - VIDEO_FORMAT_RGB888 : RGB888 (4byte/px) 00350 * @param[in] wr_rd_swa : frame buffer swap setting 00351 * - WR_RD_WRSWA_NON : Not swapped: 1-2-3-4-5-6-7-8 00352 * - WR_RD_WRSWA_8BIT : Swapped in 8-bit units: 2-1-4-3-6-5-8-7 00353 * - WR_RD_WRSWA_16BIT : Swapped in 16-bit units: 3-4-1-2-7-8-5-6 00354 * - WR_RD_WRSWA_16_8BIT : Swapped in 16-bit units + 8-bit units: 4-3-2-1-8-7-6-5 00355 * - WR_RD_WRSWA_32BIT : Swapped in 32-bit units: 5-6-7-8-1-2-3-4 00356 * - WR_RD_WRSWA_32_8BIT : Swapped in 32-bit units + 8-bit units: 6-5-8-7-2-1-4-3 00357 * - WR_RD_WRSWA_32_16BIT : Swapped in 32-bit units + 16-bit units: 7-8-5-6-3-4-1-2 00358 * - 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 00359 * @param[in] video_write_size_vw [px]: output v width 00360 * @param[in] video_write_size_hw [px]: output h width 00361 * @param[in] video_adc_vinsel : Input pin control 00362 * @retval Error code 00363 ******************************************************************************/ 00364 DisplayBase::graphics_error_t 00365 DisplayBase::Video_Write_Setting( 00366 video_input_channel_t video_input_channel, 00367 graphics_video_col_sys_t col_sys, 00368 void * framebuff, 00369 unsigned int fb_stride, 00370 video_format_t video_format, 00371 wr_rd_swa_t wr_rd_swa, 00372 unsigned short write_buff_vw, 00373 unsigned short write_buff_hw, 00374 video_adc_vinsel_t video_adc_vinsel ) 00375 00376 { 00377 graphics_error_t error = GRAPHICS_OK ; 00378 00379 if( _video_input_sel == INPUT_SEL_VDEC ) { 00380 if( col_sys == COL_SYS_NTSC_358 || col_sys == COL_SYS_NTSC_443 || col_sys == COL_SYS_NTSC_443_60 ) { 00381 if( (write_buff_vw / 2u) > 240u ) { 00382 error = GRAPHICS_VIDEO_NTSC_SIZE_ERR ; 00383 } 00384 } else { 00385 if( (write_buff_vw / 2u) > 280u ) { 00386 error = GRAPHICS_VIDEO_PAL_SIZE_ERR ; 00387 } 00388 } 00389 00390 if( write_buff_hw > 800u ) { 00391 error = GRAPHICS_PARAM_RANGE_ERR ; 00392 } 00393 if( error == GRAPHICS_OK ) { 00394 error = (graphics_error_t)DRV_Video_Write_Setting( 00395 (drv_video_input_channel_t)video_input_channel, 00396 (drv_graphics_video_col_sys_t)col_sys, 00397 framebuff, 00398 fb_stride, 00399 (drv_video_format_t)video_format, 00400 (drv_wr_rd_swa_t)wr_rd_swa, 00401 write_buff_vw, 00402 write_buff_hw, 00403 (drv_video_adc_vinsel_t)video_adc_vinsel); 00404 } 00405 } else if( _video_input_sel == INPUT_SEL_EXT ) { 00406 rect_t cap_area; 00407 00408 cap_area.hs = _video_ext_in_config.cap_hs_pos * 2; 00409 cap_area.hw = _video_ext_in_config.cap_width * 2; 00410 cap_area.vs = _video_ext_in_config.cap_vs_pos ; 00411 cap_area.vw = _video_ext_in_config.cap_height ; 00412 00413 error = (graphics_error_t) DRV_Video_Write_Setting_Digital( 00414 framebuff, 00415 fb_stride, 00416 (drv_video_format_t)video_format, 00417 (drv_wr_rd_swa_t)wr_rd_swa, 00418 write_buff_vw, 00419 write_buff_hw, 00420 (drv_rect_t *)&cap_area ); 00421 } else { 00422 error = GRAPHICS_PARAM_RANGE_ERR ; 00423 } 00424 return error; 00425 } /* End of method Video_Write_Setting() */ 00426 00427 /**************************************************************************//** 00428 * @brief Graphics surface write process changing 00429 * This function is used to swap buffers of the weave write processing. 00430 * @param[in] video_input_ch : Video input channle 00431 * @param[in] framebuff : Base address of the frame buffer 00432 * @param[in] fb_stride : Line offset address of the frame buffer 00433 * @retval Error code 00434 ******************************************************************************/ 00435 DisplayBase::graphics_error_t 00436 DisplayBase::Video_Write_Change ( 00437 video_input_channel_t video_input_channel, void * framebuff, uint32_t fb_stride ) 00438 { 00439 return (graphics_error_t)DRV_Video_Write_Change( 00440 (drv_video_input_channel_t)video_input_channel, framebuff, fb_stride ); 00441 } /* End of method Video_Write_Change() */ 00442 00443 /* End of file */
Generated on Tue Jul 12 2022 14:46:33 by
1.7.2
