pac.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for PAC
  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_PAC_COMPONENT_
  30. #define _SAMD11_PAC_COMPONENT_
  31. /* ========================================================================== */
  32. /** SOFTWARE API DEFINITION FOR PAC */
  33. /* ========================================================================== */
  34. /** \addtogroup SAMD11_PAC Peripheral Access Controller */
  35. /*@{*/
  36. #define PAC_U2211
  37. #define REV_PAC 0x101
  38. /* -------- PAC_WPCLR : (PAC Offset: 0x0) (R/W 32) Write Protection Clear -------- */
  39. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  40. typedef union {
  41. struct {
  42. uint32_t :1; /*!< bit: 0 Reserved */
  43. uint32_t WP:31; /*!< bit: 1..31 Write Protection Clear */
  44. } bit; /*!< Structure used for bit access */
  45. uint32_t reg; /*!< Type used for register access */
  46. } PAC_WPCLR_Type;
  47. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  48. #define PAC_WPCLR_OFFSET 0x0 /**< \brief (PAC_WPCLR offset) Write Protection Clear */
  49. #define PAC_WPCLR_RESETVALUE _U_(0x00000000) /**< \brief (PAC_WPCLR reset_value) Write Protection Clear */
  50. #define PAC_WPCLR_WP_Pos 1 /**< \brief (PAC_WPCLR) Write Protection Clear */
  51. #define PAC_WPCLR_WP_Msk (_U_(0x7FFFFFFF) << PAC_WPCLR_WP_Pos)
  52. #define PAC_WPCLR_WP(value) (PAC_WPCLR_WP_Msk & ((value) << PAC_WPCLR_WP_Pos))
  53. #define PAC_WPCLR_MASK _U_(0xFFFFFFFE) /**< \brief (PAC_WPCLR) MASK Register */
  54. /* -------- PAC_WPSET : (PAC Offset: 0x4) (R/W 32) Write Protection Set -------- */
  55. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  56. typedef union {
  57. struct {
  58. uint32_t :1; /*!< bit: 0 Reserved */
  59. uint32_t WP:31; /*!< bit: 1..31 Write Protection Set */
  60. } bit; /*!< Structure used for bit access */
  61. uint32_t reg; /*!< Type used for register access */
  62. } PAC_WPSET_Type;
  63. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  64. #define PAC_WPSET_OFFSET 0x4 /**< \brief (PAC_WPSET offset) Write Protection Set */
  65. #define PAC_WPSET_RESETVALUE _U_(0x00000000) /**< \brief (PAC_WPSET reset_value) Write Protection Set */
  66. #define PAC_WPSET_WP_Pos 1 /**< \brief (PAC_WPSET) Write Protection Set */
  67. #define PAC_WPSET_WP_Msk (_U_(0x7FFFFFFF) << PAC_WPSET_WP_Pos)
  68. #define PAC_WPSET_WP(value) (PAC_WPSET_WP_Msk & ((value) << PAC_WPSET_WP_Pos))
  69. #define PAC_WPSET_MASK _U_(0xFFFFFFFE) /**< \brief (PAC_WPSET) MASK Register */
  70. /** \brief PAC hardware registers */
  71. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  72. typedef struct {
  73. __IO PAC_WPCLR_Type WPCLR; /**< \brief Offset: 0x0 (R/W 32) Write Protection Clear */
  74. __IO PAC_WPSET_Type WPSET; /**< \brief Offset: 0x4 (R/W 32) Write Protection Set */
  75. } Pac;
  76. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  77. /*@}*/
  78. #endif /* _SAMD11_PAC_COMPONENT_ */