]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX600_RX64M_RSK_Renesas_e2studio/Source/Renesas_Code/cg_src/r_cg_hardware_setup.c
Start to create an RX64M demo.
[freertos] / FreeRTOS / Demo / RX600_RX64M_RSK_Renesas_e2studio / Source / Renesas_Code / cg_src / r_cg_hardware_setup.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) 2013 Renesas Electronics Corporation. All rights reserved.\r
23 ***********************************************************************************************************************/\r
24 \r
25 /***********************************************************************************************************************\r
26 * File Name    : r_cg_hardware_setup.c\r
27 * Version      : Applilet4 for RX64M V1.00.00.00 [02 Aug 2013]\r
28 * Device(s)    : R5F564MLHxFC\r
29 * Tool-Chain   : CCRX\r
30 * Description  : This file implements system initializing function.\r
31 * Creation Date: 07/02/2014\r
32 ***********************************************************************************************************************/\r
33 \r
34 /***********************************************************************************************************************\r
35 Pragma directive\r
36 ***********************************************************************************************************************/\r
37 /* Start user code for pragma. Do not edit comment generated here */\r
38 /* End user code. Do not edit comment generated here */\r
39 \r
40 /***********************************************************************************************************************\r
41 Includes\r
42 ***********************************************************************************************************************/\r
43 #include "r_cg_macrodriver.h"\r
44 #include "r_cg_cgc.h"\r
45 #include "r_cg_cmt.h"\r
46 /* Start user code for include. Do not edit comment generated here */\r
47 /* End user code. Do not edit comment generated here */\r
48 #include "r_cg_userdefine.h"\r
49 \r
50 /***********************************************************************************************************************\r
51 Global variables and functions\r
52 ***********************************************************************************************************************/\r
53 /* Start user code for global. Do not edit comment generated here */\r
54 /* End user code. Do not edit comment generated here */\r
55 \r
56 /***********************************************************************************************************************\r
57 * Function Name: R_Systeminit\r
58 * Description  : This function initializes every macro.\r
59 * Arguments    : None\r
60 * Return Value : None\r
61 ***********************************************************************************************************************/\r
62 void R_Systeminit(void)\r
63 {\r
64     /* Enable writing to registers related to operating modes, LPC, CGC and software reset */\r
65     SYSTEM.PRCR.WORD = 0xA50BU; \r
66 \r
67     /* Enable writing to MPC pin function control registers */\r
68     MPC.PWPR.BIT.B0WI = 0U;\r
69     MPC.PWPR.BIT.PFSWE = 1U;\r
70 \r
71     /* Set peripheral settings */\r
72     R_CGC_Create();\r
73 \r
74     /* Disable writing to MPC pin function control registers */\r
75     MPC.PWPR.BIT.PFSWE = 0U;    \r
76     MPC.PWPR.BIT.B0WI = 1U;     \r
77 \r
78     /* Enable protection */\r
79     SYSTEM.PRCR.WORD = 0xA500U;  \r
80 }\r
81 /***********************************************************************************************************************\r
82 * Function Name: HardwareSetup\r
83 * Description  : This function initializes hardware setting.\r
84 * Arguments    : None\r
85 * Return Value : None\r
86 ***********************************************************************************************************************/\r
87 void HardwareSetup(void)\r
88 {\r
89     R_Systeminit();\r
90 }\r
91 \r
92 /* Start user code for adding. Do not edit comment generated here */\r
93 /* End user code. Do not edit comment generated here */\r