1 /***********************************************************************************************************************
\r
3 * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products.
\r
4 * No other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
\r
5 * applicable laws, including copyright laws.
\r
6 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIESREGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED
\r
7 * OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
8 * NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY
\r
9 * LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE FOR ANY DIRECT,
\r
10 * INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR
\r
11 * ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
\r
12 * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability
\r
13 * of this software. By using this software, you agree to the additional terms and conditions found by accessing the
\r
15 * http://www.renesas.com/disclaimer
\r
17 * Copyright (C) 2015 Renesas Electronics Corporation. All rights reserved.
\r
18 ***********************************************************************************************************************/
\r
20 /***********************************************************************************************************************
\r
21 * File Name : r_cg_icu.c
\r
22 * Version : Code Generator for RZ/T1 V1.00.00.09 [02 Mar 2015]
\r
23 * Device(s) : R7S910018CBG
\r
24 * Tool-Chain : GCCARM
\r
25 * Description : This file implements device driver for ICU module.
\r
26 * Creation Date: 22/04/2015
\r
27 ***********************************************************************************************************************/
\r
29 /***********************************************************************************************************************
\r
31 ***********************************************************************************************************************/
\r
32 /* Start user code for pragma. Do not edit comment generated here */
\r
33 /* End user code. Do not edit comment generated here */
\r
35 /***********************************************************************************************************************
\r
37 ***********************************************************************************************************************/
\r
38 #include "r_cg_macrodriver.h"
\r
39 #include "r_cg_icu.h"
\r
40 /* Start user code for include. Do not edit comment generated here */
\r
41 /* End user code. Do not edit comment generated here */
\r
42 #include "r_cg_userdefine.h"
\r
44 /***********************************************************************************************************************
\r
45 Global variables and functions
\r
46 ***********************************************************************************************************************/
\r
47 /* Start user code for global. Do not edit comment generated here */
\r
48 /* End user code. Do not edit comment generated here */
\r
50 /***********************************************************************************************************************
\r
51 * Function Name: R_ICU_Create
\r
52 * Description : This function initializes ICU module.
\r
54 * Return Value : None
\r
55 ***********************************************************************************************************************/
\r
56 void R_ICU_Create(void)
\r
59 /* Disable IRQ12 interrupt */
\r
60 VIC.IEC0.LONG = 0x00010000UL;
\r
62 /* Set IRQ12 edge detection type */
\r
63 VIC.PLS0.LONG |= 0x00010000UL;
\r
64 ICU.IRQCR12.BIT.IRQMD = (uint8_t)_ICU_IRQ_EDGE_FALLING;
\r
66 /* Enable IRQ12 digital filter */
\r
67 ICU.IRQFLTE.BIT.FLTEN12 = 1U;
\r
69 /* Set IRQ12 digital filter clock */
\r
70 ICU.IRQFLTC.BIT.FCLKSEL12 = _ICU_IRQ12_FILTER_PCLKB_64;
\r
72 /* Set IRQ12 Priority */
\r
73 VIC.PRL16.LONG = _ICU_PRIORITY_LEVEL3;
\r
75 /* Set IRQ12 interupt address */
\r
76 VIC.VAD16.LONG = (uint32_t)r_icu_irq12_interrupt;
\r
78 /***********************************************************************************************************************
\r
79 * Function Name: R_ICU_IRQ12_Start
\r
80 * Description : This function enables IRQ12 interrupt.
\r
82 * Return Value : None
\r
83 ***********************************************************************************************************************/
\r
84 void R_ICU_IRQ12_Start(void)
\r
86 /* Enable IRQ12 interrupt */
\r
87 VIC.IEN0.LONG |= 0x00010000UL;
\r
89 /***********************************************************************************************************************
\r
90 * Function Name: R_ICU_IRQ12_Stop
\r
91 * Description : This function disables IRQ12 interrupt.
\r
93 * Return Value : None
\r
94 ***********************************************************************************************************************/
\r
95 void R_ICU_IRQ12_Stop(void)
\r
97 /* Disable IRQ12 interrupt */
\r
98 VIC.IEC0.LONG = 0x00010000UL;
\r
101 /* Start user code for adding. Do not edit comment generated here */
\r
102 /* End user code. Do not edit comment generated here */
\r