port.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. /**
  2. * \brief Component description for PORT
  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_PORT_COMPONENT_H_
  24. #define _SAMD21_PORT_COMPONENT_H_
  25. /* ************************************************************************** */
  26. /* SOFTWARE API DEFINITION FOR PORT */
  27. /* ************************************************************************** */
  28. /* -------- PORT_DIR : (PORT Offset: 0x00) (R/W 32) Data Direction -------- */
  29. #define PORT_DIR_RESETVALUE _U_(0x00) /**< (PORT_DIR) Data Direction Reset Value */
  30. #define PORT_DIR_DIR_Pos _U_(0) /**< (PORT_DIR) Port Data Direction Position */
  31. #define PORT_DIR_DIR_Msk (_U_(0xFFFFFFFF) << PORT_DIR_DIR_Pos) /**< (PORT_DIR) Port Data Direction Mask */
  32. #define PORT_DIR_DIR(value) (PORT_DIR_DIR_Msk & ((value) << PORT_DIR_DIR_Pos))
  33. #define PORT_DIR_Msk _U_(0xFFFFFFFF) /**< (PORT_DIR) Register Mask */
  34. /* -------- PORT_DIRCLR : (PORT Offset: 0x04) (R/W 32) Data Direction Clear -------- */
  35. #define PORT_DIRCLR_RESETVALUE _U_(0x00) /**< (PORT_DIRCLR) Data Direction Clear Reset Value */
  36. #define PORT_DIRCLR_DIRCLR_Pos _U_(0) /**< (PORT_DIRCLR) Port Data Direction Clear Position */
  37. #define PORT_DIRCLR_DIRCLR_Msk (_U_(0xFFFFFFFF) << PORT_DIRCLR_DIRCLR_Pos) /**< (PORT_DIRCLR) Port Data Direction Clear Mask */
  38. #define PORT_DIRCLR_DIRCLR(value) (PORT_DIRCLR_DIRCLR_Msk & ((value) << PORT_DIRCLR_DIRCLR_Pos))
  39. #define PORT_DIRCLR_Msk _U_(0xFFFFFFFF) /**< (PORT_DIRCLR) Register Mask */
  40. /* -------- PORT_DIRSET : (PORT Offset: 0x08) (R/W 32) Data Direction Set -------- */
  41. #define PORT_DIRSET_RESETVALUE _U_(0x00) /**< (PORT_DIRSET) Data Direction Set Reset Value */
  42. #define PORT_DIRSET_DIRSET_Pos _U_(0) /**< (PORT_DIRSET) Port Data Direction Set Position */
  43. #define PORT_DIRSET_DIRSET_Msk (_U_(0xFFFFFFFF) << PORT_DIRSET_DIRSET_Pos) /**< (PORT_DIRSET) Port Data Direction Set Mask */
  44. #define PORT_DIRSET_DIRSET(value) (PORT_DIRSET_DIRSET_Msk & ((value) << PORT_DIRSET_DIRSET_Pos))
  45. #define PORT_DIRSET_Msk _U_(0xFFFFFFFF) /**< (PORT_DIRSET) Register Mask */
  46. /* -------- PORT_DIRTGL : (PORT Offset: 0x0C) (R/W 32) Data Direction Toggle -------- */
  47. #define PORT_DIRTGL_RESETVALUE _U_(0x00) /**< (PORT_DIRTGL) Data Direction Toggle Reset Value */
  48. #define PORT_DIRTGL_DIRTGL_Pos _U_(0) /**< (PORT_DIRTGL) Port Data Direction Toggle Position */
  49. #define PORT_DIRTGL_DIRTGL_Msk (_U_(0xFFFFFFFF) << PORT_DIRTGL_DIRTGL_Pos) /**< (PORT_DIRTGL) Port Data Direction Toggle Mask */
  50. #define PORT_DIRTGL_DIRTGL(value) (PORT_DIRTGL_DIRTGL_Msk & ((value) << PORT_DIRTGL_DIRTGL_Pos))
  51. #define PORT_DIRTGL_Msk _U_(0xFFFFFFFF) /**< (PORT_DIRTGL) Register Mask */
  52. /* -------- PORT_OUT : (PORT Offset: 0x10) (R/W 32) Data Output Value -------- */
  53. #define PORT_OUT_RESETVALUE _U_(0x00) /**< (PORT_OUT) Data Output Value Reset Value */
  54. #define PORT_OUT_OUT_Pos _U_(0) /**< (PORT_OUT) Port Data Output Value Position */
  55. #define PORT_OUT_OUT_Msk (_U_(0xFFFFFFFF) << PORT_OUT_OUT_Pos) /**< (PORT_OUT) Port Data Output Value Mask */
  56. #define PORT_OUT_OUT(value) (PORT_OUT_OUT_Msk & ((value) << PORT_OUT_OUT_Pos))
  57. #define PORT_OUT_Msk _U_(0xFFFFFFFF) /**< (PORT_OUT) Register Mask */
  58. /* -------- PORT_OUTCLR : (PORT Offset: 0x14) (R/W 32) Data Output Value Clear -------- */
  59. #define PORT_OUTCLR_RESETVALUE _U_(0x00) /**< (PORT_OUTCLR) Data Output Value Clear Reset Value */
  60. #define PORT_OUTCLR_OUTCLR_Pos _U_(0) /**< (PORT_OUTCLR) Port Data Output Value Clear Position */
  61. #define PORT_OUTCLR_OUTCLR_Msk (_U_(0xFFFFFFFF) << PORT_OUTCLR_OUTCLR_Pos) /**< (PORT_OUTCLR) Port Data Output Value Clear Mask */
  62. #define PORT_OUTCLR_OUTCLR(value) (PORT_OUTCLR_OUTCLR_Msk & ((value) << PORT_OUTCLR_OUTCLR_Pos))
  63. #define PORT_OUTCLR_Msk _U_(0xFFFFFFFF) /**< (PORT_OUTCLR) Register Mask */
  64. /* -------- PORT_OUTSET : (PORT Offset: 0x18) (R/W 32) Data Output Value Set -------- */
  65. #define PORT_OUTSET_RESETVALUE _U_(0x00) /**< (PORT_OUTSET) Data Output Value Set Reset Value */
  66. #define PORT_OUTSET_OUTSET_Pos _U_(0) /**< (PORT_OUTSET) Port Data Output Value Set Position */
  67. #define PORT_OUTSET_OUTSET_Msk (_U_(0xFFFFFFFF) << PORT_OUTSET_OUTSET_Pos) /**< (PORT_OUTSET) Port Data Output Value Set Mask */
  68. #define PORT_OUTSET_OUTSET(value) (PORT_OUTSET_OUTSET_Msk & ((value) << PORT_OUTSET_OUTSET_Pos))
  69. #define PORT_OUTSET_Msk _U_(0xFFFFFFFF) /**< (PORT_OUTSET) Register Mask */
  70. /* -------- PORT_OUTTGL : (PORT Offset: 0x1C) (R/W 32) Data Output Value Toggle -------- */
  71. #define PORT_OUTTGL_RESETVALUE _U_(0x00) /**< (PORT_OUTTGL) Data Output Value Toggle Reset Value */
  72. #define PORT_OUTTGL_OUTTGL_Pos _U_(0) /**< (PORT_OUTTGL) Port Data Output Value Toggle Position */
  73. #define PORT_OUTTGL_OUTTGL_Msk (_U_(0xFFFFFFFF) << PORT_OUTTGL_OUTTGL_Pos) /**< (PORT_OUTTGL) Port Data Output Value Toggle Mask */
  74. #define PORT_OUTTGL_OUTTGL(value) (PORT_OUTTGL_OUTTGL_Msk & ((value) << PORT_OUTTGL_OUTTGL_Pos))
  75. #define PORT_OUTTGL_Msk _U_(0xFFFFFFFF) /**< (PORT_OUTTGL) Register Mask */
  76. /* -------- PORT_IN : (PORT Offset: 0x20) ( R/ 32) Data Input Value -------- */
  77. #define PORT_IN_RESETVALUE _U_(0x00) /**< (PORT_IN) Data Input Value Reset Value */
  78. #define PORT_IN_IN_Pos _U_(0) /**< (PORT_IN) Port Data Input Value Position */
  79. #define PORT_IN_IN_Msk (_U_(0xFFFFFFFF) << PORT_IN_IN_Pos) /**< (PORT_IN) Port Data Input Value Mask */
  80. #define PORT_IN_IN(value) (PORT_IN_IN_Msk & ((value) << PORT_IN_IN_Pos))
  81. #define PORT_IN_Msk _U_(0xFFFFFFFF) /**< (PORT_IN) Register Mask */
  82. /* -------- PORT_CTRL : (PORT Offset: 0x24) (R/W 32) Control -------- */
  83. #define PORT_CTRL_RESETVALUE _U_(0x00) /**< (PORT_CTRL) Control Reset Value */
  84. #define PORT_CTRL_SAMPLING_Pos _U_(0) /**< (PORT_CTRL) Input Sampling Mode Position */
  85. #define PORT_CTRL_SAMPLING_Msk (_U_(0xFFFFFFFF) << PORT_CTRL_SAMPLING_Pos) /**< (PORT_CTRL) Input Sampling Mode Mask */
  86. #define PORT_CTRL_SAMPLING(value) (PORT_CTRL_SAMPLING_Msk & ((value) << PORT_CTRL_SAMPLING_Pos))
  87. #define PORT_CTRL_Msk _U_(0xFFFFFFFF) /**< (PORT_CTRL) Register Mask */
  88. /* -------- PORT_WRCONFIG : (PORT Offset: 0x28) ( /W 32) Write Configuration -------- */
  89. #define PORT_WRCONFIG_RESETVALUE _U_(0x00) /**< (PORT_WRCONFIG) Write Configuration Reset Value */
  90. #define PORT_WRCONFIG_PINMASK_Pos _U_(0) /**< (PORT_WRCONFIG) Pin Mask for Multiple Pin Configuration Position */
  91. #define PORT_WRCONFIG_PINMASK_Msk (_U_(0xFFFF) << PORT_WRCONFIG_PINMASK_Pos) /**< (PORT_WRCONFIG) Pin Mask for Multiple Pin Configuration Mask */
  92. #define PORT_WRCONFIG_PINMASK(value) (PORT_WRCONFIG_PINMASK_Msk & ((value) << PORT_WRCONFIG_PINMASK_Pos))
  93. #define PORT_WRCONFIG_PMUXEN_Pos _U_(16) /**< (PORT_WRCONFIG) Peripheral Multiplexer Enable Position */
  94. #define PORT_WRCONFIG_PMUXEN_Msk (_U_(0x1) << PORT_WRCONFIG_PMUXEN_Pos) /**< (PORT_WRCONFIG) Peripheral Multiplexer Enable Mask */
  95. #define PORT_WRCONFIG_PMUXEN(value) (PORT_WRCONFIG_PMUXEN_Msk & ((value) << PORT_WRCONFIG_PMUXEN_Pos))
  96. #define PORT_WRCONFIG_INEN_Pos _U_(17) /**< (PORT_WRCONFIG) Input Enable Position */
  97. #define PORT_WRCONFIG_INEN_Msk (_U_(0x1) << PORT_WRCONFIG_INEN_Pos) /**< (PORT_WRCONFIG) Input Enable Mask */
  98. #define PORT_WRCONFIG_INEN(value) (PORT_WRCONFIG_INEN_Msk & ((value) << PORT_WRCONFIG_INEN_Pos))
  99. #define PORT_WRCONFIG_PULLEN_Pos _U_(18) /**< (PORT_WRCONFIG) Pull Enable Position */
  100. #define PORT_WRCONFIG_PULLEN_Msk (_U_(0x1) << PORT_WRCONFIG_PULLEN_Pos) /**< (PORT_WRCONFIG) Pull Enable Mask */
  101. #define PORT_WRCONFIG_PULLEN(value) (PORT_WRCONFIG_PULLEN_Msk & ((value) << PORT_WRCONFIG_PULLEN_Pos))
  102. #define PORT_WRCONFIG_DRVSTR_Pos _U_(22) /**< (PORT_WRCONFIG) Output Driver Strength Selection Position */
  103. #define PORT_WRCONFIG_DRVSTR_Msk (_U_(0x1) << PORT_WRCONFIG_DRVSTR_Pos) /**< (PORT_WRCONFIG) Output Driver Strength Selection Mask */
  104. #define PORT_WRCONFIG_DRVSTR(value) (PORT_WRCONFIG_DRVSTR_Msk & ((value) << PORT_WRCONFIG_DRVSTR_Pos))
  105. #define PORT_WRCONFIG_PMUX_Pos _U_(24) /**< (PORT_WRCONFIG) Peripheral Multiplexing Position */
  106. #define PORT_WRCONFIG_PMUX_Msk (_U_(0xF) << PORT_WRCONFIG_PMUX_Pos) /**< (PORT_WRCONFIG) Peripheral Multiplexing Mask */
  107. #define PORT_WRCONFIG_PMUX(value) (PORT_WRCONFIG_PMUX_Msk & ((value) << PORT_WRCONFIG_PMUX_Pos))
  108. #define PORT_WRCONFIG_WRPMUX_Pos _U_(28) /**< (PORT_WRCONFIG) Write PMUX Position */
  109. #define PORT_WRCONFIG_WRPMUX_Msk (_U_(0x1) << PORT_WRCONFIG_WRPMUX_Pos) /**< (PORT_WRCONFIG) Write PMUX Mask */
  110. #define PORT_WRCONFIG_WRPMUX(value) (PORT_WRCONFIG_WRPMUX_Msk & ((value) << PORT_WRCONFIG_WRPMUX_Pos))
  111. #define PORT_WRCONFIG_WRPINCFG_Pos _U_(30) /**< (PORT_WRCONFIG) Write PINCFG Position */
  112. #define PORT_WRCONFIG_WRPINCFG_Msk (_U_(0x1) << PORT_WRCONFIG_WRPINCFG_Pos) /**< (PORT_WRCONFIG) Write PINCFG Mask */
  113. #define PORT_WRCONFIG_WRPINCFG(value) (PORT_WRCONFIG_WRPINCFG_Msk & ((value) << PORT_WRCONFIG_WRPINCFG_Pos))
  114. #define PORT_WRCONFIG_HWSEL_Pos _U_(31) /**< (PORT_WRCONFIG) Half-Word Select Position */
  115. #define PORT_WRCONFIG_HWSEL_Msk (_U_(0x1) << PORT_WRCONFIG_HWSEL_Pos) /**< (PORT_WRCONFIG) Half-Word Select Mask */
  116. #define PORT_WRCONFIG_HWSEL(value) (PORT_WRCONFIG_HWSEL_Msk & ((value) << PORT_WRCONFIG_HWSEL_Pos))
  117. #define PORT_WRCONFIG_Msk _U_(0xDF47FFFF) /**< (PORT_WRCONFIG) Register Mask */
  118. /* -------- PORT_PMUX : (PORT Offset: 0x30) (R/W 8) Peripheral Multiplexing n -------- */
  119. #define PORT_PMUX_RESETVALUE _U_(0x00) /**< (PORT_PMUX) Peripheral Multiplexing n Reset Value */
  120. #define PORT_PMUX_PMUXE_Pos _U_(0) /**< (PORT_PMUX) Peripheral Multiplexing Even Position */
  121. #define PORT_PMUX_PMUXE_Msk (_U_(0xF) << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral Multiplexing Even Mask */
  122. #define PORT_PMUX_PMUXE(value) (PORT_PMUX_PMUXE_Msk & ((value) << PORT_PMUX_PMUXE_Pos))
  123. #define PORT_PMUX_PMUXE_A_Val _U_(0x0) /**< (PORT_PMUX) Peripheral function A selected */
  124. #define PORT_PMUX_PMUXE_B_Val _U_(0x1) /**< (PORT_PMUX) Peripheral function B selected */
  125. #define PORT_PMUX_PMUXE_C_Val _U_(0x2) /**< (PORT_PMUX) Peripheral function C selected */
  126. #define PORT_PMUX_PMUXE_D_Val _U_(0x3) /**< (PORT_PMUX) Peripheral function D selected */
  127. #define PORT_PMUX_PMUXE_E_Val _U_(0x4) /**< (PORT_PMUX) Peripheral function E selected */
  128. #define PORT_PMUX_PMUXE_F_Val _U_(0x5) /**< (PORT_PMUX) Peripheral function F selected */
  129. #define PORT_PMUX_PMUXE_G_Val _U_(0x6) /**< (PORT_PMUX) Peripheral function G selected */
  130. #define PORT_PMUX_PMUXE_H_Val _U_(0x7) /**< (PORT_PMUX) Peripheral function H selected */
  131. #define PORT_PMUX_PMUXE_A (PORT_PMUX_PMUXE_A_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function A selected Position */
  132. #define PORT_PMUX_PMUXE_B (PORT_PMUX_PMUXE_B_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function B selected Position */
  133. #define PORT_PMUX_PMUXE_C (PORT_PMUX_PMUXE_C_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function C selected Position */
  134. #define PORT_PMUX_PMUXE_D (PORT_PMUX_PMUXE_D_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function D selected Position */
  135. #define PORT_PMUX_PMUXE_E (PORT_PMUX_PMUXE_E_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function E selected Position */
  136. #define PORT_PMUX_PMUXE_F (PORT_PMUX_PMUXE_F_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function F selected Position */
  137. #define PORT_PMUX_PMUXE_G (PORT_PMUX_PMUXE_G_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function G selected Position */
  138. #define PORT_PMUX_PMUXE_H (PORT_PMUX_PMUXE_H_Val << PORT_PMUX_PMUXE_Pos) /**< (PORT_PMUX) Peripheral function H selected Position */
  139. #define PORT_PMUX_PMUXO_Pos _U_(4) /**< (PORT_PMUX) Peripheral Multiplexing Odd Position */
  140. #define PORT_PMUX_PMUXO_Msk (_U_(0xF) << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral Multiplexing Odd Mask */
  141. #define PORT_PMUX_PMUXO(value) (PORT_PMUX_PMUXO_Msk & ((value) << PORT_PMUX_PMUXO_Pos))
  142. #define PORT_PMUX_PMUXO_A_Val _U_(0x0) /**< (PORT_PMUX) Peripheral function A selected */
  143. #define PORT_PMUX_PMUXO_B_Val _U_(0x1) /**< (PORT_PMUX) Peripheral function B selected */
  144. #define PORT_PMUX_PMUXO_C_Val _U_(0x2) /**< (PORT_PMUX) Peripheral function C selected */
  145. #define PORT_PMUX_PMUXO_D_Val _U_(0x3) /**< (PORT_PMUX) Peripheral function D selected */
  146. #define PORT_PMUX_PMUXO_E_Val _U_(0x4) /**< (PORT_PMUX) Peripheral function E selected */
  147. #define PORT_PMUX_PMUXO_F_Val _U_(0x5) /**< (PORT_PMUX) Peripheral function F selected */
  148. #define PORT_PMUX_PMUXO_G_Val _U_(0x6) /**< (PORT_PMUX) Peripheral function G selected */
  149. #define PORT_PMUX_PMUXO_H_Val _U_(0x7) /**< (PORT_PMUX) Peripheral function H selected */
  150. #define PORT_PMUX_PMUXO_A (PORT_PMUX_PMUXO_A_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function A selected Position */
  151. #define PORT_PMUX_PMUXO_B (PORT_PMUX_PMUXO_B_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function B selected Position */
  152. #define PORT_PMUX_PMUXO_C (PORT_PMUX_PMUXO_C_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function C selected Position */
  153. #define PORT_PMUX_PMUXO_D (PORT_PMUX_PMUXO_D_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function D selected Position */
  154. #define PORT_PMUX_PMUXO_E (PORT_PMUX_PMUXO_E_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function E selected Position */
  155. #define PORT_PMUX_PMUXO_F (PORT_PMUX_PMUXO_F_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function F selected Position */
  156. #define PORT_PMUX_PMUXO_G (PORT_PMUX_PMUXO_G_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function G selected Position */
  157. #define PORT_PMUX_PMUXO_H (PORT_PMUX_PMUXO_H_Val << PORT_PMUX_PMUXO_Pos) /**< (PORT_PMUX) Peripheral function H selected Position */
  158. #define PORT_PMUX_Msk _U_(0xFF) /**< (PORT_PMUX) Register Mask */
  159. /* -------- PORT_PINCFG : (PORT Offset: 0x40) (R/W 8) Pin Configuration n -------- */
  160. #define PORT_PINCFG_RESETVALUE _U_(0x00) /**< (PORT_PINCFG) Pin Configuration n Reset Value */
  161. #define PORT_PINCFG_PMUXEN_Pos _U_(0) /**< (PORT_PINCFG) Peripheral Multiplexer Enable Position */
  162. #define PORT_PINCFG_PMUXEN_Msk (_U_(0x1) << PORT_PINCFG_PMUXEN_Pos) /**< (PORT_PINCFG) Peripheral Multiplexer Enable Mask */
  163. #define PORT_PINCFG_PMUXEN(value) (PORT_PINCFG_PMUXEN_Msk & ((value) << PORT_PINCFG_PMUXEN_Pos))
  164. #define PORT_PINCFG_INEN_Pos _U_(1) /**< (PORT_PINCFG) Input Enable Position */
  165. #define PORT_PINCFG_INEN_Msk (_U_(0x1) << PORT_PINCFG_INEN_Pos) /**< (PORT_PINCFG) Input Enable Mask */
  166. #define PORT_PINCFG_INEN(value) (PORT_PINCFG_INEN_Msk & ((value) << PORT_PINCFG_INEN_Pos))
  167. #define PORT_PINCFG_PULLEN_Pos _U_(2) /**< (PORT_PINCFG) Pull Enable Position */
  168. #define PORT_PINCFG_PULLEN_Msk (_U_(0x1) << PORT_PINCFG_PULLEN_Pos) /**< (PORT_PINCFG) Pull Enable Mask */
  169. #define PORT_PINCFG_PULLEN(value) (PORT_PINCFG_PULLEN_Msk & ((value) << PORT_PINCFG_PULLEN_Pos))
  170. #define PORT_PINCFG_DRVSTR_Pos _U_(6) /**< (PORT_PINCFG) Output Driver Strength Selection Position */
  171. #define PORT_PINCFG_DRVSTR_Msk (_U_(0x1) << PORT_PINCFG_DRVSTR_Pos) /**< (PORT_PINCFG) Output Driver Strength Selection Mask */
  172. #define PORT_PINCFG_DRVSTR(value) (PORT_PINCFG_DRVSTR_Msk & ((value) << PORT_PINCFG_DRVSTR_Pos))
  173. #define PORT_PINCFG_Msk _U_(0x47) /**< (PORT_PINCFG) Register Mask */
  174. /** \brief PORT register offsets definitions */
  175. #define PORT_DIR_REG_OFST (0x00) /**< (PORT_DIR) Data Direction Offset */
  176. #define PORT_DIRCLR_REG_OFST (0x04) /**< (PORT_DIRCLR) Data Direction Clear Offset */
  177. #define PORT_DIRSET_REG_OFST (0x08) /**< (PORT_DIRSET) Data Direction Set Offset */
  178. #define PORT_DIRTGL_REG_OFST (0x0C) /**< (PORT_DIRTGL) Data Direction Toggle Offset */
  179. #define PORT_OUT_REG_OFST (0x10) /**< (PORT_OUT) Data Output Value Offset */
  180. #define PORT_OUTCLR_REG_OFST (0x14) /**< (PORT_OUTCLR) Data Output Value Clear Offset */
  181. #define PORT_OUTSET_REG_OFST (0x18) /**< (PORT_OUTSET) Data Output Value Set Offset */
  182. #define PORT_OUTTGL_REG_OFST (0x1C) /**< (PORT_OUTTGL) Data Output Value Toggle Offset */
  183. #define PORT_IN_REG_OFST (0x20) /**< (PORT_IN) Data Input Value Offset */
  184. #define PORT_CTRL_REG_OFST (0x24) /**< (PORT_CTRL) Control Offset */
  185. #define PORT_WRCONFIG_REG_OFST (0x28) /**< (PORT_WRCONFIG) Write Configuration Offset */
  186. #define PORT_PMUX_REG_OFST (0x30) /**< (PORT_PMUX) Peripheral Multiplexing n Offset */
  187. #define PORT_PMUX0_REG_OFST (0x30) /**< (PORT_PMUX0) Peripheral Multiplexing n Offset */
  188. #define PORT_PMUX1_REG_OFST (0x31) /**< (PORT_PMUX1) Peripheral Multiplexing n Offset */
  189. #define PORT_PMUX2_REG_OFST (0x32) /**< (PORT_PMUX2) Peripheral Multiplexing n Offset */
  190. #define PORT_PMUX3_REG_OFST (0x33) /**< (PORT_PMUX3) Peripheral Multiplexing n Offset */
  191. #define PORT_PMUX4_REG_OFST (0x34) /**< (PORT_PMUX4) Peripheral Multiplexing n Offset */
  192. #define PORT_PMUX5_REG_OFST (0x35) /**< (PORT_PMUX5) Peripheral Multiplexing n Offset */
  193. #define PORT_PMUX6_REG_OFST (0x36) /**< (PORT_PMUX6) Peripheral Multiplexing n Offset */
  194. #define PORT_PMUX7_REG_OFST (0x37) /**< (PORT_PMUX7) Peripheral Multiplexing n Offset */
  195. #define PORT_PMUX8_REG_OFST (0x38) /**< (PORT_PMUX8) Peripheral Multiplexing n Offset */
  196. #define PORT_PMUX9_REG_OFST (0x39) /**< (PORT_PMUX9) Peripheral Multiplexing n Offset */
  197. #define PORT_PMUX10_REG_OFST (0x3A) /**< (PORT_PMUX10) Peripheral Multiplexing n Offset */
  198. #define PORT_PMUX11_REG_OFST (0x3B) /**< (PORT_PMUX11) Peripheral Multiplexing n Offset */
  199. #define PORT_PMUX12_REG_OFST (0x3C) /**< (PORT_PMUX12) Peripheral Multiplexing n Offset */
  200. #define PORT_PMUX13_REG_OFST (0x3D) /**< (PORT_PMUX13) Peripheral Multiplexing n Offset */
  201. #define PORT_PMUX14_REG_OFST (0x3E) /**< (PORT_PMUX14) Peripheral Multiplexing n Offset */
  202. #define PORT_PMUX15_REG_OFST (0x3F) /**< (PORT_PMUX15) Peripheral Multiplexing n Offset */
  203. #define PORT_PINCFG_REG_OFST (0x40) /**< (PORT_PINCFG) Pin Configuration n Offset */
  204. #define PORT_PINCFG0_REG_OFST (0x40) /**< (PORT_PINCFG0) Pin Configuration n Offset */
  205. #define PORT_PINCFG1_REG_OFST (0x41) /**< (PORT_PINCFG1) Pin Configuration n Offset */
  206. #define PORT_PINCFG2_REG_OFST (0x42) /**< (PORT_PINCFG2) Pin Configuration n Offset */
  207. #define PORT_PINCFG3_REG_OFST (0x43) /**< (PORT_PINCFG3) Pin Configuration n Offset */
  208. #define PORT_PINCFG4_REG_OFST (0x44) /**< (PORT_PINCFG4) Pin Configuration n Offset */
  209. #define PORT_PINCFG5_REG_OFST (0x45) /**< (PORT_PINCFG5) Pin Configuration n Offset */
  210. #define PORT_PINCFG6_REG_OFST (0x46) /**< (PORT_PINCFG6) Pin Configuration n Offset */
  211. #define PORT_PINCFG7_REG_OFST (0x47) /**< (PORT_PINCFG7) Pin Configuration n Offset */
  212. #define PORT_PINCFG8_REG_OFST (0x48) /**< (PORT_PINCFG8) Pin Configuration n Offset */
  213. #define PORT_PINCFG9_REG_OFST (0x49) /**< (PORT_PINCFG9) Pin Configuration n Offset */
  214. #define PORT_PINCFG10_REG_OFST (0x4A) /**< (PORT_PINCFG10) Pin Configuration n Offset */
  215. #define PORT_PINCFG11_REG_OFST (0x4B) /**< (PORT_PINCFG11) Pin Configuration n Offset */
  216. #define PORT_PINCFG12_REG_OFST (0x4C) /**< (PORT_PINCFG12) Pin Configuration n Offset */
  217. #define PORT_PINCFG13_REG_OFST (0x4D) /**< (PORT_PINCFG13) Pin Configuration n Offset */
  218. #define PORT_PINCFG14_REG_OFST (0x4E) /**< (PORT_PINCFG14) Pin Configuration n Offset */
  219. #define PORT_PINCFG15_REG_OFST (0x4F) /**< (PORT_PINCFG15) Pin Configuration n Offset */
  220. #define PORT_PINCFG16_REG_OFST (0x50) /**< (PORT_PINCFG16) Pin Configuration n Offset */
  221. #define PORT_PINCFG17_REG_OFST (0x51) /**< (PORT_PINCFG17) Pin Configuration n Offset */
  222. #define PORT_PINCFG18_REG_OFST (0x52) /**< (PORT_PINCFG18) Pin Configuration n Offset */
  223. #define PORT_PINCFG19_REG_OFST (0x53) /**< (PORT_PINCFG19) Pin Configuration n Offset */
  224. #define PORT_PINCFG20_REG_OFST (0x54) /**< (PORT_PINCFG20) Pin Configuration n Offset */
  225. #define PORT_PINCFG21_REG_OFST (0x55) /**< (PORT_PINCFG21) Pin Configuration n Offset */
  226. #define PORT_PINCFG22_REG_OFST (0x56) /**< (PORT_PINCFG22) Pin Configuration n Offset */
  227. #define PORT_PINCFG23_REG_OFST (0x57) /**< (PORT_PINCFG23) Pin Configuration n Offset */
  228. #define PORT_PINCFG24_REG_OFST (0x58) /**< (PORT_PINCFG24) Pin Configuration n Offset */
  229. #define PORT_PINCFG25_REG_OFST (0x59) /**< (PORT_PINCFG25) Pin Configuration n Offset */
  230. #define PORT_PINCFG26_REG_OFST (0x5A) /**< (PORT_PINCFG26) Pin Configuration n Offset */
  231. #define PORT_PINCFG27_REG_OFST (0x5B) /**< (PORT_PINCFG27) Pin Configuration n Offset */
  232. #define PORT_PINCFG28_REG_OFST (0x5C) /**< (PORT_PINCFG28) Pin Configuration n Offset */
  233. #define PORT_PINCFG29_REG_OFST (0x5D) /**< (PORT_PINCFG29) Pin Configuration n Offset */
  234. #define PORT_PINCFG30_REG_OFST (0x5E) /**< (PORT_PINCFG30) Pin Configuration n Offset */
  235. #define PORT_PINCFG31_REG_OFST (0x5F) /**< (PORT_PINCFG31) Pin Configuration n Offset */
  236. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  237. /** \brief GROUP register API structure */
  238. typedef struct
  239. {
  240. __IO uint32_t PORT_DIR; /**< Offset: 0x00 (R/W 32) Data Direction */
  241. __IO uint32_t PORT_DIRCLR; /**< Offset: 0x04 (R/W 32) Data Direction Clear */
  242. __IO uint32_t PORT_DIRSET; /**< Offset: 0x08 (R/W 32) Data Direction Set */
  243. __IO uint32_t PORT_DIRTGL; /**< Offset: 0x0C (R/W 32) Data Direction Toggle */
  244. __IO uint32_t PORT_OUT; /**< Offset: 0x10 (R/W 32) Data Output Value */
  245. __IO uint32_t PORT_OUTCLR; /**< Offset: 0x14 (R/W 32) Data Output Value Clear */
  246. __IO uint32_t PORT_OUTSET; /**< Offset: 0x18 (R/W 32) Data Output Value Set */
  247. __IO uint32_t PORT_OUTTGL; /**< Offset: 0x1C (R/W 32) Data Output Value Toggle */
  248. __I uint32_t PORT_IN; /**< Offset: 0x20 (R/ 32) Data Input Value */
  249. __IO uint32_t PORT_CTRL; /**< Offset: 0x24 (R/W 32) Control */
  250. __O uint32_t PORT_WRCONFIG; /**< Offset: 0x28 ( /W 32) Write Configuration */
  251. __I uint8_t Reserved1[0x04];
  252. __IO uint8_t PORT_PMUX[16]; /**< Offset: 0x30 (R/W 8) Peripheral Multiplexing n */
  253. __IO uint8_t PORT_PINCFG[32]; /**< Offset: 0x40 (R/W 8) Pin Configuration n */
  254. __I uint8_t Reserved2[0x20];
  255. } port_group_registers_t;
  256. #define PORT_GROUP_NUMBER _U_(2)
  257. /** \brief PORT register API structure */
  258. typedef struct
  259. { /* Port Module */
  260. port_group_registers_t GROUP[PORT_GROUP_NUMBER]; /**< Offset: 0x00 */
  261. } port_registers_t;
  262. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  263. #endif /* _SAMD21_PORT_COMPONENT_H_ */