cpu.h 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /***********************************************************************************************************************
  2. * DISCLAIMER
  3. * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No
  4. * other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all
  5. * applicable laws, including copyright laws.
  6. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
  7. * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY,
  8. * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM
  9. * EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES
  10. * SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO THIS
  11. * SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
  12. * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of
  13. * this software. By using this software, you agree to the additional terms and conditions found by accessing the
  14. * following link:
  15. * http://www.renesas.com/disclaimer
  16. *
  17. * Copyright (C) 2016 Renesas Electronics Corporation. All rights reserved.
  18. ***********************************************************************************************************************/
  19. /***********************************************************************************************************************
  20. * File Name : cpu.h
  21. * Description : This module implements CPU specific functions. An example is enabling/disabling interrupts.
  22. ***********************************************************************************************************************/
  23. /***********************************************************************************************************************
  24. * History : DD.MM.YYYY Version Description
  25. * : 01.10.2016 1.00 First Release
  26. * : 15.05.2017 2.00 Changed comments of the following enumeration.
  27. * - bsp_reg_protect_t
  28. * : xx.xx.xxxx 2.01 Added bsp_ram_initialize function.
  29. ***********************************************************************************************************************/
  30. /***********************************************************************************************************************
  31. Macro definitions
  32. ***********************************************************************************************************************/
  33. /***********************************************************************************************************************
  34. Typedef definitions
  35. ***********************************************************************************************************************/
  36. /* The different types of registers that can be protected. */
  37. typedef enum
  38. {
  39. /* Enables writing to the registers related to the clock generation circuit: SCKCR, SCKCR2, SCKCR3, PLLCR,
  40. PLLCR2, BCKCR, MOSCCR, SOSCCR, LOCOCR, ILOCOCR, HOCOCR, HOCOCR2, OSTDCR, OSTDSR. */
  41. BSP_REG_PROTECT_CGC = 0,
  42. /* Enables writing to the registers related to operating modes, low power consumption, the clock generation circuit,
  43. and software reset: SYSCR0, SYSCR1, SBYCR, MSTPCRA, MSTPCRB, MSTPCRC, MSTPCRD, OPCCR, RSTCKCR,
  44. DPSBYCR, DPSIER0, DPSIER1, DPSIER2, DPSIER3, DPSIFR0, DPSIFR1, DPSIFR2, DPSIFR3,
  45. DPSIEGR0, DPSIEGR1, DPSIEGR2, DPSIEGR3, MOSCWTCR, SOSCWTCR, MOFCR, HOCOPCR, SWRR. */
  46. BSP_REG_PROTECT_LPC_CGC_SWR,
  47. /* Enables writing to the registers related to the LVD:LVCMPCR, LVDLVLR, LVD1CR0, LVD1CR1, LVD1SR, LVD2CR0,
  48. LVD2CR1, LVD2SR. */
  49. BSP_REG_PROTECT_LVD,
  50. /* Enables writing to MPC's PFS registers. */
  51. BSP_REG_PROTECT_MPC,
  52. /* This entry is used for getting the number of enum items. This must be the last entry. DO NOT REMOVE THIS ENTRY!*/
  53. BSP_REG_PROTECT_TOTAL_ITEMS
  54. } bsp_reg_protect_t;
  55. /***********************************************************************************************************************
  56. Exported global variables
  57. ***********************************************************************************************************************/
  58. /***********************************************************************************************************************
  59. Exported global functions (to be accessed by other files)
  60. ***********************************************************************************************************************/
  61. void R_BSP_InterruptsDisable(void);
  62. void R_BSP_InterruptsEnable(void);
  63. uint32_t R_BSP_CpuInterruptLevelRead(void);
  64. bool R_BSP_CpuInterruptLevelWrite(uint32_t level);
  65. void R_BSP_RegisterProtectEnable(bsp_reg_protect_t regs_to_protect);
  66. void R_BSP_RegisterProtectDisable(bsp_reg_protect_t regs_to_unprotect);
  67. void bsp_register_protect_open(void); //r_bsp internal function. DO NOT CALL.
  68. void bsp_ram_initialize(void);