dac.h 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for DAC
  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_DAC_COMPONENT_H_
  31. #define _SAML11_DAC_COMPONENT_H_
  32. #define _SAML11_DAC_COMPONENT_ /**< \deprecated Backward compatibility for ASF */
  33. /** \addtogroup SAML_SAML11 Digital Analog Converter
  34. * @{
  35. */
  36. /* ========================================================================== */
  37. /** SOFTWARE API DEFINITION FOR DAC */
  38. /* ========================================================================== */
  39. #define DAC_U2214 /**< (DAC) Module ID */
  40. #define REV_DAC 0x210 /**< (DAC) Module revision */
  41. /* -------- DAC_CTRLA : (DAC 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 :4; /**< bit: 2..5 Reserved */
  48. uint8_t RUNSTDBY:1; /**< bit: 6 Run in Standby */
  49. uint8_t :1; /**< bit: 7 Reserved */
  50. } bit; /**< Structure used for bit access */
  51. uint8_t reg; /**< Type used for register access */
  52. } DAC_CTRLA_Type;
  53. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  54. #define DAC_CTRLA_OFFSET (0x00) /**< (DAC_CTRLA) Control A Offset */
  55. #define DAC_CTRLA_RESETVALUE _U_(0x00) /**< (DAC_CTRLA) Control A Reset Value */
  56. #define DAC_CTRLA_SWRST_Pos 0 /**< (DAC_CTRLA) Software Reset Position */
  57. #define DAC_CTRLA_SWRST_Msk (_U_(0x1) << DAC_CTRLA_SWRST_Pos) /**< (DAC_CTRLA) Software Reset Mask */
  58. #define DAC_CTRLA_SWRST DAC_CTRLA_SWRST_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLA_SWRST_Msk instead */
  59. #define DAC_CTRLA_ENABLE_Pos 1 /**< (DAC_CTRLA) Enable Position */
  60. #define DAC_CTRLA_ENABLE_Msk (_U_(0x1) << DAC_CTRLA_ENABLE_Pos) /**< (DAC_CTRLA) Enable Mask */
  61. #define DAC_CTRLA_ENABLE DAC_CTRLA_ENABLE_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLA_ENABLE_Msk instead */
  62. #define DAC_CTRLA_RUNSTDBY_Pos 6 /**< (DAC_CTRLA) Run in Standby Position */
  63. #define DAC_CTRLA_RUNSTDBY_Msk (_U_(0x1) << DAC_CTRLA_RUNSTDBY_Pos) /**< (DAC_CTRLA) Run in Standby Mask */
  64. #define DAC_CTRLA_RUNSTDBY DAC_CTRLA_RUNSTDBY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLA_RUNSTDBY_Msk instead */
  65. #define DAC_CTRLA_MASK _U_(0x43) /**< \deprecated (DAC_CTRLA) Register MASK (Use DAC_CTRLA_Msk instead) */
  66. #define DAC_CTRLA_Msk _U_(0x43) /**< (DAC_CTRLA) Register Mask */
  67. /* -------- DAC_CTRLB : (DAC Offset: 0x01) (R/W 8) Control B -------- */
  68. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  69. typedef union {
  70. struct {
  71. uint8_t EOEN:1; /**< bit: 0 External Output Enable */
  72. uint8_t IOEN:1; /**< bit: 1 Internal Output Enable */
  73. uint8_t LEFTADJ:1; /**< bit: 2 Left Adjusted Data */
  74. uint8_t VPD:1; /**< bit: 3 Voltage Pump Disable */
  75. uint8_t :1; /**< bit: 4 Reserved */
  76. uint8_t DITHER:1; /**< bit: 5 Dither Enable */
  77. uint8_t REFSEL:2; /**< bit: 6..7 Reference Selection */
  78. } bit; /**< Structure used for bit access */
  79. uint8_t reg; /**< Type used for register access */
  80. } DAC_CTRLB_Type;
  81. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  82. #define DAC_CTRLB_OFFSET (0x01) /**< (DAC_CTRLB) Control B Offset */
  83. #define DAC_CTRLB_RESETVALUE _U_(0x00) /**< (DAC_CTRLB) Control B Reset Value */
  84. #define DAC_CTRLB_EOEN_Pos 0 /**< (DAC_CTRLB) External Output Enable Position */
  85. #define DAC_CTRLB_EOEN_Msk (_U_(0x1) << DAC_CTRLB_EOEN_Pos) /**< (DAC_CTRLB) External Output Enable Mask */
  86. #define DAC_CTRLB_EOEN DAC_CTRLB_EOEN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLB_EOEN_Msk instead */
  87. #define DAC_CTRLB_IOEN_Pos 1 /**< (DAC_CTRLB) Internal Output Enable Position */
  88. #define DAC_CTRLB_IOEN_Msk (_U_(0x1) << DAC_CTRLB_IOEN_Pos) /**< (DAC_CTRLB) Internal Output Enable Mask */
  89. #define DAC_CTRLB_IOEN DAC_CTRLB_IOEN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLB_IOEN_Msk instead */
  90. #define DAC_CTRLB_LEFTADJ_Pos 2 /**< (DAC_CTRLB) Left Adjusted Data Position */
  91. #define DAC_CTRLB_LEFTADJ_Msk (_U_(0x1) << DAC_CTRLB_LEFTADJ_Pos) /**< (DAC_CTRLB) Left Adjusted Data Mask */
  92. #define DAC_CTRLB_LEFTADJ DAC_CTRLB_LEFTADJ_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLB_LEFTADJ_Msk instead */
  93. #define DAC_CTRLB_VPD_Pos 3 /**< (DAC_CTRLB) Voltage Pump Disable Position */
  94. #define DAC_CTRLB_VPD_Msk (_U_(0x1) << DAC_CTRLB_VPD_Pos) /**< (DAC_CTRLB) Voltage Pump Disable Mask */
  95. #define DAC_CTRLB_VPD DAC_CTRLB_VPD_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLB_VPD_Msk instead */
  96. #define DAC_CTRLB_DITHER_Pos 5 /**< (DAC_CTRLB) Dither Enable Position */
  97. #define DAC_CTRLB_DITHER_Msk (_U_(0x1) << DAC_CTRLB_DITHER_Pos) /**< (DAC_CTRLB) Dither Enable Mask */
  98. #define DAC_CTRLB_DITHER DAC_CTRLB_DITHER_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_CTRLB_DITHER_Msk instead */
  99. #define DAC_CTRLB_REFSEL_Pos 6 /**< (DAC_CTRLB) Reference Selection Position */
  100. #define DAC_CTRLB_REFSEL_Msk (_U_(0x3) << DAC_CTRLB_REFSEL_Pos) /**< (DAC_CTRLB) Reference Selection Mask */
  101. #define DAC_CTRLB_REFSEL(value) (DAC_CTRLB_REFSEL_Msk & ((value) << DAC_CTRLB_REFSEL_Pos))
  102. #define DAC_CTRLB_REFSEL_INT1V_Val _U_(0x0) /**< (DAC_CTRLB) Internal 1.0V reference */
  103. #define DAC_CTRLB_REFSEL_AVCC_Val _U_(0x1) /**< (DAC_CTRLB) AVCC */
  104. #define DAC_CTRLB_REFSEL_VREFP_Val _U_(0x2) /**< (DAC_CTRLB) External reference */
  105. #define DAC_CTRLB_REFSEL_INT1V (DAC_CTRLB_REFSEL_INT1V_Val << DAC_CTRLB_REFSEL_Pos) /**< (DAC_CTRLB) Internal 1.0V reference Position */
  106. #define DAC_CTRLB_REFSEL_AVCC (DAC_CTRLB_REFSEL_AVCC_Val << DAC_CTRLB_REFSEL_Pos) /**< (DAC_CTRLB) AVCC Position */
  107. #define DAC_CTRLB_REFSEL_VREFP (DAC_CTRLB_REFSEL_VREFP_Val << DAC_CTRLB_REFSEL_Pos) /**< (DAC_CTRLB) External reference Position */
  108. #define DAC_CTRLB_MASK _U_(0xEF) /**< \deprecated (DAC_CTRLB) Register MASK (Use DAC_CTRLB_Msk instead) */
  109. #define DAC_CTRLB_Msk _U_(0xEF) /**< (DAC_CTRLB) Register Mask */
  110. /* -------- DAC_EVCTRL : (DAC Offset: 0x02) (R/W 8) Event Control -------- */
  111. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  112. typedef union {
  113. struct {
  114. uint8_t STARTEI:1; /**< bit: 0 Start Conversion Event Input */
  115. uint8_t EMPTYEO:1; /**< bit: 1 Data Buffer Empty Event Output */
  116. uint8_t INVEI:1; /**< bit: 2 Invert Event Input */
  117. uint8_t :5; /**< bit: 3..7 Reserved */
  118. } bit; /**< Structure used for bit access */
  119. uint8_t reg; /**< Type used for register access */
  120. } DAC_EVCTRL_Type;
  121. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  122. #define DAC_EVCTRL_OFFSET (0x02) /**< (DAC_EVCTRL) Event Control Offset */
  123. #define DAC_EVCTRL_RESETVALUE _U_(0x00) /**< (DAC_EVCTRL) Event Control Reset Value */
  124. #define DAC_EVCTRL_STARTEI_Pos 0 /**< (DAC_EVCTRL) Start Conversion Event Input Position */
  125. #define DAC_EVCTRL_STARTEI_Msk (_U_(0x1) << DAC_EVCTRL_STARTEI_Pos) /**< (DAC_EVCTRL) Start Conversion Event Input Mask */
  126. #define DAC_EVCTRL_STARTEI DAC_EVCTRL_STARTEI_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_EVCTRL_STARTEI_Msk instead */
  127. #define DAC_EVCTRL_EMPTYEO_Pos 1 /**< (DAC_EVCTRL) Data Buffer Empty Event Output Position */
  128. #define DAC_EVCTRL_EMPTYEO_Msk (_U_(0x1) << DAC_EVCTRL_EMPTYEO_Pos) /**< (DAC_EVCTRL) Data Buffer Empty Event Output Mask */
  129. #define DAC_EVCTRL_EMPTYEO DAC_EVCTRL_EMPTYEO_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_EVCTRL_EMPTYEO_Msk instead */
  130. #define DAC_EVCTRL_INVEI_Pos 2 /**< (DAC_EVCTRL) Invert Event Input Position */
  131. #define DAC_EVCTRL_INVEI_Msk (_U_(0x1) << DAC_EVCTRL_INVEI_Pos) /**< (DAC_EVCTRL) Invert Event Input Mask */
  132. #define DAC_EVCTRL_INVEI DAC_EVCTRL_INVEI_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_EVCTRL_INVEI_Msk instead */
  133. #define DAC_EVCTRL_MASK _U_(0x07) /**< \deprecated (DAC_EVCTRL) Register MASK (Use DAC_EVCTRL_Msk instead) */
  134. #define DAC_EVCTRL_Msk _U_(0x07) /**< (DAC_EVCTRL) Register Mask */
  135. /* -------- DAC_INTENCLR : (DAC Offset: 0x04) (R/W 8) Interrupt Enable Clear -------- */
  136. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  137. typedef union {
  138. struct {
  139. uint8_t UNDERRUN:1; /**< bit: 0 Underrun Interrupt Enable */
  140. uint8_t EMPTY:1; /**< bit: 1 Data Buffer Empty Interrupt Enable */
  141. uint8_t :6; /**< bit: 2..7 Reserved */
  142. } bit; /**< Structure used for bit access */
  143. uint8_t reg; /**< Type used for register access */
  144. } DAC_INTENCLR_Type;
  145. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  146. #define DAC_INTENCLR_OFFSET (0x04) /**< (DAC_INTENCLR) Interrupt Enable Clear Offset */
  147. #define DAC_INTENCLR_RESETVALUE _U_(0x00) /**< (DAC_INTENCLR) Interrupt Enable Clear Reset Value */
  148. #define DAC_INTENCLR_UNDERRUN_Pos 0 /**< (DAC_INTENCLR) Underrun Interrupt Enable Position */
  149. #define DAC_INTENCLR_UNDERRUN_Msk (_U_(0x1) << DAC_INTENCLR_UNDERRUN_Pos) /**< (DAC_INTENCLR) Underrun Interrupt Enable Mask */
  150. #define DAC_INTENCLR_UNDERRUN DAC_INTENCLR_UNDERRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_INTENCLR_UNDERRUN_Msk instead */
  151. #define DAC_INTENCLR_EMPTY_Pos 1 /**< (DAC_INTENCLR) Data Buffer Empty Interrupt Enable Position */
  152. #define DAC_INTENCLR_EMPTY_Msk (_U_(0x1) << DAC_INTENCLR_EMPTY_Pos) /**< (DAC_INTENCLR) Data Buffer Empty Interrupt Enable Mask */
  153. #define DAC_INTENCLR_EMPTY DAC_INTENCLR_EMPTY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_INTENCLR_EMPTY_Msk instead */
  154. #define DAC_INTENCLR_MASK _U_(0x03) /**< \deprecated (DAC_INTENCLR) Register MASK (Use DAC_INTENCLR_Msk instead) */
  155. #define DAC_INTENCLR_Msk _U_(0x03) /**< (DAC_INTENCLR) Register Mask */
  156. /* -------- DAC_INTENSET : (DAC Offset: 0x05) (R/W 8) Interrupt Enable Set -------- */
  157. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  158. typedef union {
  159. struct {
  160. uint8_t UNDERRUN:1; /**< bit: 0 Underrun Interrupt Enable */
  161. uint8_t EMPTY:1; /**< bit: 1 Data Buffer Empty Interrupt Enable */
  162. uint8_t :6; /**< bit: 2..7 Reserved */
  163. } bit; /**< Structure used for bit access */
  164. uint8_t reg; /**< Type used for register access */
  165. } DAC_INTENSET_Type;
  166. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  167. #define DAC_INTENSET_OFFSET (0x05) /**< (DAC_INTENSET) Interrupt Enable Set Offset */
  168. #define DAC_INTENSET_RESETVALUE _U_(0x00) /**< (DAC_INTENSET) Interrupt Enable Set Reset Value */
  169. #define DAC_INTENSET_UNDERRUN_Pos 0 /**< (DAC_INTENSET) Underrun Interrupt Enable Position */
  170. #define DAC_INTENSET_UNDERRUN_Msk (_U_(0x1) << DAC_INTENSET_UNDERRUN_Pos) /**< (DAC_INTENSET) Underrun Interrupt Enable Mask */
  171. #define DAC_INTENSET_UNDERRUN DAC_INTENSET_UNDERRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_INTENSET_UNDERRUN_Msk instead */
  172. #define DAC_INTENSET_EMPTY_Pos 1 /**< (DAC_INTENSET) Data Buffer Empty Interrupt Enable Position */
  173. #define DAC_INTENSET_EMPTY_Msk (_U_(0x1) << DAC_INTENSET_EMPTY_Pos) /**< (DAC_INTENSET) Data Buffer Empty Interrupt Enable Mask */
  174. #define DAC_INTENSET_EMPTY DAC_INTENSET_EMPTY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_INTENSET_EMPTY_Msk instead */
  175. #define DAC_INTENSET_MASK _U_(0x03) /**< \deprecated (DAC_INTENSET) Register MASK (Use DAC_INTENSET_Msk instead) */
  176. #define DAC_INTENSET_Msk _U_(0x03) /**< (DAC_INTENSET) Register Mask */
  177. /* -------- DAC_INTFLAG : (DAC Offset: 0x06) (R/W 8) Interrupt Flag Status and Clear -------- */
  178. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  179. typedef union { // __I to avoid read-modify-write on write-to-clear register
  180. struct {
  181. __I uint8_t UNDERRUN:1; /**< bit: 0 Underrun */
  182. __I uint8_t EMPTY:1; /**< bit: 1 Data Buffer Empty */
  183. __I uint8_t :6; /**< bit: 2..7 Reserved */
  184. } bit; /**< Structure used for bit access */
  185. uint8_t reg; /**< Type used for register access */
  186. } DAC_INTFLAG_Type;
  187. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  188. #define DAC_INTFLAG_OFFSET (0x06) /**< (DAC_INTFLAG) Interrupt Flag Status and Clear Offset */
  189. #define DAC_INTFLAG_RESETVALUE _U_(0x00) /**< (DAC_INTFLAG) Interrupt Flag Status and Clear Reset Value */
  190. #define DAC_INTFLAG_UNDERRUN_Pos 0 /**< (DAC_INTFLAG) Underrun Position */
  191. #define DAC_INTFLAG_UNDERRUN_Msk (_U_(0x1) << DAC_INTFLAG_UNDERRUN_Pos) /**< (DAC_INTFLAG) Underrun Mask */
  192. #define DAC_INTFLAG_UNDERRUN DAC_INTFLAG_UNDERRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_INTFLAG_UNDERRUN_Msk instead */
  193. #define DAC_INTFLAG_EMPTY_Pos 1 /**< (DAC_INTFLAG) Data Buffer Empty Position */
  194. #define DAC_INTFLAG_EMPTY_Msk (_U_(0x1) << DAC_INTFLAG_EMPTY_Pos) /**< (DAC_INTFLAG) Data Buffer Empty Mask */
  195. #define DAC_INTFLAG_EMPTY DAC_INTFLAG_EMPTY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_INTFLAG_EMPTY_Msk instead */
  196. #define DAC_INTFLAG_MASK _U_(0x03) /**< \deprecated (DAC_INTFLAG) Register MASK (Use DAC_INTFLAG_Msk instead) */
  197. #define DAC_INTFLAG_Msk _U_(0x03) /**< (DAC_INTFLAG) Register Mask */
  198. /* -------- DAC_STATUS : (DAC Offset: 0x07) (R/ 8) Status -------- */
  199. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  200. typedef union {
  201. struct {
  202. uint8_t READY:1; /**< bit: 0 Ready */
  203. uint8_t :7; /**< bit: 1..7 Reserved */
  204. } bit; /**< Structure used for bit access */
  205. uint8_t reg; /**< Type used for register access */
  206. } DAC_STATUS_Type;
  207. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  208. #define DAC_STATUS_OFFSET (0x07) /**< (DAC_STATUS) Status Offset */
  209. #define DAC_STATUS_RESETVALUE _U_(0x00) /**< (DAC_STATUS) Status Reset Value */
  210. #define DAC_STATUS_READY_Pos 0 /**< (DAC_STATUS) Ready Position */
  211. #define DAC_STATUS_READY_Msk (_U_(0x1) << DAC_STATUS_READY_Pos) /**< (DAC_STATUS) Ready Mask */
  212. #define DAC_STATUS_READY DAC_STATUS_READY_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_STATUS_READY_Msk instead */
  213. #define DAC_STATUS_MASK _U_(0x01) /**< \deprecated (DAC_STATUS) Register MASK (Use DAC_STATUS_Msk instead) */
  214. #define DAC_STATUS_Msk _U_(0x01) /**< (DAC_STATUS) Register Mask */
  215. /* -------- DAC_DATA : (DAC Offset: 0x08) (/W 16) Data -------- */
  216. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  217. typedef union {
  218. struct {
  219. uint16_t DATA:16; /**< bit: 0..15 Data value to be converted */
  220. } bit; /**< Structure used for bit access */
  221. uint16_t reg; /**< Type used for register access */
  222. } DAC_DATA_Type;
  223. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  224. #define DAC_DATA_OFFSET (0x08) /**< (DAC_DATA) Data Offset */
  225. #define DAC_DATA_RESETVALUE _U_(0x00) /**< (DAC_DATA) Data Reset Value */
  226. #define DAC_DATA_DATA_Pos 0 /**< (DAC_DATA) Data value to be converted Position */
  227. #define DAC_DATA_DATA_Msk (_U_(0xFFFF) << DAC_DATA_DATA_Pos) /**< (DAC_DATA) Data value to be converted Mask */
  228. #define DAC_DATA_DATA(value) (DAC_DATA_DATA_Msk & ((value) << DAC_DATA_DATA_Pos))
  229. #define DAC_DATA_MASK _U_(0xFFFF) /**< \deprecated (DAC_DATA) Register MASK (Use DAC_DATA_Msk instead) */
  230. #define DAC_DATA_Msk _U_(0xFFFF) /**< (DAC_DATA) Register Mask */
  231. /* -------- DAC_DATABUF : (DAC Offset: 0x0c) (/W 16) Data Buffer -------- */
  232. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  233. typedef union {
  234. struct {
  235. uint16_t DATABUF:16; /**< bit: 0..15 Data Buffer */
  236. } bit; /**< Structure used for bit access */
  237. uint16_t reg; /**< Type used for register access */
  238. } DAC_DATABUF_Type;
  239. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  240. #define DAC_DATABUF_OFFSET (0x0C) /**< (DAC_DATABUF) Data Buffer Offset */
  241. #define DAC_DATABUF_RESETVALUE _U_(0x00) /**< (DAC_DATABUF) Data Buffer Reset Value */
  242. #define DAC_DATABUF_DATABUF_Pos 0 /**< (DAC_DATABUF) Data Buffer Position */
  243. #define DAC_DATABUF_DATABUF_Msk (_U_(0xFFFF) << DAC_DATABUF_DATABUF_Pos) /**< (DAC_DATABUF) Data Buffer Mask */
  244. #define DAC_DATABUF_DATABUF(value) (DAC_DATABUF_DATABUF_Msk & ((value) << DAC_DATABUF_DATABUF_Pos))
  245. #define DAC_DATABUF_MASK _U_(0xFFFF) /**< \deprecated (DAC_DATABUF) Register MASK (Use DAC_DATABUF_Msk instead) */
  246. #define DAC_DATABUF_Msk _U_(0xFFFF) /**< (DAC_DATABUF) Register Mask */
  247. /* -------- DAC_SYNCBUSY : (DAC Offset: 0x10) (R/ 32) Synchronization Busy -------- */
  248. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  249. typedef union {
  250. struct {
  251. uint32_t SWRST:1; /**< bit: 0 Software Reset */
  252. uint32_t ENABLE:1; /**< bit: 1 Enable */
  253. uint32_t DATA:1; /**< bit: 2 Data */
  254. uint32_t DATABUF:1; /**< bit: 3 Data Buffer */
  255. uint32_t :28; /**< bit: 4..31 Reserved */
  256. } bit; /**< Structure used for bit access */
  257. uint32_t reg; /**< Type used for register access */
  258. } DAC_SYNCBUSY_Type;
  259. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  260. #define DAC_SYNCBUSY_OFFSET (0x10) /**< (DAC_SYNCBUSY) Synchronization Busy Offset */
  261. #define DAC_SYNCBUSY_RESETVALUE _U_(0x00) /**< (DAC_SYNCBUSY) Synchronization Busy Reset Value */
  262. #define DAC_SYNCBUSY_SWRST_Pos 0 /**< (DAC_SYNCBUSY) Software Reset Position */
  263. #define DAC_SYNCBUSY_SWRST_Msk (_U_(0x1) << DAC_SYNCBUSY_SWRST_Pos) /**< (DAC_SYNCBUSY) Software Reset Mask */
  264. #define DAC_SYNCBUSY_SWRST DAC_SYNCBUSY_SWRST_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_SYNCBUSY_SWRST_Msk instead */
  265. #define DAC_SYNCBUSY_ENABLE_Pos 1 /**< (DAC_SYNCBUSY) Enable Position */
  266. #define DAC_SYNCBUSY_ENABLE_Msk (_U_(0x1) << DAC_SYNCBUSY_ENABLE_Pos) /**< (DAC_SYNCBUSY) Enable Mask */
  267. #define DAC_SYNCBUSY_ENABLE DAC_SYNCBUSY_ENABLE_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_SYNCBUSY_ENABLE_Msk instead */
  268. #define DAC_SYNCBUSY_DATA_Pos 2 /**< (DAC_SYNCBUSY) Data Position */
  269. #define DAC_SYNCBUSY_DATA_Msk (_U_(0x1) << DAC_SYNCBUSY_DATA_Pos) /**< (DAC_SYNCBUSY) Data Mask */
  270. #define DAC_SYNCBUSY_DATA DAC_SYNCBUSY_DATA_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_SYNCBUSY_DATA_Msk instead */
  271. #define DAC_SYNCBUSY_DATABUF_Pos 3 /**< (DAC_SYNCBUSY) Data Buffer Position */
  272. #define DAC_SYNCBUSY_DATABUF_Msk (_U_(0x1) << DAC_SYNCBUSY_DATABUF_Pos) /**< (DAC_SYNCBUSY) Data Buffer Mask */
  273. #define DAC_SYNCBUSY_DATABUF DAC_SYNCBUSY_DATABUF_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_SYNCBUSY_DATABUF_Msk instead */
  274. #define DAC_SYNCBUSY_MASK _U_(0x0F) /**< \deprecated (DAC_SYNCBUSY) Register MASK (Use DAC_SYNCBUSY_Msk instead) */
  275. #define DAC_SYNCBUSY_Msk _U_(0x0F) /**< (DAC_SYNCBUSY) Register Mask */
  276. /* -------- DAC_DBGCTRL : (DAC Offset: 0x14) (R/W 8) Debug Control -------- */
  277. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  278. typedef union {
  279. struct {
  280. uint8_t DBGRUN:1; /**< bit: 0 Debug Run */
  281. uint8_t :7; /**< bit: 1..7 Reserved */
  282. } bit; /**< Structure used for bit access */
  283. uint8_t reg; /**< Type used for register access */
  284. } DAC_DBGCTRL_Type;
  285. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  286. #define DAC_DBGCTRL_OFFSET (0x14) /**< (DAC_DBGCTRL) Debug Control Offset */
  287. #define DAC_DBGCTRL_RESETVALUE _U_(0x00) /**< (DAC_DBGCTRL) Debug Control Reset Value */
  288. #define DAC_DBGCTRL_DBGRUN_Pos 0 /**< (DAC_DBGCTRL) Debug Run Position */
  289. #define DAC_DBGCTRL_DBGRUN_Msk (_U_(0x1) << DAC_DBGCTRL_DBGRUN_Pos) /**< (DAC_DBGCTRL) Debug Run Mask */
  290. #define DAC_DBGCTRL_DBGRUN DAC_DBGCTRL_DBGRUN_Msk /**< \deprecated Old style mask definition for 1 bit bitfield. Use DAC_DBGCTRL_DBGRUN_Msk instead */
  291. #define DAC_DBGCTRL_MASK _U_(0x01) /**< \deprecated (DAC_DBGCTRL) Register MASK (Use DAC_DBGCTRL_Msk instead) */
  292. #define DAC_DBGCTRL_Msk _U_(0x01) /**< (DAC_DBGCTRL) Register Mask */
  293. #if !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
  294. /** \brief DAC hardware registers */
  295. typedef struct { /* Digital Analog Converter */
  296. __IO DAC_CTRLA_Type CTRLA; /**< Offset: 0x00 (R/W 8) Control A */
  297. __IO DAC_CTRLB_Type CTRLB; /**< Offset: 0x01 (R/W 8) Control B */
  298. __IO DAC_EVCTRL_Type EVCTRL; /**< Offset: 0x02 (R/W 8) Event Control */
  299. __I uint8_t Reserved1[1];
  300. __IO DAC_INTENCLR_Type INTENCLR; /**< Offset: 0x04 (R/W 8) Interrupt Enable Clear */
  301. __IO DAC_INTENSET_Type INTENSET; /**< Offset: 0x05 (R/W 8) Interrupt Enable Set */
  302. __IO DAC_INTFLAG_Type INTFLAG; /**< Offset: 0x06 (R/W 8) Interrupt Flag Status and Clear */
  303. __I DAC_STATUS_Type STATUS; /**< Offset: 0x07 (R/ 8) Status */
  304. __O DAC_DATA_Type DATA; /**< Offset: 0x08 ( /W 16) Data */
  305. __I uint8_t Reserved2[2];
  306. __O DAC_DATABUF_Type DATABUF; /**< Offset: 0x0C ( /W 16) Data Buffer */
  307. __I uint8_t Reserved3[2];
  308. __I DAC_SYNCBUSY_Type SYNCBUSY; /**< Offset: 0x10 (R/ 32) Synchronization Busy */
  309. __IO DAC_DBGCTRL_Type DBGCTRL; /**< Offset: 0x14 (R/W 8) Debug Control */
  310. } Dac;
  311. #endif /* !(defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__)) */
  312. /** @} end of Digital Analog Converter */
  313. #endif /* _SAML11_DAC_COMPONENT_H_ */