コード例 #1
0
ファイル: drv_lcd_mz102.c プロジェクト: BarryChen/RDA
// ============================================================================
// lcdd_Open
// ----------------------------------------------------------------------------
/// Open the LCDD driver.
/// It must be called before any call to any other function of this driver.
/// This function is to be called only once.
/// @return #LCDD_ERR_NO or #LCDD_ERR_DEVICE_NOT_FOUND.
// ============================================================================
PUBLIC LCDD_ERR_T lcdd_Open(VOID)
{
	UINT32 i=0;

    LCDD_CONFIG_T lcddReadConfig=LCDD_READ_CONFIG;

lcdd_SetBrightness(7);

#ifdef USE_SPI_LCD
    hal_GoudaSerialOpen(LCDD_SPI_LINE_TYPE, LCDD_SPI_FREQ, &lcddReadConfig.config, 0);
#else
    hal_GoudaOpen(&lcddReadConfig.config, lcddReadConfig.timings, 0);
#endif    

    sxr_Sleep(20 MS_WAITING);

    lcdd_Init();

    g_lcddInSleep = FALSE;

    return LCDD_ERR_NO;
}
コード例 #2
0
ファイル: calib_stub_task.c プロジェクト: jprothwell/sc-fix
// =============================================================================
// calib_StubTaskInit
// -----------------------------------------------------------------------------
/// Calib Stub OS task.
// =============================================================================
PROTECTED VOID calib_StubTaskInit(VOID)
{
    UINT32  evt[4];
    Msg_t   *msg;
#ifdef CES_DISPLAY
    LCDD_SCREEN_INFO_T screenInfo;
    GFX_ROI_T fullScreenRoi;
#endif

    CALIB_PROFILE_FUNCTION_ENTER(calib_StubTestTaskInit);
    
    /// Some initialization.
   
    /// Enable full-speed access to flash and ram.
    memd_FlashOpen(tgt_GetMemdFlashConfig());
    memd_RamOpen(tgt_GetMemdRamConfig());

#if (CHIP_HAS_USB == 1) && (CALIB_WITHOUT_USB != 1)
    uctls_Open(g_calibStubMbx, 0, 0, 0, "USB Calib");
    uctls_SetMode(UCTLS_ID_TRACE);

    // Force usb power cycle
    uctls_ChargerStatus(UCTLS_CHARGER_STATUS_DISCONNECTED);
    sxr_Sleep(8000);

    // Initiate charger status
    calib_ChargerHandler(pmd_GetChargerStatus());
    // Configure PMD to warn the calib when a charger is plugged.
    pmd_SetChargerStatusHandler(calib_ChargerHandler);
#endif // CHIP_HAS_USB  && (CALIB_WITHOUT_USB != 1)

#ifdef CES_DISPLAY
    /// Setup the display.
    lcdd_Open();
    lcdd_SetStandbyMode(FALSE);
    lcdd_GetScreenInfo(&screenInfo);
    
    // Fill the whole screen with white.
    fullScreenRoi.start.x      = 0;
    fullScreenRoi.start.y      = 0;
    fullScreenRoi.width        = screenInfo.width;    
    fullScreenRoi.height       = screenInfo.height;
    while (LCDD_ERR_NO != lcdd_FillRect16(&fullScreenRoi, 0xffff));
    
    /// Draw a cool logo.
    while (lcdd_Blit16(&g_calibLogoFbw, 0, 0) != LCDD_ERR_NO);
    lcdd_SetBrightness(6);

    fmg_PrintfInit(0, 8, screenInfo.width, screenInfo.height);

    SXS_TRACE(TSTDOUT, "Running code: Calib Embedded Stub");

    /// Switch ON/OFF PAL traces. 
    sxs_SetTraceLevel(_PAL, 0x1);
#endif

    // Start the calibration stub
    calib_StubOpen();



    /// Update the display. 
    calib_DispState(TRUE);


    /// Start the display refresh and battery monitoring timers. 
    sxs_StartTimer(DISP_TIME, DISP_TIMER, NULL, FALSE, g_calibStubMbx);
    
    /// Main loop. 
    while (1)
    {
        /// Wait for a timer event or a key message. 
        msg = sxr_Wait(evt, g_calibStubMbx);

        if (msg == 0)
        {
            /// Refresh screen. 
            if (evt[0] == DISP_TIMER)
            {
                CALIB_PROFILE_PULSE(calib_StubTimDisp);
                
                /// Update the display. 
                calib_DispState(FALSE);
                
                /// Wakeup the task to update the display. 
                sxs_StartTimer(DISP_TIME, DISP_TIMER, NULL, FALSE, g_calibStubMbx);
            }

            /// Skip the message handling. 
            continue;
        }
        else
        {
            /// Free the message.
            sxr_Free(msg);
            /// Don't handle the key pressing.
            

        }
    }
}