am_reg_tpiu.h 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. //*****************************************************************************
  2. //
  3. // am_reg_tpiu.h
  4. //! @file
  5. //!
  6. //! @brief Register macros for the TPIU module
  7. //
  8. //*****************************************************************************
  9. //*****************************************************************************
  10. //
  11. // Copyright (c) 2017, Ambiq Micro
  12. // All rights reserved.
  13. //
  14. // Redistribution and use in source and binary forms, with or without
  15. // modification, are permitted provided that the following conditions are met:
  16. //
  17. // 1. Redistributions of source code must retain the above copyright notice,
  18. // this list of conditions and the following disclaimer.
  19. //
  20. // 2. Redistributions in binary form must reproduce the above copyright
  21. // notice, this list of conditions and the following disclaimer in the
  22. // documentation and/or other materials provided with the distribution.
  23. //
  24. // 3. Neither the name of the copyright holder nor the names of its
  25. // contributors may be used to endorse or promote products derived from this
  26. // software without specific prior written permission.
  27. //
  28. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  29. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  32. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  33. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  34. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  35. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  36. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  37. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  38. // POSSIBILITY OF SUCH DAMAGE.
  39. //
  40. // This is part of revision 1.2.11 of the AmbiqSuite Development Package.
  41. //
  42. //*****************************************************************************
  43. #ifndef AM_REG_TPIU_H
  44. #define AM_REG_TPIU_H
  45. //*****************************************************************************
  46. //
  47. // Instance finder. (1 instance(s) available)
  48. //
  49. //*****************************************************************************
  50. #define AM_REG_TPIU_NUM_MODULES 1
  51. #define AM_REG_TPIUn(n) \
  52. (REG_TPIU_BASEADDR + 0x00000000 * n)
  53. //*****************************************************************************
  54. //
  55. // Register offsets.
  56. //
  57. //*****************************************************************************
  58. #define AM_REG_TPIU_SSPSR_O 0xE0040000
  59. #define AM_REG_TPIU_CSPSR_O 0xE0040004
  60. #define AM_REG_TPIU_ACPR_O 0xE0040010
  61. #define AM_REG_TPIU_SPPR_O 0xE00400F0
  62. #define AM_REG_TPIU_FFCR_O 0xE0040304
  63. #define AM_REG_TPIU_ITCTRL_O 0xE0040F00
  64. #define AM_REG_TPIU_TYPE_O 0xE0040FC8
  65. //*****************************************************************************
  66. //
  67. // TPIU_SSPSR - Supported Parallel Port Sizes.
  68. //
  69. //*****************************************************************************
  70. // Parallel Port Width 1 supported
  71. #define AM_REG_TPIU_SSPSR_SWIDTH0_S 0
  72. #define AM_REG_TPIU_SSPSR_SWIDTH0_M 0x00000001
  73. #define AM_REG_TPIU_SSPSR_SWIDTH0(n) (((uint32_t)(n) << 0) & 0x00000001)
  74. //*****************************************************************************
  75. //
  76. // TPIU_CSPSR - Current Parallel Port Size.
  77. //
  78. //*****************************************************************************
  79. // One-hot representation of the current port width.
  80. #define AM_REG_TPIU_CSPSR_CWIDTH_S 0
  81. #define AM_REG_TPIU_CSPSR_CWIDTH_M 0xFFFFFFFF
  82. #define AM_REG_TPIU_CSPSR_CWIDTH(n) (((uint32_t)(n) << 0) & 0xFFFFFFFF)
  83. #define AM_REG_TPIU_CSPSR_CWIDTH_1BIT 0x00000001
  84. //*****************************************************************************
  85. //
  86. // TPIU_ACPR - Asynchronous Clock Prescaler.
  87. //
  88. //*****************************************************************************
  89. // Prescaler value for the baudrate of SWO.
  90. #define AM_REG_TPIU_ACPR_SWOSCALER_S 0
  91. #define AM_REG_TPIU_ACPR_SWOSCALER_M 0x0000FFFF
  92. #define AM_REG_TPIU_ACPR_SWOSCALER(n) (((uint32_t)(n) << 0) & 0x0000FFFF)
  93. #define AM_REG_TPIU_ACPR_SWOSCALER_115200 0x00000033
  94. //*****************************************************************************
  95. //
  96. // TPIU_SPPR - Selected Pin Protocol.
  97. //
  98. //*****************************************************************************
  99. // Selects the protocol used for trace output.
  100. #define AM_REG_TPIU_SPPR_TXMODE_S 0
  101. #define AM_REG_TPIU_SPPR_TXMODE_M 0x00000003
  102. #define AM_REG_TPIU_SPPR_TXMODE(n) (((uint32_t)(n) << 0) & 0x00000003)
  103. #define AM_REG_TPIU_SPPR_TXMODE_PARALLEL 0x00000000
  104. #define AM_REG_TPIU_SPPR_TXMODE_MANCHESTER 0x00000001
  105. #define AM_REG_TPIU_SPPR_TXMODE_NRZ 0x00000002
  106. #define AM_REG_TPIU_SPPR_TXMODE_UART 0x00000002
  107. //*****************************************************************************
  108. //
  109. // TPIU_FFCR - Formatter and Flush Control Register.
  110. //
  111. //*****************************************************************************
  112. // Enable continuous formatting.
  113. #define AM_REG_TPIU_FFCR_ENFCONT_S 1
  114. #define AM_REG_TPIU_FFCR_ENFCONT_M 0x00000002
  115. #define AM_REG_TPIU_FFCR_ENFCONT(n) (((uint32_t)(n) << 1) & 0x00000002)
  116. //*****************************************************************************
  117. //
  118. // TPIU_ITCTRL - Specifies normal or integration mode for the TPIU.
  119. //
  120. //*****************************************************************************
  121. // Specifies the current mode for the TPIU.
  122. #define AM_REG_TPIU_ITCTRL_MODE_S 0
  123. #define AM_REG_TPIU_ITCTRL_MODE_M 0x00000003
  124. #define AM_REG_TPIU_ITCTRL_MODE(n) (((uint32_t)(n) << 0) & 0x00000003)
  125. #define AM_REG_TPIU_ITCTRL_MODE_NORMAL 0x00000000
  126. #define AM_REG_TPIU_ITCTRL_MODE_TEST 0x00000001
  127. #define AM_REG_TPIU_ITCTRL_MODE_DATA_TEST 0x00000002
  128. //*****************************************************************************
  129. //
  130. // TPIU_TYPE - TPIU Type.
  131. //
  132. //*****************************************************************************
  133. // 1 Indicates UART/NRZ support.
  134. #define AM_REG_TPIU_TYPE_NRZVALID_S 11
  135. #define AM_REG_TPIU_TYPE_NRZVALID_M 0x00000800
  136. #define AM_REG_TPIU_TYPE_NRZVALID(n) (((uint32_t)(n) << 11) & 0x00000800)
  137. // 1 Indicates Manchester support.
  138. #define AM_REG_TPIU_TYPE_MANCVALID_S 10
  139. #define AM_REG_TPIU_TYPE_MANCVALID_M 0x00000400
  140. #define AM_REG_TPIU_TYPE_MANCVALID(n) (((uint32_t)(n) << 10) & 0x00000400)
  141. // 0 Indicates Parallel Trace support.
  142. #define AM_REG_TPIU_TYPE_PTINVALID_S 9
  143. #define AM_REG_TPIU_TYPE_PTINVALID_M 0x00000200
  144. #define AM_REG_TPIU_TYPE_PTINVALID(n) (((uint32_t)(n) << 9) & 0x00000200)
  145. // FIFO Size reported as a power of two. For instance, 0x3 indicates a FIFO size
  146. // of 8 bytes.
  147. #define AM_REG_TPIU_TYPE_FIFOSZ_S 6
  148. #define AM_REG_TPIU_TYPE_FIFOSZ_M 0x000001C0
  149. #define AM_REG_TPIU_TYPE_FIFOSZ(n) (((uint32_t)(n) << 6) & 0x000001C0)
  150. #endif // AM_REG_TPIU_H