Ejemplo n.º 1
0
PRIVATE void camerap_PowerOff(void)
{
    // Turn off the Camera
#ifdef TGT_GALLITE_G800
     camerap_WriteOneReg( 0x43 , 0x00);
     camerap_WriteOneReg( 0x44 , 0x0a);
#endif
    if (s_camOpened == TRUE)
    {
        HAL_CAMERA_IRQ_CAUSE_T mask = {0,0,0,0};
        hal_CameraIrqSetMask(mask);
       // disable IFC
        if (gIsCameraStartXfer == TRUE )
        {
            gIsCameraStartXfer=FALSE;
            hal_CameraStopXfer(1);
            gSensorInfo.cammode = CAM_MODE_IDLE;
        }
        // Disable Camera Interface Module
        hal_CameraClose();
    }
    // Disable I2C
#ifdef I2C_BASED_ON_GPIO
    gpio_i2c_close();
#else
    hal_I2cClose(g_camdI2cBusId); 
#endif

    // Disable the LDO for the camera
    pmd_EnablePower(PMD_POWER_CAMERA, FALSE); 
}
Ejemplo n.º 2
0
// =============================================================================
// fmd_Close
// -----------------------------------------------------------------------------
/// This function closes the FM driver and desactivate the FM chip 
/// and stops any pending #fmd_Tune or #fmd_Seek operation.
/// @return             \c FMD_ERR_NO, or \c FMD_ERR_RESOURCE_BUSY
// =============================================================================
PUBLIC FMD_ERR_T fmd_Close(VOID)
{ 
    //set mute,close adac
   // fmd_Write(0x10,0xc500);
    //set pdn low
    RDA5888FM_Exit();
    hal_GpioClr(g_fmdConfig->pinPdn);

#ifdef RDA5888_FM_26MCRYSTAL_ENABLE    
//if ( 0==rdabt_getCurrentState() )
{
	hal_SysAuxClkOut(FALSE);
}
#endif
//close 32k here
#ifdef RDA5888_32KFMMODE_ENALBE
    {
        RDA_Close32KOnClip();
    }
#endif

#ifdef I2C_BASED_ON_GPIO
		   gpio_i2c_close();
#else 
		//xiaoyifeng for atv
		 hal_I2cClose(g_atvdI2cBusId); 
#endif

    g_band = FMD_BAND_QTY; // close marker
 
    return FMD_ERR_NO;
}
Ejemplo n.º 3
0
// ============================================================================
// camerap_CheckProductId
// ----------------------------------------------------------------------------
/// read sensor id,compare with define sensor id 
/// @return #TRUE, #FALSE
// ============================================================================
PRIVATE BOOL camerap_CheckProductId()
{
    UINT8 cameraID=0;

    camerap_Reserve(NULL);

#ifdef I2C_BASED_ON_GPIO
    gpio_i2c_open();
#else
    g_camdI2cBusId = tgt_GetCamdConfig()->i2cBusId;
    hal_I2cOpen(g_camdI2cBusId);
#endif

    HAL_CAMERA_CFG_T CamConfig = {0,};
    CamConfig.rstActiveH = FALSE;
    CamConfig.pdnActiveH = TRUE;
    CamConfig.dropFrame = FALSE;
    CamConfig.camClkDiv = 6; // 156MHz/6 = 26MHz
    CamConfig.endianess = NO_SWAP;//BYTE_SWAP;//
    CamConfig.colRatio= COL_RATIO_1_1;
    CamConfig.rowRatio= ROW_RATIO_1_1;
    CamConfig.camId = camera_GetCameraID();
    hal_CameraOpen(&CamConfig);

    hal_CameraReset(TRUE);      // set reset to low
    // Enable Camera LDO
    pmd_EnablePower(PMD_POWER_CAMERA,TRUE); 
    hal_TimDelay(819);          // delay 5ms for stable reset low signal

    hal_CameraPowerDown(FALSE);
    if (gSensorInfo.snrrst)
    {
    }
    else
    {
        hal_CameraReset(FALSE);
    }
   //before read,must delay for sensor   
    camerap_Delay(20);
    cameraID=camerap_GetId();

   // Disable Camera Interface Module
    hal_CameraClose();
    // Disable I2C
 
#ifdef I2C_BASED_ON_GPIO
       gpio_i2c_close();
#else
	 hal_I2cClose(g_camdI2cBusId); 
#endif

    // Disable the LDO for the camera
    pmd_EnablePower(PMD_POWER_CAMERA,FALSE);

    SXS_TRACE(TSTDOUT,"byd3703(0x%02x): read id is 0x%02x", CAM_BYD3703_ID, cameraID);
    if(cameraID == CAM_BYD3703_ID)
        return TRUE;
    else
        return FALSE;
}
Ejemplo n.º 4
0
VOID I2C_Close(VOID)
{

#ifdef I2C_BASED_ON_GPIO
    gpio_i2c_close();
#else
    hal_I2cClose(g_btdI2cBusId);
#endif
 	
       return;
	 
}