GR-MANGO sample using mbed-os library from my repository.

Dependencies:   mbed-http

Committer:
RyoheiHagimoto
Date:
Mon Oct 12 02:25:49 2020 +0000
Revision:
0:b4c1e32627f2
replaced mbed-os library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RyoheiHagimoto 0:b4c1e32627f2 1 /*******************************************************************************
RyoheiHagimoto 0:b4c1e32627f2 2 * DISCLAIMER
RyoheiHagimoto 0:b4c1e32627f2 3 * This software is supplied by Renesas Electronics Corporation and is only
RyoheiHagimoto 0:b4c1e32627f2 4 * intended for use with Renesas products. No other uses are authorized. This
RyoheiHagimoto 0:b4c1e32627f2 5 * software is owned by Renesas Electronics Corporation and is protected under
RyoheiHagimoto 0:b4c1e32627f2 6 * all applicable laws, including copyright laws.
RyoheiHagimoto 0:b4c1e32627f2 7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
RyoheiHagimoto 0:b4c1e32627f2 8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
RyoheiHagimoto 0:b4c1e32627f2 9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
RyoheiHagimoto 0:b4c1e32627f2 10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
RyoheiHagimoto 0:b4c1e32627f2 11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
RyoheiHagimoto 0:b4c1e32627f2 12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
RyoheiHagimoto 0:b4c1e32627f2 13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
RyoheiHagimoto 0:b4c1e32627f2 14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
RyoheiHagimoto 0:b4c1e32627f2 15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
RyoheiHagimoto 0:b4c1e32627f2 16 * Renesas reserves the right, without notice, to make changes to this software
RyoheiHagimoto 0:b4c1e32627f2 17 * and to discontinue the availability of this software. By using this software,
RyoheiHagimoto 0:b4c1e32627f2 18 * you agree to the additional terms and conditions found by accessing the
RyoheiHagimoto 0:b4c1e32627f2 19 * following link:
RyoheiHagimoto 0:b4c1e32627f2 20 * http://www.renesas.com/disclaimer
RyoheiHagimoto 0:b4c1e32627f2 21 *
RyoheiHagimoto 0:b4c1e32627f2 22 * Copyright (C) 2019 Renesas Electronics Corporation. All rights reserved.
RyoheiHagimoto 0:b4c1e32627f2 23 *******************************************************************************/
RyoheiHagimoto 0:b4c1e32627f2 24 #include "sample_select.h"
RyoheiHagimoto 0:b4c1e32627f2 25 #include "mbed.h"
RyoheiHagimoto 0:b4c1e32627f2 26
RyoheiHagimoto 0:b4c1e32627f2 27 #define DEBUG_BAUDRATE 115200
RyoheiHagimoto 0:b4c1e32627f2 28
RyoheiHagimoto 0:b4c1e32627f2 29 #if (SAMPLE_PROGRAM_NO == 23)
RyoheiHagimoto 0:b4c1e32627f2 30 // SAMPLE_PROGRAM_NO 23 : HDMI output & MIPI Sample
RyoheiHagimoto 0:b4c1e32627f2 31 //
RyoheiHagimoto 0:b4c1e32627f2 32 // Please set the value of "camera-type" in "mbed_app.json" to null or "CAMERA_RASPBERRY_PI".
RyoheiHagimoto 0:b4c1e32627f2 33 //
RyoheiHagimoto 0:b4c1e32627f2 34 // "camera-type":{
RyoheiHagimoto 0:b4c1e32627f2 35 // "help": "Please see EasyAttach_CameraAndLCD/README.md",
RyoheiHagimoto 0:b4c1e32627f2 36 // "value": null
RyoheiHagimoto 0:b4c1e32627f2 37 // },
RyoheiHagimoto 0:b4c1e32627f2 38 //
RyoheiHagimoto 0:b4c1e32627f2 39 // or
RyoheiHagimoto 0:b4c1e32627f2 40 //
RyoheiHagimoto 0:b4c1e32627f2 41 // "camera-type":{
RyoheiHagimoto 0:b4c1e32627f2 42 // "help": "Please see EasyAttach_CameraAndLCD/README.md",
RyoheiHagimoto 0:b4c1e32627f2 43 // "value": "CAMERA_RASPBERRY_PI"
RyoheiHagimoto 0:b4c1e32627f2 44 // },
RyoheiHagimoto 0:b4c1e32627f2 45 //
RyoheiHagimoto 0:b4c1e32627f2 46 // Requirements
RyoheiHagimoto 0:b4c1e32627f2 47 // RZ/A2M Evaluation Board Kit : Display Output Board
RyoheiHagimoto 0:b4c1e32627f2 48 // SBEV-RZ/A2M : LVDS To HDMI Board
RyoheiHagimoto 0:b4c1e32627f2 49 // SEMB1402 : LVDS To HDMI Board
RyoheiHagimoto 0:b4c1e32627f2 50
RyoheiHagimoto 0:b4c1e32627f2 51 #if !defined(TARGET_RZ_A2XX)
RyoheiHagimoto 0:b4c1e32627f2 52 #error "DRP and MIPI are not supported."
RyoheiHagimoto 0:b4c1e32627f2 53 #endif
RyoheiHagimoto 0:b4c1e32627f2 54 #if MBED_CONF_APP_CAMERA_TYPE != CAMERA_RASPBERRY_PI
RyoheiHagimoto 0:b4c1e32627f2 55 #error Please set the value of "camera-type" in "mbed_app.json" to "CAMERA_RASPBERRY_PI" and build.
RyoheiHagimoto 0:b4c1e32627f2 56 #endif
RyoheiHagimoto 0:b4c1e32627f2 57
RyoheiHagimoto 0:b4c1e32627f2 58 #include "mbed.h"
RyoheiHagimoto 0:b4c1e32627f2 59 #include "EasyAttach_CameraAndLCD.h"
RyoheiHagimoto 0:b4c1e32627f2 60 #include "AsciiFont.h"
RyoheiHagimoto 0:b4c1e32627f2 61 #include "r_dk2_if.h"
RyoheiHagimoto 0:b4c1e32627f2 62 #include "r_drp_simple_isp.h"
RyoheiHagimoto 0:b4c1e32627f2 63
RyoheiHagimoto 0:b4c1e32627f2 64 /*! Frame buffer stride: Frame buffer stride should be set to a multiple of 32 or 128
RyoheiHagimoto 0:b4c1e32627f2 65 in accordance with the frame buffer burst transfer mode. */
RyoheiHagimoto 0:b4c1e32627f2 66 #define VIDEO_PIXEL_HW LCD_PIXEL_WIDTH
RyoheiHagimoto 0:b4c1e32627f2 67 #define VIDEO_PIXEL_VW LCD_PIXEL_HEIGHT
RyoheiHagimoto 0:b4c1e32627f2 68
RyoheiHagimoto 0:b4c1e32627f2 69 #define FRAME_BUFFER_STRIDE (((VIDEO_PIXEL_HW * 1) + 31u) & ~31u)
RyoheiHagimoto 0:b4c1e32627f2 70 #define FRAME_BUFFER_STRIDE_2 (((VIDEO_PIXEL_HW * 2) + 31u) & ~31u)
RyoheiHagimoto 0:b4c1e32627f2 71 #define FRAME_BUFFER_HEIGHT (VIDEO_PIXEL_VW)
RyoheiHagimoto 0:b4c1e32627f2 72
RyoheiHagimoto 0:b4c1e32627f2 73 #define OVL_WIDTH (AsciiFont::CHAR_PIX_WIDTH * 2 * 11)
RyoheiHagimoto 0:b4c1e32627f2 74 #define OVL_STRIDE (((OVL_WIDTH * 1) + 31u) & ~31u)
RyoheiHagimoto 0:b4c1e32627f2 75 #define OVL_HEIGHT (AsciiFont::CHAR_PIX_HEIGHT * 2)
RyoheiHagimoto 0:b4c1e32627f2 76
RyoheiHagimoto 0:b4c1e32627f2 77 #define DRP_FLG_CAMER_IN (0x00000100)
RyoheiHagimoto 0:b4c1e32627f2 78
RyoheiHagimoto 0:b4c1e32627f2 79 #define WB_DAYLIGHT (0)
RyoheiHagimoto 0:b4c1e32627f2 80 #define WB_CLOUDY (1)
RyoheiHagimoto 0:b4c1e32627f2 81 #define WB_FLUORESCENT (2)
RyoheiHagimoto 0:b4c1e32627f2 82 #define WB_TUNGSTEN (3)
RyoheiHagimoto 0:b4c1e32627f2 83
RyoheiHagimoto 0:b4c1e32627f2 84 static DisplayBase Display;
RyoheiHagimoto 0:b4c1e32627f2 85 static uint8_t fbuf_bayer[FRAME_BUFFER_STRIDE * FRAME_BUFFER_HEIGHT]__attribute((aligned(128)));
RyoheiHagimoto 0:b4c1e32627f2 86 static uint8_t fbuf_yuv[FRAME_BUFFER_STRIDE_2 * FRAME_BUFFER_HEIGHT]__attribute((aligned(32)));
RyoheiHagimoto 0:b4c1e32627f2 87 static uint8_t fbuf_overlay[OVL_STRIDE * OVL_HEIGHT]__attribute((section("NC_BSS"),aligned(32)));
RyoheiHagimoto 0:b4c1e32627f2 88
RyoheiHagimoto 0:b4c1e32627f2 89 static r_drp_simple_isp_t param_isp __attribute((section("NC_BSS")));
RyoheiHagimoto 0:b4c1e32627f2 90 static uint8_t drp_lib_id[R_DK2_TILE_NUM] = {0};
RyoheiHagimoto 0:b4c1e32627f2 91 static Thread drpTask(osPriorityHigh);
RyoheiHagimoto 0:b4c1e32627f2 92 static uint32_t isp_wb_mode_req;
RyoheiHagimoto 0:b4c1e32627f2 93 static uint32_t isp_wb_mode;
RyoheiHagimoto 0:b4c1e32627f2 94
RyoheiHagimoto 0:b4c1e32627f2 95 static const uint32_t clut_data_resut[] = {0x00000000, 0xff00ff00}; // ARGB8888
RyoheiHagimoto 0:b4c1e32627f2 96
RyoheiHagimoto 0:b4c1e32627f2 97 static void IntCallbackFunc_Vfield(DisplayBase::int_type_t int_type) {
RyoheiHagimoto 0:b4c1e32627f2 98 drpTask.flags_set(DRP_FLG_CAMER_IN);
RyoheiHagimoto 0:b4c1e32627f2 99 }
RyoheiHagimoto 0:b4c1e32627f2 100
RyoheiHagimoto 0:b4c1e32627f2 101 static void cb_drp_finish(uint8_t id) {
RyoheiHagimoto 0:b4c1e32627f2 102 // do nothing
RyoheiHagimoto 0:b4c1e32627f2 103 }
RyoheiHagimoto 0:b4c1e32627f2 104
RyoheiHagimoto 0:b4c1e32627f2 105 static void Start_Video_Camera(void) {
RyoheiHagimoto 0:b4c1e32627f2 106 // Video capture setting (progressive form fixed)
RyoheiHagimoto 0:b4c1e32627f2 107 Display.Video_Write_Setting(
RyoheiHagimoto 0:b4c1e32627f2 108 DisplayBase::VIDEO_INPUT_CHANNEL_0,
RyoheiHagimoto 0:b4c1e32627f2 109 DisplayBase::COL_SYS_NTSC_358,
RyoheiHagimoto 0:b4c1e32627f2 110 (void *)fbuf_bayer,
RyoheiHagimoto 0:b4c1e32627f2 111 FRAME_BUFFER_STRIDE,
RyoheiHagimoto 0:b4c1e32627f2 112 DisplayBase::VIDEO_FORMAT_RAW8,
RyoheiHagimoto 0:b4c1e32627f2 113 DisplayBase::WR_RD_WRSWA_NON,
RyoheiHagimoto 0:b4c1e32627f2 114 VIDEO_PIXEL_VW,
RyoheiHagimoto 0:b4c1e32627f2 115 VIDEO_PIXEL_HW
RyoheiHagimoto 0:b4c1e32627f2 116 );
RyoheiHagimoto 0:b4c1e32627f2 117 EasyAttach_CameraStart(Display, DisplayBase::VIDEO_INPUT_CHANNEL_0);
RyoheiHagimoto 0:b4c1e32627f2 118 }
RyoheiHagimoto 0:b4c1e32627f2 119
RyoheiHagimoto 0:b4c1e32627f2 120 static void Start_LCD_Display(void) {
RyoheiHagimoto 0:b4c1e32627f2 121 DisplayBase::rect_t rect;
RyoheiHagimoto 0:b4c1e32627f2 122 DisplayBase::clut_t clut_param;
RyoheiHagimoto 0:b4c1e32627f2 123
RyoheiHagimoto 0:b4c1e32627f2 124 rect.vs = 0;
RyoheiHagimoto 0:b4c1e32627f2 125 rect.vw = VIDEO_PIXEL_VW;
RyoheiHagimoto 0:b4c1e32627f2 126 rect.hs = 0;
RyoheiHagimoto 0:b4c1e32627f2 127 rect.hw = VIDEO_PIXEL_HW;
RyoheiHagimoto 0:b4c1e32627f2 128 Display.Graphics_Read_Setting(
RyoheiHagimoto 0:b4c1e32627f2 129 DisplayBase::GRAPHICS_LAYER_0,
RyoheiHagimoto 0:b4c1e32627f2 130 (void *)fbuf_yuv,
RyoheiHagimoto 0:b4c1e32627f2 131 FRAME_BUFFER_STRIDE_2,
RyoheiHagimoto 0:b4c1e32627f2 132 DisplayBase::GRAPHICS_FORMAT_YCBCR422,
RyoheiHagimoto 0:b4c1e32627f2 133 DisplayBase::WR_RD_WRSWA_32_16_8BIT,
RyoheiHagimoto 0:b4c1e32627f2 134 &rect
RyoheiHagimoto 0:b4c1e32627f2 135 );
RyoheiHagimoto 0:b4c1e32627f2 136 Display.Graphics_Start(DisplayBase::GRAPHICS_LAYER_0);
RyoheiHagimoto 0:b4c1e32627f2 137
RyoheiHagimoto 0:b4c1e32627f2 138 memset(fbuf_overlay, 0, sizeof(fbuf_overlay));
RyoheiHagimoto 0:b4c1e32627f2 139 clut_param.color_num = sizeof(clut_data_resut) / sizeof(uint32_t);
RyoheiHagimoto 0:b4c1e32627f2 140 clut_param.clut = clut_data_resut;
RyoheiHagimoto 0:b4c1e32627f2 141
RyoheiHagimoto 0:b4c1e32627f2 142 rect.vs = 5;
RyoheiHagimoto 0:b4c1e32627f2 143 rect.vw = OVL_HEIGHT;
RyoheiHagimoto 0:b4c1e32627f2 144 rect.hs = 5;
RyoheiHagimoto 0:b4c1e32627f2 145 rect.hw = OVL_WIDTH;
RyoheiHagimoto 0:b4c1e32627f2 146 Display.Graphics_Read_Setting(
RyoheiHagimoto 0:b4c1e32627f2 147 DisplayBase::GRAPHICS_LAYER_2,
RyoheiHagimoto 0:b4c1e32627f2 148 (void *)fbuf_overlay,
RyoheiHagimoto 0:b4c1e32627f2 149 OVL_STRIDE,
RyoheiHagimoto 0:b4c1e32627f2 150 DisplayBase::GRAPHICS_FORMAT_CLUT8,
RyoheiHagimoto 0:b4c1e32627f2 151 DisplayBase::WR_RD_WRSWA_32_16_8BIT,
RyoheiHagimoto 0:b4c1e32627f2 152 &rect,
RyoheiHagimoto 0:b4c1e32627f2 153 &clut_param
RyoheiHagimoto 0:b4c1e32627f2 154 );
RyoheiHagimoto 0:b4c1e32627f2 155 Display.Graphics_Start(DisplayBase::GRAPHICS_LAYER_2);
RyoheiHagimoto 0:b4c1e32627f2 156
RyoheiHagimoto 0:b4c1e32627f2 157 ThisThread::sleep_for(50);
RyoheiHagimoto 0:b4c1e32627f2 158 EasyAttach_LcdBacklight(true);
RyoheiHagimoto 0:b4c1e32627f2 159 }
RyoheiHagimoto 0:b4c1e32627f2 160
RyoheiHagimoto 0:b4c1e32627f2 161 static void button_fall(void) {
RyoheiHagimoto 0:b4c1e32627f2 162 if (isp_wb_mode_req < WB_TUNGSTEN) {
RyoheiHagimoto 0:b4c1e32627f2 163 isp_wb_mode_req++;
RyoheiHagimoto 0:b4c1e32627f2 164 } else {
RyoheiHagimoto 0:b4c1e32627f2 165 isp_wb_mode_req = WB_DAYLIGHT;
RyoheiHagimoto 0:b4c1e32627f2 166 }
RyoheiHagimoto 0:b4c1e32627f2 167 }
RyoheiHagimoto 0:b4c1e32627f2 168
RyoheiHagimoto 0:b4c1e32627f2 169 static void drp_task(void) {
RyoheiHagimoto 0:b4c1e32627f2 170 AsciiFont ascii_font(fbuf_overlay, OVL_WIDTH, OVL_HEIGHT, OVL_STRIDE, 1);
RyoheiHagimoto 0:b4c1e32627f2 171 char str[64];
RyoheiHagimoto 0:b4c1e32627f2 172
RyoheiHagimoto 0:b4c1e32627f2 173 EasyAttach_Init(Display);
RyoheiHagimoto 0:b4c1e32627f2 174 Start_LCD_Display();
RyoheiHagimoto 0:b4c1e32627f2 175 // Interrupt callback function setting (Field end signal for recording function in scaler 0)
RyoheiHagimoto 0:b4c1e32627f2 176 Display.Graphics_Irq_Handler_Set(DisplayBase::INT_TYPE_S0_VFIELD, 0, IntCallbackFunc_Vfield);
RyoheiHagimoto 0:b4c1e32627f2 177 Start_Video_Camera();
RyoheiHagimoto 0:b4c1e32627f2 178
RyoheiHagimoto 0:b4c1e32627f2 179 R_DK2_Initialize();
RyoheiHagimoto 0:b4c1e32627f2 180
RyoheiHagimoto 0:b4c1e32627f2 181 /* Load DRP Library */
RyoheiHagimoto 0:b4c1e32627f2 182 /* +-----------------------+ */
RyoheiHagimoto 0:b4c1e32627f2 183 /* tile 0 | | */
RyoheiHagimoto 0:b4c1e32627f2 184 /* + + */
RyoheiHagimoto 0:b4c1e32627f2 185 /* tile 1 | | */
RyoheiHagimoto 0:b4c1e32627f2 186 /* + + */
RyoheiHagimoto 0:b4c1e32627f2 187 /* tile 2 | | */
RyoheiHagimoto 0:b4c1e32627f2 188 /* + SimpleIsp bayer2yuv_6 + */
RyoheiHagimoto 0:b4c1e32627f2 189 /* tile 3 | | */
RyoheiHagimoto 0:b4c1e32627f2 190 /* + + */
RyoheiHagimoto 0:b4c1e32627f2 191 /* tile 4 | | */
RyoheiHagimoto 0:b4c1e32627f2 192 /* + + */
RyoheiHagimoto 0:b4c1e32627f2 193 /* tile 5 | | */
RyoheiHagimoto 0:b4c1e32627f2 194 /* +-----------------------+ */
RyoheiHagimoto 0:b4c1e32627f2 195 R_DK2_Load(g_drp_lib_simple_isp_bayer2yuv_6,
RyoheiHagimoto 0:b4c1e32627f2 196 R_DK2_TILE_0,
RyoheiHagimoto 0:b4c1e32627f2 197 R_DK2_TILE_PATTERN_6, NULL, &cb_drp_finish, drp_lib_id);
RyoheiHagimoto 0:b4c1e32627f2 198 R_DK2_Activate(0, 0);
RyoheiHagimoto 0:b4c1e32627f2 199
RyoheiHagimoto 0:b4c1e32627f2 200 memset(&param_isp, 0, sizeof(param_isp));
RyoheiHagimoto 0:b4c1e32627f2 201 param_isp.src = (uint32_t)fbuf_bayer;
RyoheiHagimoto 0:b4c1e32627f2 202 param_isp.dst = (uint32_t)fbuf_yuv;
RyoheiHagimoto 0:b4c1e32627f2 203 param_isp.width = VIDEO_PIXEL_HW;
RyoheiHagimoto 0:b4c1e32627f2 204 param_isp.height = VIDEO_PIXEL_VW;
RyoheiHagimoto 0:b4c1e32627f2 205 param_isp.gain_r = 0x1266;
RyoheiHagimoto 0:b4c1e32627f2 206 param_isp.gain_g = 0x0CB0;
RyoheiHagimoto 0:b4c1e32627f2 207 param_isp.gain_b = 0x1359;
RyoheiHagimoto 0:b4c1e32627f2 208
RyoheiHagimoto 0:b4c1e32627f2 209 isp_wb_mode_req = WB_DAYLIGHT;
RyoheiHagimoto 0:b4c1e32627f2 210 isp_wb_mode = WB_DAYLIGHT;
RyoheiHagimoto 0:b4c1e32627f2 211 sprintf(str, "Daylight");
RyoheiHagimoto 0:b4c1e32627f2 212 ascii_font.DrawStr(str, 0, 0 + (AsciiFont::CHAR_PIX_HEIGHT + 1) * 0, 1, 2);
RyoheiHagimoto 0:b4c1e32627f2 213
RyoheiHagimoto 0:b4c1e32627f2 214 InterruptIn button(USER_BUTTON0);
RyoheiHagimoto 0:b4c1e32627f2 215 button.fall(&button_fall);
RyoheiHagimoto 0:b4c1e32627f2 216
RyoheiHagimoto 0:b4c1e32627f2 217 while (true) {
RyoheiHagimoto 0:b4c1e32627f2 218 ThisThread::flags_wait_all(DRP_FLG_CAMER_IN);
RyoheiHagimoto 0:b4c1e32627f2 219 if (isp_wb_mode_req != isp_wb_mode) {
RyoheiHagimoto 0:b4c1e32627f2 220 isp_wb_mode = isp_wb_mode_req;
RyoheiHagimoto 0:b4c1e32627f2 221 switch (isp_wb_mode) {
RyoheiHagimoto 0:b4c1e32627f2 222 case WB_DAYLIGHT:
RyoheiHagimoto 0:b4c1e32627f2 223 param_isp.gain_r = 0x1266;
RyoheiHagimoto 0:b4c1e32627f2 224 param_isp.gain_g = 0x0CB0;
RyoheiHagimoto 0:b4c1e32627f2 225 param_isp.gain_b = 0x1359;
RyoheiHagimoto 0:b4c1e32627f2 226 sprintf(str, "Daylight");
RyoheiHagimoto 0:b4c1e32627f2 227 break;
RyoheiHagimoto 0:b4c1e32627f2 228 case WB_CLOUDY:
RyoheiHagimoto 0:b4c1e32627f2 229 param_isp.gain_r = 0x1400;
RyoheiHagimoto 0:b4c1e32627f2 230 param_isp.gain_g = 0x0CB0;
RyoheiHagimoto 0:b4c1e32627f2 231 param_isp.gain_b = 0x11CA;
RyoheiHagimoto 0:b4c1e32627f2 232 sprintf(str, "Cloudy");
RyoheiHagimoto 0:b4c1e32627f2 233 break;
RyoheiHagimoto 0:b4c1e32627f2 234 case WB_FLUORESCENT:
RyoheiHagimoto 0:b4c1e32627f2 235 param_isp.gain_r = 0x1000;
RyoheiHagimoto 0:b4c1e32627f2 236 param_isp.gain_g = 0x0CB0;
RyoheiHagimoto 0:b4c1e32627f2 237 param_isp.gain_b = 0x163D;
RyoheiHagimoto 0:b4c1e32627f2 238 sprintf(str, "Fluorescent");
RyoheiHagimoto 0:b4c1e32627f2 239 break;
RyoheiHagimoto 0:b4c1e32627f2 240 case WB_TUNGSTEN:
RyoheiHagimoto 0:b4c1e32627f2 241 param_isp.gain_r = 0x0E66;
RyoheiHagimoto 0:b4c1e32627f2 242 param_isp.gain_g = 0x0CB0;
RyoheiHagimoto 0:b4c1e32627f2 243 param_isp.gain_b = 0x1876;
RyoheiHagimoto 0:b4c1e32627f2 244 sprintf(str, "Tungsten");
RyoheiHagimoto 0:b4c1e32627f2 245 break;
RyoheiHagimoto 0:b4c1e32627f2 246 }
RyoheiHagimoto 0:b4c1e32627f2 247 memset(fbuf_overlay, 0, sizeof(fbuf_overlay));
RyoheiHagimoto 0:b4c1e32627f2 248 ascii_font.DrawStr(str, 0, 0 + (AsciiFont::CHAR_PIX_HEIGHT + 1) * 0, 1, 2);
RyoheiHagimoto 0:b4c1e32627f2 249 }
RyoheiHagimoto 0:b4c1e32627f2 250 R_DK2_Start(drp_lib_id[0], (void *)&param_isp, sizeof(r_drp_simple_isp_t));
RyoheiHagimoto 0:b4c1e32627f2 251 }
RyoheiHagimoto 0:b4c1e32627f2 252 }
RyoheiHagimoto 0:b4c1e32627f2 253
RyoheiHagimoto 0:b4c1e32627f2 254 int main(void) {
RyoheiHagimoto 0:b4c1e32627f2 255
RyoheiHagimoto 0:b4c1e32627f2 256 // Start DRP task
RyoheiHagimoto 0:b4c1e32627f2 257 drpTask.start(callback(drp_task));
RyoheiHagimoto 0:b4c1e32627f2 258
RyoheiHagimoto 0:b4c1e32627f2 259 ThisThread::sleep_for(osWaitForever);
RyoheiHagimoto 0:b4c1e32627f2 260 }
RyoheiHagimoto 0:b4c1e32627f2 261
RyoheiHagimoto 0:b4c1e32627f2 262 #endif