diff options
Diffstat (limited to 'ports_module/rxv2/iar/example_build/hwsetup.c')
| -rw-r--r-- | ports_module/rxv2/iar/example_build/hwsetup.c | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/ports_module/rxv2/iar/example_build/hwsetup.c b/ports_module/rxv2/iar/example_build/hwsetup.c index ab3e3bac..c03895a5 100644 --- a/ports_module/rxv2/iar/example_build/hwsetup.c +++ b/ports_module/rxv2/iar/example_build/hwsetup.c @@ -1,25 +1,25 @@ /* Adapted for use with IAR Embedded Workbench */ /*********************************************************************************************************************** * DISCLAIMER -* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No -* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all -* applicable laws, including copyright laws. +* This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No +* other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all +* applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING -* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, -* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM -* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES -* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS +* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM +* EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES +* SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS * SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. -* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of -* this software. By using this software, you agree to the additional terms and conditions found by accessing the +* Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of +* this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: -* http://www.renesas.com/disclaimer +* http://www.renesas.com/disclaimer * -* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. +* Copyright (C) 2012 Renesas Electronics Corporation. All rights reserved. ***********************************************************************************************************************/ /*********************************************************************************************************************** * File Name : hwsetup.c -* Version : 1.0 +* Version : 1.0 * Device(s) : RX * H/W Platform : RX65N * Description : Defines the initialisation routines used each time the MCU is restarted. @@ -83,34 +83,34 @@ void operating_frequency_set(void) Peripheral Clock Frequency....... 48 MHz USB Clock Frequency.............. 48 MHz External Bus Clock Frequency..... 24 MHz */ - + volatile unsigned int i; - + /* Protect off. */ SYSTEM.PRCR.WORD = 0xA50B; - + /* Uncomment if not using sub-clock */ //SYSTEM.SOSCCR.BYTE = 0x01; /* stop sub-clock */ SYSTEM.SOSCCR.BYTE = 0x00; /* Enable sub-clock for RTC */ - + /* Wait 131,072 cycles * 12 MHz = 10.9 ms */ SYSTEM.MOSCWTCR.BYTE = 0x0D; - + /* x16 @PLL, 2 divisor */ SYSTEM.PLLCR.WORD = 0x0F01; - + /* EXTAL ON */ SYSTEM.MOSCCR.BYTE = 0x00; - + /* PLL ON */ SYSTEM.PLLCR2.BYTE = 0x00; - + for(i = 0;i< 0x168;i++) { /* Wait over 12ms */ __no_operation(); } - + /* Setup system clocks SCKCR - System Clock Control Register b31:b28 FCK[3:0] 0x02 = Flash clock: PLL/4 = (192 / 4) = 48 MHz @@ -120,17 +120,17 @@ void operating_frequency_set(void) b11:b8 PCKB[3:0] 0x02 = Peripheral clock B: PLL/4 = 48 MHz */ SYSTEM.SCKCR.LONG = 0x21031222; /* ICK=PLL/2,BCK,FCK,PCK=PLL/4 */ - + /* Setup IEBUS and USB clocks - SCKCR2 - System Clock Control Register 2 + SCKCR2 - System Clock Control Register 2 b7:b4 UCK[3:0] 0x03 = USB clock is PLL/4 = 48 MHz b3:b0 IEBCK[3:0] 0x01 = IE Bus clock is PLL/2 = 96 MHz */ SYSTEM.SCKCR2.WORD = 0x0031; - + /* ICLK, PCLKB, FCLK, BCLK, IECLK, and USBCLK all come from PLL circuit */ SYSTEM.SCKCR3.WORD = 0x0400; - + /* Protect on. */ SYSTEM.PRCR.WORD = 0xA500; } @@ -146,7 +146,7 @@ void interrupts_configure(void) { /* Protect off. */ SYSTEM.PRCR.WORD = 0xA50B; - + /* Enable the bus error interrupt to catch accesses to illegal/reserved areas of memory. */ @@ -154,9 +154,9 @@ void interrupts_configure(void) IR(BSC,BUSERR) = 0; /* Make this the highest priority interrupt (adjust as necessary for your application) */ - IPR(BSC,BUSERR) = 0x0F; + IPR(BSC,BUSERR) = 0x0F; /* Enable the interrupt in the ICU */ - IEN(BSC,BUSERR) = 1; + IEN(BSC,BUSERR) = 1; /* Enable illegal address interrupt in the BSC */ BSC.BEREN.BIT.IGAEN = 1; } @@ -167,11 +167,11 @@ void interrupts_configure(void) * Description : Sample ISR for bus error (must do hardware setup first!) * By default, this demo code enables the Bus Error Interrupt. * This interrupt will fire if the user tries to access code -* or data from one of the reserved areas in the memory map, +* or data from one of the reserved areas in the memory map, * including the areas covered by disabled chip selects. * A nop statement is included here as a convenient place * to set a breakpoint during debugging and development, and -* further handling should be added by the user for their +* further handling should be added by the user for their * application. * Arguments : none * Return value : none @@ -183,7 +183,7 @@ __interrupt void buserr_isr(void) the register BSC.BERSR2.WORD. The upper 13 bits of this register contain the upper 13-bits of the offending address (in 512K byte units). */ - + /* Add your own code here to handle this interrupt */ __no_operation(); } |
