Video image display and touch panel sample for GR-PEACH LCD Shield.

Information

Japanese version is available in lower part of this page.
このページの後半に日本語版が用意されています.

Information

This sample has multiple frame buffers so that the clock source can display different cameras and LCDs cleanly. If you are using the NTSC signal, the following sample is simpler.
このサンプルはクロック元が異なるカメラとLCDを綺麗に表示するために、複数のフレームバッファを持っています。NTSC信号を使用するのであれば、以下のサンプルの方が単純です。

https://developer.mbed.org/users/dkato/code/GR-PEACH_NTSC_in_2ch/

What is this ?

The basic function of the GR-PEACH LCD Shield can be tried by this sample.
Display the information of the touch panel on the camera image.
A character font is shown to the screen lower right every 1 second.

Touch panel information

The touch location of the blue and the 2nd point becomes pink in the 1st touch location in case of a multi-touch.
While touching the screen, a white square in the upper left corner of the screen will be displayed.
Touch information is being output in printf. When doing terminal designation, please set 230400 as a baud rate.

Composition

GR-PEACH, GR-PEACH 4.3 inch LCD Shield or GR-PEACH 7.1 inch LCD Shield, GR-PEACH AUDIO CAMERA Shield and Camera.
/media/uploads/dkato/gr-peach_with_camera_lcd.png

When using analog input for video input, GR-PEACH AUDIO CAMERA Shield and the camera are unnecessary.
(Setting the VIDEO_CVBS to VIDEO_INPUT_METHOD)
Please input analog signal to NTSC1A pin. (Even if there are no input signals, a touch panel can be operated.).
/media/uploads/dkato/video_display_analog.jpg

Video input of default is a digital input (Cmos Camera). When changing the video input, please change the below.

mbed_app.json

{
    "config": {
        "camera":{
            "help": "0:disable 1:enable",
            "value": "1"
        },
        "camera-type":{
            "help": "Please see README.md",
            "value": "CAMERA_CVBS"
        },
        "lcd":{
            "help": "0:disable 1:enable",
            "value": "1"
        },
        "lcd-type":{
            "help": "Please see README.md",
            "value": "GR_PEACH_4_3INCH_SHIELD"
        }
    }
}
camera-type "value"Description
CAMERA_CVBSGR-PEACH NTSC signal
CAMERA_MT9V111GR-PEACH MT9V111
CAMERA_OV7725GR-LYHCEE included camera
CAMERA_OV5642GR-PEACH OV5642
CAMERA_WIRELESS_CAMERAGR-PEACH Wireless/Camera shield (MT9V111)
lcd-type "value"Description
GR_PEACH_4_3INCH_SHIELDGR-PEACH 4.3 inch LCD shield
GR_PEACH_7_1INCH_SHIELDGR-PEACH 7.1 inch LCD shield
GR_PEACH_RSK_TFTGR-PEACH RSK board LCD
GR_PEACH_DISPLAY_SHIELDGR-PEACH Display Shield or DVi-Board
GR_LYCHEE_LCDGR-LYHCEE TF043HV001A0..etc(40pin)




概要

このサンプルではGR-PEACH LCD Shieldの基本的な機能を試せます。
カメラ画像の上にタッチパネルの情報を重ねて表示します。
文字フォントが右下に1秒毎に表示されます。

タッチパネルの情報

マルチタッチの場合は1点目のタッチ位置は青、2点目のタッチ位置はピンクになります。
画面がタッチされている間、画面左上に白い四角が表示されます。
printfでもタッチ情報を出力しています。ターミナル表示を行う際は、ボーレートに230400を設定してください。

構成

GR-PEACH、GR-PEACH 4.3 inch LCD Shield または GR-PEACH 7.1 inch LCD Shield、GR-PEACH AUDIO CAMERA Shield 、カメラ。
/media/uploads/dkato/gr-peach_with_camera_lcd.png

ビデオ入力にアナログ入力を使用する場合はGR-PEACH AUDIO CAMERA Shield とカメラは不要です。
(VIDEO_INPUT_METHOD にVIDEO_CVBS を設定)
NTSC1Aピンにアナログ信号を入力してください。(入力信号が無くてもタッチパネルは操作できます。)
/media/uploads/dkato/video_display_analog.jpg

デフォルトのビデオ入力はデジタル入力(Cmos Camera)です。ビデオ入力を変更する際は以下を変更してください。

mbed_app.json

{
    "config": {
        "camera":{
            "help": "0:disable 1:enable",
            "value": "1"
        },
        "camera-type":{
            "help": "Please see README.md",
            "value": "CAMERA_CVBS"
        },
        "lcd":{
            "help": "0:disable 1:enable",
            "value": "1"
        },
        "lcd-type":{
            "help": "Please see README.md",
            "value": "GR_PEACH_4_3INCH_SHIELD"
        }
    }
}
camera-type "value"Description
CAMERA_CVBSGR-PEACH NTSC signal
CAMERA_MT9V111GR-PEACH MT9V111
CAMERA_OV7725GR-LYHCEE included camera
CAMERA_OV5642GR-PEACH OV5642
CAMERA_WIRELESS_CAMERAGR-PEACH Wireless/Camera shield (MT9V111)
lcd-type "value"Description
GR_PEACH_4_3INCH_SHIELDGR-PEACH 4.3 inch LCD shield
GR_PEACH_7_1INCH_SHIELDGR-PEACH 7.1 inch LCD shield
GR_PEACH_RSK_TFTGR-PEACH RSK board LCD
GR_PEACH_DISPLAY_SHIELDGR-PEACH Display Shield or DVi-Board
GR_LYCHEE_LCDGR-LYHCEE TF043HV001A0..etc(40pin)
Revision:
1:54a3e69f6f09
Parent:
0:b2184c2d15dd
Child:
2:8721836b639d
--- a/main.cpp	Thu Jun 30 11:05:41 2016 +0000
+++ b/main.cpp	Thu Jun 30 13:26:05 2016 +0000
@@ -9,12 +9,12 @@
 #define VIDEO_RGB565           (2)
 
 /**** User Selection *********/
-/** Camera **/
+/** Camera setting **/
 #define VIDEO_INPUT_METHOD     (VIDEO_CMOS_CAMERA) /* Select  VIDEO_CVBS or VIDEO_CMOS_CAMERA                       */
 #define VIDEO_INPUT_FORMAT     (VIDEO_YCBCR422)    /* Select  VIDEO_YCBCR422 or VIDEO_RGB888 or VIDEO_RGB565        */
 #define USE_VIDEO_CH           (0)                 /* Select  0 or 1            If selecting VIDEO_CMOS_CAMERA, should be 0.)               */
 #define VIDEO_PAL              (0)                 /* Select  0(NTSC) or 1(PAL) If selecting VIDEO_CVBS, this parameter is not referenced.) */
-/** LCD **/
+/** LCD setting **/
 #define LCD_TYPE               (0)                 /* Select  0(4.3inch) or 1(7.1inch) */
 /*****************************/
 
@@ -105,8 +105,8 @@
 static uint8_t user_frame_buffer2[FRAME_BUFFER_STRIDE * LCD_PIXEL_HEIGHT]__attribute((aligned(32)));
 static uint8_t user_frame_buffer_touch[TOUCH_BUFFER_STRIDE * LCD_PIXEL_HEIGHT]__attribute((aligned(32)));
 #endif
+static uint8_t * FrameBufferTbl[FRAME_BUFFER_NUM] = {user_frame_buffer0, user_frame_buffer1, user_frame_buffer2};
 static volatile int32_t vfield_count = 0;
-static uint8_t * FrameBufferTbl[FRAME_BUFFER_NUM] = {user_frame_buffer0, user_frame_buffer1, user_frame_buffer2};
 static int write_buff_num = 0;
 static int read_buff_num = 0;
 static bool graphics_init_end = false;
@@ -253,7 +253,7 @@
                                                                              Due to CMOS(MT9V111) output signal timing and VDC5 specification */
 #else
     ext_in_config.cap_width      = 640;                                   /* Capture width  */
-    ext_in_config.cap_height     = 468u;                                  /* Capture height Max 468[line]
+    ext_in_config.cap_height     = 468;                                   /* Capture height Max 468[line]
                                                                              Due to CMOS(MT9V111) output signal timing and VDC5 specification */
 #endif
     error = Display.Graphics_Video_init( DisplayBase::INPUT_SEL_EXT, &ext_in_config);
@@ -262,7 +262,7 @@
         mbed_die();
     }
 
-    /* MT9V111 camera input port setting */
+    /* Camera input port setting */
     error = Display.Graphics_Dvinput_Port_Init(cmos_camera_pin, 11);
     if( error != DisplayBase::GRAPHICS_OK ) {
         printf("Line %d, error %d\n", __LINE__, error);