Rev.1.01 2007.02.16
RJJ10J1643-0101
190
Delayed trigger mode 1
Repeat sweep mode
Specify 1, 2, 3, or 4.
(R8C)
Specify 1.
(H8/300H)
One-shot mode
Specify 1.
Repeat mode
Single sweep mode
Specify 1, 2, 3, or 4.
Repeat sweep mode 0
[data3]
(M16C) (R8C)
Specify the interrupt priority level (0
–
7) to be set in the interrupt control register.
(H8/300H)
Specify the interrupt priority level (0–1) to be set in the interrupt control register.
For the CPUs that do not have an interrupt control register, specify 0.
Return value
If A/D converter was successfully set, RAPI_TRUE is returned; if failed, RAPI_FALSE
is returned.
Functionality
A/D converter
Reference
__EnableADC
,
__DestroyADC
,
__GetADC
,
__GetADCAll
Remark
•
If an undefined value is specified in the first argument, operation of the API cannot
be guaranteed.
•
The specifiable analog input pins differ with each CPU used.
•
If you use an R8C MCU which does not support fOCO-F for its operating frequency, you
cannot specify RAPI_FOCOF.
•
If you use an R8C MCU which does not support timer RD as a trigger, you cannot specify
RAPI_TIMER_RD_TRIGGER as a trigger.
•
When used for the H8/300H, this API specify when freeing it from module stanby.
Program example
#include " rapi_ad_r8c_13.h"
void AdIntFunc( void ){}
void func( void )
{
/* Set up A/D converter as one short mode */
__CreateADC( RAPI_ONE_SHOT|RAPI_AN2|RAPI_FAD2| RAPI_WITH_SAMPLE_HOLD
|
RAPI_EXTERNAL_TRIGGER
|RAPI_AD_ON|RAPI_10BIT,
1,
5,
AdIntFunc );
}