Renesas / GR-PEACH_video

Dependents:   Trace_Program2 GR-PEACH_Camera_in_barcode GR-PEACH_LCD_sample GR-PEACH_LCD_4_3inch_sample ... more

Video library for GR-PEACH.

Hello World!

Import programGR-PEACH_Camera_in

Camera in sample for GR-PEACH. This sample works on GR-LYCHEE besides GR-PEACH.

API

Import library

Data Structures

struct lcd_config_t
LCD configuration. More...
struct rect_t
The relative position within the graphics display area. More...
struct video_ext_in_config_t
Digital Video Input configuration. More...

Public Types

enum video_input_channel_t { VIDEO_INPUT_CHANNEL_0 = 0, VIDEO_INPUT_CHANNEL_1 }

Video input channel select.

More...
enum graphics_layer_t { GRAPHICS_LAYER_0 = 0, GRAPHICS_LAYER_1 , GRAPHICS_LAYER_2 , GRAPHICS_LAYER_3 }

Graphics layer select.

More...
enum graphics_error_t {
GRAPHICS_OK = 0, GRAPHICS_VDC5_ERR = -1, GRAPHICS_FORMA_ERR = -2, GRAPHICS_LAYER_ERR = -3,
GRAPHICS_CHANNLE_ERR = -4, GRAPHICS_VIDEO_NTSC_SIZE_ERR = -5, GRAPHICS_VIDEO_PAL_SIZE_ERR = -6, GRAPHICS_PARAM_RANGE_ERR = -7
}

Error codes.

More...
enum graphics_format_t { GRAPHICS_FORMAT_YCBCR422 = 0, GRAPHICS_FORMAT_RGB565 , GRAPHICS_FORMAT_RGB888 , GRAPHICS_FORMAT_ARGB8888 }

Graphics layer read format selects.

More...
enum video_format_t { VIDEO_FORMAT_YCBCR422 = 0, VIDEO_FORMAT_RGB565 , VIDEO_FORMAT_RGB888 }

Video writing format selects.

More...
enum wr_rd_swa_t {
WR_RD_WRSWA_NON = 0, WR_RD_WRSWA_8BIT , WR_RD_WRSWA_16BIT , WR_RD_WRSWA_16_8BIT ,
WR_RD_WRSWA_32BIT , WR_RD_WRSWA_32_8BIT , WR_RD_WRSWA_32_16BIT , WR_RD_WRSWA_32_16_8BIT
}

Frame buffer swap setting.

More...
enum lcd_tcon_pin_t { LCD_TCON_PIN_NON = -1, LCD_TCON_PIN_0 , LCD_TCON_PIN_1 , LCD_TCON_PIN_2 }

LCD tcon output pin selects.

More...
enum lcd_outformat_t { LCD_OUTFORMAT_RGB888 = 0, LCD_OUTFORMAT_RGB666 , LCD_OUTFORMAT_RGB565 }

LCD output format selects.

More...
enum edge_t { EDGE_RISING = 0, EDGE_FALLING = 1 }

Edge of a signal.

More...
enum lcd_type_t { LCD_TYPE_LVDS = 0, LCD_TYPE_PARALLEL_RGB }

LCD type.

More...
enum sig_pol_t { SIG_POL_NOT_INVERTED = 0, SIG_POL_INVERTED }

Polarity of a signal.

More...
enum int_type_t {
INT_TYPE_S0_VI_VSYNC = 0, INT_TYPE_S0_LO_VSYNC , INT_TYPE_S0_VSYNCERR , INT_TYPE_VLINE ,
INT_TYPE_S0_VFIELD , INT_TYPE_IV1_VBUFERR , INT_TYPE_IV3_VBUFERR , INT_TYPE_IV5_VBUFERR ,
INT_TYPE_IV6_VBUFERR , INT_TYPE_S0_WLINE , INT_TYPE_S1_VI_VSYNC , INT_TYPE_S1_LO_VSYNC ,
INT_TYPE_S1_VSYNCERR , INT_TYPE_S1_VFIELD , INT_TYPE_IV2_VBUFERR , INT_TYPE_IV4_VBUFERR ,
INT_TYPE_S1_WLINE , INT_TYPE_OIR_VI_VSYNC , INT_TYPE_OIR_LO_VSYNC , INT_TYPE_OIR_VLINE ,
INT_TYPE_OIR_VFIELD , INT_TYPE_IV7_VBUFERR , INT_TYPE_IV8_VBUFERR , INT_TYPE_NUM
}

Interrupt type.

More...
enum graphics_video_col_sys_t {
COL_SYS_NTSC_358 = 0, COL_SYS_NTSC_443 = 1, COL_SYS_PAL_443 = 2, COL_SYS_PAL_M = 3,
COL_SYS_PAL_N = 4, COL_SYS_SECAM = 5, COL_SYS_NTSC_443_60 = 6, COL_SYS_PAL_60 = 7
}

Video color system.

More...
enum video_input_sel_t { INPUT_SEL_VDEC = 0, INPUT_SEL_EXT = 1 }

External Input select.

More...
enum video_extin_format_t {
VIDEO_EXTIN_FORMAT_RGB888 = 0, VIDEO_EXTIN_FORMAT_RGB666 , VIDEO_EXTIN_FORMAT_RGB565 , VIDEO_EXTIN_FORMAT_BT656 ,
VIDEO_EXTIN_FORMAT_BT601 , VIDEO_EXTIN_FORMAT_YCBCR422 , VIDEO_EXTIN_FORMAT_YCBCR444
}

External input format select.

More...
enum onoff_t { OFF = 0, ON = 1 }

On/off.

More...
enum extin_input_line_t { EXTIN_LINE_525 = 0, EXTIN_LINE_625 = 1 }

Number of lines for BT.656 external input.

More...
enum extin_h_pos_t { EXTIN_H_POS_CBYCRY = 0, EXTIN_H_POS_YCRYCB , EXTIN_H_POS_CRYCBY , EXTIN_H_POS_YCBYCR }

Y/Cb/Y/Cr data string start timing.

More...

Public Member Functions

DisplayBase (void)
Constructor method of display base object.
graphics_error_t Graphics_init ( lcd_config_t *lcd_config)
Graphics initialization processing
If not using display, set NULL in parameter.
graphics_error_t Graphics_Video_init ( video_input_sel_t video_input_sel, video_ext_in_config_t *video_ext_in_config)
Graphics Video initialization processing
If setting INPUT_SEL_VDEC in video_input_sel parameter, set NULL in video_ext_in_config parameter.
graphics_error_t Graphics_Lcd_Port_Init (PinName *pin, unsigned int pin_count)
LCD output port initialization processing.
graphics_error_t Graphics_Lvds_Port_Init (PinName *pin, unsigned int pin_count)
LVDS output port initialization processing.
graphics_error_t Graphics_Dvinput_Port_Init (PinName *pin, unsigned int pin_count)
Digital video input port initialization processing.
graphics_error_t Graphics_Irq_Handler_Set ( int_type_t Graphics_Irq_Handler_Set, unsigned short num, void(*callback)( int_type_t ))
Interrupt callback setup This function performs the following processing:

  • Enables the interrupt when the pointer to the corresponding interrupt callback function is specified.

graphics_error_t Graphics_Start ( graphics_layer_t layer_id)
Start the graphics surface read process.
graphics_error_t Graphics_Stop ( graphics_layer_t layer_id)
Stop the graphics surface read process.
graphics_error_t Video_Start ( video_input_channel_t video_input_channel)
Start the video surface write process.
graphics_error_t Video_Stop ( video_input_channel_t video_input_channel)
Stop the video surface write process.
graphics_error_t Graphics_Read_Setting ( graphics_layer_t layer_id, void *framebuff, unsigned int fb_stride, graphics_format_t gr_format, wr_rd_swa_t wr_rd_swa, rect_t *gr_rect)
Graphics surface read process setting.
graphics_error_t Graphics_Read_Change ( graphics_layer_t layer_id, void *framebuff)
Graphics surface read buffer change process.
graphics_error_t Video_Write_Setting ( video_input_channel_t video_input_channel, graphics_video_col_sys_t col_sys, void *framebuff, unsigned int fb_stride, video_format_t video_format, wr_rd_swa_t wr_rd_swa, unsigned short video_write_buff_vw, unsigned short video_write_buff_hw)
Video surface write process setting.
graphics_error_t Video_Write_Change ( video_input_channel_t video_input_channel, void *framebuff, uint32_t fb_stride)
Video surface write buffer change process.

Interface

See the Pinout page for more details

Files at this revision

API Documentation at this revision

Comitter:
dkato
Date:
Wed Nov 25 05:11:29 2015 +0000
Parent:
1:fe90cfd5fe25
Child:
3:e0e475089616
Commit message:
Added functionality for select the pin for inputting composite video signals.

Changed in this revision

DisplayBace.h Show annotated file Show diff for this revision Revisions of this file
DisplayBase.cpp Show annotated file Show diff for this revision Revisions of this file
gr_peach_vdc5.c Show annotated file Show diff for this revision Revisions of this file
gr_peach_vdc5.h Show annotated file Show diff for this revision Revisions of this file
--- a/DisplayBace.h	Thu Oct 01 07:12:34 2015 +0000
+++ b/DisplayBace.h	Wed Nov 25 05:11:29 2015 +0000
@@ -45,6 +45,14 @@
         VIDEO_INPUT_CHANNEL_1      /*!< Video input channel 1 */
     } video_input_channel_t;
 
+    /*! @enum video_adc_vinsel_t
+        @brief Input pin control
+     */
+    typedef enum {
+        VIDEO_ADC_VINSEL_VIN1 = 0, /*!< VIN1 input            */
+        VIDEO_ADC_VINSEL_VIN2      /*!< VIN2 input            */
+    } video_adc_vinsel_t;
+
     /*! @enum graphics_layer_t
         @brief Graphics layer select
      */
@@ -109,7 +117,7 @@
         LCD_TCON_PIN_NON = -1,          /*!< Not using output         */
         LCD_TCON_PIN_0,                 /*!< LCD_TCON0                */
         LCD_TCON_PIN_1,                 /*!< LCD_TCON1                */
-        LCD_TCON_PIN_2,                  /*!< LCD_TCON2                */
+        LCD_TCON_PIN_2,                 /*!< LCD_TCON2                */
         LCD_TCON_PIN_3                  /*!< LCD_TCON3                */
     } lcd_tcon_pin_t;
 
@@ -471,6 +479,9 @@
      *      - PAL format  : Max height is 520[px]
      *  @param[in]    video_write_buff_hw : Output width[px] <br />
      *      - Max width : 800[px]
+     *  @param[in]    video_adc_vinsel : Input pin control <br />
+     *      - VIDEO_ADC_VINSEL_VIN1 : VIN1 input
+     *      - VIDEO_ADC_VINSEL_VIN2 : VIN2 input
      *  @retval       Error code
      */
     graphics_error_t Video_Write_Setting (
@@ -481,7 +492,8 @@
         video_format_t              video_format,
         wr_rd_swa_t                 wr_rd_swa,
         unsigned short              video_write_buff_vw,
-        unsigned short              video_write_buff_hw );
+        unsigned short              video_write_buff_hw,
+        video_adc_vinsel_t          video_adc_vinsel = VIDEO_ADC_VINSEL_VIN1 );
 
     /** Video surface write buffer change process
      *  @param[in]    video_input_channel : Video input channel <br />
--- a/DisplayBase.cpp	Thu Oct 01 07:12:34 2015 +0000
+++ b/DisplayBase.cpp	Wed Nov 25 05:11:29 2015 +0000
@@ -358,6 +358,7 @@
  *      - 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
  * @param[in]   video_write_size_vw [px]: output v width
  * @param[in]   video_write_size_hw [px]: output h width
+ * @param[in]   video_adc_vinsel        : Input pin control
  * @retval      Error code
 ******************************************************************************/
 DisplayBase::graphics_error_t
@@ -369,7 +370,9 @@
     video_format_t              video_format,
     wr_rd_swa_t                 wr_rd_swa,
     unsigned short              write_buff_vw,
-    unsigned short              write_buff_hw )
+    unsigned short              write_buff_hw,
+    video_adc_vinsel_t          video_adc_vinsel )
+
 {
     graphics_error_t error = GRAPHICS_OK;
 
@@ -396,7 +399,8 @@
                         (drv_video_format_t)video_format,
                         (drv_wr_rd_swa_t)wr_rd_swa,
                         write_buff_vw,
-                        write_buff_hw);
+                        write_buff_hw,
+                        (drv_video_adc_vinsel_t)video_adc_vinsel);
         }
     } else if( _video_input_sel == INPUT_SEL_EXT ) {
         rect_t cap_area;
--- a/gr_peach_vdc5.c	Thu Oct 01 07:12:34 2015 +0000
+++ b/gr_peach_vdc5.c	Wed Nov 25 05:11:29 2015 +0000
@@ -942,6 +942,7 @@
  * @param[in]   wr_rd_swa               : Frame buffer swap setting
  * @param[in]   video_write_size_vw [px]: output height
  * @param[in]   video_write_size_hw [px]: output width
+ * @param[in]   video_adc_vinsel        : Input pin control
  * @retval      Error code
 ******************************************************************************/
 drv_graphics_error_t DRV_Video_Write_Setting (
@@ -952,7 +953,8 @@
     drv_video_format_t              video_format,
     drv_wr_rd_swa_t                 wr_rd_swa,
     uint16_t                        video_write_buff_vw,
-    uint16_t                        video_write_buff_hw )
+    uint16_t                        video_write_buff_hw,
+    drv_video_adc_vinsel_t          video_adc_vinsel )
 {
     drv_graphics_error_t        drv_error   = DRV_GRAPHICS_OK;
     vdc5_channel_t              ch          = VDC5_CHANNEL_0;
@@ -966,9 +968,9 @@
     uint8_t                   * framebuffer_b;
 
     if( video_input_ch == DRV_VIDEO_INPUT_CHANNEL_0 ) {
-        GRAPHICS_VideoDecoderInit( VDEC_ADC_VINSEL_VIN1, VDEC_CHANNEL_0, (graphics_col_sys_t)col_sys );
+        GRAPHICS_VideoDecoderInit( (vdec_adc_vinsel_t)video_adc_vinsel, VDEC_CHANNEL_0, (graphics_col_sys_t)col_sys );
     } else if( video_input_ch == DRV_VIDEO_INPUT_CHANNEL_1 ) {
-        GRAPHICS_VideoDecoderInit( VDEC_ADC_VINSEL_VIN1, VDEC_CHANNEL_1, (graphics_col_sys_t)col_sys );
+        GRAPHICS_VideoDecoderInit( (vdec_adc_vinsel_t)video_adc_vinsel, VDEC_CHANNEL_1, (graphics_col_sys_t)col_sys );
     } else {
         drv_error = DRV_GRAPHICS_CHANNEL_ERR;
     }
--- a/gr_peach_vdc5.h	Thu Oct 01 07:12:34 2015 +0000
+++ b/gr_peach_vdc5.h	Wed Nov 25 05:11:29 2015 +0000
@@ -72,6 +72,12 @@
     DRV_VIDEO_INPUT_CHANNEL_1           /* video input channel 1    */
 } drv_video_input_channel_t;
 
+/* input pin control */
+typedef enum {
+    DRV_VIDEO_ADC_VINSEL_VIN1 = 0,      /* VIN1 input               */
+    DRV_VIDEO_ADC_VINSEL_VIN2           /* VIN2 input               */
+} drv_video_adc_vinsel_t;
+
 /* graphics layer select */
 typedef enum {
     DRV_GRAPHICS_LAYER_0 = 0,           /* graphics layer 0         */
@@ -294,7 +300,8 @@
     drv_video_format_t              video_format,
     drv_wr_rd_swa_t                 wr_rd_swa,
     uint16_t                        video_write_buff_vw,
-    uint16_t                        video_write_buff_hw );
+    uint16_t                        video_write_buff_hw,
+    drv_video_adc_vinsel_t          video_adc_vinsel );
 
 drv_graphics_error_t DRV_Video_Write_Setting_Digital (
     void                          * framebuff,