User`s manual
RX62N Group, RX621 Group 4. Library Reference
2) R_INTC_CreateSoftwareInterrupt
Synopsis
Enable use of the software interrupt.
Prototype
bool R_INTC_CreateSoftwareInterrupt(
uint8_t data1,
// Configuration
void * func,
// Callback function
uint8_t data2
// Interrupt priority level
);
Description
Configure and enable the software interrupt.
[data1]
Choose the pin settings. The default setting is shown in bold.
•
DTC trigger control.
PDL_INTC_DTC_SW_TRIGGER_DISABLE or
PDL_INTC_DTC_SW_TRIGGER_ENABLE
Disable or enable activation of the DTC
when a software interrupt is generated.
[func]
The function to be called when a valid condition is detected.
Specify PDL_NO_FUNC if no interrupt is required.
[data2]
The interrupt priority level. Select between 1 (lowest priority) and 15 (highest priority).
This parameter will be ignored if PDL_NO_FUNC is specified for parameter func.
Return value
True if all parameters are valid; otherwise false.
Category
Interrupt control
Reference
R_INTC_Write
Remarks
•
Please see the notes on callback function use in §6.
•
Specifying PDL_NO_FUNC for the callback function allows the software interrupt to be used
as a DTC trigger.
•
R_INTC_Write to generate the software interrupt.
Program example
/* RPDL definitions */
#include "r_pdl_intc.h"
/* RPDL device-specific definitions */
#include "r_pdl_definitions.h"
/* Declaration of callback function */
void CallBackFunc( void );
void func( void )
{
/* Configure the software interrupt handler */
R_INTC_CreateSoftwareInterrupt(
PDL_NO_DATA,
CallBackFunc,
7
);
}
R20UT0084EE0112 Rev.1.12 Page 4-11
July. 16, 2014