]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_R4F_RZ_T_GCC_IAR_ARM/System/GCC/src/r_atcm_init.c
Modify RZ/T e2studio directory structure to accommodate an IAR project.
[freertos] / FreeRTOS / Demo / CORTEX_R4F_RZ_T_GCC_IAR_ARM / System / GCC / src / r_atcm_init.c
1 /*******************************************************************************\r
2 * DISCLAIMER\r
3 * This software is supplied by Renesas Electronics Corporation and is only\r
4 * intended for use with Renesas products. No other uses are authorized. This\r
5 * software is owned by Renesas Electronics Corporation and is protected under\r
6 * all applicable laws, including copyright laws.\r
7 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING\r
8 * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT\r
9 * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE\r
10 * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.\r
11 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS\r
12 * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE\r
13 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR\r
14 * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE\r
15 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\r
16 * Renesas reserves the right, without notice, to make changes to this software\r
17 * and to discontinue the availability of this software. By using this software,\r
18 * you agree to the additional terms and conditions found by accessing the\r
19 * following link:\r
20 * http://www.renesas.com/disclaimer\r
21 *\r
22 * Copyright (C) 2014 Renesas Electronics Corporation. All rights reserved.\r
23 ***********************************************************************************************************************/\r
24 /***********************************************************************************************************************\r
25 * System Name  : RZ/T1 Init program\r
26 * File Name    : r_atcm_init.c\r
27 * Version      : 0.1\r
28 * Device       : R7S910018\r
29 * Abstract     : API for ATCM function\r
30 * Tool-Chain   : GNUARM-NONEv14.02-EABI\r
31 * OS           : not use\r
32 * H/W Platform : Renesas Starter Kit for RZ/T1(Preliminary)\r
33 * Description  : ATCM access wait setting API of RZ/T1\r
34 * Limitation   : This wait setting could not be executed in ATCM program area. \r
35 ***********************************************************************************************************************/\r
36 /***********************************************************************************************************************\r
37 * History      : DD.MM.YYYY Version  Description\r
38 *              : 21.05.2015 1.00     First Release\r
39 ***********************************************************************************************************************/\r
40 \r
41 /***********************************************************************************************************************\r
42 Includes <System Includes> , "Project Includes"\r
43 ***********************************************************************************************************************/\r
44 #include <stdint.h>\r
45 #include "iodefine.h"\r
46 #include "r_system.h"\r
47 #include "r_atcm_init.h"\r
48 #include "r_typedefs.h"\r
49 \r
50 /***********************************************************************************************************************\r
51 Macro definitions\r
52 ***********************************************************************************************************************/\r
53 #define ATCM_WRITE_ENABLE (0x0000A508)\r
54 #define ATCM_WRITE_DISABLE (0x0000A500)\r
55 \r
56 /***********************************************************************************************************************\r
57 Typedef definitions\r
58 ***********************************************************************************************************************/\r
59 \r
60 \r
61 \r
62 /***********************************************************************************************************************\r
63 Imported global variables and functions (from other files)\r
64 ***********************************************************************************************************************/\r
65 \r
66 \r
67 /***********************************************************************************************************************\r
68 Exported global variables and functions (to be accessed by other files)\r
69 ***********************************************************************************************************************/\r
70 \r
71 \r
72 \r
73 /***********************************************************************************************************************\r
74 Private variables and functions\r
75 ***********************************************************************************************************************/\r
76 \r
77 \r
78 \r
79 /***********************************************************************************************************************\r
80 * Function Name : R_ATCM_WaitSet\r
81 * Description   : Sets ATCM access wait.           \r
82 * Arguments    : atcm_wait\r
83 *                    Wait settings for ATCM access\r
84 * Return Value : none\r
85 ***********************************************************************************************************************/\r
86 void R_ATCM_WaitSet(uint32_t atcm_wait)\r
87 {\r
88     volatile uint32_t dummy=0;\r
89 \r
90     UNUSED_VARIABLE(dummy);\r
91   \r
92     /* Enables writing to the ATCM register */\r
93     SYSTEM.PRCR.LONG = ATCM_WRITE_ENABLE;\r
94     dummy = SYSTEM.PRCR.LONG;\r
95     \r
96     /* Sets ATCM access wait to atcm_wait value */\r
97     SYSTEM.SYTATCMWAIT.LONG = atcm_wait;\r
98     \r
99     /* Disables writing to the ATCM register */\r
100     SYSTEM.PRCR.LONG = ATCM_WRITE_DISABLE;\r
101     dummy = SYSTEM.PRCR.LONG;\r
102     \r
103 }\r
104 \r
105 /***********************************************************************************************************************\r
106  End of function R_ATCM_WaitSet\r
107 ***********************************************************************************************************************/\r
108 \r
109 /* End of File */\r
110 \r
111 \r