adc.h 82 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for ADC
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \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");
  15. * you may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License 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,
  22. * WITHOUT 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. * \license_stop
  27. *
  28. */
  29. /* file generated from device description version 2018-05-30T11:07:17Z */
  30. #ifndef _SAML11_ADC_COMPONENT_H_
  31. #define _SAML11_ADC_COMPONENT_H_
  32. #define _SAML11_ADC_COMPONENT_ /**< \deprecated Backward compatibility for ASF */
  33. /** \addtogroup SAML_SAML11 Analog Digital Converter
  34. * @{
  35. */
  36. /* ========================================================================== */
  37. /** SOFTWARE API DEFINITION FOR ADC */
  38. /* ========================================================================== */
  39. #define ADC_U2247 /**< (ADC) Module ID */
  40. #define REV_ADC 0x240 /**< (ADC) Module revision */
  41. /* -------- ADC_CTRLA : (ADC Offset: 0x00) (R/W 8) Control A -------- */
  42. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  43. typedef union {
  44. struct {
  45. uint8_t SWRST:1; /**< bit: 0 Software Reset */
  46. uint8_t ENABLE:1; /**< bit: 1 Enable */
  47. uint8_t :3; /**< bit: 2..4 Reserved */
  48. uint8_t SLAVEEN:1; /**< bit: 5 Slave Enable */
  49. uint8_t RUNSTDBY:1; /**< bit: 6 Run During Standby */
  50. uint8_t ONDEMAND:1; /**< bit: 7 On Demand Control */
  51. } bit; /**< Structure used for bit access */
  52. uint8_t reg; /**< Type used for register access */
  53. } ADC_CTRLA_Type;
  54. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  55. #define ADC_CTRLA_OFFSET (0x00) /**< (ADC_CTRLA) Control A Offset */
  56. #define ADC_CTRLA_RESETVALUE _U_(0x00) /**< (ADC_CTRLA) Control A Reset Value */
  57. #define ADC_CTRLA_SWRST_Pos 0 /**< (ADC_CTRLA) Software Reset Position */
  58. #define ADC_CTRLA_SWRST_Msk (_U_(0x1) << ADC_CTRLA_SWRST_Pos) /**< (ADC_CTRLA) Software Reset Mask */
  59. #define ADC_CTRLA_SWRST ADC_CTRLA_SWRST_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLA_SWRST_Msk instead */
  60. #define ADC_CTRLA_ENABLE_Pos 1 /**< (ADC_CTRLA) Enable Position */
  61. #define ADC_CTRLA_ENABLE_Msk (_U_(0x1) << ADC_CTRLA_ENABLE_Pos) /**< (ADC_CTRLA) Enable Mask */
  62. #define ADC_CTRLA_ENABLE ADC_CTRLA_ENABLE_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLA_ENABLE_Msk instead */
  63. #define ADC_CTRLA_SLAVEEN_Pos 5 /**< (ADC_CTRLA) Slave Enable Position */
  64. #define ADC_CTRLA_SLAVEEN_Msk (_U_(0x1) << ADC_CTRLA_SLAVEEN_Pos) /**< (ADC_CTRLA) Slave Enable Mask */
  65. #define ADC_CTRLA_SLAVEEN ADC_CTRLA_SLAVEEN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLA_SLAVEEN_Msk instead */
  66. #define ADC_CTRLA_RUNSTDBY_Pos 6 /**< (ADC_CTRLA) Run During Standby Position */
  67. #define ADC_CTRLA_RUNSTDBY_Msk (_U_(0x1) << ADC_CTRLA_RUNSTDBY_Pos) /**< (ADC_CTRLA) Run During Standby Mask */
  68. #define ADC_CTRLA_RUNSTDBY ADC_CTRLA_RUNSTDBY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLA_RUNSTDBY_Msk instead */
  69. #define ADC_CTRLA_ONDEMAND_Pos 7 /**< (ADC_CTRLA) On Demand Control Position */
  70. #define ADC_CTRLA_ONDEMAND_Msk (_U_(0x1) << ADC_CTRLA_ONDEMAND_Pos) /**< (ADC_CTRLA) On Demand Control Mask */
  71. #define ADC_CTRLA_ONDEMAND ADC_CTRLA_ONDEMAND_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLA_ONDEMAND_Msk instead */
  72. #define ADC_CTRLA_MASK _U_(0xE3) /**< \deprecated (ADC_CTRLA) Register MASK (Use ADC_CTRLA_Msk instead) */
  73. #define ADC_CTRLA_Msk _U_(0xE3) /**< (ADC_CTRLA) Register Mask */
  74. /* -------- ADC_CTRLB : (ADC Offset: 0x01) (R/W 8) Control B -------- */
  75. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  76. typedef union {
  77. struct {
  78. uint8_t PRESCALER:3; /**< bit: 0..2 Prescaler Configuration */
  79. uint8_t :5; /**< bit: 3..7 Reserved */
  80. } bit; /**< Structure used for bit access */
  81. uint8_t reg; /**< Type used for register access */
  82. } ADC_CTRLB_Type;
  83. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  84. #define ADC_CTRLB_OFFSET (0x01) /**< (ADC_CTRLB) Control B Offset */
  85. #define ADC_CTRLB_RESETVALUE _U_(0x00) /**< (ADC_CTRLB) Control B Reset Value */
  86. #define ADC_CTRLB_PRESCALER_Pos 0 /**< (ADC_CTRLB) Prescaler Configuration Position */
  87. #define ADC_CTRLB_PRESCALER_Msk (_U_(0x7) << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Prescaler Configuration Mask */
  88. #define ADC_CTRLB_PRESCALER(value) (ADC_CTRLB_PRESCALER_Msk & ((value) << ADC_CTRLB_PRESCALER_Pos))
  89. #define ADC_CTRLB_PRESCALER_DIV2_Val _U_(0x0) /**< (ADC_CTRLB) Peripheral clock divided by 2 */
  90. #define ADC_CTRLB_PRESCALER_DIV4_Val _U_(0x1) /**< (ADC_CTRLB) Peripheral clock divided by 4 */
  91. #define ADC_CTRLB_PRESCALER_DIV8_Val _U_(0x2) /**< (ADC_CTRLB) Peripheral clock divided by 8 */
  92. #define ADC_CTRLB_PRESCALER_DIV16_Val _U_(0x3) /**< (ADC_CTRLB) Peripheral clock divided by 16 */
  93. #define ADC_CTRLB_PRESCALER_DIV32_Val _U_(0x4) /**< (ADC_CTRLB) Peripheral clock divided by 32 */
  94. #define ADC_CTRLB_PRESCALER_DIV64_Val _U_(0x5) /**< (ADC_CTRLB) Peripheral clock divided by 64 */
  95. #define ADC_CTRLB_PRESCALER_DIV128_Val _U_(0x6) /**< (ADC_CTRLB) Peripheral clock divided by 128 */
  96. #define ADC_CTRLB_PRESCALER_DIV256_Val _U_(0x7) /**< (ADC_CTRLB) Peripheral clock divided by 256 */
  97. #define ADC_CTRLB_PRESCALER_DIV2 (ADC_CTRLB_PRESCALER_DIV2_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 2 Position */
  98. #define ADC_CTRLB_PRESCALER_DIV4 (ADC_CTRLB_PRESCALER_DIV4_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 4 Position */
  99. #define ADC_CTRLB_PRESCALER_DIV8 (ADC_CTRLB_PRESCALER_DIV8_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 8 Position */
  100. #define ADC_CTRLB_PRESCALER_DIV16 (ADC_CTRLB_PRESCALER_DIV16_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 16 Position */
  101. #define ADC_CTRLB_PRESCALER_DIV32 (ADC_CTRLB_PRESCALER_DIV32_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 32 Position */
  102. #define ADC_CTRLB_PRESCALER_DIV64 (ADC_CTRLB_PRESCALER_DIV64_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 64 Position */
  103. #define ADC_CTRLB_PRESCALER_DIV128 (ADC_CTRLB_PRESCALER_DIV128_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 128 Position */
  104. #define ADC_CTRLB_PRESCALER_DIV256 (ADC_CTRLB_PRESCALER_DIV256_Val << ADC_CTRLB_PRESCALER_Pos) /**< (ADC_CTRLB) Peripheral clock divided by 256 Position */
  105. #define ADC_CTRLB_MASK _U_(0x07) /**< \deprecated (ADC_CTRLB) Register MASK (Use ADC_CTRLB_Msk instead) */
  106. #define ADC_CTRLB_Msk _U_(0x07) /**< (ADC_CTRLB) Register Mask */
  107. /* -------- ADC_REFCTRL : (ADC Offset: 0x02) (R/W 8) Reference Control -------- */
  108. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  109. typedef union {
  110. struct {
  111. uint8_t REFSEL:4; /**< bit: 0..3 Reference Selection */
  112. uint8_t :3; /**< bit: 4..6 Reserved */
  113. uint8_t REFCOMP:1; /**< bit: 7 Reference Buffer Offset Compensation Enable */
  114. } bit; /**< Structure used for bit access */
  115. uint8_t reg; /**< Type used for register access */
  116. } ADC_REFCTRL_Type;
  117. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  118. #define ADC_REFCTRL_OFFSET (0x02) /**< (ADC_REFCTRL) Reference Control Offset */
  119. #define ADC_REFCTRL_RESETVALUE _U_(0x00) /**< (ADC_REFCTRL) Reference Control Reset Value */
  120. #define ADC_REFCTRL_REFSEL_Pos 0 /**< (ADC_REFCTRL) Reference Selection Position */
  121. #define ADC_REFCTRL_REFSEL_Msk (_U_(0xF) << ADC_REFCTRL_REFSEL_Pos) /**< (ADC_REFCTRL) Reference Selection Mask */
  122. #define ADC_REFCTRL_REFSEL(value) (ADC_REFCTRL_REFSEL_Msk & ((value) << ADC_REFCTRL_REFSEL_Pos))
  123. #define ADC_REFCTRL_REFSEL_INTREF_Val _U_(0x0) /**< (ADC_REFCTRL) Internal Bandgap Reference */
  124. #define ADC_REFCTRL_REFSEL_INTVCC0_Val _U_(0x1) /**< (ADC_REFCTRL) 1/1.6 VDDANA */
  125. #define ADC_REFCTRL_REFSEL_INTVCC1_Val _U_(0x2) /**< (ADC_REFCTRL) 1/2 VDDANA */
  126. #define ADC_REFCTRL_REFSEL_AREFA_Val _U_(0x3) /**< (ADC_REFCTRL) External Reference */
  127. #define ADC_REFCTRL_REFSEL_AREFB_Val _U_(0x4) /**< (ADC_REFCTRL) External Reference */
  128. #define ADC_REFCTRL_REFSEL_INTVCC2_Val _U_(0x5) /**< (ADC_REFCTRL) VCCANA */
  129. #define ADC_REFCTRL_REFSEL_INTREF (ADC_REFCTRL_REFSEL_INTREF_Val << ADC_REFCTRL_REFSEL_Pos) /**< (ADC_REFCTRL) Internal Bandgap Reference Position */
  130. #define ADC_REFCTRL_REFSEL_INTVCC0 (ADC_REFCTRL_REFSEL_INTVCC0_Val << ADC_REFCTRL_REFSEL_Pos) /**< (ADC_REFCTRL) 1/1.6 VDDANA Position */
  131. #define ADC_REFCTRL_REFSEL_INTVCC1 (ADC_REFCTRL_REFSEL_INTVCC1_Val << ADC_REFCTRL_REFSEL_Pos) /**< (ADC_REFCTRL) 1/2 VDDANA Position */
  132. #define ADC_REFCTRL_REFSEL_AREFA (ADC_REFCTRL_REFSEL_AREFA_Val << ADC_REFCTRL_REFSEL_Pos) /**< (ADC_REFCTRL) External Reference Position */
  133. #define ADC_REFCTRL_REFSEL_AREFB (ADC_REFCTRL_REFSEL_AREFB_Val << ADC_REFCTRL_REFSEL_Pos) /**< (ADC_REFCTRL) External Reference Position */
  134. #define ADC_REFCTRL_REFSEL_INTVCC2 (ADC_REFCTRL_REFSEL_INTVCC2_Val << ADC_REFCTRL_REFSEL_Pos) /**< (ADC_REFCTRL) VCCANA Position */
  135. #define ADC_REFCTRL_REFCOMP_Pos 7 /**< (ADC_REFCTRL) Reference Buffer Offset Compensation Enable Position */
  136. #define ADC_REFCTRL_REFCOMP_Msk (_U_(0x1) << ADC_REFCTRL_REFCOMP_Pos) /**< (ADC_REFCTRL) Reference Buffer Offset Compensation Enable Mask */
  137. #define ADC_REFCTRL_REFCOMP ADC_REFCTRL_REFCOMP_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_REFCTRL_REFCOMP_Msk instead */
  138. #define ADC_REFCTRL_MASK _U_(0x8F) /**< \deprecated (ADC_REFCTRL) Register MASK (Use ADC_REFCTRL_Msk instead) */
  139. #define ADC_REFCTRL_Msk _U_(0x8F) /**< (ADC_REFCTRL) Register Mask */
  140. /* -------- ADC_EVCTRL : (ADC Offset: 0x03) (R/W 8) Event Control -------- */
  141. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  142. typedef union {
  143. struct {
  144. uint8_t FLUSHEI:1; /**< bit: 0 Flush Event Input Enable */
  145. uint8_t STARTEI:1; /**< bit: 1 Start Conversion Event Input Enable */
  146. uint8_t FLUSHINV:1; /**< bit: 2 Flush Event Invert Enable */
  147. uint8_t STARTINV:1; /**< bit: 3 Satrt Event Invert Enable */
  148. uint8_t RESRDYEO:1; /**< bit: 4 Result Ready Event Out */
  149. uint8_t WINMONEO:1; /**< bit: 5 Window Monitor Event Out */
  150. uint8_t :2; /**< bit: 6..7 Reserved */
  151. } bit; /**< Structure used for bit access */
  152. uint8_t reg; /**< Type used for register access */
  153. } ADC_EVCTRL_Type;
  154. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  155. #define ADC_EVCTRL_OFFSET (0x03) /**< (ADC_EVCTRL) Event Control Offset */
  156. #define ADC_EVCTRL_RESETVALUE _U_(0x00) /**< (ADC_EVCTRL) Event Control Reset Value */
  157. #define ADC_EVCTRL_FLUSHEI_Pos 0 /**< (ADC_EVCTRL) Flush Event Input Enable Position */
  158. #define ADC_EVCTRL_FLUSHEI_Msk (_U_(0x1) << ADC_EVCTRL_FLUSHEI_Pos) /**< (ADC_EVCTRL) Flush Event Input Enable Mask */
  159. #define ADC_EVCTRL_FLUSHEI ADC_EVCTRL_FLUSHEI_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_EVCTRL_FLUSHEI_Msk instead */
  160. #define ADC_EVCTRL_STARTEI_Pos 1 /**< (ADC_EVCTRL) Start Conversion Event Input Enable Position */
  161. #define ADC_EVCTRL_STARTEI_Msk (_U_(0x1) << ADC_EVCTRL_STARTEI_Pos) /**< (ADC_EVCTRL) Start Conversion Event Input Enable Mask */
  162. #define ADC_EVCTRL_STARTEI ADC_EVCTRL_STARTEI_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_EVCTRL_STARTEI_Msk instead */
  163. #define ADC_EVCTRL_FLUSHINV_Pos 2 /**< (ADC_EVCTRL) Flush Event Invert Enable Position */
  164. #define ADC_EVCTRL_FLUSHINV_Msk (_U_(0x1) << ADC_EVCTRL_FLUSHINV_Pos) /**< (ADC_EVCTRL) Flush Event Invert Enable Mask */
  165. #define ADC_EVCTRL_FLUSHINV ADC_EVCTRL_FLUSHINV_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_EVCTRL_FLUSHINV_Msk instead */
  166. #define ADC_EVCTRL_STARTINV_Pos 3 /**< (ADC_EVCTRL) Satrt Event Invert Enable Position */
  167. #define ADC_EVCTRL_STARTINV_Msk (_U_(0x1) << ADC_EVCTRL_STARTINV_Pos) /**< (ADC_EVCTRL) Satrt Event Invert Enable Mask */
  168. #define ADC_EVCTRL_STARTINV ADC_EVCTRL_STARTINV_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_EVCTRL_STARTINV_Msk instead */
  169. #define ADC_EVCTRL_RESRDYEO_Pos 4 /**< (ADC_EVCTRL) Result Ready Event Out Position */
  170. #define ADC_EVCTRL_RESRDYEO_Msk (_U_(0x1) << ADC_EVCTRL_RESRDYEO_Pos) /**< (ADC_EVCTRL) Result Ready Event Out Mask */
  171. #define ADC_EVCTRL_RESRDYEO ADC_EVCTRL_RESRDYEO_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_EVCTRL_RESRDYEO_Msk instead */
  172. #define ADC_EVCTRL_WINMONEO_Pos 5 /**< (ADC_EVCTRL) Window Monitor Event Out Position */
  173. #define ADC_EVCTRL_WINMONEO_Msk (_U_(0x1) << ADC_EVCTRL_WINMONEO_Pos) /**< (ADC_EVCTRL) Window Monitor Event Out Mask */
  174. #define ADC_EVCTRL_WINMONEO ADC_EVCTRL_WINMONEO_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_EVCTRL_WINMONEO_Msk instead */
  175. #define ADC_EVCTRL_MASK _U_(0x3F) /**< \deprecated (ADC_EVCTRL) Register MASK (Use ADC_EVCTRL_Msk instead) */
  176. #define ADC_EVCTRL_Msk _U_(0x3F) /**< (ADC_EVCTRL) Register Mask */
  177. /* -------- ADC_INTENCLR : (ADC Offset: 0x04) (R/W 8) Interrupt Enable Clear -------- */
  178. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  179. typedef union {
  180. struct {
  181. uint8_t RESRDY:1; /**< bit: 0 Result Ready Interrupt Disable */
  182. uint8_t OVERRUN:1; /**< bit: 1 Overrun Interrupt Disable */
  183. uint8_t WINMON:1; /**< bit: 2 Window Monitor Interrupt Disable */
  184. uint8_t :5; /**< bit: 3..7 Reserved */
  185. } bit; /**< Structure used for bit access */
  186. uint8_t reg; /**< Type used for register access */
  187. } ADC_INTENCLR_Type;
  188. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  189. #define ADC_INTENCLR_OFFSET (0x04) /**< (ADC_INTENCLR) Interrupt Enable Clear Offset */
  190. #define ADC_INTENCLR_RESETVALUE _U_(0x00) /**< (ADC_INTENCLR) Interrupt Enable Clear Reset Value */
  191. #define ADC_INTENCLR_RESRDY_Pos 0 /**< (ADC_INTENCLR) Result Ready Interrupt Disable Position */
  192. #define ADC_INTENCLR_RESRDY_Msk (_U_(0x1) << ADC_INTENCLR_RESRDY_Pos) /**< (ADC_INTENCLR) Result Ready Interrupt Disable Mask */
  193. #define ADC_INTENCLR_RESRDY ADC_INTENCLR_RESRDY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTENCLR_RESRDY_Msk instead */
  194. #define ADC_INTENCLR_OVERRUN_Pos 1 /**< (ADC_INTENCLR) Overrun Interrupt Disable Position */
  195. #define ADC_INTENCLR_OVERRUN_Msk (_U_(0x1) << ADC_INTENCLR_OVERRUN_Pos) /**< (ADC_INTENCLR) Overrun Interrupt Disable Mask */
  196. #define ADC_INTENCLR_OVERRUN ADC_INTENCLR_OVERRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTENCLR_OVERRUN_Msk instead */
  197. #define ADC_INTENCLR_WINMON_Pos 2 /**< (ADC_INTENCLR) Window Monitor Interrupt Disable Position */
  198. #define ADC_INTENCLR_WINMON_Msk (_U_(0x1) << ADC_INTENCLR_WINMON_Pos) /**< (ADC_INTENCLR) Window Monitor Interrupt Disable Mask */
  199. #define ADC_INTENCLR_WINMON ADC_INTENCLR_WINMON_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTENCLR_WINMON_Msk instead */
  200. #define ADC_INTENCLR_MASK _U_(0x07) /**< \deprecated (ADC_INTENCLR) Register MASK (Use ADC_INTENCLR_Msk instead) */
  201. #define ADC_INTENCLR_Msk _U_(0x07) /**< (ADC_INTENCLR) Register Mask */
  202. /* -------- ADC_INTENSET : (ADC Offset: 0x05) (R/W 8) Interrupt Enable Set -------- */
  203. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  204. typedef union {
  205. struct {
  206. uint8_t RESRDY:1; /**< bit: 0 Result Ready Interrupt Enable */
  207. uint8_t OVERRUN:1; /**< bit: 1 Overrun Interrupt Enable */
  208. uint8_t WINMON:1; /**< bit: 2 Window Monitor Interrupt Enable */
  209. uint8_t :5; /**< bit: 3..7 Reserved */
  210. } bit; /**< Structure used for bit access */
  211. uint8_t reg; /**< Type used for register access */
  212. } ADC_INTENSET_Type;
  213. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  214. #define ADC_INTENSET_OFFSET (0x05) /**< (ADC_INTENSET) Interrupt Enable Set Offset */
  215. #define ADC_INTENSET_RESETVALUE _U_(0x00) /**< (ADC_INTENSET) Interrupt Enable Set Reset Value */
  216. #define ADC_INTENSET_RESRDY_Pos 0 /**< (ADC_INTENSET) Result Ready Interrupt Enable Position */
  217. #define ADC_INTENSET_RESRDY_Msk (_U_(0x1) << ADC_INTENSET_RESRDY_Pos) /**< (ADC_INTENSET) Result Ready Interrupt Enable Mask */
  218. #define ADC_INTENSET_RESRDY ADC_INTENSET_RESRDY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTENSET_RESRDY_Msk instead */
  219. #define ADC_INTENSET_OVERRUN_Pos 1 /**< (ADC_INTENSET) Overrun Interrupt Enable Position */
  220. #define ADC_INTENSET_OVERRUN_Msk (_U_(0x1) << ADC_INTENSET_OVERRUN_Pos) /**< (ADC_INTENSET) Overrun Interrupt Enable Mask */
  221. #define ADC_INTENSET_OVERRUN ADC_INTENSET_OVERRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTENSET_OVERRUN_Msk instead */
  222. #define ADC_INTENSET_WINMON_Pos 2 /**< (ADC_INTENSET) Window Monitor Interrupt Enable Position */
  223. #define ADC_INTENSET_WINMON_Msk (_U_(0x1) << ADC_INTENSET_WINMON_Pos) /**< (ADC_INTENSET) Window Monitor Interrupt Enable Mask */
  224. #define ADC_INTENSET_WINMON ADC_INTENSET_WINMON_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTENSET_WINMON_Msk instead */
  225. #define ADC_INTENSET_MASK _U_(0x07) /**< \deprecated (ADC_INTENSET) Register MASK (Use ADC_INTENSET_Msk instead) */
  226. #define ADC_INTENSET_Msk _U_(0x07) /**< (ADC_INTENSET) Register Mask */
  227. /* -------- ADC_INTFLAG : (ADC Offset: 0x06) (R/W 8) Interrupt Flag Status and Clear -------- */
  228. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  229. typedef union { // __I to avoid read-modify-write on write-to-clear register
  230. struct {
  231. __I uint8_t RESRDY:1; /**< bit: 0 Result Ready Interrupt Flag */
  232. __I uint8_t OVERRUN:1; /**< bit: 1 Overrun Interrupt Flag */
  233. __I uint8_t WINMON:1; /**< bit: 2 Window Monitor Interrupt Flag */
  234. __I uint8_t :5; /**< bit: 3..7 Reserved */
  235. } bit; /**< Structure used for bit access */
  236. uint8_t reg; /**< Type used for register access */
  237. } ADC_INTFLAG_Type;
  238. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  239. #define ADC_INTFLAG_OFFSET (0x06) /**< (ADC_INTFLAG) Interrupt Flag Status and Clear Offset */
  240. #define ADC_INTFLAG_RESETVALUE _U_(0x00) /**< (ADC_INTFLAG) Interrupt Flag Status and Clear Reset Value */
  241. #define ADC_INTFLAG_RESRDY_Pos 0 /**< (ADC_INTFLAG) Result Ready Interrupt Flag Position */
  242. #define ADC_INTFLAG_RESRDY_Msk (_U_(0x1) << ADC_INTFLAG_RESRDY_Pos) /**< (ADC_INTFLAG) Result Ready Interrupt Flag Mask */
  243. #define ADC_INTFLAG_RESRDY ADC_INTFLAG_RESRDY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTFLAG_RESRDY_Msk instead */
  244. #define ADC_INTFLAG_OVERRUN_Pos 1 /**< (ADC_INTFLAG) Overrun Interrupt Flag Position */
  245. #define ADC_INTFLAG_OVERRUN_Msk (_U_(0x1) << ADC_INTFLAG_OVERRUN_Pos) /**< (ADC_INTFLAG) Overrun Interrupt Flag Mask */
  246. #define ADC_INTFLAG_OVERRUN ADC_INTFLAG_OVERRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTFLAG_OVERRUN_Msk instead */
  247. #define ADC_INTFLAG_WINMON_Pos 2 /**< (ADC_INTFLAG) Window Monitor Interrupt Flag Position */
  248. #define ADC_INTFLAG_WINMON_Msk (_U_(0x1) << ADC_INTFLAG_WINMON_Pos) /**< (ADC_INTFLAG) Window Monitor Interrupt Flag Mask */
  249. #define ADC_INTFLAG_WINMON ADC_INTFLAG_WINMON_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_INTFLAG_WINMON_Msk instead */
  250. #define ADC_INTFLAG_MASK _U_(0x07) /**< \deprecated (ADC_INTFLAG) Register MASK (Use ADC_INTFLAG_Msk instead) */
  251. #define ADC_INTFLAG_Msk _U_(0x07) /**< (ADC_INTFLAG) Register Mask */
  252. /* -------- ADC_SEQSTATUS : (ADC Offset: 0x07) (R/ 8) Sequence Status -------- */
  253. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  254. typedef union {
  255. struct {
  256. uint8_t SEQSTATE:5; /**< bit: 0..4 Sequence State */
  257. uint8_t :2; /**< bit: 5..6 Reserved */
  258. uint8_t SEQBUSY:1; /**< bit: 7 Sequence Busy */
  259. } bit; /**< Structure used for bit access */
  260. uint8_t reg; /**< Type used for register access */
  261. } ADC_SEQSTATUS_Type;
  262. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  263. #define ADC_SEQSTATUS_OFFSET (0x07) /**< (ADC_SEQSTATUS) Sequence Status Offset */
  264. #define ADC_SEQSTATUS_RESETVALUE _U_(0x00) /**< (ADC_SEQSTATUS) Sequence Status Reset Value */
  265. #define ADC_SEQSTATUS_SEQSTATE_Pos 0 /**< (ADC_SEQSTATUS) Sequence State Position */
  266. #define ADC_SEQSTATUS_SEQSTATE_Msk (_U_(0x1F) << ADC_SEQSTATUS_SEQSTATE_Pos) /**< (ADC_SEQSTATUS) Sequence State Mask */
  267. #define ADC_SEQSTATUS_SEQSTATE(value) (ADC_SEQSTATUS_SEQSTATE_Msk & ((value) << ADC_SEQSTATUS_SEQSTATE_Pos))
  268. #define ADC_SEQSTATUS_SEQBUSY_Pos 7 /**< (ADC_SEQSTATUS) Sequence Busy Position */
  269. #define ADC_SEQSTATUS_SEQBUSY_Msk (_U_(0x1) << ADC_SEQSTATUS_SEQBUSY_Pos) /**< (ADC_SEQSTATUS) Sequence Busy Mask */
  270. #define ADC_SEQSTATUS_SEQBUSY ADC_SEQSTATUS_SEQBUSY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SEQSTATUS_SEQBUSY_Msk instead */
  271. #define ADC_SEQSTATUS_MASK _U_(0x9F) /**< \deprecated (ADC_SEQSTATUS) Register MASK (Use ADC_SEQSTATUS_Msk instead) */
  272. #define ADC_SEQSTATUS_Msk _U_(0x9F) /**< (ADC_SEQSTATUS) Register Mask */
  273. /* -------- ADC_INPUTCTRL : (ADC Offset: 0x08) (R/W 16) Input Control -------- */
  274. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  275. typedef union {
  276. struct {
  277. uint16_t MUXPOS:5; /**< bit: 0..4 Positive Mux Input Selection */
  278. uint16_t :3; /**< bit: 5..7 Reserved */
  279. uint16_t MUXNEG:5; /**< bit: 8..12 Negative Mux Input Selection */
  280. uint16_t :3; /**< bit: 13..15 Reserved */
  281. } bit; /**< Structure used for bit access */
  282. uint16_t reg; /**< Type used for register access */
  283. } ADC_INPUTCTRL_Type;
  284. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  285. #define ADC_INPUTCTRL_OFFSET (0x08) /**< (ADC_INPUTCTRL) Input Control Offset */
  286. #define ADC_INPUTCTRL_RESETVALUE _U_(0x00) /**< (ADC_INPUTCTRL) Input Control Reset Value */
  287. #define ADC_INPUTCTRL_MUXPOS_Pos 0 /**< (ADC_INPUTCTRL) Positive Mux Input Selection Position */
  288. #define ADC_INPUTCTRL_MUXPOS_Msk (_U_(0x1F) << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) Positive Mux Input Selection Mask */
  289. #define ADC_INPUTCTRL_MUXPOS(value) (ADC_INPUTCTRL_MUXPOS_Msk & ((value) << ADC_INPUTCTRL_MUXPOS_Pos))
  290. #define ADC_INPUTCTRL_MUXPOS_AIN0_Val _U_(0x0) /**< (ADC_INPUTCTRL) ADC AIN0 Pin */
  291. #define ADC_INPUTCTRL_MUXPOS_AIN1_Val _U_(0x1) /**< (ADC_INPUTCTRL) ADC AIN1 Pin */
  292. #define ADC_INPUTCTRL_MUXPOS_AIN2_Val _U_(0x2) /**< (ADC_INPUTCTRL) ADC AIN2 Pin */
  293. #define ADC_INPUTCTRL_MUXPOS_AIN3_Val _U_(0x3) /**< (ADC_INPUTCTRL) ADC AIN3 Pin */
  294. #define ADC_INPUTCTRL_MUXPOS_AIN4_Val _U_(0x4) /**< (ADC_INPUTCTRL) ADC AIN4 Pin */
  295. #define ADC_INPUTCTRL_MUXPOS_AIN5_Val _U_(0x5) /**< (ADC_INPUTCTRL) ADC AIN5 Pin */
  296. #define ADC_INPUTCTRL_MUXPOS_AIN6_Val _U_(0x6) /**< (ADC_INPUTCTRL) ADC AIN6 Pin */
  297. #define ADC_INPUTCTRL_MUXPOS_AIN7_Val _U_(0x7) /**< (ADC_INPUTCTRL) ADC AIN7 Pin */
  298. #define ADC_INPUTCTRL_MUXPOS_AIN8_Val _U_(0x8) /**< (ADC_INPUTCTRL) ADC AIN8 Pin */
  299. #define ADC_INPUTCTRL_MUXPOS_AIN9_Val _U_(0x9) /**< (ADC_INPUTCTRL) ADC AIN9 Pin */
  300. #define ADC_INPUTCTRL_MUXPOS_AIN10_Val _U_(0xA) /**< (ADC_INPUTCTRL) ADC AIN10 Pin */
  301. #define ADC_INPUTCTRL_MUXPOS_AIN11_Val _U_(0xB) /**< (ADC_INPUTCTRL) ADC AIN11 Pin */
  302. #define ADC_INPUTCTRL_MUXPOS_AIN12_Val _U_(0xC) /**< (ADC_INPUTCTRL) ADC AIN12 Pin */
  303. #define ADC_INPUTCTRL_MUXPOS_AIN13_Val _U_(0xD) /**< (ADC_INPUTCTRL) ADC AIN13 Pin */
  304. #define ADC_INPUTCTRL_MUXPOS_AIN14_Val _U_(0xE) /**< (ADC_INPUTCTRL) ADC AIN14 Pin */
  305. #define ADC_INPUTCTRL_MUXPOS_AIN15_Val _U_(0xF) /**< (ADC_INPUTCTRL) ADC AIN15 Pin */
  306. #define ADC_INPUTCTRL_MUXPOS_AIN16_Val _U_(0x10) /**< (ADC_INPUTCTRL) ADC AIN16 Pin */
  307. #define ADC_INPUTCTRL_MUXPOS_AIN17_Val _U_(0x11) /**< (ADC_INPUTCTRL) ADC AIN17 Pin */
  308. #define ADC_INPUTCTRL_MUXPOS_AIN18_Val _U_(0x12) /**< (ADC_INPUTCTRL) ADC AIN18 Pin */
  309. #define ADC_INPUTCTRL_MUXPOS_AIN19_Val _U_(0x13) /**< (ADC_INPUTCTRL) ADC AIN19 Pin */
  310. #define ADC_INPUTCTRL_MUXPOS_AIN20_Val _U_(0x14) /**< (ADC_INPUTCTRL) ADC AIN20 Pin */
  311. #define ADC_INPUTCTRL_MUXPOS_AIN21_Val _U_(0x15) /**< (ADC_INPUTCTRL) ADC AIN21 Pin */
  312. #define ADC_INPUTCTRL_MUXPOS_AIN22_Val _U_(0x16) /**< (ADC_INPUTCTRL) ADC AIN22 Pin */
  313. #define ADC_INPUTCTRL_MUXPOS_AIN23_Val _U_(0x17) /**< (ADC_INPUTCTRL) ADC AIN23 Pin */
  314. #define ADC_INPUTCTRL_MUXPOS_TEMP_Val _U_(0x18) /**< (ADC_INPUTCTRL) Temperature Sensor */
  315. #define ADC_INPUTCTRL_MUXPOS_BANDGAP_Val _U_(0x19) /**< (ADC_INPUTCTRL) Bandgap Voltage */
  316. #define ADC_INPUTCTRL_MUXPOS_SCALEDCOREVCC_Val _U_(0x1A) /**< (ADC_INPUTCTRL) 1/4 Scaled Core Supply */
  317. #define ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC_Val _U_(0x1B) /**< (ADC_INPUTCTRL) 1/4 Scaled I/O Supply */
  318. #define ADC_INPUTCTRL_MUXPOS_DAC_Val _U_(0x1C) /**< (ADC_INPUTCTRL) DAC Output */
  319. #define ADC_INPUTCTRL_MUXPOS_SCALEDVBAT_Val _U_(0x1D) /**< (ADC_INPUTCTRL) 1/4 Scaled VBAT Supply */
  320. #define ADC_INPUTCTRL_MUXPOS_OPAMP01_Val _U_(0x1E) /**< (ADC_INPUTCTRL) OPAMP0 or OPAMP1 output */
  321. #define ADC_INPUTCTRL_MUXPOS_OPAMP2_Val _U_(0x1F) /**< (ADC_INPUTCTRL) OPAMP2 output */
  322. #define ADC_INPUTCTRL_MUXPOS_AIN0 (ADC_INPUTCTRL_MUXPOS_AIN0_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN0 Pin Position */
  323. #define ADC_INPUTCTRL_MUXPOS_AIN1 (ADC_INPUTCTRL_MUXPOS_AIN1_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN1 Pin Position */
  324. #define ADC_INPUTCTRL_MUXPOS_AIN2 (ADC_INPUTCTRL_MUXPOS_AIN2_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN2 Pin Position */
  325. #define ADC_INPUTCTRL_MUXPOS_AIN3 (ADC_INPUTCTRL_MUXPOS_AIN3_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN3 Pin Position */
  326. #define ADC_INPUTCTRL_MUXPOS_AIN4 (ADC_INPUTCTRL_MUXPOS_AIN4_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN4 Pin Position */
  327. #define ADC_INPUTCTRL_MUXPOS_AIN5 (ADC_INPUTCTRL_MUXPOS_AIN5_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN5 Pin Position */
  328. #define ADC_INPUTCTRL_MUXPOS_AIN6 (ADC_INPUTCTRL_MUXPOS_AIN6_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN6 Pin Position */
  329. #define ADC_INPUTCTRL_MUXPOS_AIN7 (ADC_INPUTCTRL_MUXPOS_AIN7_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN7 Pin Position */
  330. #define ADC_INPUTCTRL_MUXPOS_AIN8 (ADC_INPUTCTRL_MUXPOS_AIN8_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN8 Pin Position */
  331. #define ADC_INPUTCTRL_MUXPOS_AIN9 (ADC_INPUTCTRL_MUXPOS_AIN9_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN9 Pin Position */
  332. #define ADC_INPUTCTRL_MUXPOS_AIN10 (ADC_INPUTCTRL_MUXPOS_AIN10_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN10 Pin Position */
  333. #define ADC_INPUTCTRL_MUXPOS_AIN11 (ADC_INPUTCTRL_MUXPOS_AIN11_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN11 Pin Position */
  334. #define ADC_INPUTCTRL_MUXPOS_AIN12 (ADC_INPUTCTRL_MUXPOS_AIN12_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN12 Pin Position */
  335. #define ADC_INPUTCTRL_MUXPOS_AIN13 (ADC_INPUTCTRL_MUXPOS_AIN13_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN13 Pin Position */
  336. #define ADC_INPUTCTRL_MUXPOS_AIN14 (ADC_INPUTCTRL_MUXPOS_AIN14_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN14 Pin Position */
  337. #define ADC_INPUTCTRL_MUXPOS_AIN15 (ADC_INPUTCTRL_MUXPOS_AIN15_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN15 Pin Position */
  338. #define ADC_INPUTCTRL_MUXPOS_AIN16 (ADC_INPUTCTRL_MUXPOS_AIN16_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN16 Pin Position */
  339. #define ADC_INPUTCTRL_MUXPOS_AIN17 (ADC_INPUTCTRL_MUXPOS_AIN17_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN17 Pin Position */
  340. #define ADC_INPUTCTRL_MUXPOS_AIN18 (ADC_INPUTCTRL_MUXPOS_AIN18_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN18 Pin Position */
  341. #define ADC_INPUTCTRL_MUXPOS_AIN19 (ADC_INPUTCTRL_MUXPOS_AIN19_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN19 Pin Position */
  342. #define ADC_INPUTCTRL_MUXPOS_AIN20 (ADC_INPUTCTRL_MUXPOS_AIN20_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN20 Pin Position */
  343. #define ADC_INPUTCTRL_MUXPOS_AIN21 (ADC_INPUTCTRL_MUXPOS_AIN21_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN21 Pin Position */
  344. #define ADC_INPUTCTRL_MUXPOS_AIN22 (ADC_INPUTCTRL_MUXPOS_AIN22_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN22 Pin Position */
  345. #define ADC_INPUTCTRL_MUXPOS_AIN23 (ADC_INPUTCTRL_MUXPOS_AIN23_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) ADC AIN23 Pin Position */
  346. #define ADC_INPUTCTRL_MUXPOS_TEMP (ADC_INPUTCTRL_MUXPOS_TEMP_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) Temperature Sensor Position */
  347. #define ADC_INPUTCTRL_MUXPOS_BANDGAP (ADC_INPUTCTRL_MUXPOS_BANDGAP_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) Bandgap Voltage Position */
  348. #define ADC_INPUTCTRL_MUXPOS_SCALEDCOREVCC (ADC_INPUTCTRL_MUXPOS_SCALEDCOREVCC_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) 1/4 Scaled Core Supply Position */
  349. #define ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC (ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) 1/4 Scaled I/O Supply Position */
  350. #define ADC_INPUTCTRL_MUXPOS_DAC (ADC_INPUTCTRL_MUXPOS_DAC_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) DAC Output Position */
  351. #define ADC_INPUTCTRL_MUXPOS_SCALEDVBAT (ADC_INPUTCTRL_MUXPOS_SCALEDVBAT_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) 1/4 Scaled VBAT Supply Position */
  352. #define ADC_INPUTCTRL_MUXPOS_OPAMP01 (ADC_INPUTCTRL_MUXPOS_OPAMP01_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) OPAMP0 or OPAMP1 output Position */
  353. #define ADC_INPUTCTRL_MUXPOS_OPAMP2 (ADC_INPUTCTRL_MUXPOS_OPAMP2_Val << ADC_INPUTCTRL_MUXPOS_Pos) /**< (ADC_INPUTCTRL) OPAMP2 output Position */
  354. #define ADC_INPUTCTRL_MUXNEG_Pos 8 /**< (ADC_INPUTCTRL) Negative Mux Input Selection Position */
  355. #define ADC_INPUTCTRL_MUXNEG_Msk (_U_(0x1F) << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) Negative Mux Input Selection Mask */
  356. #define ADC_INPUTCTRL_MUXNEG(value) (ADC_INPUTCTRL_MUXNEG_Msk & ((value) << ADC_INPUTCTRL_MUXNEG_Pos))
  357. #define ADC_INPUTCTRL_MUXNEG_AIN0_Val _U_(0x0) /**< (ADC_INPUTCTRL) ADC AIN0 Pin */
  358. #define ADC_INPUTCTRL_MUXNEG_AIN1_Val _U_(0x1) /**< (ADC_INPUTCTRL) ADC AIN1 Pin */
  359. #define ADC_INPUTCTRL_MUXNEG_AIN2_Val _U_(0x2) /**< (ADC_INPUTCTRL) ADC AIN2 Pin */
  360. #define ADC_INPUTCTRL_MUXNEG_AIN3_Val _U_(0x3) /**< (ADC_INPUTCTRL) ADC AIN3 Pin */
  361. #define ADC_INPUTCTRL_MUXNEG_AIN4_Val _U_(0x4) /**< (ADC_INPUTCTRL) ADC AIN4 Pin */
  362. #define ADC_INPUTCTRL_MUXNEG_AIN5_Val _U_(0x5) /**< (ADC_INPUTCTRL) ADC AIN5 Pin */
  363. #define ADC_INPUTCTRL_MUXNEG_AIN6_Val _U_(0x6) /**< (ADC_INPUTCTRL) ADC AIN6 Pin */
  364. #define ADC_INPUTCTRL_MUXNEG_AIN7_Val _U_(0x7) /**< (ADC_INPUTCTRL) ADC AIN7 Pin */
  365. #define ADC_INPUTCTRL_MUXNEG_AIN0 (ADC_INPUTCTRL_MUXNEG_AIN0_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN0 Pin Position */
  366. #define ADC_INPUTCTRL_MUXNEG_AIN1 (ADC_INPUTCTRL_MUXNEG_AIN1_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN1 Pin Position */
  367. #define ADC_INPUTCTRL_MUXNEG_AIN2 (ADC_INPUTCTRL_MUXNEG_AIN2_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN2 Pin Position */
  368. #define ADC_INPUTCTRL_MUXNEG_AIN3 (ADC_INPUTCTRL_MUXNEG_AIN3_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN3 Pin Position */
  369. #define ADC_INPUTCTRL_MUXNEG_AIN4 (ADC_INPUTCTRL_MUXNEG_AIN4_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN4 Pin Position */
  370. #define ADC_INPUTCTRL_MUXNEG_AIN5 (ADC_INPUTCTRL_MUXNEG_AIN5_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN5 Pin Position */
  371. #define ADC_INPUTCTRL_MUXNEG_AIN6 (ADC_INPUTCTRL_MUXNEG_AIN6_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN6 Pin Position */
  372. #define ADC_INPUTCTRL_MUXNEG_AIN7 (ADC_INPUTCTRL_MUXNEG_AIN7_Val << ADC_INPUTCTRL_MUXNEG_Pos) /**< (ADC_INPUTCTRL) ADC AIN7 Pin Position */
  373. #define ADC_INPUTCTRL_MASK _U_(0x1F1F) /**< \deprecated (ADC_INPUTCTRL) Register MASK (Use ADC_INPUTCTRL_Msk instead) */
  374. #define ADC_INPUTCTRL_Msk _U_(0x1F1F) /**< (ADC_INPUTCTRL) Register Mask */
  375. /* -------- ADC_CTRLC : (ADC Offset: 0x0a) (R/W 16) Control C -------- */
  376. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  377. typedef union {
  378. struct {
  379. uint16_t DIFFMODE:1; /**< bit: 0 Differential Mode */
  380. uint16_t LEFTADJ:1; /**< bit: 1 Left-Adjusted Result */
  381. uint16_t FREERUN:1; /**< bit: 2 Free Running Mode */
  382. uint16_t CORREN:1; /**< bit: 3 Digital Correction Logic Enable */
  383. uint16_t RESSEL:2; /**< bit: 4..5 Conversion Result Resolution */
  384. uint16_t :1; /**< bit: 6 Reserved */
  385. uint16_t R2R:1; /**< bit: 7 Rail-to-Rail mode enable */
  386. uint16_t WINMODE:3; /**< bit: 8..10 Window Monitor Mode */
  387. uint16_t :1; /**< bit: 11 Reserved */
  388. uint16_t DUALSEL:2; /**< bit: 12..13 Dual Mode Trigger Selection */
  389. uint16_t :2; /**< bit: 14..15 Reserved */
  390. } bit; /**< Structure used for bit access */
  391. uint16_t reg; /**< Type used for register access */
  392. } ADC_CTRLC_Type;
  393. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  394. #define ADC_CTRLC_OFFSET (0x0A) /**< (ADC_CTRLC) Control C Offset */
  395. #define ADC_CTRLC_RESETVALUE _U_(0x00) /**< (ADC_CTRLC) Control C Reset Value */
  396. #define ADC_CTRLC_DIFFMODE_Pos 0 /**< (ADC_CTRLC) Differential Mode Position */
  397. #define ADC_CTRLC_DIFFMODE_Msk (_U_(0x1) << ADC_CTRLC_DIFFMODE_Pos) /**< (ADC_CTRLC) Differential Mode Mask */
  398. #define ADC_CTRLC_DIFFMODE ADC_CTRLC_DIFFMODE_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLC_DIFFMODE_Msk instead */
  399. #define ADC_CTRLC_LEFTADJ_Pos 1 /**< (ADC_CTRLC) Left-Adjusted Result Position */
  400. #define ADC_CTRLC_LEFTADJ_Msk (_U_(0x1) << ADC_CTRLC_LEFTADJ_Pos) /**< (ADC_CTRLC) Left-Adjusted Result Mask */
  401. #define ADC_CTRLC_LEFTADJ ADC_CTRLC_LEFTADJ_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLC_LEFTADJ_Msk instead */
  402. #define ADC_CTRLC_FREERUN_Pos 2 /**< (ADC_CTRLC) Free Running Mode Position */
  403. #define ADC_CTRLC_FREERUN_Msk (_U_(0x1) << ADC_CTRLC_FREERUN_Pos) /**< (ADC_CTRLC) Free Running Mode Mask */
  404. #define ADC_CTRLC_FREERUN ADC_CTRLC_FREERUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLC_FREERUN_Msk instead */
  405. #define ADC_CTRLC_CORREN_Pos 3 /**< (ADC_CTRLC) Digital Correction Logic Enable Position */
  406. #define ADC_CTRLC_CORREN_Msk (_U_(0x1) << ADC_CTRLC_CORREN_Pos) /**< (ADC_CTRLC) Digital Correction Logic Enable Mask */
  407. #define ADC_CTRLC_CORREN ADC_CTRLC_CORREN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLC_CORREN_Msk instead */
  408. #define ADC_CTRLC_RESSEL_Pos 4 /**< (ADC_CTRLC) Conversion Result Resolution Position */
  409. #define ADC_CTRLC_RESSEL_Msk (_U_(0x3) << ADC_CTRLC_RESSEL_Pos) /**< (ADC_CTRLC) Conversion Result Resolution Mask */
  410. #define ADC_CTRLC_RESSEL(value) (ADC_CTRLC_RESSEL_Msk & ((value) << ADC_CTRLC_RESSEL_Pos))
  411. #define ADC_CTRLC_RESSEL_12BIT_Val _U_(0x0) /**< (ADC_CTRLC) 12-bit result */
  412. #define ADC_CTRLC_RESSEL_16BIT_Val _U_(0x1) /**< (ADC_CTRLC) For averaging mode output */
  413. #define ADC_CTRLC_RESSEL_10BIT_Val _U_(0x2) /**< (ADC_CTRLC) 10-bit result */
  414. #define ADC_CTRLC_RESSEL_8BIT_Val _U_(0x3) /**< (ADC_CTRLC) 8-bit result */
  415. #define ADC_CTRLC_RESSEL_12BIT (ADC_CTRLC_RESSEL_12BIT_Val << ADC_CTRLC_RESSEL_Pos) /**< (ADC_CTRLC) 12-bit result Position */
  416. #define ADC_CTRLC_RESSEL_16BIT (ADC_CTRLC_RESSEL_16BIT_Val << ADC_CTRLC_RESSEL_Pos) /**< (ADC_CTRLC) For averaging mode output Position */
  417. #define ADC_CTRLC_RESSEL_10BIT (ADC_CTRLC_RESSEL_10BIT_Val << ADC_CTRLC_RESSEL_Pos) /**< (ADC_CTRLC) 10-bit result Position */
  418. #define ADC_CTRLC_RESSEL_8BIT (ADC_CTRLC_RESSEL_8BIT_Val << ADC_CTRLC_RESSEL_Pos) /**< (ADC_CTRLC) 8-bit result Position */
  419. #define ADC_CTRLC_R2R_Pos 7 /**< (ADC_CTRLC) Rail-to-Rail mode enable Position */
  420. #define ADC_CTRLC_R2R_Msk (_U_(0x1) << ADC_CTRLC_R2R_Pos) /**< (ADC_CTRLC) Rail-to-Rail mode enable Mask */
  421. #define ADC_CTRLC_R2R ADC_CTRLC_R2R_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_CTRLC_R2R_Msk instead */
  422. #define ADC_CTRLC_WINMODE_Pos 8 /**< (ADC_CTRLC) Window Monitor Mode Position */
  423. #define ADC_CTRLC_WINMODE_Msk (_U_(0x7) << ADC_CTRLC_WINMODE_Pos) /**< (ADC_CTRLC) Window Monitor Mode Mask */
  424. #define ADC_CTRLC_WINMODE(value) (ADC_CTRLC_WINMODE_Msk & ((value) << ADC_CTRLC_WINMODE_Pos))
  425. #define ADC_CTRLC_WINMODE_DISABLE_Val _U_(0x0) /**< (ADC_CTRLC) No window mode (default) */
  426. #define ADC_CTRLC_WINMODE_MODE1_Val _U_(0x1) /**< (ADC_CTRLC) RESULT > WINLT */
  427. #define ADC_CTRLC_WINMODE_MODE2_Val _U_(0x2) /**< (ADC_CTRLC) RESULT < WINUT */
  428. #define ADC_CTRLC_WINMODE_MODE3_Val _U_(0x3) /**< (ADC_CTRLC) WINLT < RESULT < WINUT */
  429. #define ADC_CTRLC_WINMODE_MODE4_Val _U_(0x4) /**< (ADC_CTRLC) !(WINLT < RESULT < WINUT) */
  430. #define ADC_CTRLC_WINMODE_DISABLE (ADC_CTRLC_WINMODE_DISABLE_Val << ADC_CTRLC_WINMODE_Pos) /**< (ADC_CTRLC) No window mode (default) Position */
  431. #define ADC_CTRLC_WINMODE_MODE1 (ADC_CTRLC_WINMODE_MODE1_Val << ADC_CTRLC_WINMODE_Pos) /**< (ADC_CTRLC) RESULT > WINLT Position */
  432. #define ADC_CTRLC_WINMODE_MODE2 (ADC_CTRLC_WINMODE_MODE2_Val << ADC_CTRLC_WINMODE_Pos) /**< (ADC_CTRLC) RESULT < WINUT Position */
  433. #define ADC_CTRLC_WINMODE_MODE3 (ADC_CTRLC_WINMODE_MODE3_Val << ADC_CTRLC_WINMODE_Pos) /**< (ADC_CTRLC) WINLT < RESULT < WINUT Position */
  434. #define ADC_CTRLC_WINMODE_MODE4 (ADC_CTRLC_WINMODE_MODE4_Val << ADC_CTRLC_WINMODE_Pos) /**< (ADC_CTRLC) !(WINLT < RESULT < WINUT) Position */
  435. #define ADC_CTRLC_DUALSEL_Pos 12 /**< (ADC_CTRLC) Dual Mode Trigger Selection Position */
  436. #define ADC_CTRLC_DUALSEL_Msk (_U_(0x3) << ADC_CTRLC_DUALSEL_Pos) /**< (ADC_CTRLC) Dual Mode Trigger Selection Mask */
  437. #define ADC_CTRLC_DUALSEL(value) (ADC_CTRLC_DUALSEL_Msk & ((value) << ADC_CTRLC_DUALSEL_Pos))
  438. #define ADC_CTRLC_DUALSEL_BOTH_Val _U_(0x0) /**< (ADC_CTRLC) Start event or software trigger will start a conversion on both ADCs */
  439. #define ADC_CTRLC_DUALSEL_INTERLEAVE_Val _U_(0x1) /**< (ADC_CTRLC) START event or software trigger will alternatingly start a conversion on ADC0 and ADC1 */
  440. #define ADC_CTRLC_DUALSEL_BOTH (ADC_CTRLC_DUALSEL_BOTH_Val << ADC_CTRLC_DUALSEL_Pos) /**< (ADC_CTRLC) Start event or software trigger will start a conversion on both ADCs Position */
  441. #define ADC_CTRLC_DUALSEL_INTERLEAVE (ADC_CTRLC_DUALSEL_INTERLEAVE_Val << ADC_CTRLC_DUALSEL_Pos) /**< (ADC_CTRLC) START event or software trigger will alternatingly start a conversion on ADC0 and ADC1 Position */
  442. #define ADC_CTRLC_MASK _U_(0x37BF) /**< \deprecated (ADC_CTRLC) Register MASK (Use ADC_CTRLC_Msk instead) */
  443. #define ADC_CTRLC_Msk _U_(0x37BF) /**< (ADC_CTRLC) Register Mask */
  444. /* -------- ADC_AVGCTRL : (ADC Offset: 0x0c) (R/W 8) Average Control -------- */
  445. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  446. typedef union {
  447. struct {
  448. uint8_t SAMPLENUM:4; /**< bit: 0..3 Number of Samples to be Collected */
  449. uint8_t ADJRES:3; /**< bit: 4..6 Adjusting Result / Division Coefficient */
  450. uint8_t :1; /**< bit: 7 Reserved */
  451. } bit; /**< Structure used for bit access */
  452. uint8_t reg; /**< Type used for register access */
  453. } ADC_AVGCTRL_Type;
  454. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  455. #define ADC_AVGCTRL_OFFSET (0x0C) /**< (ADC_AVGCTRL) Average Control Offset */
  456. #define ADC_AVGCTRL_RESETVALUE _U_(0x00) /**< (ADC_AVGCTRL) Average Control Reset Value */
  457. #define ADC_AVGCTRL_SAMPLENUM_Pos 0 /**< (ADC_AVGCTRL) Number of Samples to be Collected Position */
  458. #define ADC_AVGCTRL_SAMPLENUM_Msk (_U_(0xF) << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) Number of Samples to be Collected Mask */
  459. #define ADC_AVGCTRL_SAMPLENUM(value) (ADC_AVGCTRL_SAMPLENUM_Msk & ((value) << ADC_AVGCTRL_SAMPLENUM_Pos))
  460. #define ADC_AVGCTRL_SAMPLENUM_1_Val _U_(0x0) /**< (ADC_AVGCTRL) 1 sample */
  461. #define ADC_AVGCTRL_SAMPLENUM_2_Val _U_(0x1) /**< (ADC_AVGCTRL) 2 samples */
  462. #define ADC_AVGCTRL_SAMPLENUM_4_Val _U_(0x2) /**< (ADC_AVGCTRL) 4 samples */
  463. #define ADC_AVGCTRL_SAMPLENUM_8_Val _U_(0x3) /**< (ADC_AVGCTRL) 8 samples */
  464. #define ADC_AVGCTRL_SAMPLENUM_16_Val _U_(0x4) /**< (ADC_AVGCTRL) 16 samples */
  465. #define ADC_AVGCTRL_SAMPLENUM_32_Val _U_(0x5) /**< (ADC_AVGCTRL) 32 samples */
  466. #define ADC_AVGCTRL_SAMPLENUM_64_Val _U_(0x6) /**< (ADC_AVGCTRL) 64 samples */
  467. #define ADC_AVGCTRL_SAMPLENUM_128_Val _U_(0x7) /**< (ADC_AVGCTRL) 128 samples */
  468. #define ADC_AVGCTRL_SAMPLENUM_256_Val _U_(0x8) /**< (ADC_AVGCTRL) 256 samples */
  469. #define ADC_AVGCTRL_SAMPLENUM_512_Val _U_(0x9) /**< (ADC_AVGCTRL) 512 samples */
  470. #define ADC_AVGCTRL_SAMPLENUM_1024_Val _U_(0xA) /**< (ADC_AVGCTRL) 1024 samples */
  471. #define ADC_AVGCTRL_SAMPLENUM_1 (ADC_AVGCTRL_SAMPLENUM_1_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 1 sample Position */
  472. #define ADC_AVGCTRL_SAMPLENUM_2 (ADC_AVGCTRL_SAMPLENUM_2_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 2 samples Position */
  473. #define ADC_AVGCTRL_SAMPLENUM_4 (ADC_AVGCTRL_SAMPLENUM_4_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 4 samples Position */
  474. #define ADC_AVGCTRL_SAMPLENUM_8 (ADC_AVGCTRL_SAMPLENUM_8_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 8 samples Position */
  475. #define ADC_AVGCTRL_SAMPLENUM_16 (ADC_AVGCTRL_SAMPLENUM_16_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 16 samples Position */
  476. #define ADC_AVGCTRL_SAMPLENUM_32 (ADC_AVGCTRL_SAMPLENUM_32_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 32 samples Position */
  477. #define ADC_AVGCTRL_SAMPLENUM_64 (ADC_AVGCTRL_SAMPLENUM_64_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 64 samples Position */
  478. #define ADC_AVGCTRL_SAMPLENUM_128 (ADC_AVGCTRL_SAMPLENUM_128_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 128 samples Position */
  479. #define ADC_AVGCTRL_SAMPLENUM_256 (ADC_AVGCTRL_SAMPLENUM_256_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 256 samples Position */
  480. #define ADC_AVGCTRL_SAMPLENUM_512 (ADC_AVGCTRL_SAMPLENUM_512_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 512 samples Position */
  481. #define ADC_AVGCTRL_SAMPLENUM_1024 (ADC_AVGCTRL_SAMPLENUM_1024_Val << ADC_AVGCTRL_SAMPLENUM_Pos) /**< (ADC_AVGCTRL) 1024 samples Position */
  482. #define ADC_AVGCTRL_ADJRES_Pos 4 /**< (ADC_AVGCTRL) Adjusting Result / Division Coefficient Position */
  483. #define ADC_AVGCTRL_ADJRES_Msk (_U_(0x7) << ADC_AVGCTRL_ADJRES_Pos) /**< (ADC_AVGCTRL) Adjusting Result / Division Coefficient Mask */
  484. #define ADC_AVGCTRL_ADJRES(value) (ADC_AVGCTRL_ADJRES_Msk & ((value) << ADC_AVGCTRL_ADJRES_Pos))
  485. #define ADC_AVGCTRL_MASK _U_(0x7F) /**< \deprecated (ADC_AVGCTRL) Register MASK (Use ADC_AVGCTRL_Msk instead) */
  486. #define ADC_AVGCTRL_Msk _U_(0x7F) /**< (ADC_AVGCTRL) Register Mask */
  487. /* -------- ADC_SAMPCTRL : (ADC Offset: 0x0d) (R/W 8) Sample Time Control -------- */
  488. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  489. typedef union {
  490. struct {
  491. uint8_t SAMPLEN:6; /**< bit: 0..5 Sampling Time Length */
  492. uint8_t :1; /**< bit: 6 Reserved */
  493. uint8_t OFFCOMP:1; /**< bit: 7 Comparator Offset Compensation Enable */
  494. } bit; /**< Structure used for bit access */
  495. uint8_t reg; /**< Type used for register access */
  496. } ADC_SAMPCTRL_Type;
  497. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  498. #define ADC_SAMPCTRL_OFFSET (0x0D) /**< (ADC_SAMPCTRL) Sample Time Control Offset */
  499. #define ADC_SAMPCTRL_RESETVALUE _U_(0x00) /**< (ADC_SAMPCTRL) Sample Time Control Reset Value */
  500. #define ADC_SAMPCTRL_SAMPLEN_Pos 0 /**< (ADC_SAMPCTRL) Sampling Time Length Position */
  501. #define ADC_SAMPCTRL_SAMPLEN_Msk (_U_(0x3F) << ADC_SAMPCTRL_SAMPLEN_Pos) /**< (ADC_SAMPCTRL) Sampling Time Length Mask */
  502. #define ADC_SAMPCTRL_SAMPLEN(value) (ADC_SAMPCTRL_SAMPLEN_Msk & ((value) << ADC_SAMPCTRL_SAMPLEN_Pos))
  503. #define ADC_SAMPCTRL_OFFCOMP_Pos 7 /**< (ADC_SAMPCTRL) Comparator Offset Compensation Enable Position */
  504. #define ADC_SAMPCTRL_OFFCOMP_Msk (_U_(0x1) << ADC_SAMPCTRL_OFFCOMP_Pos) /**< (ADC_SAMPCTRL) Comparator Offset Compensation Enable Mask */
  505. #define ADC_SAMPCTRL_OFFCOMP ADC_SAMPCTRL_OFFCOMP_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SAMPCTRL_OFFCOMP_Msk instead */
  506. #define ADC_SAMPCTRL_MASK _U_(0xBF) /**< \deprecated (ADC_SAMPCTRL) Register MASK (Use ADC_SAMPCTRL_Msk instead) */
  507. #define ADC_SAMPCTRL_Msk _U_(0xBF) /**< (ADC_SAMPCTRL) Register Mask */
  508. /* -------- ADC_WINLT : (ADC Offset: 0x0e) (R/W 16) Window Monitor Lower Threshold -------- */
  509. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  510. typedef union {
  511. struct {
  512. uint16_t WINLT:16; /**< bit: 0..15 Window Lower Threshold */
  513. } bit; /**< Structure used for bit access */
  514. uint16_t reg; /**< Type used for register access */
  515. } ADC_WINLT_Type;
  516. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  517. #define ADC_WINLT_OFFSET (0x0E) /**< (ADC_WINLT) Window Monitor Lower Threshold Offset */
  518. #define ADC_WINLT_RESETVALUE _U_(0x00) /**< (ADC_WINLT) Window Monitor Lower Threshold Reset Value */
  519. #define ADC_WINLT_WINLT_Pos 0 /**< (ADC_WINLT) Window Lower Threshold Position */
  520. #define ADC_WINLT_WINLT_Msk (_U_(0xFFFF) << ADC_WINLT_WINLT_Pos) /**< (ADC_WINLT) Window Lower Threshold Mask */
  521. #define ADC_WINLT_WINLT(value) (ADC_WINLT_WINLT_Msk & ((value) << ADC_WINLT_WINLT_Pos))
  522. #define ADC_WINLT_MASK _U_(0xFFFF) /**< \deprecated (ADC_WINLT) Register MASK (Use ADC_WINLT_Msk instead) */
  523. #define ADC_WINLT_Msk _U_(0xFFFF) /**< (ADC_WINLT) Register Mask */
  524. /* -------- ADC_WINUT : (ADC Offset: 0x10) (R/W 16) Window Monitor Upper Threshold -------- */
  525. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  526. typedef union {
  527. struct {
  528. uint16_t WINUT:16; /**< bit: 0..15 Window Upper Threshold */
  529. } bit; /**< Structure used for bit access */
  530. uint16_t reg; /**< Type used for register access */
  531. } ADC_WINUT_Type;
  532. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  533. #define ADC_WINUT_OFFSET (0x10) /**< (ADC_WINUT) Window Monitor Upper Threshold Offset */
  534. #define ADC_WINUT_RESETVALUE _U_(0x00) /**< (ADC_WINUT) Window Monitor Upper Threshold Reset Value */
  535. #define ADC_WINUT_WINUT_Pos 0 /**< (ADC_WINUT) Window Upper Threshold Position */
  536. #define ADC_WINUT_WINUT_Msk (_U_(0xFFFF) << ADC_WINUT_WINUT_Pos) /**< (ADC_WINUT) Window Upper Threshold Mask */
  537. #define ADC_WINUT_WINUT(value) (ADC_WINUT_WINUT_Msk & ((value) << ADC_WINUT_WINUT_Pos))
  538. #define ADC_WINUT_MASK _U_(0xFFFF) /**< \deprecated (ADC_WINUT) Register MASK (Use ADC_WINUT_Msk instead) */
  539. #define ADC_WINUT_Msk _U_(0xFFFF) /**< (ADC_WINUT) Register Mask */
  540. /* -------- ADC_GAINCORR : (ADC Offset: 0x12) (R/W 16) Gain Correction -------- */
  541. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  542. typedef union {
  543. struct {
  544. uint16_t GAINCORR:12; /**< bit: 0..11 Gain Correction Value */
  545. uint16_t :4; /**< bit: 12..15 Reserved */
  546. } bit; /**< Structure used for bit access */
  547. uint16_t reg; /**< Type used for register access */
  548. } ADC_GAINCORR_Type;
  549. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  550. #define ADC_GAINCORR_OFFSET (0x12) /**< (ADC_GAINCORR) Gain Correction Offset */
  551. #define ADC_GAINCORR_RESETVALUE _U_(0x00) /**< (ADC_GAINCORR) Gain Correction Reset Value */
  552. #define ADC_GAINCORR_GAINCORR_Pos 0 /**< (ADC_GAINCORR) Gain Correction Value Position */
  553. #define ADC_GAINCORR_GAINCORR_Msk (_U_(0xFFF) << ADC_GAINCORR_GAINCORR_Pos) /**< (ADC_GAINCORR) Gain Correction Value Mask */
  554. #define ADC_GAINCORR_GAINCORR(value) (ADC_GAINCORR_GAINCORR_Msk & ((value) << ADC_GAINCORR_GAINCORR_Pos))
  555. #define ADC_GAINCORR_MASK _U_(0xFFF) /**< \deprecated (ADC_GAINCORR) Register MASK (Use ADC_GAINCORR_Msk instead) */
  556. #define ADC_GAINCORR_Msk _U_(0xFFF) /**< (ADC_GAINCORR) Register Mask */
  557. /* -------- ADC_OFFSETCORR : (ADC Offset: 0x14) (R/W 16) Offset Correction -------- */
  558. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  559. typedef union {
  560. struct {
  561. uint16_t OFFSETCORR:12; /**< bit: 0..11 Offset Correction Value */
  562. uint16_t :4; /**< bit: 12..15 Reserved */
  563. } bit; /**< Structure used for bit access */
  564. uint16_t reg; /**< Type used for register access */
  565. } ADC_OFFSETCORR_Type;
  566. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  567. #define ADC_OFFSETCORR_OFFSET (0x14) /**< (ADC_OFFSETCORR) Offset Correction Offset */
  568. #define ADC_OFFSETCORR_RESETVALUE _U_(0x00) /**< (ADC_OFFSETCORR) Offset Correction Reset Value */
  569. #define ADC_OFFSETCORR_OFFSETCORR_Pos 0 /**< (ADC_OFFSETCORR) Offset Correction Value Position */
  570. #define ADC_OFFSETCORR_OFFSETCORR_Msk (_U_(0xFFF) << ADC_OFFSETCORR_OFFSETCORR_Pos) /**< (ADC_OFFSETCORR) Offset Correction Value Mask */
  571. #define ADC_OFFSETCORR_OFFSETCORR(value) (ADC_OFFSETCORR_OFFSETCORR_Msk & ((value) << ADC_OFFSETCORR_OFFSETCORR_Pos))
  572. #define ADC_OFFSETCORR_MASK _U_(0xFFF) /**< \deprecated (ADC_OFFSETCORR) Register MASK (Use ADC_OFFSETCORR_Msk instead) */
  573. #define ADC_OFFSETCORR_Msk _U_(0xFFF) /**< (ADC_OFFSETCORR) Register Mask */
  574. /* -------- ADC_SWTRIG : (ADC Offset: 0x18) (R/W 8) Software Trigger -------- */
  575. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  576. typedef union {
  577. struct {
  578. uint8_t FLUSH:1; /**< bit: 0 ADC Flush */
  579. uint8_t START:1; /**< bit: 1 Start ADC Conversion */
  580. uint8_t :6; /**< bit: 2..7 Reserved */
  581. } bit; /**< Structure used for bit access */
  582. uint8_t reg; /**< Type used for register access */
  583. } ADC_SWTRIG_Type;
  584. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  585. #define ADC_SWTRIG_OFFSET (0x18) /**< (ADC_SWTRIG) Software Trigger Offset */
  586. #define ADC_SWTRIG_RESETVALUE _U_(0x00) /**< (ADC_SWTRIG) Software Trigger Reset Value */
  587. #define ADC_SWTRIG_FLUSH_Pos 0 /**< (ADC_SWTRIG) ADC Flush Position */
  588. #define ADC_SWTRIG_FLUSH_Msk (_U_(0x1) << ADC_SWTRIG_FLUSH_Pos) /**< (ADC_SWTRIG) ADC Flush Mask */
  589. #define ADC_SWTRIG_FLUSH ADC_SWTRIG_FLUSH_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SWTRIG_FLUSH_Msk instead */
  590. #define ADC_SWTRIG_START_Pos 1 /**< (ADC_SWTRIG) Start ADC Conversion Position */
  591. #define ADC_SWTRIG_START_Msk (_U_(0x1) << ADC_SWTRIG_START_Pos) /**< (ADC_SWTRIG) Start ADC Conversion Mask */
  592. #define ADC_SWTRIG_START ADC_SWTRIG_START_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SWTRIG_START_Msk instead */
  593. #define ADC_SWTRIG_MASK _U_(0x03) /**< \deprecated (ADC_SWTRIG) Register MASK (Use ADC_SWTRIG_Msk instead) */
  594. #define ADC_SWTRIG_Msk _U_(0x03) /**< (ADC_SWTRIG) Register Mask */
  595. /* -------- ADC_DBGCTRL : (ADC Offset: 0x1c) (R/W 8) Debug Control -------- */
  596. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  597. typedef union {
  598. struct {
  599. uint8_t DBGRUN:1; /**< bit: 0 Debug Run */
  600. uint8_t :7; /**< bit: 1..7 Reserved */
  601. } bit; /**< Structure used for bit access */
  602. uint8_t reg; /**< Type used for register access */
  603. } ADC_DBGCTRL_Type;
  604. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  605. #define ADC_DBGCTRL_OFFSET (0x1C) /**< (ADC_DBGCTRL) Debug Control Offset */
  606. #define ADC_DBGCTRL_RESETVALUE _U_(0x00) /**< (ADC_DBGCTRL) Debug Control Reset Value */
  607. #define ADC_DBGCTRL_DBGRUN_Pos 0 /**< (ADC_DBGCTRL) Debug Run Position */
  608. #define ADC_DBGCTRL_DBGRUN_Msk (_U_(0x1) << ADC_DBGCTRL_DBGRUN_Pos) /**< (ADC_DBGCTRL) Debug Run Mask */
  609. #define ADC_DBGCTRL_DBGRUN ADC_DBGCTRL_DBGRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_DBGCTRL_DBGRUN_Msk instead */
  610. #define ADC_DBGCTRL_MASK _U_(0x01) /**< \deprecated (ADC_DBGCTRL) Register MASK (Use ADC_DBGCTRL_Msk instead) */
  611. #define ADC_DBGCTRL_Msk _U_(0x01) /**< (ADC_DBGCTRL) Register Mask */
  612. /* -------- ADC_SYNCBUSY : (ADC Offset: 0x20) (R/ 16) Synchronization Busy -------- */
  613. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  614. typedef union {
  615. struct {
  616. uint16_t SWRST:1; /**< bit: 0 SWRST Synchronization Busy */
  617. uint16_t ENABLE:1; /**< bit: 1 ENABLE Synchronization Busy */
  618. uint16_t INPUTCTRL:1; /**< bit: 2 INPUTCTRL Synchronization Busy */
  619. uint16_t CTRLC:1; /**< bit: 3 CTRLC Synchronization Busy */
  620. uint16_t AVGCTRL:1; /**< bit: 4 AVGCTRL Synchronization Busy */
  621. uint16_t SAMPCTRL:1; /**< bit: 5 SAMPCTRL Synchronization Busy */
  622. uint16_t WINLT:1; /**< bit: 6 WINLT Synchronization Busy */
  623. uint16_t WINUT:1; /**< bit: 7 WINUT Synchronization Busy */
  624. uint16_t GAINCORR:1; /**< bit: 8 GAINCORR Synchronization Busy */
  625. uint16_t OFFSETCORR:1; /**< bit: 9 OFFSETCTRL Synchronization Busy */
  626. uint16_t SWTRIG:1; /**< bit: 10 SWTRG Synchronization Busy */
  627. uint16_t :5; /**< bit: 11..15 Reserved */
  628. } bit; /**< Structure used for bit access */
  629. uint16_t reg; /**< Type used for register access */
  630. } ADC_SYNCBUSY_Type;
  631. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  632. #define ADC_SYNCBUSY_OFFSET (0x20) /**< (ADC_SYNCBUSY) Synchronization Busy Offset */
  633. #define ADC_SYNCBUSY_RESETVALUE _U_(0x00) /**< (ADC_SYNCBUSY) Synchronization Busy Reset Value */
  634. #define ADC_SYNCBUSY_SWRST_Pos 0 /**< (ADC_SYNCBUSY) SWRST Synchronization Busy Position */
  635. #define ADC_SYNCBUSY_SWRST_Msk (_U_(0x1) << ADC_SYNCBUSY_SWRST_Pos) /**< (ADC_SYNCBUSY) SWRST Synchronization Busy Mask */
  636. #define ADC_SYNCBUSY_SWRST ADC_SYNCBUSY_SWRST_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_SWRST_Msk instead */
  637. #define ADC_SYNCBUSY_ENABLE_Pos 1 /**< (ADC_SYNCBUSY) ENABLE Synchronization Busy Position */
  638. #define ADC_SYNCBUSY_ENABLE_Msk (_U_(0x1) << ADC_SYNCBUSY_ENABLE_Pos) /**< (ADC_SYNCBUSY) ENABLE Synchronization Busy Mask */
  639. #define ADC_SYNCBUSY_ENABLE ADC_SYNCBUSY_ENABLE_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_ENABLE_Msk instead */
  640. #define ADC_SYNCBUSY_INPUTCTRL_Pos 2 /**< (ADC_SYNCBUSY) INPUTCTRL Synchronization Busy Position */
  641. #define ADC_SYNCBUSY_INPUTCTRL_Msk (_U_(0x1) << ADC_SYNCBUSY_INPUTCTRL_Pos) /**< (ADC_SYNCBUSY) INPUTCTRL Synchronization Busy Mask */
  642. #define ADC_SYNCBUSY_INPUTCTRL ADC_SYNCBUSY_INPUTCTRL_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_INPUTCTRL_Msk instead */
  643. #define ADC_SYNCBUSY_CTRLC_Pos 3 /**< (ADC_SYNCBUSY) CTRLC Synchronization Busy Position */
  644. #define ADC_SYNCBUSY_CTRLC_Msk (_U_(0x1) << ADC_SYNCBUSY_CTRLC_Pos) /**< (ADC_SYNCBUSY) CTRLC Synchronization Busy Mask */
  645. #define ADC_SYNCBUSY_CTRLC ADC_SYNCBUSY_CTRLC_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_CTRLC_Msk instead */
  646. #define ADC_SYNCBUSY_AVGCTRL_Pos 4 /**< (ADC_SYNCBUSY) AVGCTRL Synchronization Busy Position */
  647. #define ADC_SYNCBUSY_AVGCTRL_Msk (_U_(0x1) << ADC_SYNCBUSY_AVGCTRL_Pos) /**< (ADC_SYNCBUSY) AVGCTRL Synchronization Busy Mask */
  648. #define ADC_SYNCBUSY_AVGCTRL ADC_SYNCBUSY_AVGCTRL_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_AVGCTRL_Msk instead */
  649. #define ADC_SYNCBUSY_SAMPCTRL_Pos 5 /**< (ADC_SYNCBUSY) SAMPCTRL Synchronization Busy Position */
  650. #define ADC_SYNCBUSY_SAMPCTRL_Msk (_U_(0x1) << ADC_SYNCBUSY_SAMPCTRL_Pos) /**< (ADC_SYNCBUSY) SAMPCTRL Synchronization Busy Mask */
  651. #define ADC_SYNCBUSY_SAMPCTRL ADC_SYNCBUSY_SAMPCTRL_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_SAMPCTRL_Msk instead */
  652. #define ADC_SYNCBUSY_WINLT_Pos 6 /**< (ADC_SYNCBUSY) WINLT Synchronization Busy Position */
  653. #define ADC_SYNCBUSY_WINLT_Msk (_U_(0x1) << ADC_SYNCBUSY_WINLT_Pos) /**< (ADC_SYNCBUSY) WINLT Synchronization Busy Mask */
  654. #define ADC_SYNCBUSY_WINLT ADC_SYNCBUSY_WINLT_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_WINLT_Msk instead */
  655. #define ADC_SYNCBUSY_WINUT_Pos 7 /**< (ADC_SYNCBUSY) WINUT Synchronization Busy Position */
  656. #define ADC_SYNCBUSY_WINUT_Msk (_U_(0x1) << ADC_SYNCBUSY_WINUT_Pos) /**< (ADC_SYNCBUSY) WINUT Synchronization Busy Mask */
  657. #define ADC_SYNCBUSY_WINUT ADC_SYNCBUSY_WINUT_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_WINUT_Msk instead */
  658. #define ADC_SYNCBUSY_GAINCORR_Pos 8 /**< (ADC_SYNCBUSY) GAINCORR Synchronization Busy Position */
  659. #define ADC_SYNCBUSY_GAINCORR_Msk (_U_(0x1) << ADC_SYNCBUSY_GAINCORR_Pos) /**< (ADC_SYNCBUSY) GAINCORR Synchronization Busy Mask */
  660. #define ADC_SYNCBUSY_GAINCORR ADC_SYNCBUSY_GAINCORR_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_GAINCORR_Msk instead */
  661. #define ADC_SYNCBUSY_OFFSETCORR_Pos 9 /**< (ADC_SYNCBUSY) OFFSETCTRL Synchronization Busy Position */
  662. #define ADC_SYNCBUSY_OFFSETCORR_Msk (_U_(0x1) << ADC_SYNCBUSY_OFFSETCORR_Pos) /**< (ADC_SYNCBUSY) OFFSETCTRL Synchronization Busy Mask */
  663. #define ADC_SYNCBUSY_OFFSETCORR ADC_SYNCBUSY_OFFSETCORR_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_OFFSETCORR_Msk instead */
  664. #define ADC_SYNCBUSY_SWTRIG_Pos 10 /**< (ADC_SYNCBUSY) SWTRG Synchronization Busy Position */
  665. #define ADC_SYNCBUSY_SWTRIG_Msk (_U_(0x1) << ADC_SYNCBUSY_SWTRIG_Pos) /**< (ADC_SYNCBUSY) SWTRG Synchronization Busy Mask */
  666. #define ADC_SYNCBUSY_SWTRIG ADC_SYNCBUSY_SWTRIG_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use ADC_SYNCBUSY_SWTRIG_Msk instead */
  667. #define ADC_SYNCBUSY_MASK _U_(0x7FF) /**< \deprecated (ADC_SYNCBUSY) Register MASK (Use ADC_SYNCBUSY_Msk instead) */
  668. #define ADC_SYNCBUSY_Msk _U_(0x7FF) /**< (ADC_SYNCBUSY) Register Mask */
  669. /* -------- ADC_RESULT : (ADC Offset: 0x24) (R/ 16) Result -------- */
  670. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  671. typedef union {
  672. struct {
  673. uint16_t RESULT:16; /**< bit: 0..15 Result Value */
  674. } bit; /**< Structure used for bit access */
  675. uint16_t reg; /**< Type used for register access */
  676. } ADC_RESULT_Type;
  677. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  678. #define ADC_RESULT_OFFSET (0x24) /**< (ADC_RESULT) Result Offset */
  679. #define ADC_RESULT_RESETVALUE _U_(0x00) /**< (ADC_RESULT) Result Reset Value */
  680. #define ADC_RESULT_RESULT_Pos 0 /**< (ADC_RESULT) Result Value Position */
  681. #define ADC_RESULT_RESULT_Msk (_U_(0xFFFF) << ADC_RESULT_RESULT_Pos) /**< (ADC_RESULT) Result Value Mask */
  682. #define ADC_RESULT_RESULT(value) (ADC_RESULT_RESULT_Msk & ((value) << ADC_RESULT_RESULT_Pos))
  683. #define ADC_RESULT_MASK _U_(0xFFFF) /**< \deprecated (ADC_RESULT) Register MASK (Use ADC_RESULT_Msk instead) */
  684. #define ADC_RESULT_Msk _U_(0xFFFF) /**< (ADC_RESULT) Register Mask */
  685. /* -------- ADC_SEQCTRL : (ADC Offset: 0x28) (R/W 32) Sequence Control -------- */
  686. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  687. typedef union {
  688. struct {
  689. uint32_t SEQEN:32; /**< bit: 0..31 Enable Positive Input in the Sequence */
  690. } bit; /**< Structure used for bit access */
  691. uint32_t reg; /**< Type used for register access */
  692. } ADC_SEQCTRL_Type;
  693. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  694. #define ADC_SEQCTRL_OFFSET (0x28) /**< (ADC_SEQCTRL) Sequence Control Offset */
  695. #define ADC_SEQCTRL_RESETVALUE _U_(0x00) /**< (ADC_SEQCTRL) Sequence Control Reset Value */
  696. #define ADC_SEQCTRL_SEQEN_Pos 0 /**< (ADC_SEQCTRL) Enable Positive Input in the Sequence Position */
  697. #define ADC_SEQCTRL_SEQEN_Msk (_U_(0xFFFFFFFF) << ADC_SEQCTRL_SEQEN_Pos) /**< (ADC_SEQCTRL) Enable Positive Input in the Sequence Mask */
  698. #define ADC_SEQCTRL_SEQEN(value) (ADC_SEQCTRL_SEQEN_Msk & ((value) << ADC_SEQCTRL_SEQEN_Pos))
  699. #define ADC_SEQCTRL_MASK _U_(0xFFFFFFFF) /**< \deprecated (ADC_SEQCTRL) Register MASK (Use ADC_SEQCTRL_Msk instead) */
  700. #define ADC_SEQCTRL_Msk _U_(0xFFFFFFFF) /**< (ADC_SEQCTRL) Register Mask */
  701. /* -------- ADC_CALIB : (ADC Offset: 0x2c) (R/W 16) Calibration -------- */
  702. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  703. typedef union {
  704. struct {
  705. uint16_t BIASCOMP:3; /**< bit: 0..2 Bias Comparator Scaling */
  706. uint16_t :5; /**< bit: 3..7 Reserved */
  707. uint16_t BIASREFBUF:3; /**< bit: 8..10 Bias Reference Buffer Scaling */
  708. uint16_t :5; /**< bit: 11..15 Reserved */
  709. } bit; /**< Structure used for bit access */
  710. uint16_t reg; /**< Type used for register access */
  711. } ADC_CALIB_Type;
  712. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  713. #define ADC_CALIB_OFFSET (0x2C) /**< (ADC_CALIB) Calibration Offset */
  714. #define ADC_CALIB_RESETVALUE _U_(0x00) /**< (ADC_CALIB) Calibration Reset Value */
  715. #define ADC_CALIB_BIASCOMP_Pos 0 /**< (ADC_CALIB) Bias Comparator Scaling Position */
  716. #define ADC_CALIB_BIASCOMP_Msk (_U_(0x7) << ADC_CALIB_BIASCOMP_Pos) /**< (ADC_CALIB) Bias Comparator Scaling Mask */
  717. #define ADC_CALIB_BIASCOMP(value) (ADC_CALIB_BIASCOMP_Msk & ((value) << ADC_CALIB_BIASCOMP_Pos))
  718. #define ADC_CALIB_BIASREFBUF_Pos 8 /**< (ADC_CALIB) Bias Reference Buffer Scaling Position */
  719. #define ADC_CALIB_BIASREFBUF_Msk (_U_(0x7) << ADC_CALIB_BIASREFBUF_Pos) /**< (ADC_CALIB) Bias Reference Buffer Scaling Mask */
  720. #define ADC_CALIB_BIASREFBUF(value) (ADC_CALIB_BIASREFBUF_Msk & ((value) << ADC_CALIB_BIASREFBUF_Pos))
  721. #define ADC_CALIB_MASK _U_(0x707) /**< \deprecated (ADC_CALIB) Register MASK (Use ADC_CALIB_Msk instead) */
  722. #define ADC_CALIB_Msk _U_(0x707) /**< (ADC_CALIB) Register Mask */
  723. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  724. /** \brief ADC hardware registers */
  725. typedef struct { /* Analog Digital Converter */
  726. __IO ADC_CTRLA_Type CTRLA; /**< Offset: 0x00 (R/W 8) Control A */
  727. __IO ADC_CTRLB_Type CTRLB; /**< Offset: 0x01 (R/W 8) Control B */
  728. __IO ADC_REFCTRL_Type REFCTRL; /**< Offset: 0x02 (R/W 8) Reference Control */
  729. __IO ADC_EVCTRL_Type EVCTRL; /**< Offset: 0x03 (R/W 8) Event Control */
  730. __IO ADC_INTENCLR_Type INTENCLR; /**< Offset: 0x04 (R/W 8) Interrupt Enable Clear */
  731. __IO ADC_INTENSET_Type INTENSET; /**< Offset: 0x05 (R/W 8) Interrupt Enable Set */
  732. __IO ADC_INTFLAG_Type INTFLAG; /**< Offset: 0x06 (R/W 8) Interrupt Flag Status and Clear */
  733. __I ADC_SEQSTATUS_Type SEQSTATUS; /**< Offset: 0x07 (R/ 8) Sequence Status */
  734. __IO ADC_INPUTCTRL_Type INPUTCTRL; /**< Offset: 0x08 (R/W 16) Input Control */
  735. __IO ADC_CTRLC_Type CTRLC; /**< Offset: 0x0A (R/W 16) Control C */
  736. __IO ADC_AVGCTRL_Type AVGCTRL; /**< Offset: 0x0C (R/W 8) Average Control */
  737. __IO ADC_SAMPCTRL_Type SAMPCTRL; /**< Offset: 0x0D (R/W 8) Sample Time Control */
  738. __IO ADC_WINLT_Type WINLT; /**< Offset: 0x0E (R/W 16) Window Monitor Lower Threshold */
  739. __IO ADC_WINUT_Type WINUT; /**< Offset: 0x10 (R/W 16) Window Monitor Upper Threshold */
  740. __IO ADC_GAINCORR_Type GAINCORR; /**< Offset: 0x12 (R/W 16) Gain Correction */
  741. __IO ADC_OFFSETCORR_Type OFFSETCORR; /**< Offset: 0x14 (R/W 16) Offset Correction */
  742. __I uint8_t Reserved1[2];
  743. __IO ADC_SWTRIG_Type SWTRIG; /**< Offset: 0x18 (R/W 8) Software Trigger */
  744. __I uint8_t Reserved2[3];
  745. __IO ADC_DBGCTRL_Type DBGCTRL; /**< Offset: 0x1C (R/W 8) Debug Control */
  746. __I uint8_t Reserved3[3];
  747. __I ADC_SYNCBUSY_Type SYNCBUSY; /**< Offset: 0x20 (R/ 16) Synchronization Busy */
  748. __I uint8_t Reserved4[2];
  749. __I ADC_RESULT_Type RESULT; /**< Offset: 0x24 (R/ 16) Result */
  750. __I uint8_t Reserved5[2];
  751. __IO ADC_SEQCTRL_Type SEQCTRL; /**< Offset: 0x28 (R/W 32) Sequence Control */
  752. __IO ADC_CALIB_Type CALIB; /**< Offset: 0x2C (R/W 16) Calibration */
  753. } Adc;
  754. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  755. /** @} end of Analog Digital Converter */
  756. #endif /* _SAML11_ADC_COMPONENT_H_ */