RL78/G13 Clock Generator (Clock Switching) CC-RL
R01AN2831EJ0100 Rev. 1.00 Page 20 of 51
May 28, 2015
[Function Name] r_tau0_channel0_interrupt
Synopsis
Processes an interval timer interrupt of channel 0 of TAU0.
Header
#include "r_cg_macrodriver.h"
#include "r_cg_timer.h"
#include "r_cg_userdefine.h"
Declaration
static void __near r_tau0_channel0_interrupt(void)
Explanation
Inverts the LED output (P62) at transition to this interrupt processing.
Arguments
None
Return value
None
Remarks
None
[Function Name] r_intc0_interrupt
Synopsis
Processes an INTP0 external interrupt.
Header
#include "r_cg_macrodriver.h"
#include “r_cg_intc.h
#include "r_cg_userdefine.h"
Declaration
static void __near r_intc0_interrupt(void)
Explanation
Updating the switch status.
This function checks the switch status twice. It waits (for 10 ms) to deal with chattering
between the first and second switch checking operations.
The function sets g_SwitchStatus to SWITCH_OFF (0x00) if it fails to detect two switch
presses in succession.
The function sets g_SwitchStatus to SWITCH_ON (0x01) if it detects two switch presses in
succession.
Updating the clock status
This function sets g_ClockStatus to one of the following constants according to the number
of switch presses:
HOCO_NEXT_STATUS_X1
X1_NEXT_STATUS_XT1
XT1_NEXT_STATUS_HOCO
Arguments
None
Return value
None
Remarks
None
[Function Name] R_IT_Wait_ms
Synopsis
Waits in units of 1 ms.
Header
#include "r_cg_macrodriver.h"
#include "r_cg_it.h"
#include "r_cg_userdefine.h"
Declaration
void R_IT_Wait_ms(uint16_t wait_count)
Explanation
Waits for a period of wait_count * 1 ms using a 12-bit interval timer.
Arguments
First argument: wait_count
: Wait count
Return value
None
Remarks
This function does not use the vector interrupt function of the 12-bit interval timer.
It waits for the period specified in the argument while polling the interrupt request flag after
the 12-bit interval timer is started.
The function does not wait if the first argument wait_count is set to 0.