;File: adc42rd.a51
;Author: Eckart Hartmann Date:05/10/2003
 ; Development progress: Adc842.df
;
;AdcRd==========Read conversion result.
;C Function prototype: int AdcRd(void);
;Description of Function: Reads conversion result of ADC.
;User interface: Call AdcCfg() to configure ADC.
;		Call AdcGo() to start a conversion.
;		Call AdcBsy to check conversion is complete.
;		Call AdcRd().
;		Returns result as 16 bit unsigned integer.
;Robustness: No known issues. 
;Side effects: Overwrites a, P, c.
;
NAME ADCRD
$NOMOD51
 $IC(..kei842.inc) ; Parameter passing registers for Keil .
 $IC(..kei842.dat) ; SFR definition for Keil .
;
public AdcRd

?PR?AdcRd?ADCRD	SEGMENT CODE
	RSEG	?PR?AdcRd?ADCRD
;
AdcRd:	mov	iP1l,ADCDATAL	;return (ADCDATAH&0xf):ADCDATAL;
	mov	a,ADCDATAH
	anl	a,#0fh
	mov	iP1h,a
	ret			; }}
;
;Function End==========================================================Function End
END

