pm.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /**
  2. * \file
  3. *
  4. * \brief Instance description for PM
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \asf_license_start
  9. *
  10. * \page License
  11. *
  12. * SPDX-License-Identifier: Apache-2.0
  13. *
  14. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the Licence at
  17. *
  18. * http://www.apache.org/licenses/LICENSE-2.0
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  22. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. *
  26. * \asf_license_stop
  27. *
  28. */
  29. #ifndef _SAMD11_PM_INSTANCE_
  30. #define _SAMD11_PM_INSTANCE_
  31. /* ========== Register definition for PM peripheral ========== */
  32. #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  33. #define REG_PM_CTRL (0x40000400) /**< \brief (PM) Control */
  34. #define REG_PM_SLEEP (0x40000401) /**< \brief (PM) Sleep Mode */
  35. #define REG_PM_EXTCTRL (0x40000402) /**< \brief (PM) External Reset Controller */
  36. #define REG_PM_CPUSEL (0x40000408) /**< \brief (PM) CPU Clock Select */
  37. #define REG_PM_APBASEL (0x40000409) /**< \brief (PM) APBA Clock Select */
  38. #define REG_PM_APBBSEL (0x4000040A) /**< \brief (PM) APBB Clock Select */
  39. #define REG_PM_APBCSEL (0x4000040B) /**< \brief (PM) APBC Clock Select */
  40. #define REG_PM_AHBMASK (0x40000414) /**< \brief (PM) AHB Mask */
  41. #define REG_PM_APBAMASK (0x40000418) /**< \brief (PM) APBA Mask */
  42. #define REG_PM_APBBMASK (0x4000041C) /**< \brief (PM) APBB Mask */
  43. #define REG_PM_APBCMASK (0x40000420) /**< \brief (PM) APBC Mask */
  44. #define REG_PM_INTENCLR (0x40000434) /**< \brief (PM) Interrupt Enable Clear */
  45. #define REG_PM_INTENSET (0x40000435) /**< \brief (PM) Interrupt Enable Set */
  46. #define REG_PM_INTFLAG (0x40000436) /**< \brief (PM) Interrupt Flag Status and Clear */
  47. #define REG_PM_RCAUSE (0x40000438) /**< \brief (PM) Reset Cause */
  48. #else
  49. #define REG_PM_CTRL (*(RwReg8 *)0x40000400UL) /**< \brief (PM) Control */
  50. #define REG_PM_SLEEP (*(RwReg8 *)0x40000401UL) /**< \brief (PM) Sleep Mode */
  51. #define REG_PM_EXTCTRL (*(RwReg8 *)0x40000402UL) /**< \brief (PM) External Reset Controller */
  52. #define REG_PM_CPUSEL (*(RwReg8 *)0x40000408UL) /**< \brief (PM) CPU Clock Select */
  53. #define REG_PM_APBASEL (*(RwReg8 *)0x40000409UL) /**< \brief (PM) APBA Clock Select */
  54. #define REG_PM_APBBSEL (*(RwReg8 *)0x4000040AUL) /**< \brief (PM) APBB Clock Select */
  55. #define REG_PM_APBCSEL (*(RwReg8 *)0x4000040BUL) /**< \brief (PM) APBC Clock Select */
  56. #define REG_PM_AHBMASK (*(RwReg *)0x40000414UL) /**< \brief (PM) AHB Mask */
  57. #define REG_PM_APBAMASK (*(RwReg *)0x40000418UL) /**< \brief (PM) APBA Mask */
  58. #define REG_PM_APBBMASK (*(RwReg *)0x4000041CUL) /**< \brief (PM) APBB Mask */
  59. #define REG_PM_APBCMASK (*(RwReg *)0x40000420UL) /**< \brief (PM) APBC Mask */
  60. #define REG_PM_INTENCLR (*(RwReg8 *)0x40000434UL) /**< \brief (PM) Interrupt Enable Clear */
  61. #define REG_PM_INTENSET (*(RwReg8 *)0x40000435UL) /**< \brief (PM) Interrupt Enable Set */
  62. #define REG_PM_INTFLAG (*(RwReg8 *)0x40000436UL) /**< \brief (PM) Interrupt Flag Status and Clear */
  63. #define REG_PM_RCAUSE (*(RoReg8 *)0x40000438UL) /**< \brief (PM) Reset Cause */
  64. #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  65. /* ========== Instance parameters for PM peripheral ========== */
  66. #define PM_CTRL_MCSEL_DFLL48M 3
  67. #define PM_CTRL_MCSEL_GCLK 0
  68. #define PM_CTRL_MCSEL_OSC8M 1
  69. #define PM_CTRL_MCSEL_XOSC 2
  70. #define PM_PM_CLK_APB_NUM 2
  71. #endif /* _SAMD11_PM_INSTANCE_ */