mtb.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. /**
  2. * \brief Component description for MTB
  3. *
  4. * Copyright (c) 2021 Microchip Technology Inc. and its subsidiaries.
  5. *
  6. * Subject to your compliance with these terms, you may use Microchip software and any derivatives
  7. * exclusively with Microchip products. It is your responsibility to comply with third party license
  8. * terms applicable to your use of third party software (including open source software) that may
  9. * accompany Microchip software.
  10. *
  11. * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY,
  12. * APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND
  13. * FITNESS FOR A PARTICULAR PURPOSE.
  14. *
  15. * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
  16. * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF
  17. * MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
  18. * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT
  19. * EXCEED THE AMOUNT OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
  20. *
  21. */
  22. /* file generated from device description version 2019-11-25T06:52:33Z */
  23. #ifndef _SAMD21_MTB_COMPONENT_H_
  24. #define _SAMD21_MTB_COMPONENT_H_
  25. /* ************************************************************************** */
  26. /* SOFTWARE API DEFINITION FOR MTB */
  27. /* ************************************************************************** */
  28. /* -------- MTB_POSITION : (MTB Offset: 0x00) (R/W 32) MTB Position -------- */
  29. #define MTB_POSITION_WRAP_Pos _U_(2) /**< (MTB_POSITION) Pointer Value Wraps Position */
  30. #define MTB_POSITION_WRAP_Msk (_U_(0x1) << MTB_POSITION_WRAP_Pos) /**< (MTB_POSITION) Pointer Value Wraps Mask */
  31. #define MTB_POSITION_WRAP(value) (MTB_POSITION_WRAP_Msk & ((value) << MTB_POSITION_WRAP_Pos))
  32. #define MTB_POSITION_POINTER_Pos _U_(3) /**< (MTB_POSITION) Trace Packet Location Pointer Position */
  33. #define MTB_POSITION_POINTER_Msk (_U_(0x1FFFFFFF) << MTB_POSITION_POINTER_Pos) /**< (MTB_POSITION) Trace Packet Location Pointer Mask */
  34. #define MTB_POSITION_POINTER(value) (MTB_POSITION_POINTER_Msk & ((value) << MTB_POSITION_POINTER_Pos))
  35. #define MTB_POSITION_Msk _U_(0xFFFFFFFC) /**< (MTB_POSITION) Register Mask */
  36. /* -------- MTB_MASTER : (MTB Offset: 0x04) (R/W 32) MTB Master -------- */
  37. #define MTB_MASTER_RESETVALUE _U_(0x00) /**< (MTB_MASTER) MTB Master Reset Value */
  38. #define MTB_MASTER_MASK_Pos _U_(0) /**< (MTB_MASTER) Maximum Value of the Trace Buffer in SRAM Position */
  39. #define MTB_MASTER_MASK_Msk (_U_(0x1F) << MTB_MASTER_MASK_Pos) /**< (MTB_MASTER) Maximum Value of the Trace Buffer in SRAM Mask */
  40. #define MTB_MASTER_MASK(value) (MTB_MASTER_MASK_Msk & ((value) << MTB_MASTER_MASK_Pos))
  41. #define MTB_MASTER_TSTARTEN_Pos _U_(5) /**< (MTB_MASTER) Trace Start Input Enable Position */
  42. #define MTB_MASTER_TSTARTEN_Msk (_U_(0x1) << MTB_MASTER_TSTARTEN_Pos) /**< (MTB_MASTER) Trace Start Input Enable Mask */
  43. #define MTB_MASTER_TSTARTEN(value) (MTB_MASTER_TSTARTEN_Msk & ((value) << MTB_MASTER_TSTARTEN_Pos))
  44. #define MTB_MASTER_TSTOPEN_Pos _U_(6) /**< (MTB_MASTER) Trace Stop Input Enable Position */
  45. #define MTB_MASTER_TSTOPEN_Msk (_U_(0x1) << MTB_MASTER_TSTOPEN_Pos) /**< (MTB_MASTER) Trace Stop Input Enable Mask */
  46. #define MTB_MASTER_TSTOPEN(value) (MTB_MASTER_TSTOPEN_Msk & ((value) << MTB_MASTER_TSTOPEN_Pos))
  47. #define MTB_MASTER_SFRWPRIV_Pos _U_(7) /**< (MTB_MASTER) Special Function Register Write Privilege Position */
  48. #define MTB_MASTER_SFRWPRIV_Msk (_U_(0x1) << MTB_MASTER_SFRWPRIV_Pos) /**< (MTB_MASTER) Special Function Register Write Privilege Mask */
  49. #define MTB_MASTER_SFRWPRIV(value) (MTB_MASTER_SFRWPRIV_Msk & ((value) << MTB_MASTER_SFRWPRIV_Pos))
  50. #define MTB_MASTER_RAMPRIV_Pos _U_(8) /**< (MTB_MASTER) SRAM Privilege Position */
  51. #define MTB_MASTER_RAMPRIV_Msk (_U_(0x1) << MTB_MASTER_RAMPRIV_Pos) /**< (MTB_MASTER) SRAM Privilege Mask */
  52. #define MTB_MASTER_RAMPRIV(value) (MTB_MASTER_RAMPRIV_Msk & ((value) << MTB_MASTER_RAMPRIV_Pos))
  53. #define MTB_MASTER_HALTREQ_Pos _U_(9) /**< (MTB_MASTER) Halt Request Position */
  54. #define MTB_MASTER_HALTREQ_Msk (_U_(0x1) << MTB_MASTER_HALTREQ_Pos) /**< (MTB_MASTER) Halt Request Mask */
  55. #define MTB_MASTER_HALTREQ(value) (MTB_MASTER_HALTREQ_Msk & ((value) << MTB_MASTER_HALTREQ_Pos))
  56. #define MTB_MASTER_EN_Pos _U_(31) /**< (MTB_MASTER) Main Trace Enable Position */
  57. #define MTB_MASTER_EN_Msk (_U_(0x1) << MTB_MASTER_EN_Pos) /**< (MTB_MASTER) Main Trace Enable Mask */
  58. #define MTB_MASTER_EN(value) (MTB_MASTER_EN_Msk & ((value) << MTB_MASTER_EN_Pos))
  59. #define MTB_MASTER_Msk _U_(0x800003FF) /**< (MTB_MASTER) Register Mask */
  60. /* -------- MTB_FLOW : (MTB Offset: 0x08) (R/W 32) MTB Flow -------- */
  61. #define MTB_FLOW_RESETVALUE _U_(0x00) /**< (MTB_FLOW) MTB Flow Reset Value */
  62. #define MTB_FLOW_AUTOSTOP_Pos _U_(0) /**< (MTB_FLOW) Auto Stop Tracing Position */
  63. #define MTB_FLOW_AUTOSTOP_Msk (_U_(0x1) << MTB_FLOW_AUTOSTOP_Pos) /**< (MTB_FLOW) Auto Stop Tracing Mask */
  64. #define MTB_FLOW_AUTOSTOP(value) (MTB_FLOW_AUTOSTOP_Msk & ((value) << MTB_FLOW_AUTOSTOP_Pos))
  65. #define MTB_FLOW_AUTOHALT_Pos _U_(1) /**< (MTB_FLOW) Auto Halt Request Position */
  66. #define MTB_FLOW_AUTOHALT_Msk (_U_(0x1) << MTB_FLOW_AUTOHALT_Pos) /**< (MTB_FLOW) Auto Halt Request Mask */
  67. #define MTB_FLOW_AUTOHALT(value) (MTB_FLOW_AUTOHALT_Msk & ((value) << MTB_FLOW_AUTOHALT_Pos))
  68. #define MTB_FLOW_WATERMARK_Pos _U_(3) /**< (MTB_FLOW) Watermark value Position */
  69. #define MTB_FLOW_WATERMARK_Msk (_U_(0x1FFFFFFF) << MTB_FLOW_WATERMARK_Pos) /**< (MTB_FLOW) Watermark value Mask */
  70. #define MTB_FLOW_WATERMARK(value) (MTB_FLOW_WATERMARK_Msk & ((value) << MTB_FLOW_WATERMARK_Pos))
  71. #define MTB_FLOW_Msk _U_(0xFFFFFFFB) /**< (MTB_FLOW) Register Mask */
  72. /* -------- MTB_BASE : (MTB Offset: 0x0C) ( R/ 32) MTB Base -------- */
  73. #define MTB_BASE_Msk _U_(0x00000000) /**< (MTB_BASE) Register Mask */
  74. /* -------- MTB_ITCTRL : (MTB Offset: 0xF00) (R/W 32) MTB Integration Mode Control -------- */
  75. #define MTB_ITCTRL_Msk _U_(0x00000000) /**< (MTB_ITCTRL) Register Mask */
  76. /* -------- MTB_CLAIMSET : (MTB Offset: 0xFA0) (R/W 32) MTB Claim Set -------- */
  77. #define MTB_CLAIMSET_Msk _U_(0x00000000) /**< (MTB_CLAIMSET) Register Mask */
  78. /* -------- MTB_CLAIMCLR : (MTB Offset: 0xFA4) (R/W 32) MTB Claim Clear -------- */
  79. #define MTB_CLAIMCLR_Msk _U_(0x00000000) /**< (MTB_CLAIMCLR) Register Mask */
  80. /* -------- MTB_LOCKACCESS : (MTB Offset: 0xFB0) (R/W 32) MTB Lock Access -------- */
  81. #define MTB_LOCKACCESS_Msk _U_(0x00000000) /**< (MTB_LOCKACCESS) Register Mask */
  82. /* -------- MTB_LOCKSTATUS : (MTB Offset: 0xFB4) ( R/ 32) MTB Lock Status -------- */
  83. #define MTB_LOCKSTATUS_Msk _U_(0x00000000) /**< (MTB_LOCKSTATUS) Register Mask */
  84. /* -------- MTB_AUTHSTATUS : (MTB Offset: 0xFB8) ( R/ 32) MTB Authentication Status -------- */
  85. #define MTB_AUTHSTATUS_Msk _U_(0x00000000) /**< (MTB_AUTHSTATUS) Register Mask */
  86. /* -------- MTB_DEVARCH : (MTB Offset: 0xFBC) ( R/ 32) MTB Device Architecture -------- */
  87. #define MTB_DEVARCH_Msk _U_(0x00000000) /**< (MTB_DEVARCH) Register Mask */
  88. /* -------- MTB_DEVID : (MTB Offset: 0xFC8) ( R/ 32) MTB Device Configuration -------- */
  89. #define MTB_DEVID_Msk _U_(0x00000000) /**< (MTB_DEVID) Register Mask */
  90. /* -------- MTB_DEVTYPE : (MTB Offset: 0xFCC) ( R/ 32) MTB Device Type -------- */
  91. #define MTB_DEVTYPE_Msk _U_(0x00000000) /**< (MTB_DEVTYPE) Register Mask */
  92. /* -------- MTB_PID4 : (MTB Offset: 0xFD0) ( R/ 32) CoreSight -------- */
  93. #define MTB_PID4_Msk _U_(0x00000000) /**< (MTB_PID4) Register Mask */
  94. /* -------- MTB_PID5 : (MTB Offset: 0xFD4) ( R/ 32) CoreSight -------- */
  95. #define MTB_PID5_Msk _U_(0x00000000) /**< (MTB_PID5) Register Mask */
  96. /* -------- MTB_PID6 : (MTB Offset: 0xFD8) ( R/ 32) CoreSight -------- */
  97. #define MTB_PID6_Msk _U_(0x00000000) /**< (MTB_PID6) Register Mask */
  98. /* -------- MTB_PID7 : (MTB Offset: 0xFDC) ( R/ 32) CoreSight -------- */
  99. #define MTB_PID7_Msk _U_(0x00000000) /**< (MTB_PID7) Register Mask */
  100. /* -------- MTB_PID0 : (MTB Offset: 0xFE0) ( R/ 32) CoreSight -------- */
  101. #define MTB_PID0_Msk _U_(0x00000000) /**< (MTB_PID0) Register Mask */
  102. /* -------- MTB_PID1 : (MTB Offset: 0xFE4) ( R/ 32) CoreSight -------- */
  103. #define MTB_PID1_Msk _U_(0x00000000) /**< (MTB_PID1) Register Mask */
  104. /* -------- MTB_PID2 : (MTB Offset: 0xFE8) ( R/ 32) CoreSight -------- */
  105. #define MTB_PID2_Msk _U_(0x00000000) /**< (MTB_PID2) Register Mask */
  106. /* -------- MTB_PID3 : (MTB Offset: 0xFEC) ( R/ 32) CoreSight -------- */
  107. #define MTB_PID3_Msk _U_(0x00000000) /**< (MTB_PID3) Register Mask */
  108. /* -------- MTB_CID0 : (MTB Offset: 0xFF0) ( R/ 32) CoreSight -------- */
  109. #define MTB_CID0_Msk _U_(0x00000000) /**< (MTB_CID0) Register Mask */
  110. /* -------- MTB_CID1 : (MTB Offset: 0xFF4) ( R/ 32) CoreSight -------- */
  111. #define MTB_CID1_Msk _U_(0x00000000) /**< (MTB_CID1) Register Mask */
  112. /* -------- MTB_CID2 : (MTB Offset: 0xFF8) ( R/ 32) CoreSight -------- */
  113. #define MTB_CID2_Msk _U_(0x00000000) /**< (MTB_CID2) Register Mask */
  114. /* -------- MTB_CID3 : (MTB Offset: 0xFFC) ( R/ 32) CoreSight -------- */
  115. #define MTB_CID3_Msk _U_(0x00000000) /**< (MTB_CID3) Register Mask */
  116. /** \brief MTB register offsets definitions */
  117. #define MTB_POSITION_REG_OFST (0x00) /**< (MTB_POSITION) MTB Position Offset */
  118. #define MTB_MASTER_REG_OFST (0x04) /**< (MTB_MASTER) MTB Master Offset */
  119. #define MTB_FLOW_REG_OFST (0x08) /**< (MTB_FLOW) MTB Flow Offset */
  120. #define MTB_BASE_REG_OFST (0x0C) /**< (MTB_BASE) MTB Base Offset */
  121. #define MTB_ITCTRL_REG_OFST (0xF00) /**< (MTB_ITCTRL) MTB Integration Mode Control Offset */
  122. #define MTB_CLAIMSET_REG_OFST (0xFA0) /**< (MTB_CLAIMSET) MTB Claim Set Offset */
  123. #define MTB_CLAIMCLR_REG_OFST (0xFA4) /**< (MTB_CLAIMCLR) MTB Claim Clear Offset */
  124. #define MTB_LOCKACCESS_REG_OFST (0xFB0) /**< (MTB_LOCKACCESS) MTB Lock Access Offset */
  125. #define MTB_LOCKSTATUS_REG_OFST (0xFB4) /**< (MTB_LOCKSTATUS) MTB Lock Status Offset */
  126. #define MTB_AUTHSTATUS_REG_OFST (0xFB8) /**< (MTB_AUTHSTATUS) MTB Authentication Status Offset */
  127. #define MTB_DEVARCH_REG_OFST (0xFBC) /**< (MTB_DEVARCH) MTB Device Architecture Offset */
  128. #define MTB_DEVID_REG_OFST (0xFC8) /**< (MTB_DEVID) MTB Device Configuration Offset */
  129. #define MTB_DEVTYPE_REG_OFST (0xFCC) /**< (MTB_DEVTYPE) MTB Device Type Offset */
  130. #define MTB_PID4_REG_OFST (0xFD0) /**< (MTB_PID4) CoreSight Offset */
  131. #define MTB_PID5_REG_OFST (0xFD4) /**< (MTB_PID5) CoreSight Offset */
  132. #define MTB_PID6_REG_OFST (0xFD8) /**< (MTB_PID6) CoreSight Offset */
  133. #define MTB_PID7_REG_OFST (0xFDC) /**< (MTB_PID7) CoreSight Offset */
  134. #define MTB_PID0_REG_OFST (0xFE0) /**< (MTB_PID0) CoreSight Offset */
  135. #define MTB_PID1_REG_OFST (0xFE4) /**< (MTB_PID1) CoreSight Offset */
  136. #define MTB_PID2_REG_OFST (0xFE8) /**< (MTB_PID2) CoreSight Offset */
  137. #define MTB_PID3_REG_OFST (0xFEC) /**< (MTB_PID3) CoreSight Offset */
  138. #define MTB_CID0_REG_OFST (0xFF0) /**< (MTB_CID0) CoreSight Offset */
  139. #define MTB_CID1_REG_OFST (0xFF4) /**< (MTB_CID1) CoreSight Offset */
  140. #define MTB_CID2_REG_OFST (0xFF8) /**< (MTB_CID2) CoreSight Offset */
  141. #define MTB_CID3_REG_OFST (0xFFC) /**< (MTB_CID3) CoreSight Offset */
  142. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  143. /** \brief MTB register API structure */
  144. typedef struct
  145. { /* Cortex-M0+ Micro-Trace Buffer */
  146. __IO uint32_t MTB_POSITION; /**< Offset: 0x00 (R/W 32) MTB Position */
  147. __IO uint32_t MTB_MASTER; /**< Offset: 0x04 (R/W 32) MTB Master */
  148. __IO uint32_t MTB_FLOW; /**< Offset: 0x08 (R/W 32) MTB Flow */
  149. __I uint32_t MTB_BASE; /**< Offset: 0x0C (R/ 32) MTB Base */
  150. __I uint8_t Reserved1[0xEF0];
  151. __IO uint32_t MTB_ITCTRL; /**< Offset: 0xF00 (R/W 32) MTB Integration Mode Control */
  152. __I uint8_t Reserved2[0x9C];
  153. __IO uint32_t MTB_CLAIMSET; /**< Offset: 0xFA0 (R/W 32) MTB Claim Set */
  154. __IO uint32_t MTB_CLAIMCLR; /**< Offset: 0xFA4 (R/W 32) MTB Claim Clear */
  155. __I uint8_t Reserved3[0x08];
  156. __IO uint32_t MTB_LOCKACCESS; /**< Offset: 0xFB0 (R/W 32) MTB Lock Access */
  157. __I uint32_t MTB_LOCKSTATUS; /**< Offset: 0xFB4 (R/ 32) MTB Lock Status */
  158. __I uint32_t MTB_AUTHSTATUS; /**< Offset: 0xFB8 (R/ 32) MTB Authentication Status */
  159. __I uint32_t MTB_DEVARCH; /**< Offset: 0xFBC (R/ 32) MTB Device Architecture */
  160. __I uint8_t Reserved4[0x08];
  161. __I uint32_t MTB_DEVID; /**< Offset: 0xFC8 (R/ 32) MTB Device Configuration */
  162. __I uint32_t MTB_DEVTYPE; /**< Offset: 0xFCC (R/ 32) MTB Device Type */
  163. __I uint32_t MTB_PID4; /**< Offset: 0xFD0 (R/ 32) CoreSight */
  164. __I uint32_t MTB_PID5; /**< Offset: 0xFD4 (R/ 32) CoreSight */
  165. __I uint32_t MTB_PID6; /**< Offset: 0xFD8 (R/ 32) CoreSight */
  166. __I uint32_t MTB_PID7; /**< Offset: 0xFDC (R/ 32) CoreSight */
  167. __I uint32_t MTB_PID0; /**< Offset: 0xFE0 (R/ 32) CoreSight */
  168. __I uint32_t MTB_PID1; /**< Offset: 0xFE4 (R/ 32) CoreSight */
  169. __I uint32_t MTB_PID2; /**< Offset: 0xFE8 (R/ 32) CoreSight */
  170. __I uint32_t MTB_PID3; /**< Offset: 0xFEC (R/ 32) CoreSight */
  171. __I uint32_t MTB_CID0; /**< Offset: 0xFF0 (R/ 32) CoreSight */
  172. __I uint32_t MTB_CID1; /**< Offset: 0xFF4 (R/ 32) CoreSight */
  173. __I uint32_t MTB_CID2; /**< Offset: 0xFF8 (R/ 32) CoreSight */
  174. __I uint32_t MTB_CID3; /**< Offset: 0xFFC (R/ 32) CoreSight */
  175. } mtb_registers_t;
  176. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  177. #endif /* _SAMD21_MTB_COMPONENT_H_ */