/* Reads data from the specified adc channel fifo.  */
uint16_t analogin_read_u16(analogin_t *obj)
/* Reads data from the specified adc channel fifo.  */
uint16_t analogin_read_u16(analogin_t *obj)
{
	uint8_t  ChIdx = obj->adc_idx;
	uint32_t data;
	ADC->ADC_CHSW_LIST[0] = ChIdx;
	ADC_ClearFIFO();
	ADC_SWTrigCmd(ENABLE);
	while(ADC_Readable()== 0);
	ADC_SWTrigCmd(DISABLE);
	data = ADC_Read();
	return (uint16_t)(data & BIT_MASK_DAT_GLOBAL);
}