Rev.1.01 2007.02.16
RJJ10J1643-0101
172
4.2.4 External interrupt
__SetInterrupt
Synopsis
<Set external interrupt>
Boolean __SetInterrupt(unsigned long data1, unsigned int data2, void* func)
data1
Setup data 1 (content differs with MCU type)
data2
Setup data 2 (content differs with MCU type)
func
Callback function pointer
(Specify 0 if no callback functions are set.)
Description
Sets a specified external interrupt.
[data1]
For data1, the following definition values can be set. To set multiple definition values at
the same time, use the symbol “|” to separate each specified value. Note, however, that
multiple external interrupts cannot be specified at the same time.
(M16C)
RAPI_INT0
Uses _INT0 interrupt.
RAPI_INT1
Uses _INT1 interrupt.
RAPI_INT2
Uses _INT2 interrupt.
RAPI_INT3
Uses _INT3 interrupt.
RAPI_INT4
Uses _INT4 interrupt.
RAPI_INT5
Uses _INT5 interrupt.
RAPI_KEY
Uses key input interrupt.
RAPI_INT_RISING
Specifies a rising edge for the active edge of a selected external
interrupt.
RAPI_INT_FALLING
Specifies a falling edge for the active edge of a selected external
interrupt.
RAPI_INT_BOTH
Specifies both edges for the active edge of a selected external
interrupt.
RAPI_KI0_ENABLE
Uses _KI0 pin input.
RAPI_KI1_ENABLE
Uses _KI1 pin input.
RAPI_KI2_ENABLE
Uses _KI2 pin input.
RAPI_KI3_ENABLE
Uses _KI3 pin input.
• Specifiable definition values when _INT0
–
5 interrupts are used (RAPI_INT0 to
RAPI_INT5 specified)
(Polarity)
Specify one from { RAPI_INT_RISING, RAPI_INT_FALLING,
RAPI_INT_BOTH }. The default value is RAPI_INT_FALLING.
• Specifiable definition values when key input interrupt is used (RAPI_KEY specified)
(Input pin)
To use _KI0, _KI1, _KI2, or _KI3 pin input, specify RAPI_KI0_ENABLE,
RAPI_KI1_ENABLE, RAPI_KI2_ENABLE, or RAPI_KI3_ENABLE,
respectively. The default value is RAPI_INT_FALLING.
(R8C)
RAPI_INT0
Uses _INT0 interrupt.
RAPI_INT1
Uses _INT1 interrupt.