Mouse code for the MacroRat
mbed-dev/targets/TARGET_RENESAS/TARGET_RZ_A1H/device/RZ_A1_Init.c@18:6a4db94011d3, 2017-05-14 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sun May 14 23:18:57 2017 +0000
- Revision:
- 18:6a4db94011d3
Publishing again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /******************************************************************************* |
sahilmgandhi | 18:6a4db94011d3 | 2 | * DISCLAIMER |
sahilmgandhi | 18:6a4db94011d3 | 3 | * This software is supplied by Renesas Electronics Corporation and is only |
sahilmgandhi | 18:6a4db94011d3 | 4 | * intended for use with Renesas products. No other uses are authorized. This |
sahilmgandhi | 18:6a4db94011d3 | 5 | * software is owned by Renesas Electronics Corporation and is protected under |
sahilmgandhi | 18:6a4db94011d3 | 6 | * all applicable laws, including copyright laws. |
sahilmgandhi | 18:6a4db94011d3 | 7 | * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING |
sahilmgandhi | 18:6a4db94011d3 | 8 | * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT |
sahilmgandhi | 18:6a4db94011d3 | 9 | * LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE |
sahilmgandhi | 18:6a4db94011d3 | 10 | * AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. |
sahilmgandhi | 18:6a4db94011d3 | 11 | * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS |
sahilmgandhi | 18:6a4db94011d3 | 12 | * ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE |
sahilmgandhi | 18:6a4db94011d3 | 13 | * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR |
sahilmgandhi | 18:6a4db94011d3 | 14 | * ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE |
sahilmgandhi | 18:6a4db94011d3 | 15 | * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. |
sahilmgandhi | 18:6a4db94011d3 | 16 | * Renesas reserves the right, without notice, to make changes to this software |
sahilmgandhi | 18:6a4db94011d3 | 17 | * and to discontinue the availability of this software. By using this software, |
sahilmgandhi | 18:6a4db94011d3 | 18 | * you agree to the additional terms and conditions found by accessing the |
sahilmgandhi | 18:6a4db94011d3 | 19 | * following link: |
sahilmgandhi | 18:6a4db94011d3 | 20 | * http://www.renesas.com/disclaimer |
sahilmgandhi | 18:6a4db94011d3 | 21 | * Copyright (C) 2012 - 2014 Renesas Electronics Corporation. All rights reserved. |
sahilmgandhi | 18:6a4db94011d3 | 22 | *******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 23 | /**************************************************************************//** |
sahilmgandhi | 18:6a4db94011d3 | 24 | * @file RZ_A1_Init.c |
sahilmgandhi | 18:6a4db94011d3 | 25 | * $Rev: 624 $ |
sahilmgandhi | 18:6a4db94011d3 | 26 | * $Date:: 2013-04-24 13:37:48 +0900#$ |
sahilmgandhi | 18:6a4db94011d3 | 27 | * @brief RZ_A1 Initialize |
sahilmgandhi | 18:6a4db94011d3 | 28 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 29 | |
sahilmgandhi | 18:6a4db94011d3 | 30 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 31 | Includes <System Includes> , "Project Includes" |
sahilmgandhi | 18:6a4db94011d3 | 32 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 33 | #include "MBRZA1H.h" |
sahilmgandhi | 18:6a4db94011d3 | 34 | #include "RZ_A1_Init.h" |
sahilmgandhi | 18:6a4db94011d3 | 35 | |
sahilmgandhi | 18:6a4db94011d3 | 36 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 37 | Typedef definitions |
sahilmgandhi | 18:6a4db94011d3 | 38 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 39 | |
sahilmgandhi | 18:6a4db94011d3 | 40 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 41 | Macro definitions |
sahilmgandhi | 18:6a4db94011d3 | 42 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 43 | #define CS2_SDRAM_MODE_16BIT_CAS2_BR_BW (*(volatile uint16_t*)0x3FFFD040) |
sahilmgandhi | 18:6a4db94011d3 | 44 | #define CS3_SDRAM_MODE_16BIT_CAS2_BR_BW (*(volatile uint16_t*)0x3FFFE040) |
sahilmgandhi | 18:6a4db94011d3 | 45 | |
sahilmgandhi | 18:6a4db94011d3 | 46 | #define GPIO_PORT0_BOOTMODE_BITMASK (0x000fu) |
sahilmgandhi | 18:6a4db94011d3 | 47 | |
sahilmgandhi | 18:6a4db94011d3 | 48 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 49 | Imported global variables and functions (from other files) |
sahilmgandhi | 18:6a4db94011d3 | 50 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 51 | |
sahilmgandhi | 18:6a4db94011d3 | 52 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 53 | Exported global variables and functions (to be accessed by other files) |
sahilmgandhi | 18:6a4db94011d3 | 54 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 55 | |
sahilmgandhi | 18:6a4db94011d3 | 56 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 57 | Private global variables and functions |
sahilmgandhi | 18:6a4db94011d3 | 58 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 59 | |
sahilmgandhi | 18:6a4db94011d3 | 60 | /**************************************************************************//** |
sahilmgandhi | 18:6a4db94011d3 | 61 | * Function Name: RZ_A1_SetSramWriteEnable |
sahilmgandhi | 18:6a4db94011d3 | 62 | * @brief Initialize Board settings |
sahilmgandhi | 18:6a4db94011d3 | 63 | * |
sahilmgandhi | 18:6a4db94011d3 | 64 | * Description:<br> |
sahilmgandhi | 18:6a4db94011d3 | 65 | * Set SRAM write enable |
sahilmgandhi | 18:6a4db94011d3 | 66 | * @param none |
sahilmgandhi | 18:6a4db94011d3 | 67 | * @retval none |
sahilmgandhi | 18:6a4db94011d3 | 68 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 69 | void RZ_A1_SetSramWriteEnable(void) |
sahilmgandhi | 18:6a4db94011d3 | 70 | { |
sahilmgandhi | 18:6a4db94011d3 | 71 | /* Enable SRAM write access */ |
sahilmgandhi | 18:6a4db94011d3 | 72 | CPG.SYSCR3 = 0x0F; |
sahilmgandhi | 18:6a4db94011d3 | 73 | |
sahilmgandhi | 18:6a4db94011d3 | 74 | return; |
sahilmgandhi | 18:6a4db94011d3 | 75 | } |
sahilmgandhi | 18:6a4db94011d3 | 76 | |
sahilmgandhi | 18:6a4db94011d3 | 77 | /**************************************************************************//** |
sahilmgandhi | 18:6a4db94011d3 | 78 | * Function Name: RZ_A1_InitClock |
sahilmgandhi | 18:6a4db94011d3 | 79 | * @brief Initialize Board settings |
sahilmgandhi | 18:6a4db94011d3 | 80 | * |
sahilmgandhi | 18:6a4db94011d3 | 81 | * Description:<br> |
sahilmgandhi | 18:6a4db94011d3 | 82 | * Initialize Clock |
sahilmgandhi | 18:6a4db94011d3 | 83 | * @param none |
sahilmgandhi | 18:6a4db94011d3 | 84 | * @retval none |
sahilmgandhi | 18:6a4db94011d3 | 85 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 86 | void RZ_A1_InitClock(void) |
sahilmgandhi | 18:6a4db94011d3 | 87 | { |
sahilmgandhi | 18:6a4db94011d3 | 88 | /* Cancel L2C standby status before clock change */ |
sahilmgandhi | 18:6a4db94011d3 | 89 | L2CREG15_POWER_CTRL = 0x00000001; |
sahilmgandhi | 18:6a4db94011d3 | 90 | |
sahilmgandhi | 18:6a4db94011d3 | 91 | /* Clock settings */ |
sahilmgandhi | 18:6a4db94011d3 | 92 | /* ClockMode0 */ |
sahilmgandhi | 18:6a4db94011d3 | 93 | CPG.FRQCR = 0x1035; /* CPU Clock =399.99MHz */ |
sahilmgandhi | 18:6a4db94011d3 | 94 | CPG.FRQCR2 = 0x0001; /* G Clock =266.66MHz */ |
sahilmgandhi | 18:6a4db94011d3 | 95 | |
sahilmgandhi | 18:6a4db94011d3 | 96 | return; |
sahilmgandhi | 18:6a4db94011d3 | 97 | } |
sahilmgandhi | 18:6a4db94011d3 | 98 | |
sahilmgandhi | 18:6a4db94011d3 | 99 | /**************************************************************************//** |
sahilmgandhi | 18:6a4db94011d3 | 100 | * Function Name: RZ_A1_IsClockMode0 |
sahilmgandhi | 18:6a4db94011d3 | 101 | * @brief Query Clock Mode |
sahilmgandhi | 18:6a4db94011d3 | 102 | * |
sahilmgandhi | 18:6a4db94011d3 | 103 | * Description:<br> |
sahilmgandhi | 18:6a4db94011d3 | 104 | * Answer ClockMode0 or not |
sahilmgandhi | 18:6a4db94011d3 | 105 | * @param none |
sahilmgandhi | 18:6a4db94011d3 | 106 | * @retval true : clock mode 0 |
sahilmgandhi | 18:6a4db94011d3 | 107 | * @retval false : clock mode 1 |
sahilmgandhi | 18:6a4db94011d3 | 108 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 109 | int RZ_A1_IsClockMode0(void) |
sahilmgandhi | 18:6a4db94011d3 | 110 | { |
sahilmgandhi | 18:6a4db94011d3 | 111 | /* ClockMode0 */ |
sahilmgandhi | 18:6a4db94011d3 | 112 | return true; |
sahilmgandhi | 18:6a4db94011d3 | 113 | } |
sahilmgandhi | 18:6a4db94011d3 | 114 | |
sahilmgandhi | 18:6a4db94011d3 | 115 | /**************************************************************************//** |
sahilmgandhi | 18:6a4db94011d3 | 116 | * Function Name: RZ_A1_InitBus |
sahilmgandhi | 18:6a4db94011d3 | 117 | * @brief Initialize Bus |
sahilmgandhi | 18:6a4db94011d3 | 118 | * |
sahilmgandhi | 18:6a4db94011d3 | 119 | * Description:<br> |
sahilmgandhi | 18:6a4db94011d3 | 120 | * Initialize Pin Setting |
sahilmgandhi | 18:6a4db94011d3 | 121 | * @param none |
sahilmgandhi | 18:6a4db94011d3 | 122 | * @retval none |
sahilmgandhi | 18:6a4db94011d3 | 123 | ******************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 124 | void RZ_A1_InitBus(void) |
sahilmgandhi | 18:6a4db94011d3 | 125 | { |
sahilmgandhi | 18:6a4db94011d3 | 126 | /*************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 127 | /* If need Pin Setting before run program, the setting will be wrote here*/ |
sahilmgandhi | 18:6a4db94011d3 | 128 | /*************************************************************************/ |
sahilmgandhi | 18:6a4db94011d3 | 129 | |
sahilmgandhi | 18:6a4db94011d3 | 130 | return; |
sahilmgandhi | 18:6a4db94011d3 | 131 | } |
sahilmgandhi | 18:6a4db94011d3 | 132 | |
sahilmgandhi | 18:6a4db94011d3 | 133 | /****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 134 | End of file |
sahilmgandhi | 18:6a4db94011d3 | 135 | ******************************************************************************/ |