void OSD::write(uint8_t c) { if(c == '|') { ClosePanel(); //It does all needed to finish auto increment and change current row OpenPanel(); //It does all needed to re-enable auto increment } else { spi_transfer(MAX7456_DMDI_reg); spi_transfer(c); } }
/** Detect HDMI is plugging in or unplugged Detect HDMI is plugging in or unplugged. @param void @return void */ void KeyScan_DetHDMI(void) { BOOL bCurHDMIDet, bCurHDMIStatus; UINT32 i, uiWindowEn; PrimaryModeID CurrMode; IPL_OBJ IplObj; IMEIDE_ATTR ImeIdeAttr; //#NT#2009/08/18#Klins Chen#[0006129] -begin //#Add to select audio channel to HDMI interface AUDIO_SETTING AudioSetting; AudioSetting.SamplingRate = AUDIO_SR_32000; // Sampling rate = Clock / 256 //#NT#2009/08/18#Klins Chen#[0006129] -end if ((KeyScan_IsUSBPlug() ==TRUE) || (KeyScan_IsTVPlugIn()==TRUE)) { return; } bCurHDMIDet = GPIOMap_DetHDMI(); bCurHDMIStatus = (BOOL)(bCurHDMIDet & bLastHDMIDet); if (bCurHDMIStatus != bLastHDMIStatus) { // Get current mode CurrMode = Primary_GetCurrentMode(); Primary_ChangeMode(PRIMARY_MODE_DUMMY); Primary_Wait4ChangeModeDone(); // HDMI is plugging in if (bCurHDMIStatus == TRUE) { debug_err(("# HDMI is plugging in #\n\r")); bHDMIStatus = TRUE; // Turn off LCD backlight GPIOMap_TurnOffLCDBacklight(); ide_disable_video(IDE_VIDEOID_1); ide_disable_video(IDE_VIDEOID_2); // Close LCD panel ClosePanel(); GPIOMap_TurnOffLCDPower(); pinmux_select_lcd(PINMUX_GPIO); // Disable all windows uiWindowEn = ide_get_window_en(); ide_set_allwindow_dis(); ide_set_load(); ide_wait_frame_end(); //Init HDMI // This settings is customized by project InitTVHDMI(HDMI_1280X720P60, HDMI_AUDIO32KHZ); OpenTVHDMI(&g_LCDCtrlObj,&g_LCDSize); //#NT#2010/04/26#Klins Chen -begin #if (_CEC_CONTROL_ == ENABLE) cec_open(); cec_setDeviceVendorID(CECVENDOR_NONE); cec_hookRemoteCallBack(KeyScan_parseRemoteKey, NULL); #endif //#NT#2010/04/26#Klins Chen -end //Display ratio ImgCapture_SetParameter(_DispRatio, _Ratio_16_9); // Scaling OSD to new size KeyScan_ScaleDisplay(); // Enable IDE ide_waitFrameEnd(); ide_setEn(TRUE); // Delay to wait for IDE stable for (i=6; i>0; i--) { ide_wait_frame_end(); } // Enable all windows ide_set_allwindow_en(uiWindowEn); ide_set_load(); //#NT#2009/11/24#Philex - begin // change audio output path/sampling rate AudioSetting.Output = AUDIO_OUTPUT_NONE; KeyScan_HDMIAudioSetting(AudioSetting, TRUE); //#NT#2009/11/24#Philex - end // forced set to playback mode CurrMode = PRIMARY_MODE_PLAYBACK; } // HDMI is unplugged else { debug_err(("# HDMI is unplugged #\n\r")); bHDMIStatus = FALSE; ide_disable_video(IDE_VIDEOID_1); ide_disable_video(IDE_VIDEOID_2); //#NT#2010/04/26#Klins Chen -begin #if (_CEC_CONTROL_ == ENABLE) cec_hookRemoteCallBack(NULL, NULL); cec_close(); #endif //#NT#2010/04/26#Klins Chen -end // Close HDMI ide_wait_frame_end(); CloseTVHDMI(); // Disable all windows uiWindowEn = ide_get_window_en(); ide_set_allwindow_dis(); ide_set_load(); ide_wait_frame_end(); // Open LCD panel GPIOMap_TurnOnLCDPower(); OpenPanel(&g_LCDCtrlObj, &g_LCDSize); //Display ratio #if (_LCDTYPE_ == _LCDTYPE_TXDT300C_) ImgCapture_SetParameter(_DispRatio, _Ratio_16_9); #else ImgCapture_SetParameter(_DispRatio, _Ratio_4_3); #endif // Scaling OSD to new size KeyScan_ScaleDisplay(); //ImeIdeAttr.uiImeOutH = g_LCDSize.uiWidth; //ImeIdeAttr.uiImeOutV = g_LCDSize.uiHeight; //ImeIdeAttr.uiIdeOutH = g_LCDSize.uiWinWidth; //ImeIdeAttr.uiIdeOutV = g_LCDSize.uiWinHeight; // Enable IDE ide_wait_frame_end(); ide_setEn(TRUE); // Delay 6 IDE frames to avoid seeing garbage display for (i=6; i>0; i--) { ide_wait_frame_end(); } // Enable all windows ide_set_allwindow_en(uiWindowEn); ide_set_load(); //#NT#2009/08/18#Klins Chen#[0006129] -begin //#Add to select audio channel to HDMI interface AudioSetting.Output = AUDIO_OUTPUT_SPK; KeyScan_HDMIAudioSetting(AudioSetting, FALSE); //#NT#2009/08/18#Klins Chen#[0006129] -end TimerDelayMs(150); // delay time before turn on LCD backlight } Primary_ChangeMode(CurrMode); Primary_Wait4ChangeModeDone(); } bLastHDMIDet = bCurHDMIDet; bLastHDMIStatus = bCurHDMIStatus; }