Renesas RJJ10J1643-0101 Network Card User Manual


 
Rev.1.01 2007.02.16
RJJ10J1643-0101
197
__GetADC
Synopsis
<Get A/D converted value (register specified)>
Boolean __GetADC(unsigned long data1, unsigned int *data2)
data1 Setup data 1 (content differs with MCU type)
data2 Pointer to the buffer in which A/D converted value is stored.
Description
Gets the A/D converted value from a specified A/D register.
For data1, the following values can be set.
(M16C)
RAPI_AD0 Selects A/D register 0.
RAPI_AD1 Selects A/D register 1.
RAPI_AD2 Selects A/D register 2.
RAPI_AD3 Selects A/D register 3.
RAPI_AD4 Selects A/D register 4.
RAPI_AD5 Selects A/D register 5.
RAPI_AD6 Selects A/D register 6.
RAPI_AD7 Selects A/D register 7.
(R8C)
Specify 0.
(H8/300H)
RAPI_ADDRA Selects A/D data register A.
RAPI_ADDRB Selects A/D data register B.
RAPI_ADDRC Selects A/D data register C.
RAPI_ADDRD Selects A/D data register D.
Return value
If A/D converted value was successfully acquired, RAPI_TRUE is returned; if failed,
RAPI_FALSE is returned.
Functionality
A/D converter
Reference
__CreateADC, __EnableADC, __DestroyADC, __GetADCAll
Remark
If an undefined value is specified in the first argument, operation of the API cannot
be guaranteed.
Program example
#include "rapi_ad_r8c_13.h"
void func( void )
{
unsigned int data;
/* Get an A/D convertered data of A/D register 0 */
__GetADC( RAPI_AD0, &data );
}