Renesas RJJ10J1643-0101 Network Card User Manual


 
Rev.1.01 2007.02.16
RJJ10J1643-0101
17
Program example
#include "rapi_ad_r8c_13.h"
void main( void )
{
unsigned int status, data;
/* Set up A/D converter as one short mode */
__
CreateADC( RAPI
_
ONE
_
SHOT|RAPI
_
AN0|RAPI
_
FAD2|
RAPI_WITH_SAMPLE_HOLD|
RAPI_AD_OFF|RAPI_10BIT, 1, 0, 0 );
while( 1 ){
/* Disable A/D converter */
__EnableADC( RAPI_AN0| RAPI_AD_ON, 1 );
/* Check a flag bit of A/D converter interrupt */
do{
__GetADCStatus( &status );
} while( (*status & 0x0001) == 0 )
/* Get A/D convertered datas of A/D register */
__GetADC( &data );
/* Clear status of A/D convertered */
__ClearADCStatus( 0 );
}
}