Ejemplo n.º 1
0
static int pollux_adc_value(int channel) 
{
	int ret_val;
    unsigned char Timeout = 0xff;
    
    MES_ADC_SetInputChannel(channel);
	MES_ADC_Start();
	
	while(!MES_ADC_IsBusy() && Timeout--);	// for check between start and busy time
	while(MES_ADC_IsBusy());
	ret_val = (U16)MES_ADC_GetConvertedData();
    return ret_val;
}
Ejemplo n.º 2
0
/**
 *  @brief      Indicaes whether the selected modules is ready to enter power-down stage
 *  @return     \b CTRUE indicate that   Ready to enter power-down stage. \n
 *              \b CFALSE indicate that  This module can't enter to power-down stage.
 *  @see        MES_ADC_GetPhysicalAddress,     MES_ADC_GetSizeOfRegisterSet,
 *              MES_ADC_SetBaseAddress,         MES_ADC_GetBaseAddress,
 *              MES_ADC_OpenModule,             MES_ADC_CloseModule,
 *              MES_ADC_CheckBusy              
 */
CBOOL   MES_ADC_CanPowerDown( void )
{
    if( MES_ADC_IsBusy() )
    {
        return CFALSE;   
    }
    
    return CTRUE;
}