Download Renesas Embedded Application Programming Interface User`s
Transcript
Library Reference
4
5)
4.2.5
A/D Converter
__GetADCFlag
__GetADCFlag
Synopsis
Description
<Acquisition of A/D converter status>
Boolean __GetADCFlag( unsigned long data, unsigned char *status )
data
Setup data
status
Pointer to the buffer in which the register content indicating A/D
converter status is stored
Acquires the status flag of the specified A/D converter.
[data]
For data, set the following parameters. To acquire multiple status flags of A/D modules at the
same time, use the symbol “|” to separate each specified parameter.
RAPI_AD_0
A/D module 0
RAPI_AD_1
A/D module 1
• A/D end flag (ADF) is the status flag which indicate the end of A/D conversion,
and is corresponding to the bit 15 of the A/D control/status register (ADCSR).
• Configuration of ADCSR:
ADF ADIE 0 0 TRGE 0 CONADF STC CKSL[1:0] ADM[1:0] ADCS CH[2:0]
A/D end flag
Return value
If A/D converter status flag is successfully acquired, RAPI_TRUE is returned; if failed,
RAPI_FALSE is returned.
Category
A/D converter
Reference
__ClearADCFlag
Remark
If an undefined value is specified in the first argument, operation of the API cannot be
guaranteed.
Program example
#include "rapi_ad_sh_7125.h"
void func( void )
{
unsigned char status;
/* Acquisition of status flag of A/D converter for module 0 */
__GetADCStatus( RAPI_AD_0 | RAPI_AD_1, &status );
}
Rev.1.01 Aug. 27, 2008
REJ10J1906-0101
4-120