Renesas Solution Starter Kit for RX23W
R20UT4449EG0100 Rev. 1.00
Page 46 of 64
Aug.30.19
5.4
Switch Code Integration
API functions for user switch control are provided with the RSSK. Refer to the Tutorial project folder created
according to the Quick Start Guide procedure. Check that the following files are in the src folder:
・
rsskrx23wdef.h
・
r_rssk_switch.c
・
r_rssk_switch.h
Copy these files in to the src folder below the workspace.
The switch code uses interrupt code in the files Config_ICU.h, Config_ICU.c and Config_ICU_user.c and timer
code in the files Config_CMT1.h, Config_CMT1.c, Config_CMT1_user.c, Config_CMT2.h, Config_CMT2.c and
Config_CMT2_user.c as described in §4.5.2. and §4.5.3 It is necessary to provide additional user code in
these files to implement the switch press/release detection and de-bouncing required by the API functions in
r_rssk_switch.c.
5.4.1
Interrupt Code
In the e
2
studio Project Tree, expand the ‘src\smc_gen\Config_ICU’ folder and open the file ‘Config_ICU.h’ by
double-clicking on it. Insert the following code in the user code area at the end of the file:
/* Start user code for function. Do not edit comment generated here */
/* Function prototypes for detecting and setting the edge trigger of ICU_IRQ */
uint8_t R_ICU_IRQIsFallingEdge(
const
uint8_t irq_no);
void
R_ICU_IRQSetFallingEdge(
const
uint8_t irq_no,
const
uint8_t set_f_edge);
void
R_ICU_IRQSetRisingEdge(
const
uint8_t irq_no,
const
uint8_t set_r_edge);
/* End user code. Do not edit comment generated here */
Содержание RSSK
Страница 64: ...R20UT4449EG0100 RX23W Group ...