1 /***********************************************************************************************************************
2  * Copyright [2015-2017] Renesas Electronics Corporation and/or its licensors. All Rights Reserved.
3  *
4  * This file is part of Renesas SynergyTM Software Package (SSP)
5  *
6  * The contents of this file (the "contents") are proprietary and confidential to Renesas Electronics Corporation
7  * and/or its licensors ("Renesas") and subject to statutory and contractual protections.
8  *
9  * This file is subject to a Renesas SSP license agreement. Unless otherwise agreed in an SSP license agreement with
10  * Renesas: 1) you may not use, copy, modify, distribute, display, or perform the contents; 2) you may not use any name
11  * or mark of Renesas for advertising or publicity purposes or in connection with your use of the contents; 3) RENESAS
12  * MAKES NO WARRANTY OR REPRESENTATIONS ABOUT THE SUITABILITY OF THE CONTENTS FOR ANY PURPOSE; THE CONTENTS ARE PROVIDED
13  * "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14  * PARTICULAR PURPOSE, AND NON-INFRINGEMENT; AND 4) RENESAS SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, OR
15  * CONSEQUENTIAL DAMAGES, INCLUDING DAMAGES RESULTING FROM LOSS OF USE, DATA, OR PROJECTS, WHETHER IN AN ACTION OF
16  * CONTRACT OR TORT, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE CONTENTS. Third-party contents
17  * included in this file may be subject to different terms.
18  **********************************************************************************************************************/
19 
20 /**********************************************************************************************************************
21  * File Name    : hw_flash_common.h
22  * Description  : Common functions used by both the Code and Data Low Power Flash modules
23  **********************************************************************************************************************/
24 
25 #ifndef R_FLASH_COMMON_H_
26 #define R_FLASH_COMMON_H_
27 
28 /* Common macro for SSP header files. There is also a corresponding SSP_FOOTER macro at the end of this file. */
29 SSP_HEADER
30 
31 /******************************************************************************
32  * Includes <System Includes> , "Project Includes"
33  ******************************************************************************/
34 
35 /******************************************************************************
36  * Typedef definitions
37  ******************************************************************************/
38 /* Wait Process definition */
39 #define WAIT_TDIS     (3U)
40 #define WAIT_TMS_MID  (4U)
41 #define WAIT_TMS_HIGH (6U)
42 #define WAIT_TDSTOP   (6U)
43 
44 #define MHZ           (1000000U)
45 #define KHZ           (1000U)
46 
47 /* Flash information */
48 
49 /* Used for DataFlash */
50 #define DATAFLASH_READ_BASE_ADDR  (0x40100000U)
51 #define DATAFLASH_WRITE_BASE_ADDR (0xFE000000U)
52 #define DATAFLASH_ADDR_OFFSET     (DATAFLASH_WRITE_BASE_ADDR - DATAFLASH_READ_BASE_ADDR)
53 
54 void HW_FLASH_LP_delay_us (uint32_t us, uint32_t mhz) PLACE_IN_RAM_SECTION;
55 
56 void HW_FLASH_LP_set_flash_settings (R_FACI_Type * p_faci_reg, current_parameters_t * p_current_parameters);
57 
58 /* Common macro for SSP header files. There is also a corresponding SSP_HEADER macro at the top of this file. */
59 SSP_FOOTER
60 
61 #endif /* R_FLASH_COMMON_H_ */
62 
63 /* End of File */
64