Renesas Solution Starter Kit for RX23W
R20UT4449EG0100 Rev. 1.00
Page 47 of 64
Aug.30.19
Now, open the Config_ICU.c file and insert the following code in the user code area at the end of the file:
/* Start user code for adding. Do not edit comment generated here */
/*******************************************************************************
* Function Name: R_ICU_IRQIsFallingEdge
* Description : This function returns 1 if the specified ICU_IRQ is set to
* falling edge triggered, otherwise 0.
* Arguments : uint8_t irq_no
* Return Value : 1 if falling edge triggered, 0 if not
*******************************************************************************/
uint8_t R_ICU_IRQIsFallingEdge (
const
uint8_t irq_no)
{
uint8_t falling_edge_trig
=
0x0;
if
(ICU.IRQCR[irq_no].BYTE
&
_04_ICU_IRQ_EDGE_FALLING)
{
falling_edge_trig
=
1;
}
return
(falling_edge_trig);
}
/*******************************************************************************
* End of function R_ICU_IRQIsFallingEdge
*******************************************************************************/
/*******************************************************************************
* Function Name: R_ICU_IRQSetFallingEdge
* Description : This function sets/clears the falling edge trigger for the
* specified ICU_IRQ.
* Arguments : uint8_t irq_no
* uint8_t set_f_edge, 1 if setting falling edge triggered, 0 if
* clearing
* Return Value : None
*******************************************************************************/
void
R_ICU_IRQSetFallingEdge (
const
uint8_t irq_no,
const
uint8_t set_f_edge)
{
if
(1
==
set_f_edge)
{
ICU.IRQCR[irq_no].BYTE
|=
_04_ICU_IRQ_EDGE_FALLING;
}
else
{
ICU.IRQCR[irq_no].BYTE
&=
(uint8_t)
~
_04_ICU_IRQ_EDGE_FALLING;
}
}
/******************************************************************************
* End of function R_ICU_IRQSetFallingEdge
*******************************************************************************/
/*******************************************************************************
* Function Name: R_ICU_IRQSetRisingEdge
* Description : This function sets/clear the rising edge trigger for the
* specified ICU_IRQ.
* Arguments : uint8_t irq_no
* uint8_t set_r_edge, 1 if setting rising edge triggered, 0 if
* clearing
* Return Value : None
*******************************************************************************/
void
R_ICU_IRQSetRisingEdge (
const
uint8_t irq_no,
const
uint8_t set_r_edge)
{
if
(1
==
set_r_edge)
{
ICU.IRQCR[irq_no].BYTE
|=
_08_ICU_IRQ_EDGE_RISING;
}
else
{
ICU.IRQCR[irq_no].BYTE
&=
(uint8_t)
~
_08_ICU_IRQ_EDGE_RISING;
}
}
/******************************************************************************
* End of function R_ICU_IRQSetRisingEdge
*******************************************************************************/
Содержание RSSK
Страница 64: ...R20UT4449EG0100 RX23W Group ...