beautypg.com

Getadc – Renesas M16C/62P Group User Manual

Page 98

background image

Rev.1.00 2007.11.1
REC10B0002-0100

96

__GetADC

Synopsis

Boolean __GetADC(unsigned long data1, unsigned int *data2)

data1

Setup data 1

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.

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.

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_m16c_62p.h"

void func( void )
{
unsigned int data;

/* Get an A/D convertered data of A/D register 0 */
__GetADC( RAPI_AD0, &data );
}