]> git.sur5r.net Git - freertos/blob - Demo/RX600_RX62N-RDK_Renesas/RTOSDemo/Renesas-Files/hwsetup.c
3cd4565f843a225f08b617194f55847d25e4d767
[freertos] / Demo / RX600_RX62N-RDK_Renesas / RTOSDemo / Renesas-Files / hwsetup.c
1 /******************************************************************************\r
2 * DISCLAIMER\r
3 \r
4 * This software is supplied by Renesas Technology Corp. and is only \r
5 * intended for use with Renesas products. No other uses are authorized.\r
6 \r
7 * This software is owned by Renesas Technology Corp. and is protected under \r
8 * all applicable laws, including copyright laws.\r
9 \r
10 * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES\r
11 * REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, \r
12 * INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A \r
13 * PARTICULAR PURPOSE AND NON-INFRINGEMENT.  ALL SUCH WARRANTIES ARE EXPRESSLY \r
14 * DISCLAIMED.\r
15 \r
16 * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS \r
17 * TECHNOLOGY CORP. NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE \r
18 * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES \r
19 * FOR ANY REASON RELATED TO THE THIS SOFTWARE, EVEN IF RENESAS OR ITS \r
20 * AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\r
21 \r
22 * Renesas reserves the right, without notice, to make changes to this \r
23 * software and to discontinue the availability of this software.  \r
24 * By using this software, you agree to the additional terms and \r
25 * conditions found by accessing the following link:\r
26 * http://www.renesas.com/disclaimer\r
27 ******************************************************************************\r
28 * Copyright (C) 2008. Renesas Technology Corp., All Rights Reserved.\r
29 ******************************************************************************* \r
30 * File Name     : hwsetup.c\r
31 * Version         : 1.00\r
32 * Description  : Power up hardware initializations\r
33 ******************************************************************************\r
34 * History : DD.MM.YYYY Version Description\r
35 *                : 15.02.2010 1.00      First Release\r
36 ******************************************************************************/\r
37 \r
38 \r
39 /******************************************************************************\r
40 Includes   <System Includes> , "Project Includes"\r
41 ******************************************************************************/\r
42 #include <stdint.h>\r
43 #include "iodefine.h"\r
44 #include "yrdkrx62ndef.h"\r
45 // #include "lcd.h" Uncomment this if an LCD is present.\r
46 \r
47 /******************************************************************************\r
48 Typedef definitions\r
49 ******************************************************************************/\r
50 \r
51 /******************************************************************************\r
52 Macro definitions\r
53 ******************************************************************************/\r
54 \r
55 /******************************************************************************\r
56 Imported global variables and functions (from other files)\r
57 ******************************************************************************/\r
58 \r
59 /******************************************************************************\r
60 Exported global variables and functions (to be accessed by other files)\r
61 ******************************************************************************/\r
62 \r
63 /******************************************************************************\r
64 Private global variables and functions\r
65 ******************************************************************************/\r
66 \r
67 /******************************************************************************\r
68 * Function Name: HardwareSetup\r
69 * Description  : This function does initial setting for CPG port pins used in\r
70 *                         : the Demo including the MII pins of the Ethernet PHY connection.\r
71 * Arguments     : none\r
72 * Return Value : none\r
73 ******************************************************************************/\r
74 void HardwareSetup(void)\r
75 {\r
76 \r
77         uint32_t sckcr = 0;\r
78 \r
79         /* Configure system clocks based on header */\r
80         sckcr += (ICLK_MUL==8) ? (0ul << 24) : (ICLK_MUL==4) ? (1ul << 24) : (ICLK_MUL==2) ? (2ul << 24) : (3ul << 24);\r
81         sckcr += (BCLK_MUL==8) ? (0ul << 16) : (BCLK_MUL==4) ? (1ul << 16) : (BCLK_MUL==2) ? (2ul << 16) : (3ul << 16);\r
82         sckcr += (PCLK_MUL==8) ? (0ul <<  8) : (PCLK_MUL==4) ? (1ul <<  8) : (PCLK_MUL==2) ? (2ul <<  8) : (3ul <<  8);\r
83         SYSTEM.SCKCR.LONG = sckcr;\r
84 \r
85         /* Configure LED pins as outputs */\r
86         LED0_DDR = 1; \r
87         LED1_DDR = 1;\r
88         LED2_DDR = 1;\r
89         LED3_DDR = 1;\r
90         LED4_DDR = 1;\r
91         LED5_DDR = 1;\r
92         LED6_DDR = 1;\r
93         LED7_DDR = 1;\r
94         LED8_DDR = 1;\r
95         LED9_DDR = 1;\r
96         LED10_DDR = 1;\r
97         LED11_DDR = 1;\r
98         \r
99         /* Configure LCD pins as outputs - uncomment this if an LCD is present.\r
100         LCD_RS_DDR = 1;\r
101         LCD_EN_DDR = 1;\r
102         LCD_DATA_DDR = 0xF0; */\r
103 \r
104         /* Initialize display - uncomment this if an LCD is present.\r
105         InitialiseDisplay(); */\r
106 }\r
107 \r