tcc.h 144 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813
  1. /**
  2. * \file
  3. *
  4. * \brief Component description for TCC
  5. *
  6. * Copyright (c) 2018 Microchip Technology Inc.
  7. *
  8. * \asf_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"); you may
  15. * not use this file except in compliance with the License.
  16. * You may obtain a copy of the Licence 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, WITHOUT
  22. * 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. * \asf_license_stop
  27. *
  28. */
  29. #ifndef _SAMD11_TCC_COMPONENT_
  30. #define _SAMD11_TCC_COMPONENT_
  31. /* ========================================================================== */
  32. /** SOFTWARE API DEFINITION FOR TCC */
  33. /* ========================================================================== */
  34. /** \addtogroup SAMD11_TCC Timer Counter Control */
  35. /*@{*/
  36. #define TCC_U2213
  37. #define REV_TCC 0x111
  38. /* -------- TCC_CTRLA : (TCC Offset: 0x00) (R/W 32) Control A -------- */
  39. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  40. typedef union {
  41. struct {
  42. uint32_t SWRST:1; /*!< bit: 0 Software Reset */
  43. uint32_t ENABLE:1; /*!< bit: 1 Enable */
  44. uint32_t :3; /*!< bit: 2.. 4 Reserved */
  45. uint32_t RESOLUTION:2; /*!< bit: 5.. 6 Enhanced Resolution */
  46. uint32_t :1; /*!< bit: 7 Reserved */
  47. uint32_t PRESCALER:3; /*!< bit: 8..10 Prescaler */
  48. uint32_t RUNSTDBY:1; /*!< bit: 11 Run in Standby */
  49. uint32_t PRESCSYNC:2; /*!< bit: 12..13 Prescaler and Counter Synchronization Selection */
  50. uint32_t ALOCK:1; /*!< bit: 14 Auto Lock */
  51. uint32_t :9; /*!< bit: 15..23 Reserved */
  52. uint32_t CPTEN0:1; /*!< bit: 24 Capture Channel 0 Enable */
  53. uint32_t CPTEN1:1; /*!< bit: 25 Capture Channel 1 Enable */
  54. uint32_t CPTEN2:1; /*!< bit: 26 Capture Channel 2 Enable */
  55. uint32_t CPTEN3:1; /*!< bit: 27 Capture Channel 3 Enable */
  56. uint32_t :4; /*!< bit: 28..31 Reserved */
  57. } bit; /*!< Structure used for bit access */
  58. struct {
  59. uint32_t :24; /*!< bit: 0..23 Reserved */
  60. uint32_t CPTEN:4; /*!< bit: 24..27 Capture Channel x Enable */
  61. uint32_t :4; /*!< bit: 28..31 Reserved */
  62. } vec; /*!< Structure used for vec access */
  63. uint32_t reg; /*!< Type used for register access */
  64. } TCC_CTRLA_Type;
  65. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  66. #define TCC_CTRLA_OFFSET 0x00 /**< \brief (TCC_CTRLA offset) Control A */
  67. #define TCC_CTRLA_RESETVALUE _U_(0x00000000) /**< \brief (TCC_CTRLA reset_value) Control A */
  68. #define TCC_CTRLA_SWRST_Pos 0 /**< \brief (TCC_CTRLA) Software Reset */
  69. #define TCC_CTRLA_SWRST (_U_(0x1) << TCC_CTRLA_SWRST_Pos)
  70. #define TCC_CTRLA_ENABLE_Pos 1 /**< \brief (TCC_CTRLA) Enable */
  71. #define TCC_CTRLA_ENABLE (_U_(0x1) << TCC_CTRLA_ENABLE_Pos)
  72. #define TCC_CTRLA_RESOLUTION_Pos 5 /**< \brief (TCC_CTRLA) Enhanced Resolution */
  73. #define TCC_CTRLA_RESOLUTION_Msk (_U_(0x3) << TCC_CTRLA_RESOLUTION_Pos)
  74. #define TCC_CTRLA_RESOLUTION(value) (TCC_CTRLA_RESOLUTION_Msk & ((value) << TCC_CTRLA_RESOLUTION_Pos))
  75. #define TCC_CTRLA_RESOLUTION_NONE_Val _U_(0x0) /**< \brief (TCC_CTRLA) Dithering is disabled */
  76. #define TCC_CTRLA_RESOLUTION_DITH4_Val _U_(0x1) /**< \brief (TCC_CTRLA) Dithering is done every 16 PWM frames */
  77. #define TCC_CTRLA_RESOLUTION_DITH5_Val _U_(0x2) /**< \brief (TCC_CTRLA) Dithering is done every 32 PWM frames */
  78. #define TCC_CTRLA_RESOLUTION_DITH6_Val _U_(0x3) /**< \brief (TCC_CTRLA) Dithering is done every 64 PWM frames */
  79. #define TCC_CTRLA_RESOLUTION_NONE (TCC_CTRLA_RESOLUTION_NONE_Val << TCC_CTRLA_RESOLUTION_Pos)
  80. #define TCC_CTRLA_RESOLUTION_DITH4 (TCC_CTRLA_RESOLUTION_DITH4_Val << TCC_CTRLA_RESOLUTION_Pos)
  81. #define TCC_CTRLA_RESOLUTION_DITH5 (TCC_CTRLA_RESOLUTION_DITH5_Val << TCC_CTRLA_RESOLUTION_Pos)
  82. #define TCC_CTRLA_RESOLUTION_DITH6 (TCC_CTRLA_RESOLUTION_DITH6_Val << TCC_CTRLA_RESOLUTION_Pos)
  83. #define TCC_CTRLA_PRESCALER_Pos 8 /**< \brief (TCC_CTRLA) Prescaler */
  84. #define TCC_CTRLA_PRESCALER_Msk (_U_(0x7) << TCC_CTRLA_PRESCALER_Pos)
  85. #define TCC_CTRLA_PRESCALER(value) (TCC_CTRLA_PRESCALER_Msk & ((value) << TCC_CTRLA_PRESCALER_Pos))
  86. #define TCC_CTRLA_PRESCALER_DIV1_Val _U_(0x0) /**< \brief (TCC_CTRLA) No division */
  87. #define TCC_CTRLA_PRESCALER_DIV2_Val _U_(0x1) /**< \brief (TCC_CTRLA) Divide by 2 */
  88. #define TCC_CTRLA_PRESCALER_DIV4_Val _U_(0x2) /**< \brief (TCC_CTRLA) Divide by 4 */
  89. #define TCC_CTRLA_PRESCALER_DIV8_Val _U_(0x3) /**< \brief (TCC_CTRLA) Divide by 8 */
  90. #define TCC_CTRLA_PRESCALER_DIV16_Val _U_(0x4) /**< \brief (TCC_CTRLA) Divide by 16 */
  91. #define TCC_CTRLA_PRESCALER_DIV64_Val _U_(0x5) /**< \brief (TCC_CTRLA) Divide by 64 */
  92. #define TCC_CTRLA_PRESCALER_DIV256_Val _U_(0x6) /**< \brief (TCC_CTRLA) Divide by 256 */
  93. #define TCC_CTRLA_PRESCALER_DIV1024_Val _U_(0x7) /**< \brief (TCC_CTRLA) Divide by 1024 */
  94. #define TCC_CTRLA_PRESCALER_DIV1 (TCC_CTRLA_PRESCALER_DIV1_Val << TCC_CTRLA_PRESCALER_Pos)
  95. #define TCC_CTRLA_PRESCALER_DIV2 (TCC_CTRLA_PRESCALER_DIV2_Val << TCC_CTRLA_PRESCALER_Pos)
  96. #define TCC_CTRLA_PRESCALER_DIV4 (TCC_CTRLA_PRESCALER_DIV4_Val << TCC_CTRLA_PRESCALER_Pos)
  97. #define TCC_CTRLA_PRESCALER_DIV8 (TCC_CTRLA_PRESCALER_DIV8_Val << TCC_CTRLA_PRESCALER_Pos)
  98. #define TCC_CTRLA_PRESCALER_DIV16 (TCC_CTRLA_PRESCALER_DIV16_Val << TCC_CTRLA_PRESCALER_Pos)
  99. #define TCC_CTRLA_PRESCALER_DIV64 (TCC_CTRLA_PRESCALER_DIV64_Val << TCC_CTRLA_PRESCALER_Pos)
  100. #define TCC_CTRLA_PRESCALER_DIV256 (TCC_CTRLA_PRESCALER_DIV256_Val << TCC_CTRLA_PRESCALER_Pos)
  101. #define TCC_CTRLA_PRESCALER_DIV1024 (TCC_CTRLA_PRESCALER_DIV1024_Val << TCC_CTRLA_PRESCALER_Pos)
  102. #define TCC_CTRLA_RUNSTDBY_Pos 11 /**< \brief (TCC_CTRLA) Run in Standby */
  103. #define TCC_CTRLA_RUNSTDBY (_U_(0x1) << TCC_CTRLA_RUNSTDBY_Pos)
  104. #define TCC_CTRLA_PRESCSYNC_Pos 12 /**< \brief (TCC_CTRLA) Prescaler and Counter Synchronization Selection */
  105. #define TCC_CTRLA_PRESCSYNC_Msk (_U_(0x3) << TCC_CTRLA_PRESCSYNC_Pos)
  106. #define TCC_CTRLA_PRESCSYNC(value) (TCC_CTRLA_PRESCSYNC_Msk & ((value) << TCC_CTRLA_PRESCSYNC_Pos))
  107. #define TCC_CTRLA_PRESCSYNC_GCLK_Val _U_(0x0) /**< \brief (TCC_CTRLA) Reload or reset counter on next GCLK */
  108. #define TCC_CTRLA_PRESCSYNC_PRESC_Val _U_(0x1) /**< \brief (TCC_CTRLA) Reload or reset counter on next prescaler clock */
  109. #define TCC_CTRLA_PRESCSYNC_RESYNC_Val _U_(0x2) /**< \brief (TCC_CTRLA) Reload or reset counter on next GCLK and reset prescaler counter */
  110. #define TCC_CTRLA_PRESCSYNC_GCLK (TCC_CTRLA_PRESCSYNC_GCLK_Val << TCC_CTRLA_PRESCSYNC_Pos)
  111. #define TCC_CTRLA_PRESCSYNC_PRESC (TCC_CTRLA_PRESCSYNC_PRESC_Val << TCC_CTRLA_PRESCSYNC_Pos)
  112. #define TCC_CTRLA_PRESCSYNC_RESYNC (TCC_CTRLA_PRESCSYNC_RESYNC_Val << TCC_CTRLA_PRESCSYNC_Pos)
  113. #define TCC_CTRLA_ALOCK_Pos 14 /**< \brief (TCC_CTRLA) Auto Lock */
  114. #define TCC_CTRLA_ALOCK (_U_(0x1) << TCC_CTRLA_ALOCK_Pos)
  115. #define TCC_CTRLA_CPTEN0_Pos 24 /**< \brief (TCC_CTRLA) Capture Channel 0 Enable */
  116. #define TCC_CTRLA_CPTEN0 (_U_(1) << TCC_CTRLA_CPTEN0_Pos)
  117. #define TCC_CTRLA_CPTEN1_Pos 25 /**< \brief (TCC_CTRLA) Capture Channel 1 Enable */
  118. #define TCC_CTRLA_CPTEN1 (_U_(1) << TCC_CTRLA_CPTEN1_Pos)
  119. #define TCC_CTRLA_CPTEN2_Pos 26 /**< \brief (TCC_CTRLA) Capture Channel 2 Enable */
  120. #define TCC_CTRLA_CPTEN2 (_U_(1) << TCC_CTRLA_CPTEN2_Pos)
  121. #define TCC_CTRLA_CPTEN3_Pos 27 /**< \brief (TCC_CTRLA) Capture Channel 3 Enable */
  122. #define TCC_CTRLA_CPTEN3 (_U_(1) << TCC_CTRLA_CPTEN3_Pos)
  123. #define TCC_CTRLA_CPTEN_Pos 24 /**< \brief (TCC_CTRLA) Capture Channel x Enable */
  124. #define TCC_CTRLA_CPTEN_Msk (_U_(0xF) << TCC_CTRLA_CPTEN_Pos)
  125. #define TCC_CTRLA_CPTEN(value) (TCC_CTRLA_CPTEN_Msk & ((value) << TCC_CTRLA_CPTEN_Pos))
  126. #define TCC_CTRLA_MASK _U_(0x0F007F63) /**< \brief (TCC_CTRLA) MASK Register */
  127. /* -------- TCC_CTRLBCLR : (TCC Offset: 0x04) (R/W 8) Control B Clear -------- */
  128. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  129. typedef union {
  130. struct {
  131. uint8_t DIR:1; /*!< bit: 0 Counter Direction */
  132. uint8_t LUPD:1; /*!< bit: 1 Lock Update */
  133. uint8_t ONESHOT:1; /*!< bit: 2 One-Shot */
  134. uint8_t IDXCMD:2; /*!< bit: 3.. 4 Ramp Index Command */
  135. uint8_t CMD:3; /*!< bit: 5.. 7 TCC Command */
  136. } bit; /*!< Structure used for bit access */
  137. uint8_t reg; /*!< Type used for register access */
  138. } TCC_CTRLBCLR_Type;
  139. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  140. #define TCC_CTRLBCLR_OFFSET 0x04 /**< \brief (TCC_CTRLBCLR offset) Control B Clear */
  141. #define TCC_CTRLBCLR_RESETVALUE _U_(0x00) /**< \brief (TCC_CTRLBCLR reset_value) Control B Clear */
  142. #define TCC_CTRLBCLR_DIR_Pos 0 /**< \brief (TCC_CTRLBCLR) Counter Direction */
  143. #define TCC_CTRLBCLR_DIR (_U_(0x1) << TCC_CTRLBCLR_DIR_Pos)
  144. #define TCC_CTRLBCLR_LUPD_Pos 1 /**< \brief (TCC_CTRLBCLR) Lock Update */
  145. #define TCC_CTRLBCLR_LUPD (_U_(0x1) << TCC_CTRLBCLR_LUPD_Pos)
  146. #define TCC_CTRLBCLR_ONESHOT_Pos 2 /**< \brief (TCC_CTRLBCLR) One-Shot */
  147. #define TCC_CTRLBCLR_ONESHOT (_U_(0x1) << TCC_CTRLBCLR_ONESHOT_Pos)
  148. #define TCC_CTRLBCLR_IDXCMD_Pos 3 /**< \brief (TCC_CTRLBCLR) Ramp Index Command */
  149. #define TCC_CTRLBCLR_IDXCMD_Msk (_U_(0x3) << TCC_CTRLBCLR_IDXCMD_Pos)
  150. #define TCC_CTRLBCLR_IDXCMD(value) (TCC_CTRLBCLR_IDXCMD_Msk & ((value) << TCC_CTRLBCLR_IDXCMD_Pos))
  151. #define TCC_CTRLBCLR_IDXCMD_DISABLE_Val _U_(0x0) /**< \brief (TCC_CTRLBCLR) Command disabled: Index toggles between cycles A and B */
  152. #define TCC_CTRLBCLR_IDXCMD_SET_Val _U_(0x1) /**< \brief (TCC_CTRLBCLR) Set index: cycle B will be forced in the next cycle */
  153. #define TCC_CTRLBCLR_IDXCMD_CLEAR_Val _U_(0x2) /**< \brief (TCC_CTRLBCLR) Clear index: cycle A will be forced in the next cycle */
  154. #define TCC_CTRLBCLR_IDXCMD_HOLD_Val _U_(0x3) /**< \brief (TCC_CTRLBCLR) Hold index: the next cycle will be the same as the current cycle */
  155. #define TCC_CTRLBCLR_IDXCMD_DISABLE (TCC_CTRLBCLR_IDXCMD_DISABLE_Val << TCC_CTRLBCLR_IDXCMD_Pos)
  156. #define TCC_CTRLBCLR_IDXCMD_SET (TCC_CTRLBCLR_IDXCMD_SET_Val << TCC_CTRLBCLR_IDXCMD_Pos)
  157. #define TCC_CTRLBCLR_IDXCMD_CLEAR (TCC_CTRLBCLR_IDXCMD_CLEAR_Val << TCC_CTRLBCLR_IDXCMD_Pos)
  158. #define TCC_CTRLBCLR_IDXCMD_HOLD (TCC_CTRLBCLR_IDXCMD_HOLD_Val << TCC_CTRLBCLR_IDXCMD_Pos)
  159. #define TCC_CTRLBCLR_CMD_Pos 5 /**< \brief (TCC_CTRLBCLR) TCC Command */
  160. #define TCC_CTRLBCLR_CMD_Msk (_U_(0x7) << TCC_CTRLBCLR_CMD_Pos)
  161. #define TCC_CTRLBCLR_CMD(value) (TCC_CTRLBCLR_CMD_Msk & ((value) << TCC_CTRLBCLR_CMD_Pos))
  162. #define TCC_CTRLBCLR_CMD_NONE_Val _U_(0x0) /**< \brief (TCC_CTRLBCLR) No action */
  163. #define TCC_CTRLBCLR_CMD_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_CTRLBCLR) Clear start, restart or retrigger */
  164. #define TCC_CTRLBCLR_CMD_STOP_Val _U_(0x2) /**< \brief (TCC_CTRLBCLR) Force stop */
  165. #define TCC_CTRLBCLR_CMD_UPDATE_Val _U_(0x3) /**< \brief (TCC_CTRLBCLR) Force update or double buffered registers */
  166. #define TCC_CTRLBCLR_CMD_READSYNC_Val _U_(0x4) /**< \brief (TCC_CTRLBCLR) Force COUNT read synchronization */
  167. #define TCC_CTRLBCLR_CMD_NONE (TCC_CTRLBCLR_CMD_NONE_Val << TCC_CTRLBCLR_CMD_Pos)
  168. #define TCC_CTRLBCLR_CMD_RETRIGGER (TCC_CTRLBCLR_CMD_RETRIGGER_Val << TCC_CTRLBCLR_CMD_Pos)
  169. #define TCC_CTRLBCLR_CMD_STOP (TCC_CTRLBCLR_CMD_STOP_Val << TCC_CTRLBCLR_CMD_Pos)
  170. #define TCC_CTRLBCLR_CMD_UPDATE (TCC_CTRLBCLR_CMD_UPDATE_Val << TCC_CTRLBCLR_CMD_Pos)
  171. #define TCC_CTRLBCLR_CMD_READSYNC (TCC_CTRLBCLR_CMD_READSYNC_Val << TCC_CTRLBCLR_CMD_Pos)
  172. #define TCC_CTRLBCLR_MASK _U_(0xFF) /**< \brief (TCC_CTRLBCLR) MASK Register */
  173. /* -------- TCC_CTRLBSET : (TCC Offset: 0x05) (R/W 8) Control B Set -------- */
  174. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  175. typedef union {
  176. struct {
  177. uint8_t DIR:1; /*!< bit: 0 Counter Direction */
  178. uint8_t LUPD:1; /*!< bit: 1 Lock Update */
  179. uint8_t ONESHOT:1; /*!< bit: 2 One-Shot */
  180. uint8_t IDXCMD:2; /*!< bit: 3.. 4 Ramp Index Command */
  181. uint8_t CMD:3; /*!< bit: 5.. 7 TCC Command */
  182. } bit; /*!< Structure used for bit access */
  183. uint8_t reg; /*!< Type used for register access */
  184. } TCC_CTRLBSET_Type;
  185. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  186. #define TCC_CTRLBSET_OFFSET 0x05 /**< \brief (TCC_CTRLBSET offset) Control B Set */
  187. #define TCC_CTRLBSET_RESETVALUE _U_(0x00) /**< \brief (TCC_CTRLBSET reset_value) Control B Set */
  188. #define TCC_CTRLBSET_DIR_Pos 0 /**< \brief (TCC_CTRLBSET) Counter Direction */
  189. #define TCC_CTRLBSET_DIR (_U_(0x1) << TCC_CTRLBSET_DIR_Pos)
  190. #define TCC_CTRLBSET_LUPD_Pos 1 /**< \brief (TCC_CTRLBSET) Lock Update */
  191. #define TCC_CTRLBSET_LUPD (_U_(0x1) << TCC_CTRLBSET_LUPD_Pos)
  192. #define TCC_CTRLBSET_ONESHOT_Pos 2 /**< \brief (TCC_CTRLBSET) One-Shot */
  193. #define TCC_CTRLBSET_ONESHOT (_U_(0x1) << TCC_CTRLBSET_ONESHOT_Pos)
  194. #define TCC_CTRLBSET_IDXCMD_Pos 3 /**< \brief (TCC_CTRLBSET) Ramp Index Command */
  195. #define TCC_CTRLBSET_IDXCMD_Msk (_U_(0x3) << TCC_CTRLBSET_IDXCMD_Pos)
  196. #define TCC_CTRLBSET_IDXCMD(value) (TCC_CTRLBSET_IDXCMD_Msk & ((value) << TCC_CTRLBSET_IDXCMD_Pos))
  197. #define TCC_CTRLBSET_IDXCMD_DISABLE_Val _U_(0x0) /**< \brief (TCC_CTRLBSET) Command disabled: Index toggles between cycles A and B */
  198. #define TCC_CTRLBSET_IDXCMD_SET_Val _U_(0x1) /**< \brief (TCC_CTRLBSET) Set index: cycle B will be forced in the next cycle */
  199. #define TCC_CTRLBSET_IDXCMD_CLEAR_Val _U_(0x2) /**< \brief (TCC_CTRLBSET) Clear index: cycle A will be forced in the next cycle */
  200. #define TCC_CTRLBSET_IDXCMD_HOLD_Val _U_(0x3) /**< \brief (TCC_CTRLBSET) Hold index: the next cycle will be the same as the current cycle */
  201. #define TCC_CTRLBSET_IDXCMD_DISABLE (TCC_CTRLBSET_IDXCMD_DISABLE_Val << TCC_CTRLBSET_IDXCMD_Pos)
  202. #define TCC_CTRLBSET_IDXCMD_SET (TCC_CTRLBSET_IDXCMD_SET_Val << TCC_CTRLBSET_IDXCMD_Pos)
  203. #define TCC_CTRLBSET_IDXCMD_CLEAR (TCC_CTRLBSET_IDXCMD_CLEAR_Val << TCC_CTRLBSET_IDXCMD_Pos)
  204. #define TCC_CTRLBSET_IDXCMD_HOLD (TCC_CTRLBSET_IDXCMD_HOLD_Val << TCC_CTRLBSET_IDXCMD_Pos)
  205. #define TCC_CTRLBSET_CMD_Pos 5 /**< \brief (TCC_CTRLBSET) TCC Command */
  206. #define TCC_CTRLBSET_CMD_Msk (_U_(0x7) << TCC_CTRLBSET_CMD_Pos)
  207. #define TCC_CTRLBSET_CMD(value) (TCC_CTRLBSET_CMD_Msk & ((value) << TCC_CTRLBSET_CMD_Pos))
  208. #define TCC_CTRLBSET_CMD_NONE_Val _U_(0x0) /**< \brief (TCC_CTRLBSET) No action */
  209. #define TCC_CTRLBSET_CMD_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_CTRLBSET) Clear start, restart or retrigger */
  210. #define TCC_CTRLBSET_CMD_STOP_Val _U_(0x2) /**< \brief (TCC_CTRLBSET) Force stop */
  211. #define TCC_CTRLBSET_CMD_UPDATE_Val _U_(0x3) /**< \brief (TCC_CTRLBSET) Force update or double buffered registers */
  212. #define TCC_CTRLBSET_CMD_READSYNC_Val _U_(0x4) /**< \brief (TCC_CTRLBSET) Force COUNT read synchronization */
  213. #define TCC_CTRLBSET_CMD_NONE (TCC_CTRLBSET_CMD_NONE_Val << TCC_CTRLBSET_CMD_Pos)
  214. #define TCC_CTRLBSET_CMD_RETRIGGER (TCC_CTRLBSET_CMD_RETRIGGER_Val << TCC_CTRLBSET_CMD_Pos)
  215. #define TCC_CTRLBSET_CMD_STOP (TCC_CTRLBSET_CMD_STOP_Val << TCC_CTRLBSET_CMD_Pos)
  216. #define TCC_CTRLBSET_CMD_UPDATE (TCC_CTRLBSET_CMD_UPDATE_Val << TCC_CTRLBSET_CMD_Pos)
  217. #define TCC_CTRLBSET_CMD_READSYNC (TCC_CTRLBSET_CMD_READSYNC_Val << TCC_CTRLBSET_CMD_Pos)
  218. #define TCC_CTRLBSET_MASK _U_(0xFF) /**< \brief (TCC_CTRLBSET) MASK Register */
  219. /* -------- TCC_SYNCBUSY : (TCC Offset: 0x08) (R/ 32) Synchronization Busy -------- */
  220. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  221. typedef union {
  222. struct {
  223. uint32_t SWRST:1; /*!< bit: 0 Swrst Busy */
  224. uint32_t ENABLE:1; /*!< bit: 1 Enable Busy */
  225. uint32_t CTRLB:1; /*!< bit: 2 Ctrlb Busy */
  226. uint32_t STATUS:1; /*!< bit: 3 Status Busy */
  227. uint32_t COUNT:1; /*!< bit: 4 Count Busy */
  228. uint32_t PATT:1; /*!< bit: 5 Pattern Busy */
  229. uint32_t WAVE:1; /*!< bit: 6 Wave Busy */
  230. uint32_t PER:1; /*!< bit: 7 Period busy */
  231. uint32_t CC0:1; /*!< bit: 8 Compare Channel 0 Busy */
  232. uint32_t CC1:1; /*!< bit: 9 Compare Channel 1 Busy */
  233. uint32_t CC2:1; /*!< bit: 10 Compare Channel 2 Busy */
  234. uint32_t CC3:1; /*!< bit: 11 Compare Channel 3 Busy */
  235. uint32_t :4; /*!< bit: 12..15 Reserved */
  236. uint32_t PATTB:1; /*!< bit: 16 Pattern Buffer Busy */
  237. uint32_t WAVEB:1; /*!< bit: 17 Wave Buffer Busy */
  238. uint32_t PERB:1; /*!< bit: 18 Period Buffer Busy */
  239. uint32_t CCB0:1; /*!< bit: 19 Compare Channel Buffer 0 Busy */
  240. uint32_t CCB1:1; /*!< bit: 20 Compare Channel Buffer 1 Busy */
  241. uint32_t CCB2:1; /*!< bit: 21 Compare Channel Buffer 2 Busy */
  242. uint32_t CCB3:1; /*!< bit: 22 Compare Channel Buffer 3 Busy */
  243. uint32_t :9; /*!< bit: 23..31 Reserved */
  244. } bit; /*!< Structure used for bit access */
  245. struct {
  246. uint32_t :8; /*!< bit: 0.. 7 Reserved */
  247. uint32_t CC:4; /*!< bit: 8..11 Compare Channel x Busy */
  248. uint32_t :7; /*!< bit: 12..18 Reserved */
  249. uint32_t CCB:4; /*!< bit: 19..22 Compare Channel Buffer x Busy */
  250. uint32_t :9; /*!< bit: 23..31 Reserved */
  251. } vec; /*!< Structure used for vec access */
  252. uint32_t reg; /*!< Type used for register access */
  253. } TCC_SYNCBUSY_Type;
  254. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  255. #define TCC_SYNCBUSY_OFFSET 0x08 /**< \brief (TCC_SYNCBUSY offset) Synchronization Busy */
  256. #define TCC_SYNCBUSY_RESETVALUE _U_(0x00000000) /**< \brief (TCC_SYNCBUSY reset_value) Synchronization Busy */
  257. #define TCC_SYNCBUSY_SWRST_Pos 0 /**< \brief (TCC_SYNCBUSY) Swrst Busy */
  258. #define TCC_SYNCBUSY_SWRST (_U_(0x1) << TCC_SYNCBUSY_SWRST_Pos)
  259. #define TCC_SYNCBUSY_ENABLE_Pos 1 /**< \brief (TCC_SYNCBUSY) Enable Busy */
  260. #define TCC_SYNCBUSY_ENABLE (_U_(0x1) << TCC_SYNCBUSY_ENABLE_Pos)
  261. #define TCC_SYNCBUSY_CTRLB_Pos 2 /**< \brief (TCC_SYNCBUSY) Ctrlb Busy */
  262. #define TCC_SYNCBUSY_CTRLB (_U_(0x1) << TCC_SYNCBUSY_CTRLB_Pos)
  263. #define TCC_SYNCBUSY_STATUS_Pos 3 /**< \brief (TCC_SYNCBUSY) Status Busy */
  264. #define TCC_SYNCBUSY_STATUS (_U_(0x1) << TCC_SYNCBUSY_STATUS_Pos)
  265. #define TCC_SYNCBUSY_COUNT_Pos 4 /**< \brief (TCC_SYNCBUSY) Count Busy */
  266. #define TCC_SYNCBUSY_COUNT (_U_(0x1) << TCC_SYNCBUSY_COUNT_Pos)
  267. #define TCC_SYNCBUSY_PATT_Pos 5 /**< \brief (TCC_SYNCBUSY) Pattern Busy */
  268. #define TCC_SYNCBUSY_PATT (_U_(0x1) << TCC_SYNCBUSY_PATT_Pos)
  269. #define TCC_SYNCBUSY_WAVE_Pos 6 /**< \brief (TCC_SYNCBUSY) Wave Busy */
  270. #define TCC_SYNCBUSY_WAVE (_U_(0x1) << TCC_SYNCBUSY_WAVE_Pos)
  271. #define TCC_SYNCBUSY_PER_Pos 7 /**< \brief (TCC_SYNCBUSY) Period busy */
  272. #define TCC_SYNCBUSY_PER (_U_(0x1) << TCC_SYNCBUSY_PER_Pos)
  273. #define TCC_SYNCBUSY_CC0_Pos 8 /**< \brief (TCC_SYNCBUSY) Compare Channel 0 Busy */
  274. #define TCC_SYNCBUSY_CC0 (_U_(1) << TCC_SYNCBUSY_CC0_Pos)
  275. #define TCC_SYNCBUSY_CC1_Pos 9 /**< \brief (TCC_SYNCBUSY) Compare Channel 1 Busy */
  276. #define TCC_SYNCBUSY_CC1 (_U_(1) << TCC_SYNCBUSY_CC1_Pos)
  277. #define TCC_SYNCBUSY_CC2_Pos 10 /**< \brief (TCC_SYNCBUSY) Compare Channel 2 Busy */
  278. #define TCC_SYNCBUSY_CC2 (_U_(1) << TCC_SYNCBUSY_CC2_Pos)
  279. #define TCC_SYNCBUSY_CC3_Pos 11 /**< \brief (TCC_SYNCBUSY) Compare Channel 3 Busy */
  280. #define TCC_SYNCBUSY_CC3 (_U_(1) << TCC_SYNCBUSY_CC3_Pos)
  281. #define TCC_SYNCBUSY_CC_Pos 8 /**< \brief (TCC_SYNCBUSY) Compare Channel x Busy */
  282. #define TCC_SYNCBUSY_CC_Msk (_U_(0xF) << TCC_SYNCBUSY_CC_Pos)
  283. #define TCC_SYNCBUSY_CC(value) (TCC_SYNCBUSY_CC_Msk & ((value) << TCC_SYNCBUSY_CC_Pos))
  284. #define TCC_SYNCBUSY_PATTB_Pos 16 /**< \brief (TCC_SYNCBUSY) Pattern Buffer Busy */
  285. #define TCC_SYNCBUSY_PATTB (_U_(0x1) << TCC_SYNCBUSY_PATTB_Pos)
  286. #define TCC_SYNCBUSY_WAVEB_Pos 17 /**< \brief (TCC_SYNCBUSY) Wave Buffer Busy */
  287. #define TCC_SYNCBUSY_WAVEB (_U_(0x1) << TCC_SYNCBUSY_WAVEB_Pos)
  288. #define TCC_SYNCBUSY_PERB_Pos 18 /**< \brief (TCC_SYNCBUSY) Period Buffer Busy */
  289. #define TCC_SYNCBUSY_PERB (_U_(0x1) << TCC_SYNCBUSY_PERB_Pos)
  290. #define TCC_SYNCBUSY_CCB0_Pos 19 /**< \brief (TCC_SYNCBUSY) Compare Channel Buffer 0 Busy */
  291. #define TCC_SYNCBUSY_CCB0 (_U_(1) << TCC_SYNCBUSY_CCB0_Pos)
  292. #define TCC_SYNCBUSY_CCB1_Pos 20 /**< \brief (TCC_SYNCBUSY) Compare Channel Buffer 1 Busy */
  293. #define TCC_SYNCBUSY_CCB1 (_U_(1) << TCC_SYNCBUSY_CCB1_Pos)
  294. #define TCC_SYNCBUSY_CCB2_Pos 21 /**< \brief (TCC_SYNCBUSY) Compare Channel Buffer 2 Busy */
  295. #define TCC_SYNCBUSY_CCB2 (_U_(1) << TCC_SYNCBUSY_CCB2_Pos)
  296. #define TCC_SYNCBUSY_CCB3_Pos 22 /**< \brief (TCC_SYNCBUSY) Compare Channel Buffer 3 Busy */
  297. #define TCC_SYNCBUSY_CCB3 (_U_(1) << TCC_SYNCBUSY_CCB3_Pos)
  298. #define TCC_SYNCBUSY_CCB_Pos 19 /**< \brief (TCC_SYNCBUSY) Compare Channel Buffer x Busy */
  299. #define TCC_SYNCBUSY_CCB_Msk (_U_(0xF) << TCC_SYNCBUSY_CCB_Pos)
  300. #define TCC_SYNCBUSY_CCB(value) (TCC_SYNCBUSY_CCB_Msk & ((value) << TCC_SYNCBUSY_CCB_Pos))
  301. #define TCC_SYNCBUSY_MASK _U_(0x007F0FFF) /**< \brief (TCC_SYNCBUSY) MASK Register */
  302. /* -------- TCC_FCTRLA : (TCC Offset: 0x0C) (R/W 32) Recoverable Fault A Configuration -------- */
  303. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  304. typedef union {
  305. struct {
  306. uint32_t SRC:2; /*!< bit: 0.. 1 Fault A Source */
  307. uint32_t :1; /*!< bit: 2 Reserved */
  308. uint32_t KEEP:1; /*!< bit: 3 Fault A Keeper */
  309. uint32_t QUAL:1; /*!< bit: 4 Fault A Qualification */
  310. uint32_t BLANK:2; /*!< bit: 5.. 6 Fault A Blanking Mode */
  311. uint32_t RESTART:1; /*!< bit: 7 Fault A Restart */
  312. uint32_t HALT:2; /*!< bit: 8.. 9 Fault A Halt Mode */
  313. uint32_t CHSEL:2; /*!< bit: 10..11 Fault A Capture Channel */
  314. uint32_t CAPTURE:3; /*!< bit: 12..14 Fault A Capture Action */
  315. uint32_t BLANKPRESC:1; /*!< bit: 15 Fault A Blanking Prescaler */
  316. uint32_t BLANKVAL:8; /*!< bit: 16..23 Fault A Blanking Time */
  317. uint32_t FILTERVAL:4; /*!< bit: 24..27 Fault A Filter Value */
  318. uint32_t :4; /*!< bit: 28..31 Reserved */
  319. } bit; /*!< Structure used for bit access */
  320. uint32_t reg; /*!< Type used for register access */
  321. } TCC_FCTRLA_Type;
  322. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  323. #define TCC_FCTRLA_OFFSET 0x0C /**< \brief (TCC_FCTRLA offset) Recoverable Fault A Configuration */
  324. #define TCC_FCTRLA_RESETVALUE _U_(0x00000000) /**< \brief (TCC_FCTRLA reset_value) Recoverable Fault A Configuration */
  325. #define TCC_FCTRLA_SRC_Pos 0 /**< \brief (TCC_FCTRLA) Fault A Source */
  326. #define TCC_FCTRLA_SRC_Msk (_U_(0x3) << TCC_FCTRLA_SRC_Pos)
  327. #define TCC_FCTRLA_SRC(value) (TCC_FCTRLA_SRC_Msk & ((value) << TCC_FCTRLA_SRC_Pos))
  328. #define TCC_FCTRLA_SRC_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Fault input disabled */
  329. #define TCC_FCTRLA_SRC_ENABLE_Val _U_(0x1) /**< \brief (TCC_FCTRLA) MCEx (x=0,1) event input */
  330. #define TCC_FCTRLA_SRC_INVERT_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Inverted MCEx (x=0,1) event input */
  331. #define TCC_FCTRLA_SRC_ALTFAULT_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Alternate fault (A or B) state at the end of the previous period */
  332. #define TCC_FCTRLA_SRC_DISABLE (TCC_FCTRLA_SRC_DISABLE_Val << TCC_FCTRLA_SRC_Pos)
  333. #define TCC_FCTRLA_SRC_ENABLE (TCC_FCTRLA_SRC_ENABLE_Val << TCC_FCTRLA_SRC_Pos)
  334. #define TCC_FCTRLA_SRC_INVERT (TCC_FCTRLA_SRC_INVERT_Val << TCC_FCTRLA_SRC_Pos)
  335. #define TCC_FCTRLA_SRC_ALTFAULT (TCC_FCTRLA_SRC_ALTFAULT_Val << TCC_FCTRLA_SRC_Pos)
  336. #define TCC_FCTRLA_KEEP_Pos 3 /**< \brief (TCC_FCTRLA) Fault A Keeper */
  337. #define TCC_FCTRLA_KEEP (_U_(0x1) << TCC_FCTRLA_KEEP_Pos)
  338. #define TCC_FCTRLA_QUAL_Pos 4 /**< \brief (TCC_FCTRLA) Fault A Qualification */
  339. #define TCC_FCTRLA_QUAL (_U_(0x1) << TCC_FCTRLA_QUAL_Pos)
  340. #define TCC_FCTRLA_BLANK_Pos 5 /**< \brief (TCC_FCTRLA) Fault A Blanking Mode */
  341. #define TCC_FCTRLA_BLANK_Msk (_U_(0x3) << TCC_FCTRLA_BLANK_Pos)
  342. #define TCC_FCTRLA_BLANK(value) (TCC_FCTRLA_BLANK_Msk & ((value) << TCC_FCTRLA_BLANK_Pos))
  343. #define TCC_FCTRLA_BLANK_START_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Blanking applied from start of ramp */
  344. #define TCC_FCTRLA_BLANK_RISE_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Blanking applied from rising edge of the output waveform */
  345. #define TCC_FCTRLA_BLANK_FALL_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Blanking applied from falling edge of the output waveform */
  346. #define TCC_FCTRLA_BLANK_BOTH_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Blanking applied from each toggle of the output waveform */
  347. #define TCC_FCTRLA_BLANK_START (TCC_FCTRLA_BLANK_START_Val << TCC_FCTRLA_BLANK_Pos)
  348. #define TCC_FCTRLA_BLANK_RISE (TCC_FCTRLA_BLANK_RISE_Val << TCC_FCTRLA_BLANK_Pos)
  349. #define TCC_FCTRLA_BLANK_FALL (TCC_FCTRLA_BLANK_FALL_Val << TCC_FCTRLA_BLANK_Pos)
  350. #define TCC_FCTRLA_BLANK_BOTH (TCC_FCTRLA_BLANK_BOTH_Val << TCC_FCTRLA_BLANK_Pos)
  351. #define TCC_FCTRLA_RESTART_Pos 7 /**< \brief (TCC_FCTRLA) Fault A Restart */
  352. #define TCC_FCTRLA_RESTART (_U_(0x1) << TCC_FCTRLA_RESTART_Pos)
  353. #define TCC_FCTRLA_HALT_Pos 8 /**< \brief (TCC_FCTRLA) Fault A Halt Mode */
  354. #define TCC_FCTRLA_HALT_Msk (_U_(0x3) << TCC_FCTRLA_HALT_Pos)
  355. #define TCC_FCTRLA_HALT(value) (TCC_FCTRLA_HALT_Msk & ((value) << TCC_FCTRLA_HALT_Pos))
  356. #define TCC_FCTRLA_HALT_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Halt action disabled */
  357. #define TCC_FCTRLA_HALT_HW_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Hardware halt action */
  358. #define TCC_FCTRLA_HALT_SW_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Software halt action */
  359. #define TCC_FCTRLA_HALT_NR_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Non-recoverable fault */
  360. #define TCC_FCTRLA_HALT_DISABLE (TCC_FCTRLA_HALT_DISABLE_Val << TCC_FCTRLA_HALT_Pos)
  361. #define TCC_FCTRLA_HALT_HW (TCC_FCTRLA_HALT_HW_Val << TCC_FCTRLA_HALT_Pos)
  362. #define TCC_FCTRLA_HALT_SW (TCC_FCTRLA_HALT_SW_Val << TCC_FCTRLA_HALT_Pos)
  363. #define TCC_FCTRLA_HALT_NR (TCC_FCTRLA_HALT_NR_Val << TCC_FCTRLA_HALT_Pos)
  364. #define TCC_FCTRLA_CHSEL_Pos 10 /**< \brief (TCC_FCTRLA) Fault A Capture Channel */
  365. #define TCC_FCTRLA_CHSEL_Msk (_U_(0x3) << TCC_FCTRLA_CHSEL_Pos)
  366. #define TCC_FCTRLA_CHSEL(value) (TCC_FCTRLA_CHSEL_Msk & ((value) << TCC_FCTRLA_CHSEL_Pos))
  367. #define TCC_FCTRLA_CHSEL_CC0_Val _U_(0x0) /**< \brief (TCC_FCTRLA) Capture value stored in channel 0 */
  368. #define TCC_FCTRLA_CHSEL_CC1_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Capture value stored in channel 1 */
  369. #define TCC_FCTRLA_CHSEL_CC2_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Capture value stored in channel 2 */
  370. #define TCC_FCTRLA_CHSEL_CC3_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Capture value stored in channel 3 */
  371. #define TCC_FCTRLA_CHSEL_CC0 (TCC_FCTRLA_CHSEL_CC0_Val << TCC_FCTRLA_CHSEL_Pos)
  372. #define TCC_FCTRLA_CHSEL_CC1 (TCC_FCTRLA_CHSEL_CC1_Val << TCC_FCTRLA_CHSEL_Pos)
  373. #define TCC_FCTRLA_CHSEL_CC2 (TCC_FCTRLA_CHSEL_CC2_Val << TCC_FCTRLA_CHSEL_Pos)
  374. #define TCC_FCTRLA_CHSEL_CC3 (TCC_FCTRLA_CHSEL_CC3_Val << TCC_FCTRLA_CHSEL_Pos)
  375. #define TCC_FCTRLA_CAPTURE_Pos 12 /**< \brief (TCC_FCTRLA) Fault A Capture Action */
  376. #define TCC_FCTRLA_CAPTURE_Msk (_U_(0x7) << TCC_FCTRLA_CAPTURE_Pos)
  377. #define TCC_FCTRLA_CAPTURE(value) (TCC_FCTRLA_CAPTURE_Msk & ((value) << TCC_FCTRLA_CAPTURE_Pos))
  378. #define TCC_FCTRLA_CAPTURE_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLA) No capture */
  379. #define TCC_FCTRLA_CAPTURE_CAPT_Val _U_(0x1) /**< \brief (TCC_FCTRLA) Capture on fault */
  380. #define TCC_FCTRLA_CAPTURE_CAPTMIN_Val _U_(0x2) /**< \brief (TCC_FCTRLA) Minimum capture */
  381. #define TCC_FCTRLA_CAPTURE_CAPTMAX_Val _U_(0x3) /**< \brief (TCC_FCTRLA) Maximum capture */
  382. #define TCC_FCTRLA_CAPTURE_LOCMIN_Val _U_(0x4) /**< \brief (TCC_FCTRLA) Minimum local detection */
  383. #define TCC_FCTRLA_CAPTURE_LOCMAX_Val _U_(0x5) /**< \brief (TCC_FCTRLA) Maximum local detection */
  384. #define TCC_FCTRLA_CAPTURE_DERIV0_Val _U_(0x6) /**< \brief (TCC_FCTRLA) Minimum and maximum local detection */
  385. #define TCC_FCTRLA_CAPTURE_CAPTMARK_Val _U_(0x7) /**< \brief (TCC_FCTRLA) Capture with ramp index as MSB value */
  386. #define TCC_FCTRLA_CAPTURE_DISABLE (TCC_FCTRLA_CAPTURE_DISABLE_Val << TCC_FCTRLA_CAPTURE_Pos)
  387. #define TCC_FCTRLA_CAPTURE_CAPT (TCC_FCTRLA_CAPTURE_CAPT_Val << TCC_FCTRLA_CAPTURE_Pos)
  388. #define TCC_FCTRLA_CAPTURE_CAPTMIN (TCC_FCTRLA_CAPTURE_CAPTMIN_Val << TCC_FCTRLA_CAPTURE_Pos)
  389. #define TCC_FCTRLA_CAPTURE_CAPTMAX (TCC_FCTRLA_CAPTURE_CAPTMAX_Val << TCC_FCTRLA_CAPTURE_Pos)
  390. #define TCC_FCTRLA_CAPTURE_LOCMIN (TCC_FCTRLA_CAPTURE_LOCMIN_Val << TCC_FCTRLA_CAPTURE_Pos)
  391. #define TCC_FCTRLA_CAPTURE_LOCMAX (TCC_FCTRLA_CAPTURE_LOCMAX_Val << TCC_FCTRLA_CAPTURE_Pos)
  392. #define TCC_FCTRLA_CAPTURE_DERIV0 (TCC_FCTRLA_CAPTURE_DERIV0_Val << TCC_FCTRLA_CAPTURE_Pos)
  393. #define TCC_FCTRLA_CAPTURE_CAPTMARK (TCC_FCTRLA_CAPTURE_CAPTMARK_Val << TCC_FCTRLA_CAPTURE_Pos)
  394. #define TCC_FCTRLA_BLANKPRESC_Pos 15 /**< \brief (TCC_FCTRLA) Fault A Blanking Prescaler */
  395. #define TCC_FCTRLA_BLANKPRESC (_U_(0x1) << TCC_FCTRLA_BLANKPRESC_Pos)
  396. #define TCC_FCTRLA_BLANKVAL_Pos 16 /**< \brief (TCC_FCTRLA) Fault A Blanking Time */
  397. #define TCC_FCTRLA_BLANKVAL_Msk (_U_(0xFF) << TCC_FCTRLA_BLANKVAL_Pos)
  398. #define TCC_FCTRLA_BLANKVAL(value) (TCC_FCTRLA_BLANKVAL_Msk & ((value) << TCC_FCTRLA_BLANKVAL_Pos))
  399. #define TCC_FCTRLA_FILTERVAL_Pos 24 /**< \brief (TCC_FCTRLA) Fault A Filter Value */
  400. #define TCC_FCTRLA_FILTERVAL_Msk (_U_(0xF) << TCC_FCTRLA_FILTERVAL_Pos)
  401. #define TCC_FCTRLA_FILTERVAL(value) (TCC_FCTRLA_FILTERVAL_Msk & ((value) << TCC_FCTRLA_FILTERVAL_Pos))
  402. #define TCC_FCTRLA_MASK _U_(0x0FFFFFFB) /**< \brief (TCC_FCTRLA) MASK Register */
  403. /* -------- TCC_FCTRLB : (TCC Offset: 0x10) (R/W 32) Recoverable Fault B Configuration -------- */
  404. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  405. typedef union {
  406. struct {
  407. uint32_t SRC:2; /*!< bit: 0.. 1 Fault B Source */
  408. uint32_t :1; /*!< bit: 2 Reserved */
  409. uint32_t KEEP:1; /*!< bit: 3 Fault B Keeper */
  410. uint32_t QUAL:1; /*!< bit: 4 Fault B Qualification */
  411. uint32_t BLANK:2; /*!< bit: 5.. 6 Fault B Blanking Mode */
  412. uint32_t RESTART:1; /*!< bit: 7 Fault B Restart */
  413. uint32_t HALT:2; /*!< bit: 8.. 9 Fault B Halt Mode */
  414. uint32_t CHSEL:2; /*!< bit: 10..11 Fault B Capture Channel */
  415. uint32_t CAPTURE:3; /*!< bit: 12..14 Fault B Capture Action */
  416. uint32_t BLANKPRESC:1; /*!< bit: 15 Fault B Blanking Prescaler */
  417. uint32_t BLANKVAL:8; /*!< bit: 16..23 Fault B Blanking Time */
  418. uint32_t FILTERVAL:4; /*!< bit: 24..27 Fault B Filter Value */
  419. uint32_t :4; /*!< bit: 28..31 Reserved */
  420. } bit; /*!< Structure used for bit access */
  421. uint32_t reg; /*!< Type used for register access */
  422. } TCC_FCTRLB_Type;
  423. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  424. #define TCC_FCTRLB_OFFSET 0x10 /**< \brief (TCC_FCTRLB offset) Recoverable Fault B Configuration */
  425. #define TCC_FCTRLB_RESETVALUE _U_(0x00000000) /**< \brief (TCC_FCTRLB reset_value) Recoverable Fault B Configuration */
  426. #define TCC_FCTRLB_SRC_Pos 0 /**< \brief (TCC_FCTRLB) Fault B Source */
  427. #define TCC_FCTRLB_SRC_Msk (_U_(0x3) << TCC_FCTRLB_SRC_Pos)
  428. #define TCC_FCTRLB_SRC(value) (TCC_FCTRLB_SRC_Msk & ((value) << TCC_FCTRLB_SRC_Pos))
  429. #define TCC_FCTRLB_SRC_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Fault input disabled */
  430. #define TCC_FCTRLB_SRC_ENABLE_Val _U_(0x1) /**< \brief (TCC_FCTRLB) MCEx (x=0,1) event input */
  431. #define TCC_FCTRLB_SRC_INVERT_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Inverted MCEx (x=0,1) event input */
  432. #define TCC_FCTRLB_SRC_ALTFAULT_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Alternate fault (A or B) state at the end of the previous period */
  433. #define TCC_FCTRLB_SRC_DISABLE (TCC_FCTRLB_SRC_DISABLE_Val << TCC_FCTRLB_SRC_Pos)
  434. #define TCC_FCTRLB_SRC_ENABLE (TCC_FCTRLB_SRC_ENABLE_Val << TCC_FCTRLB_SRC_Pos)
  435. #define TCC_FCTRLB_SRC_INVERT (TCC_FCTRLB_SRC_INVERT_Val << TCC_FCTRLB_SRC_Pos)
  436. #define TCC_FCTRLB_SRC_ALTFAULT (TCC_FCTRLB_SRC_ALTFAULT_Val << TCC_FCTRLB_SRC_Pos)
  437. #define TCC_FCTRLB_KEEP_Pos 3 /**< \brief (TCC_FCTRLB) Fault B Keeper */
  438. #define TCC_FCTRLB_KEEP (_U_(0x1) << TCC_FCTRLB_KEEP_Pos)
  439. #define TCC_FCTRLB_QUAL_Pos 4 /**< \brief (TCC_FCTRLB) Fault B Qualification */
  440. #define TCC_FCTRLB_QUAL (_U_(0x1) << TCC_FCTRLB_QUAL_Pos)
  441. #define TCC_FCTRLB_BLANK_Pos 5 /**< \brief (TCC_FCTRLB) Fault B Blanking Mode */
  442. #define TCC_FCTRLB_BLANK_Msk (_U_(0x3) << TCC_FCTRLB_BLANK_Pos)
  443. #define TCC_FCTRLB_BLANK(value) (TCC_FCTRLB_BLANK_Msk & ((value) << TCC_FCTRLB_BLANK_Pos))
  444. #define TCC_FCTRLB_BLANK_START_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Blanking applied from start of ramp */
  445. #define TCC_FCTRLB_BLANK_RISE_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Blanking applied from rising edge of the output waveform */
  446. #define TCC_FCTRLB_BLANK_FALL_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Blanking applied from falling edge of the output waveform */
  447. #define TCC_FCTRLB_BLANK_BOTH_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Blanking applied from each toggle of the output waveform */
  448. #define TCC_FCTRLB_BLANK_START (TCC_FCTRLB_BLANK_START_Val << TCC_FCTRLB_BLANK_Pos)
  449. #define TCC_FCTRLB_BLANK_RISE (TCC_FCTRLB_BLANK_RISE_Val << TCC_FCTRLB_BLANK_Pos)
  450. #define TCC_FCTRLB_BLANK_FALL (TCC_FCTRLB_BLANK_FALL_Val << TCC_FCTRLB_BLANK_Pos)
  451. #define TCC_FCTRLB_BLANK_BOTH (TCC_FCTRLB_BLANK_BOTH_Val << TCC_FCTRLB_BLANK_Pos)
  452. #define TCC_FCTRLB_RESTART_Pos 7 /**< \brief (TCC_FCTRLB) Fault B Restart */
  453. #define TCC_FCTRLB_RESTART (_U_(0x1) << TCC_FCTRLB_RESTART_Pos)
  454. #define TCC_FCTRLB_HALT_Pos 8 /**< \brief (TCC_FCTRLB) Fault B Halt Mode */
  455. #define TCC_FCTRLB_HALT_Msk (_U_(0x3) << TCC_FCTRLB_HALT_Pos)
  456. #define TCC_FCTRLB_HALT(value) (TCC_FCTRLB_HALT_Msk & ((value) << TCC_FCTRLB_HALT_Pos))
  457. #define TCC_FCTRLB_HALT_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Halt action disabled */
  458. #define TCC_FCTRLB_HALT_HW_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Hardware halt action */
  459. #define TCC_FCTRLB_HALT_SW_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Software halt action */
  460. #define TCC_FCTRLB_HALT_NR_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Non-recoverable fault */
  461. #define TCC_FCTRLB_HALT_DISABLE (TCC_FCTRLB_HALT_DISABLE_Val << TCC_FCTRLB_HALT_Pos)
  462. #define TCC_FCTRLB_HALT_HW (TCC_FCTRLB_HALT_HW_Val << TCC_FCTRLB_HALT_Pos)
  463. #define TCC_FCTRLB_HALT_SW (TCC_FCTRLB_HALT_SW_Val << TCC_FCTRLB_HALT_Pos)
  464. #define TCC_FCTRLB_HALT_NR (TCC_FCTRLB_HALT_NR_Val << TCC_FCTRLB_HALT_Pos)
  465. #define TCC_FCTRLB_CHSEL_Pos 10 /**< \brief (TCC_FCTRLB) Fault B Capture Channel */
  466. #define TCC_FCTRLB_CHSEL_Msk (_U_(0x3) << TCC_FCTRLB_CHSEL_Pos)
  467. #define TCC_FCTRLB_CHSEL(value) (TCC_FCTRLB_CHSEL_Msk & ((value) << TCC_FCTRLB_CHSEL_Pos))
  468. #define TCC_FCTRLB_CHSEL_CC0_Val _U_(0x0) /**< \brief (TCC_FCTRLB) Capture value stored in channel 0 */
  469. #define TCC_FCTRLB_CHSEL_CC1_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Capture value stored in channel 1 */
  470. #define TCC_FCTRLB_CHSEL_CC2_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Capture value stored in channel 2 */
  471. #define TCC_FCTRLB_CHSEL_CC3_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Capture value stored in channel 3 */
  472. #define TCC_FCTRLB_CHSEL_CC0 (TCC_FCTRLB_CHSEL_CC0_Val << TCC_FCTRLB_CHSEL_Pos)
  473. #define TCC_FCTRLB_CHSEL_CC1 (TCC_FCTRLB_CHSEL_CC1_Val << TCC_FCTRLB_CHSEL_Pos)
  474. #define TCC_FCTRLB_CHSEL_CC2 (TCC_FCTRLB_CHSEL_CC2_Val << TCC_FCTRLB_CHSEL_Pos)
  475. #define TCC_FCTRLB_CHSEL_CC3 (TCC_FCTRLB_CHSEL_CC3_Val << TCC_FCTRLB_CHSEL_Pos)
  476. #define TCC_FCTRLB_CAPTURE_Pos 12 /**< \brief (TCC_FCTRLB) Fault B Capture Action */
  477. #define TCC_FCTRLB_CAPTURE_Msk (_U_(0x7) << TCC_FCTRLB_CAPTURE_Pos)
  478. #define TCC_FCTRLB_CAPTURE(value) (TCC_FCTRLB_CAPTURE_Msk & ((value) << TCC_FCTRLB_CAPTURE_Pos))
  479. #define TCC_FCTRLB_CAPTURE_DISABLE_Val _U_(0x0) /**< \brief (TCC_FCTRLB) No capture */
  480. #define TCC_FCTRLB_CAPTURE_CAPT_Val _U_(0x1) /**< \brief (TCC_FCTRLB) Capture on fault */
  481. #define TCC_FCTRLB_CAPTURE_CAPTMIN_Val _U_(0x2) /**< \brief (TCC_FCTRLB) Minimum capture */
  482. #define TCC_FCTRLB_CAPTURE_CAPTMAX_Val _U_(0x3) /**< \brief (TCC_FCTRLB) Maximum capture */
  483. #define TCC_FCTRLB_CAPTURE_LOCMIN_Val _U_(0x4) /**< \brief (TCC_FCTRLB) Minimum local detection */
  484. #define TCC_FCTRLB_CAPTURE_LOCMAX_Val _U_(0x5) /**< \brief (TCC_FCTRLB) Maximum local detection */
  485. #define TCC_FCTRLB_CAPTURE_DERIV0_Val _U_(0x6) /**< \brief (TCC_FCTRLB) Minimum and maximum local detection */
  486. #define TCC_FCTRLB_CAPTURE_CAPTMARK_Val _U_(0x7) /**< \brief (TCC_FCTRLB) Capture with ramp index as MSB value */
  487. #define TCC_FCTRLB_CAPTURE_DISABLE (TCC_FCTRLB_CAPTURE_DISABLE_Val << TCC_FCTRLB_CAPTURE_Pos)
  488. #define TCC_FCTRLB_CAPTURE_CAPT (TCC_FCTRLB_CAPTURE_CAPT_Val << TCC_FCTRLB_CAPTURE_Pos)
  489. #define TCC_FCTRLB_CAPTURE_CAPTMIN (TCC_FCTRLB_CAPTURE_CAPTMIN_Val << TCC_FCTRLB_CAPTURE_Pos)
  490. #define TCC_FCTRLB_CAPTURE_CAPTMAX (TCC_FCTRLB_CAPTURE_CAPTMAX_Val << TCC_FCTRLB_CAPTURE_Pos)
  491. #define TCC_FCTRLB_CAPTURE_LOCMIN (TCC_FCTRLB_CAPTURE_LOCMIN_Val << TCC_FCTRLB_CAPTURE_Pos)
  492. #define TCC_FCTRLB_CAPTURE_LOCMAX (TCC_FCTRLB_CAPTURE_LOCMAX_Val << TCC_FCTRLB_CAPTURE_Pos)
  493. #define TCC_FCTRLB_CAPTURE_DERIV0 (TCC_FCTRLB_CAPTURE_DERIV0_Val << TCC_FCTRLB_CAPTURE_Pos)
  494. #define TCC_FCTRLB_CAPTURE_CAPTMARK (TCC_FCTRLB_CAPTURE_CAPTMARK_Val << TCC_FCTRLB_CAPTURE_Pos)
  495. #define TCC_FCTRLB_BLANKPRESC_Pos 15 /**< \brief (TCC_FCTRLB) Fault B Blanking Prescaler */
  496. #define TCC_FCTRLB_BLANKPRESC (_U_(0x1) << TCC_FCTRLB_BLANKPRESC_Pos)
  497. #define TCC_FCTRLB_BLANKVAL_Pos 16 /**< \brief (TCC_FCTRLB) Fault B Blanking Time */
  498. #define TCC_FCTRLB_BLANKVAL_Msk (_U_(0xFF) << TCC_FCTRLB_BLANKVAL_Pos)
  499. #define TCC_FCTRLB_BLANKVAL(value) (TCC_FCTRLB_BLANKVAL_Msk & ((value) << TCC_FCTRLB_BLANKVAL_Pos))
  500. #define TCC_FCTRLB_FILTERVAL_Pos 24 /**< \brief (TCC_FCTRLB) Fault B Filter Value */
  501. #define TCC_FCTRLB_FILTERVAL_Msk (_U_(0xF) << TCC_FCTRLB_FILTERVAL_Pos)
  502. #define TCC_FCTRLB_FILTERVAL(value) (TCC_FCTRLB_FILTERVAL_Msk & ((value) << TCC_FCTRLB_FILTERVAL_Pos))
  503. #define TCC_FCTRLB_MASK _U_(0x0FFFFFFB) /**< \brief (TCC_FCTRLB) MASK Register */
  504. /* -------- TCC_WEXCTRL : (TCC Offset: 0x14) (R/W 32) Waveform Extension Configuration -------- */
  505. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  506. typedef union {
  507. struct {
  508. uint32_t OTMX:2; /*!< bit: 0.. 1 Output Matrix */
  509. uint32_t :6; /*!< bit: 2.. 7 Reserved */
  510. uint32_t DTIEN0:1; /*!< bit: 8 Dead-time Insertion Generator 0 Enable */
  511. uint32_t DTIEN1:1; /*!< bit: 9 Dead-time Insertion Generator 1 Enable */
  512. uint32_t DTIEN2:1; /*!< bit: 10 Dead-time Insertion Generator 2 Enable */
  513. uint32_t DTIEN3:1; /*!< bit: 11 Dead-time Insertion Generator 3 Enable */
  514. uint32_t :4; /*!< bit: 12..15 Reserved */
  515. uint32_t DTLS:8; /*!< bit: 16..23 Dead-time Low Side Outputs Value */
  516. uint32_t DTHS:8; /*!< bit: 24..31 Dead-time High Side Outputs Value */
  517. } bit; /*!< Structure used for bit access */
  518. struct {
  519. uint32_t :8; /*!< bit: 0.. 7 Reserved */
  520. uint32_t DTIEN:4; /*!< bit: 8..11 Dead-time Insertion Generator x Enable */
  521. uint32_t :20; /*!< bit: 12..31 Reserved */
  522. } vec; /*!< Structure used for vec access */
  523. uint32_t reg; /*!< Type used for register access */
  524. } TCC_WEXCTRL_Type;
  525. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  526. #define TCC_WEXCTRL_OFFSET 0x14 /**< \brief (TCC_WEXCTRL offset) Waveform Extension Configuration */
  527. #define TCC_WEXCTRL_RESETVALUE _U_(0x00000000) /**< \brief (TCC_WEXCTRL reset_value) Waveform Extension Configuration */
  528. #define TCC_WEXCTRL_OTMX_Pos 0 /**< \brief (TCC_WEXCTRL) Output Matrix */
  529. #define TCC_WEXCTRL_OTMX_Msk (_U_(0x3) << TCC_WEXCTRL_OTMX_Pos)
  530. #define TCC_WEXCTRL_OTMX(value) (TCC_WEXCTRL_OTMX_Msk & ((value) << TCC_WEXCTRL_OTMX_Pos))
  531. #define TCC_WEXCTRL_DTIEN0_Pos 8 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 0 Enable */
  532. #define TCC_WEXCTRL_DTIEN0 (_U_(1) << TCC_WEXCTRL_DTIEN0_Pos)
  533. #define TCC_WEXCTRL_DTIEN1_Pos 9 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 1 Enable */
  534. #define TCC_WEXCTRL_DTIEN1 (_U_(1) << TCC_WEXCTRL_DTIEN1_Pos)
  535. #define TCC_WEXCTRL_DTIEN2_Pos 10 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 2 Enable */
  536. #define TCC_WEXCTRL_DTIEN2 (_U_(1) << TCC_WEXCTRL_DTIEN2_Pos)
  537. #define TCC_WEXCTRL_DTIEN3_Pos 11 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator 3 Enable */
  538. #define TCC_WEXCTRL_DTIEN3 (_U_(1) << TCC_WEXCTRL_DTIEN3_Pos)
  539. #define TCC_WEXCTRL_DTIEN_Pos 8 /**< \brief (TCC_WEXCTRL) Dead-time Insertion Generator x Enable */
  540. #define TCC_WEXCTRL_DTIEN_Msk (_U_(0xF) << TCC_WEXCTRL_DTIEN_Pos)
  541. #define TCC_WEXCTRL_DTIEN(value) (TCC_WEXCTRL_DTIEN_Msk & ((value) << TCC_WEXCTRL_DTIEN_Pos))
  542. #define TCC_WEXCTRL_DTLS_Pos 16 /**< \brief (TCC_WEXCTRL) Dead-time Low Side Outputs Value */
  543. #define TCC_WEXCTRL_DTLS_Msk (_U_(0xFF) << TCC_WEXCTRL_DTLS_Pos)
  544. #define TCC_WEXCTRL_DTLS(value) (TCC_WEXCTRL_DTLS_Msk & ((value) << TCC_WEXCTRL_DTLS_Pos))
  545. #define TCC_WEXCTRL_DTHS_Pos 24 /**< \brief (TCC_WEXCTRL) Dead-time High Side Outputs Value */
  546. #define TCC_WEXCTRL_DTHS_Msk (_U_(0xFF) << TCC_WEXCTRL_DTHS_Pos)
  547. #define TCC_WEXCTRL_DTHS(value) (TCC_WEXCTRL_DTHS_Msk & ((value) << TCC_WEXCTRL_DTHS_Pos))
  548. #define TCC_WEXCTRL_MASK _U_(0xFFFF0F03) /**< \brief (TCC_WEXCTRL) MASK Register */
  549. /* -------- TCC_DRVCTRL : (TCC Offset: 0x18) (R/W 32) Driver Control -------- */
  550. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  551. typedef union {
  552. struct {
  553. uint32_t NRE0:1; /*!< bit: 0 Non-Recoverable State 0 Output Enable */
  554. uint32_t NRE1:1; /*!< bit: 1 Non-Recoverable State 1 Output Enable */
  555. uint32_t NRE2:1; /*!< bit: 2 Non-Recoverable State 2 Output Enable */
  556. uint32_t NRE3:1; /*!< bit: 3 Non-Recoverable State 3 Output Enable */
  557. uint32_t NRE4:1; /*!< bit: 4 Non-Recoverable State 4 Output Enable */
  558. uint32_t NRE5:1; /*!< bit: 5 Non-Recoverable State 5 Output Enable */
  559. uint32_t NRE6:1; /*!< bit: 6 Non-Recoverable State 6 Output Enable */
  560. uint32_t NRE7:1; /*!< bit: 7 Non-Recoverable State 7 Output Enable */
  561. uint32_t NRV0:1; /*!< bit: 8 Non-Recoverable State 0 Output Value */
  562. uint32_t NRV1:1; /*!< bit: 9 Non-Recoverable State 1 Output Value */
  563. uint32_t NRV2:1; /*!< bit: 10 Non-Recoverable State 2 Output Value */
  564. uint32_t NRV3:1; /*!< bit: 11 Non-Recoverable State 3 Output Value */
  565. uint32_t NRV4:1; /*!< bit: 12 Non-Recoverable State 4 Output Value */
  566. uint32_t NRV5:1; /*!< bit: 13 Non-Recoverable State 5 Output Value */
  567. uint32_t NRV6:1; /*!< bit: 14 Non-Recoverable State 6 Output Value */
  568. uint32_t NRV7:1; /*!< bit: 15 Non-Recoverable State 7 Output Value */
  569. uint32_t INVEN0:1; /*!< bit: 16 Output Waveform 0 Inversion */
  570. uint32_t INVEN1:1; /*!< bit: 17 Output Waveform 1 Inversion */
  571. uint32_t INVEN2:1; /*!< bit: 18 Output Waveform 2 Inversion */
  572. uint32_t INVEN3:1; /*!< bit: 19 Output Waveform 3 Inversion */
  573. uint32_t INVEN4:1; /*!< bit: 20 Output Waveform 4 Inversion */
  574. uint32_t INVEN5:1; /*!< bit: 21 Output Waveform 5 Inversion */
  575. uint32_t INVEN6:1; /*!< bit: 22 Output Waveform 6 Inversion */
  576. uint32_t INVEN7:1; /*!< bit: 23 Output Waveform 7 Inversion */
  577. uint32_t FILTERVAL0:4; /*!< bit: 24..27 Non-Recoverable Fault Input 0 Filter Value */
  578. uint32_t FILTERVAL1:4; /*!< bit: 28..31 Non-Recoverable Fault Input 1 Filter Value */
  579. } bit; /*!< Structure used for bit access */
  580. struct {
  581. uint32_t NRE:8; /*!< bit: 0.. 7 Non-Recoverable State x Output Enable */
  582. uint32_t NRV:8; /*!< bit: 8..15 Non-Recoverable State x Output Value */
  583. uint32_t INVEN:8; /*!< bit: 16..23 Output Waveform x Inversion */
  584. uint32_t :8; /*!< bit: 24..31 Reserved */
  585. } vec; /*!< Structure used for vec access */
  586. uint32_t reg; /*!< Type used for register access */
  587. } TCC_DRVCTRL_Type;
  588. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  589. #define TCC_DRVCTRL_OFFSET 0x18 /**< \brief (TCC_DRVCTRL offset) Driver Control */
  590. #define TCC_DRVCTRL_RESETVALUE _U_(0x00000000) /**< \brief (TCC_DRVCTRL reset_value) Driver Control */
  591. #define TCC_DRVCTRL_NRE0_Pos 0 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 0 Output Enable */
  592. #define TCC_DRVCTRL_NRE0 (_U_(1) << TCC_DRVCTRL_NRE0_Pos)
  593. #define TCC_DRVCTRL_NRE1_Pos 1 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 1 Output Enable */
  594. #define TCC_DRVCTRL_NRE1 (_U_(1) << TCC_DRVCTRL_NRE1_Pos)
  595. #define TCC_DRVCTRL_NRE2_Pos 2 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 2 Output Enable */
  596. #define TCC_DRVCTRL_NRE2 (_U_(1) << TCC_DRVCTRL_NRE2_Pos)
  597. #define TCC_DRVCTRL_NRE3_Pos 3 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 3 Output Enable */
  598. #define TCC_DRVCTRL_NRE3 (_U_(1) << TCC_DRVCTRL_NRE3_Pos)
  599. #define TCC_DRVCTRL_NRE4_Pos 4 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 4 Output Enable */
  600. #define TCC_DRVCTRL_NRE4 (_U_(1) << TCC_DRVCTRL_NRE4_Pos)
  601. #define TCC_DRVCTRL_NRE5_Pos 5 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 5 Output Enable */
  602. #define TCC_DRVCTRL_NRE5 (_U_(1) << TCC_DRVCTRL_NRE5_Pos)
  603. #define TCC_DRVCTRL_NRE6_Pos 6 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 6 Output Enable */
  604. #define TCC_DRVCTRL_NRE6 (_U_(1) << TCC_DRVCTRL_NRE6_Pos)
  605. #define TCC_DRVCTRL_NRE7_Pos 7 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 7 Output Enable */
  606. #define TCC_DRVCTRL_NRE7 (_U_(1) << TCC_DRVCTRL_NRE7_Pos)
  607. #define TCC_DRVCTRL_NRE_Pos 0 /**< \brief (TCC_DRVCTRL) Non-Recoverable State x Output Enable */
  608. #define TCC_DRVCTRL_NRE_Msk (_U_(0xFF) << TCC_DRVCTRL_NRE_Pos)
  609. #define TCC_DRVCTRL_NRE(value) (TCC_DRVCTRL_NRE_Msk & ((value) << TCC_DRVCTRL_NRE_Pos))
  610. #define TCC_DRVCTRL_NRV0_Pos 8 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 0 Output Value */
  611. #define TCC_DRVCTRL_NRV0 (_U_(1) << TCC_DRVCTRL_NRV0_Pos)
  612. #define TCC_DRVCTRL_NRV1_Pos 9 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 1 Output Value */
  613. #define TCC_DRVCTRL_NRV1 (_U_(1) << TCC_DRVCTRL_NRV1_Pos)
  614. #define TCC_DRVCTRL_NRV2_Pos 10 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 2 Output Value */
  615. #define TCC_DRVCTRL_NRV2 (_U_(1) << TCC_DRVCTRL_NRV2_Pos)
  616. #define TCC_DRVCTRL_NRV3_Pos 11 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 3 Output Value */
  617. #define TCC_DRVCTRL_NRV3 (_U_(1) << TCC_DRVCTRL_NRV3_Pos)
  618. #define TCC_DRVCTRL_NRV4_Pos 12 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 4 Output Value */
  619. #define TCC_DRVCTRL_NRV4 (_U_(1) << TCC_DRVCTRL_NRV4_Pos)
  620. #define TCC_DRVCTRL_NRV5_Pos 13 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 5 Output Value */
  621. #define TCC_DRVCTRL_NRV5 (_U_(1) << TCC_DRVCTRL_NRV5_Pos)
  622. #define TCC_DRVCTRL_NRV6_Pos 14 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 6 Output Value */
  623. #define TCC_DRVCTRL_NRV6 (_U_(1) << TCC_DRVCTRL_NRV6_Pos)
  624. #define TCC_DRVCTRL_NRV7_Pos 15 /**< \brief (TCC_DRVCTRL) Non-Recoverable State 7 Output Value */
  625. #define TCC_DRVCTRL_NRV7 (_U_(1) << TCC_DRVCTRL_NRV7_Pos)
  626. #define TCC_DRVCTRL_NRV_Pos 8 /**< \brief (TCC_DRVCTRL) Non-Recoverable State x Output Value */
  627. #define TCC_DRVCTRL_NRV_Msk (_U_(0xFF) << TCC_DRVCTRL_NRV_Pos)
  628. #define TCC_DRVCTRL_NRV(value) (TCC_DRVCTRL_NRV_Msk & ((value) << TCC_DRVCTRL_NRV_Pos))
  629. #define TCC_DRVCTRL_INVEN0_Pos 16 /**< \brief (TCC_DRVCTRL) Output Waveform 0 Inversion */
  630. #define TCC_DRVCTRL_INVEN0 (_U_(1) << TCC_DRVCTRL_INVEN0_Pos)
  631. #define TCC_DRVCTRL_INVEN1_Pos 17 /**< \brief (TCC_DRVCTRL) Output Waveform 1 Inversion */
  632. #define TCC_DRVCTRL_INVEN1 (_U_(1) << TCC_DRVCTRL_INVEN1_Pos)
  633. #define TCC_DRVCTRL_INVEN2_Pos 18 /**< \brief (TCC_DRVCTRL) Output Waveform 2 Inversion */
  634. #define TCC_DRVCTRL_INVEN2 (_U_(1) << TCC_DRVCTRL_INVEN2_Pos)
  635. #define TCC_DRVCTRL_INVEN3_Pos 19 /**< \brief (TCC_DRVCTRL) Output Waveform 3 Inversion */
  636. #define TCC_DRVCTRL_INVEN3 (_U_(1) << TCC_DRVCTRL_INVEN3_Pos)
  637. #define TCC_DRVCTRL_INVEN4_Pos 20 /**< \brief (TCC_DRVCTRL) Output Waveform 4 Inversion */
  638. #define TCC_DRVCTRL_INVEN4 (_U_(1) << TCC_DRVCTRL_INVEN4_Pos)
  639. #define TCC_DRVCTRL_INVEN5_Pos 21 /**< \brief (TCC_DRVCTRL) Output Waveform 5 Inversion */
  640. #define TCC_DRVCTRL_INVEN5 (_U_(1) << TCC_DRVCTRL_INVEN5_Pos)
  641. #define TCC_DRVCTRL_INVEN6_Pos 22 /**< \brief (TCC_DRVCTRL) Output Waveform 6 Inversion */
  642. #define TCC_DRVCTRL_INVEN6 (_U_(1) << TCC_DRVCTRL_INVEN6_Pos)
  643. #define TCC_DRVCTRL_INVEN7_Pos 23 /**< \brief (TCC_DRVCTRL) Output Waveform 7 Inversion */
  644. #define TCC_DRVCTRL_INVEN7 (_U_(1) << TCC_DRVCTRL_INVEN7_Pos)
  645. #define TCC_DRVCTRL_INVEN_Pos 16 /**< \brief (TCC_DRVCTRL) Output Waveform x Inversion */
  646. #define TCC_DRVCTRL_INVEN_Msk (_U_(0xFF) << TCC_DRVCTRL_INVEN_Pos)
  647. #define TCC_DRVCTRL_INVEN(value) (TCC_DRVCTRL_INVEN_Msk & ((value) << TCC_DRVCTRL_INVEN_Pos))
  648. #define TCC_DRVCTRL_FILTERVAL0_Pos 24 /**< \brief (TCC_DRVCTRL) Non-Recoverable Fault Input 0 Filter Value */
  649. #define TCC_DRVCTRL_FILTERVAL0_Msk (_U_(0xF) << TCC_DRVCTRL_FILTERVAL0_Pos)
  650. #define TCC_DRVCTRL_FILTERVAL0(value) (TCC_DRVCTRL_FILTERVAL0_Msk & ((value) << TCC_DRVCTRL_FILTERVAL0_Pos))
  651. #define TCC_DRVCTRL_FILTERVAL1_Pos 28 /**< \brief (TCC_DRVCTRL) Non-Recoverable Fault Input 1 Filter Value */
  652. #define TCC_DRVCTRL_FILTERVAL1_Msk (_U_(0xF) << TCC_DRVCTRL_FILTERVAL1_Pos)
  653. #define TCC_DRVCTRL_FILTERVAL1(value) (TCC_DRVCTRL_FILTERVAL1_Msk & ((value) << TCC_DRVCTRL_FILTERVAL1_Pos))
  654. #define TCC_DRVCTRL_MASK _U_(0xFFFFFFFF) /**< \brief (TCC_DRVCTRL) MASK Register */
  655. /* -------- TCC_DBGCTRL : (TCC Offset: 0x1E) (R/W 8) Debug Control -------- */
  656. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  657. typedef union {
  658. struct {
  659. uint8_t DBGRUN:1; /*!< bit: 0 Debug Running Mode */
  660. uint8_t :1; /*!< bit: 1 Reserved */
  661. uint8_t FDDBD:1; /*!< bit: 2 Fault Detection on Debug Break Detection */
  662. uint8_t :5; /*!< bit: 3.. 7 Reserved */
  663. } bit; /*!< Structure used for bit access */
  664. uint8_t reg; /*!< Type used for register access */
  665. } TCC_DBGCTRL_Type;
  666. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  667. #define TCC_DBGCTRL_OFFSET 0x1E /**< \brief (TCC_DBGCTRL offset) Debug Control */
  668. #define TCC_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (TCC_DBGCTRL reset_value) Debug Control */
  669. #define TCC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (TCC_DBGCTRL) Debug Running Mode */
  670. #define TCC_DBGCTRL_DBGRUN (_U_(0x1) << TCC_DBGCTRL_DBGRUN_Pos)
  671. #define TCC_DBGCTRL_FDDBD_Pos 2 /**< \brief (TCC_DBGCTRL) Fault Detection on Debug Break Detection */
  672. #define TCC_DBGCTRL_FDDBD (_U_(0x1) << TCC_DBGCTRL_FDDBD_Pos)
  673. #define TCC_DBGCTRL_MASK _U_(0x05) /**< \brief (TCC_DBGCTRL) MASK Register */
  674. /* -------- TCC_EVCTRL : (TCC Offset: 0x20) (R/W 32) Event Control -------- */
  675. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  676. typedef union {
  677. struct {
  678. uint32_t EVACT0:3; /*!< bit: 0.. 2 Timer/counter Input Event0 Action */
  679. uint32_t EVACT1:3; /*!< bit: 3.. 5 Timer/counter Input Event1 Action */
  680. uint32_t CNTSEL:2; /*!< bit: 6.. 7 Timer/counter Output Event Mode */
  681. uint32_t OVFEO:1; /*!< bit: 8 Overflow/Underflow Output Event Enable */
  682. uint32_t TRGEO:1; /*!< bit: 9 Retrigger Output Event Enable */
  683. uint32_t CNTEO:1; /*!< bit: 10 Timer/counter Output Event Enable */
  684. uint32_t :1; /*!< bit: 11 Reserved */
  685. uint32_t TCINV0:1; /*!< bit: 12 Inverted Event 0 Input Enable */
  686. uint32_t TCINV1:1; /*!< bit: 13 Inverted Event 1 Input Enable */
  687. uint32_t TCEI0:1; /*!< bit: 14 Timer/counter Event 0 Input Enable */
  688. uint32_t TCEI1:1; /*!< bit: 15 Timer/counter Event 1 Input Enable */
  689. uint32_t MCEI0:1; /*!< bit: 16 Match or Capture Channel 0 Event Input Enable */
  690. uint32_t MCEI1:1; /*!< bit: 17 Match or Capture Channel 1 Event Input Enable */
  691. uint32_t MCEI2:1; /*!< bit: 18 Match or Capture Channel 2 Event Input Enable */
  692. uint32_t MCEI3:1; /*!< bit: 19 Match or Capture Channel 3 Event Input Enable */
  693. uint32_t :4; /*!< bit: 20..23 Reserved */
  694. uint32_t MCEO0:1; /*!< bit: 24 Match or Capture Channel 0 Event Output Enable */
  695. uint32_t MCEO1:1; /*!< bit: 25 Match or Capture Channel 1 Event Output Enable */
  696. uint32_t MCEO2:1; /*!< bit: 26 Match or Capture Channel 2 Event Output Enable */
  697. uint32_t MCEO3:1; /*!< bit: 27 Match or Capture Channel 3 Event Output Enable */
  698. uint32_t :4; /*!< bit: 28..31 Reserved */
  699. } bit; /*!< Structure used for bit access */
  700. struct {
  701. uint32_t :12; /*!< bit: 0..11 Reserved */
  702. uint32_t TCINV:2; /*!< bit: 12..13 Inverted Event x Input Enable */
  703. uint32_t TCEI:2; /*!< bit: 14..15 Timer/counter Event x Input Enable */
  704. uint32_t MCEI:4; /*!< bit: 16..19 Match or Capture Channel x Event Input Enable */
  705. uint32_t :4; /*!< bit: 20..23 Reserved */
  706. uint32_t MCEO:4; /*!< bit: 24..27 Match or Capture Channel x Event Output Enable */
  707. uint32_t :4; /*!< bit: 28..31 Reserved */
  708. } vec; /*!< Structure used for vec access */
  709. uint32_t reg; /*!< Type used for register access */
  710. } TCC_EVCTRL_Type;
  711. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  712. #define TCC_EVCTRL_OFFSET 0x20 /**< \brief (TCC_EVCTRL offset) Event Control */
  713. #define TCC_EVCTRL_RESETVALUE _U_(0x00000000) /**< \brief (TCC_EVCTRL reset_value) Event Control */
  714. #define TCC_EVCTRL_EVACT0_Pos 0 /**< \brief (TCC_EVCTRL) Timer/counter Input Event0 Action */
  715. #define TCC_EVCTRL_EVACT0_Msk (_U_(0x7) << TCC_EVCTRL_EVACT0_Pos)
  716. #define TCC_EVCTRL_EVACT0(value) (TCC_EVCTRL_EVACT0_Msk & ((value) << TCC_EVCTRL_EVACT0_Pos))
  717. #define TCC_EVCTRL_EVACT0_OFF_Val _U_(0x0) /**< \brief (TCC_EVCTRL) Event action disabled */
  718. #define TCC_EVCTRL_EVACT0_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_EVCTRL) Start, restart or re-trigger counter on event */
  719. #define TCC_EVCTRL_EVACT0_COUNTEV_Val _U_(0x2) /**< \brief (TCC_EVCTRL) Count on event */
  720. #define TCC_EVCTRL_EVACT0_START_Val _U_(0x3) /**< \brief (TCC_EVCTRL) Start counter on event */
  721. #define TCC_EVCTRL_EVACT0_INC_Val _U_(0x4) /**< \brief (TCC_EVCTRL) Increment counter on event */
  722. #define TCC_EVCTRL_EVACT0_COUNT_Val _U_(0x5) /**< \brief (TCC_EVCTRL) Count on active state of asynchronous event */
  723. #define TCC_EVCTRL_EVACT0_FAULT_Val _U_(0x7) /**< \brief (TCC_EVCTRL) Non-recoverable fault */
  724. #define TCC_EVCTRL_EVACT0_OFF (TCC_EVCTRL_EVACT0_OFF_Val << TCC_EVCTRL_EVACT0_Pos)
  725. #define TCC_EVCTRL_EVACT0_RETRIGGER (TCC_EVCTRL_EVACT0_RETRIGGER_Val << TCC_EVCTRL_EVACT0_Pos)
  726. #define TCC_EVCTRL_EVACT0_COUNTEV (TCC_EVCTRL_EVACT0_COUNTEV_Val << TCC_EVCTRL_EVACT0_Pos)
  727. #define TCC_EVCTRL_EVACT0_START (TCC_EVCTRL_EVACT0_START_Val << TCC_EVCTRL_EVACT0_Pos)
  728. #define TCC_EVCTRL_EVACT0_INC (TCC_EVCTRL_EVACT0_INC_Val << TCC_EVCTRL_EVACT0_Pos)
  729. #define TCC_EVCTRL_EVACT0_COUNT (TCC_EVCTRL_EVACT0_COUNT_Val << TCC_EVCTRL_EVACT0_Pos)
  730. #define TCC_EVCTRL_EVACT0_FAULT (TCC_EVCTRL_EVACT0_FAULT_Val << TCC_EVCTRL_EVACT0_Pos)
  731. #define TCC_EVCTRL_EVACT1_Pos 3 /**< \brief (TCC_EVCTRL) Timer/counter Input Event1 Action */
  732. #define TCC_EVCTRL_EVACT1_Msk (_U_(0x7) << TCC_EVCTRL_EVACT1_Pos)
  733. #define TCC_EVCTRL_EVACT1(value) (TCC_EVCTRL_EVACT1_Msk & ((value) << TCC_EVCTRL_EVACT1_Pos))
  734. #define TCC_EVCTRL_EVACT1_OFF_Val _U_(0x0) /**< \brief (TCC_EVCTRL) Event action disabled */
  735. #define TCC_EVCTRL_EVACT1_RETRIGGER_Val _U_(0x1) /**< \brief (TCC_EVCTRL) Re-trigger counter on event */
  736. #define TCC_EVCTRL_EVACT1_DIR_Val _U_(0x2) /**< \brief (TCC_EVCTRL) Direction control */
  737. #define TCC_EVCTRL_EVACT1_STOP_Val _U_(0x3) /**< \brief (TCC_EVCTRL) Stop counter on event */
  738. #define TCC_EVCTRL_EVACT1_DEC_Val _U_(0x4) /**< \brief (TCC_EVCTRL) Decrement counter on event */
  739. #define TCC_EVCTRL_EVACT1_PPW_Val _U_(0x5) /**< \brief (TCC_EVCTRL) Period capture value in CC0 register, pulse width capture value in CC1 register */
  740. #define TCC_EVCTRL_EVACT1_PWP_Val _U_(0x6) /**< \brief (TCC_EVCTRL) Period capture value in CC1 register, pulse width capture value in CC0 register */
  741. #define TCC_EVCTRL_EVACT1_FAULT_Val _U_(0x7) /**< \brief (TCC_EVCTRL) Non-recoverable fault */
  742. #define TCC_EVCTRL_EVACT1_OFF (TCC_EVCTRL_EVACT1_OFF_Val << TCC_EVCTRL_EVACT1_Pos)
  743. #define TCC_EVCTRL_EVACT1_RETRIGGER (TCC_EVCTRL_EVACT1_RETRIGGER_Val << TCC_EVCTRL_EVACT1_Pos)
  744. #define TCC_EVCTRL_EVACT1_DIR (TCC_EVCTRL_EVACT1_DIR_Val << TCC_EVCTRL_EVACT1_Pos)
  745. #define TCC_EVCTRL_EVACT1_STOP (TCC_EVCTRL_EVACT1_STOP_Val << TCC_EVCTRL_EVACT1_Pos)
  746. #define TCC_EVCTRL_EVACT1_DEC (TCC_EVCTRL_EVACT1_DEC_Val << TCC_EVCTRL_EVACT1_Pos)
  747. #define TCC_EVCTRL_EVACT1_PPW (TCC_EVCTRL_EVACT1_PPW_Val << TCC_EVCTRL_EVACT1_Pos)
  748. #define TCC_EVCTRL_EVACT1_PWP (TCC_EVCTRL_EVACT1_PWP_Val << TCC_EVCTRL_EVACT1_Pos)
  749. #define TCC_EVCTRL_EVACT1_FAULT (TCC_EVCTRL_EVACT1_FAULT_Val << TCC_EVCTRL_EVACT1_Pos)
  750. #define TCC_EVCTRL_CNTSEL_Pos 6 /**< \brief (TCC_EVCTRL) Timer/counter Output Event Mode */
  751. #define TCC_EVCTRL_CNTSEL_Msk (_U_(0x3) << TCC_EVCTRL_CNTSEL_Pos)
  752. #define TCC_EVCTRL_CNTSEL(value) (TCC_EVCTRL_CNTSEL_Msk & ((value) << TCC_EVCTRL_CNTSEL_Pos))
  753. #define TCC_EVCTRL_CNTSEL_START_Val _U_(0x0) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a new counter cycle starts */
  754. #define TCC_EVCTRL_CNTSEL_END_Val _U_(0x1) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a counter cycle ends */
  755. #define TCC_EVCTRL_CNTSEL_BETWEEN_Val _U_(0x2) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a counter cycle ends, except for the first and last cycles */
  756. #define TCC_EVCTRL_CNTSEL_BOUNDARY_Val _U_(0x3) /**< \brief (TCC_EVCTRL) An interrupt/event is generated when a new counter cycle starts or a counter cycle ends */
  757. #define TCC_EVCTRL_CNTSEL_START (TCC_EVCTRL_CNTSEL_START_Val << TCC_EVCTRL_CNTSEL_Pos)
  758. #define TCC_EVCTRL_CNTSEL_END (TCC_EVCTRL_CNTSEL_END_Val << TCC_EVCTRL_CNTSEL_Pos)
  759. #define TCC_EVCTRL_CNTSEL_BETWEEN (TCC_EVCTRL_CNTSEL_BETWEEN_Val << TCC_EVCTRL_CNTSEL_Pos)
  760. #define TCC_EVCTRL_CNTSEL_BOUNDARY (TCC_EVCTRL_CNTSEL_BOUNDARY_Val << TCC_EVCTRL_CNTSEL_Pos)
  761. #define TCC_EVCTRL_OVFEO_Pos 8 /**< \brief (TCC_EVCTRL) Overflow/Underflow Output Event Enable */
  762. #define TCC_EVCTRL_OVFEO (_U_(0x1) << TCC_EVCTRL_OVFEO_Pos)
  763. #define TCC_EVCTRL_TRGEO_Pos 9 /**< \brief (TCC_EVCTRL) Retrigger Output Event Enable */
  764. #define TCC_EVCTRL_TRGEO (_U_(0x1) << TCC_EVCTRL_TRGEO_Pos)
  765. #define TCC_EVCTRL_CNTEO_Pos 10 /**< \brief (TCC_EVCTRL) Timer/counter Output Event Enable */
  766. #define TCC_EVCTRL_CNTEO (_U_(0x1) << TCC_EVCTRL_CNTEO_Pos)
  767. #define TCC_EVCTRL_TCINV0_Pos 12 /**< \brief (TCC_EVCTRL) Inverted Event 0 Input Enable */
  768. #define TCC_EVCTRL_TCINV0 (_U_(1) << TCC_EVCTRL_TCINV0_Pos)
  769. #define TCC_EVCTRL_TCINV1_Pos 13 /**< \brief (TCC_EVCTRL) Inverted Event 1 Input Enable */
  770. #define TCC_EVCTRL_TCINV1 (_U_(1) << TCC_EVCTRL_TCINV1_Pos)
  771. #define TCC_EVCTRL_TCINV_Pos 12 /**< \brief (TCC_EVCTRL) Inverted Event x Input Enable */
  772. #define TCC_EVCTRL_TCINV_Msk (_U_(0x3) << TCC_EVCTRL_TCINV_Pos)
  773. #define TCC_EVCTRL_TCINV(value) (TCC_EVCTRL_TCINV_Msk & ((value) << TCC_EVCTRL_TCINV_Pos))
  774. #define TCC_EVCTRL_TCEI0_Pos 14 /**< \brief (TCC_EVCTRL) Timer/counter Event 0 Input Enable */
  775. #define TCC_EVCTRL_TCEI0 (_U_(1) << TCC_EVCTRL_TCEI0_Pos)
  776. #define TCC_EVCTRL_TCEI1_Pos 15 /**< \brief (TCC_EVCTRL) Timer/counter Event 1 Input Enable */
  777. #define TCC_EVCTRL_TCEI1 (_U_(1) << TCC_EVCTRL_TCEI1_Pos)
  778. #define TCC_EVCTRL_TCEI_Pos 14 /**< \brief (TCC_EVCTRL) Timer/counter Event x Input Enable */
  779. #define TCC_EVCTRL_TCEI_Msk (_U_(0x3) << TCC_EVCTRL_TCEI_Pos)
  780. #define TCC_EVCTRL_TCEI(value) (TCC_EVCTRL_TCEI_Msk & ((value) << TCC_EVCTRL_TCEI_Pos))
  781. #define TCC_EVCTRL_MCEI0_Pos 16 /**< \brief (TCC_EVCTRL) Match or Capture Channel 0 Event Input Enable */
  782. #define TCC_EVCTRL_MCEI0 (_U_(1) << TCC_EVCTRL_MCEI0_Pos)
  783. #define TCC_EVCTRL_MCEI1_Pos 17 /**< \brief (TCC_EVCTRL) Match or Capture Channel 1 Event Input Enable */
  784. #define TCC_EVCTRL_MCEI1 (_U_(1) << TCC_EVCTRL_MCEI1_Pos)
  785. #define TCC_EVCTRL_MCEI2_Pos 18 /**< \brief (TCC_EVCTRL) Match or Capture Channel 2 Event Input Enable */
  786. #define TCC_EVCTRL_MCEI2 (_U_(1) << TCC_EVCTRL_MCEI2_Pos)
  787. #define TCC_EVCTRL_MCEI3_Pos 19 /**< \brief (TCC_EVCTRL) Match or Capture Channel 3 Event Input Enable */
  788. #define TCC_EVCTRL_MCEI3 (_U_(1) << TCC_EVCTRL_MCEI3_Pos)
  789. #define TCC_EVCTRL_MCEI_Pos 16 /**< \brief (TCC_EVCTRL) Match or Capture Channel x Event Input Enable */
  790. #define TCC_EVCTRL_MCEI_Msk (_U_(0xF) << TCC_EVCTRL_MCEI_Pos)
  791. #define TCC_EVCTRL_MCEI(value) (TCC_EVCTRL_MCEI_Msk & ((value) << TCC_EVCTRL_MCEI_Pos))
  792. #define TCC_EVCTRL_MCEO0_Pos 24 /**< \brief (TCC_EVCTRL) Match or Capture Channel 0 Event Output Enable */
  793. #define TCC_EVCTRL_MCEO0 (_U_(1) << TCC_EVCTRL_MCEO0_Pos)
  794. #define TCC_EVCTRL_MCEO1_Pos 25 /**< \brief (TCC_EVCTRL) Match or Capture Channel 1 Event Output Enable */
  795. #define TCC_EVCTRL_MCEO1 (_U_(1) << TCC_EVCTRL_MCEO1_Pos)
  796. #define TCC_EVCTRL_MCEO2_Pos 26 /**< \brief (TCC_EVCTRL) Match or Capture Channel 2 Event Output Enable */
  797. #define TCC_EVCTRL_MCEO2 (_U_(1) << TCC_EVCTRL_MCEO2_Pos)
  798. #define TCC_EVCTRL_MCEO3_Pos 27 /**< \brief (TCC_EVCTRL) Match or Capture Channel 3 Event Output Enable */
  799. #define TCC_EVCTRL_MCEO3 (_U_(1) << TCC_EVCTRL_MCEO3_Pos)
  800. #define TCC_EVCTRL_MCEO_Pos 24 /**< \brief (TCC_EVCTRL) Match or Capture Channel x Event Output Enable */
  801. #define TCC_EVCTRL_MCEO_Msk (_U_(0xF) << TCC_EVCTRL_MCEO_Pos)
  802. #define TCC_EVCTRL_MCEO(value) (TCC_EVCTRL_MCEO_Msk & ((value) << TCC_EVCTRL_MCEO_Pos))
  803. #define TCC_EVCTRL_MASK _U_(0x0F0FF7FF) /**< \brief (TCC_EVCTRL) MASK Register */
  804. /* -------- TCC_INTENCLR : (TCC Offset: 0x24) (R/W 32) Interrupt Enable Clear -------- */
  805. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  806. typedef union {
  807. struct {
  808. uint32_t OVF:1; /*!< bit: 0 Overflow Interrupt Enable */
  809. uint32_t TRG:1; /*!< bit: 1 Retrigger Interrupt Enable */
  810. uint32_t CNT:1; /*!< bit: 2 Counter Interrupt Enable */
  811. uint32_t ERR:1; /*!< bit: 3 Error Interrupt Enable */
  812. uint32_t :7; /*!< bit: 4..10 Reserved */
  813. uint32_t DFS:1; /*!< bit: 11 Non-Recoverable Debug Fault Interrupt Enable */
  814. uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A Interrupt Enable */
  815. uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B Interrupt Enable */
  816. uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 Interrupt Enable */
  817. uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 Interrupt Enable */
  818. uint32_t MC0:1; /*!< bit: 16 Match or Capture Channel 0 Interrupt Enable */
  819. uint32_t MC1:1; /*!< bit: 17 Match or Capture Channel 1 Interrupt Enable */
  820. uint32_t MC2:1; /*!< bit: 18 Match or Capture Channel 2 Interrupt Enable */
  821. uint32_t MC3:1; /*!< bit: 19 Match or Capture Channel 3 Interrupt Enable */
  822. uint32_t :12; /*!< bit: 20..31 Reserved */
  823. } bit; /*!< Structure used for bit access */
  824. struct {
  825. uint32_t :16; /*!< bit: 0..15 Reserved */
  826. uint32_t MC:4; /*!< bit: 16..19 Match or Capture Channel x Interrupt Enable */
  827. uint32_t :12; /*!< bit: 20..31 Reserved */
  828. } vec; /*!< Structure used for vec access */
  829. uint32_t reg; /*!< Type used for register access */
  830. } TCC_INTENCLR_Type;
  831. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  832. #define TCC_INTENCLR_OFFSET 0x24 /**< \brief (TCC_INTENCLR offset) Interrupt Enable Clear */
  833. #define TCC_INTENCLR_RESETVALUE _U_(0x00000000) /**< \brief (TCC_INTENCLR reset_value) Interrupt Enable Clear */
  834. #define TCC_INTENCLR_OVF_Pos 0 /**< \brief (TCC_INTENCLR) Overflow Interrupt Enable */
  835. #define TCC_INTENCLR_OVF (_U_(0x1) << TCC_INTENCLR_OVF_Pos)
  836. #define TCC_INTENCLR_TRG_Pos 1 /**< \brief (TCC_INTENCLR) Retrigger Interrupt Enable */
  837. #define TCC_INTENCLR_TRG (_U_(0x1) << TCC_INTENCLR_TRG_Pos)
  838. #define TCC_INTENCLR_CNT_Pos 2 /**< \brief (TCC_INTENCLR) Counter Interrupt Enable */
  839. #define TCC_INTENCLR_CNT (_U_(0x1) << TCC_INTENCLR_CNT_Pos)
  840. #define TCC_INTENCLR_ERR_Pos 3 /**< \brief (TCC_INTENCLR) Error Interrupt Enable */
  841. #define TCC_INTENCLR_ERR (_U_(0x1) << TCC_INTENCLR_ERR_Pos)
  842. #define TCC_INTENCLR_DFS_Pos 11 /**< \brief (TCC_INTENCLR) Non-Recoverable Debug Fault Interrupt Enable */
  843. #define TCC_INTENCLR_DFS (_U_(0x1) << TCC_INTENCLR_DFS_Pos)
  844. #define TCC_INTENCLR_FAULTA_Pos 12 /**< \brief (TCC_INTENCLR) Recoverable Fault A Interrupt Enable */
  845. #define TCC_INTENCLR_FAULTA (_U_(0x1) << TCC_INTENCLR_FAULTA_Pos)
  846. #define TCC_INTENCLR_FAULTB_Pos 13 /**< \brief (TCC_INTENCLR) Recoverable Fault B Interrupt Enable */
  847. #define TCC_INTENCLR_FAULTB (_U_(0x1) << TCC_INTENCLR_FAULTB_Pos)
  848. #define TCC_INTENCLR_FAULT0_Pos 14 /**< \brief (TCC_INTENCLR) Non-Recoverable Fault 0 Interrupt Enable */
  849. #define TCC_INTENCLR_FAULT0 (_U_(0x1) << TCC_INTENCLR_FAULT0_Pos)
  850. #define TCC_INTENCLR_FAULT1_Pos 15 /**< \brief (TCC_INTENCLR) Non-Recoverable Fault 1 Interrupt Enable */
  851. #define TCC_INTENCLR_FAULT1 (_U_(0x1) << TCC_INTENCLR_FAULT1_Pos)
  852. #define TCC_INTENCLR_MC0_Pos 16 /**< \brief (TCC_INTENCLR) Match or Capture Channel 0 Interrupt Enable */
  853. #define TCC_INTENCLR_MC0 (_U_(1) << TCC_INTENCLR_MC0_Pos)
  854. #define TCC_INTENCLR_MC1_Pos 17 /**< \brief (TCC_INTENCLR) Match or Capture Channel 1 Interrupt Enable */
  855. #define TCC_INTENCLR_MC1 (_U_(1) << TCC_INTENCLR_MC1_Pos)
  856. #define TCC_INTENCLR_MC2_Pos 18 /**< \brief (TCC_INTENCLR) Match or Capture Channel 2 Interrupt Enable */
  857. #define TCC_INTENCLR_MC2 (_U_(1) << TCC_INTENCLR_MC2_Pos)
  858. #define TCC_INTENCLR_MC3_Pos 19 /**< \brief (TCC_INTENCLR) Match or Capture Channel 3 Interrupt Enable */
  859. #define TCC_INTENCLR_MC3 (_U_(1) << TCC_INTENCLR_MC3_Pos)
  860. #define TCC_INTENCLR_MC_Pos 16 /**< \brief (TCC_INTENCLR) Match or Capture Channel x Interrupt Enable */
  861. #define TCC_INTENCLR_MC_Msk (_U_(0xF) << TCC_INTENCLR_MC_Pos)
  862. #define TCC_INTENCLR_MC(value) (TCC_INTENCLR_MC_Msk & ((value) << TCC_INTENCLR_MC_Pos))
  863. #define TCC_INTENCLR_MASK _U_(0x000FF80F) /**< \brief (TCC_INTENCLR) MASK Register */
  864. /* -------- TCC_INTENSET : (TCC Offset: 0x28) (R/W 32) Interrupt Enable Set -------- */
  865. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  866. typedef union {
  867. struct {
  868. uint32_t OVF:1; /*!< bit: 0 Overflow Interrupt Enable */
  869. uint32_t TRG:1; /*!< bit: 1 Retrigger Interrupt Enable */
  870. uint32_t CNT:1; /*!< bit: 2 Counter Interrupt Enable */
  871. uint32_t ERR:1; /*!< bit: 3 Error Interrupt Enable */
  872. uint32_t :7; /*!< bit: 4..10 Reserved */
  873. uint32_t DFS:1; /*!< bit: 11 Non-Recoverable Debug Fault Interrupt Enable */
  874. uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A Interrupt Enable */
  875. uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B Interrupt Enable */
  876. uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 Interrupt Enable */
  877. uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 Interrupt Enable */
  878. uint32_t MC0:1; /*!< bit: 16 Match or Capture Channel 0 Interrupt Enable */
  879. uint32_t MC1:1; /*!< bit: 17 Match or Capture Channel 1 Interrupt Enable */
  880. uint32_t MC2:1; /*!< bit: 18 Match or Capture Channel 2 Interrupt Enable */
  881. uint32_t MC3:1; /*!< bit: 19 Match or Capture Channel 3 Interrupt Enable */
  882. uint32_t :12; /*!< bit: 20..31 Reserved */
  883. } bit; /*!< Structure used for bit access */
  884. struct {
  885. uint32_t :16; /*!< bit: 0..15 Reserved */
  886. uint32_t MC:4; /*!< bit: 16..19 Match or Capture Channel x Interrupt Enable */
  887. uint32_t :12; /*!< bit: 20..31 Reserved */
  888. } vec; /*!< Structure used for vec access */
  889. uint32_t reg; /*!< Type used for register access */
  890. } TCC_INTENSET_Type;
  891. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  892. #define TCC_INTENSET_OFFSET 0x28 /**< \brief (TCC_INTENSET offset) Interrupt Enable Set */
  893. #define TCC_INTENSET_RESETVALUE _U_(0x00000000) /**< \brief (TCC_INTENSET reset_value) Interrupt Enable Set */
  894. #define TCC_INTENSET_OVF_Pos 0 /**< \brief (TCC_INTENSET) Overflow Interrupt Enable */
  895. #define TCC_INTENSET_OVF (_U_(0x1) << TCC_INTENSET_OVF_Pos)
  896. #define TCC_INTENSET_TRG_Pos 1 /**< \brief (TCC_INTENSET) Retrigger Interrupt Enable */
  897. #define TCC_INTENSET_TRG (_U_(0x1) << TCC_INTENSET_TRG_Pos)
  898. #define TCC_INTENSET_CNT_Pos 2 /**< \brief (TCC_INTENSET) Counter Interrupt Enable */
  899. #define TCC_INTENSET_CNT (_U_(0x1) << TCC_INTENSET_CNT_Pos)
  900. #define TCC_INTENSET_ERR_Pos 3 /**< \brief (TCC_INTENSET) Error Interrupt Enable */
  901. #define TCC_INTENSET_ERR (_U_(0x1) << TCC_INTENSET_ERR_Pos)
  902. #define TCC_INTENSET_DFS_Pos 11 /**< \brief (TCC_INTENSET) Non-Recoverable Debug Fault Interrupt Enable */
  903. #define TCC_INTENSET_DFS (_U_(0x1) << TCC_INTENSET_DFS_Pos)
  904. #define TCC_INTENSET_FAULTA_Pos 12 /**< \brief (TCC_INTENSET) Recoverable Fault A Interrupt Enable */
  905. #define TCC_INTENSET_FAULTA (_U_(0x1) << TCC_INTENSET_FAULTA_Pos)
  906. #define TCC_INTENSET_FAULTB_Pos 13 /**< \brief (TCC_INTENSET) Recoverable Fault B Interrupt Enable */
  907. #define TCC_INTENSET_FAULTB (_U_(0x1) << TCC_INTENSET_FAULTB_Pos)
  908. #define TCC_INTENSET_FAULT0_Pos 14 /**< \brief (TCC_INTENSET) Non-Recoverable Fault 0 Interrupt Enable */
  909. #define TCC_INTENSET_FAULT0 (_U_(0x1) << TCC_INTENSET_FAULT0_Pos)
  910. #define TCC_INTENSET_FAULT1_Pos 15 /**< \brief (TCC_INTENSET) Non-Recoverable Fault 1 Interrupt Enable */
  911. #define TCC_INTENSET_FAULT1 (_U_(0x1) << TCC_INTENSET_FAULT1_Pos)
  912. #define TCC_INTENSET_MC0_Pos 16 /**< \brief (TCC_INTENSET) Match or Capture Channel 0 Interrupt Enable */
  913. #define TCC_INTENSET_MC0 (_U_(1) << TCC_INTENSET_MC0_Pos)
  914. #define TCC_INTENSET_MC1_Pos 17 /**< \brief (TCC_INTENSET) Match or Capture Channel 1 Interrupt Enable */
  915. #define TCC_INTENSET_MC1 (_U_(1) << TCC_INTENSET_MC1_Pos)
  916. #define TCC_INTENSET_MC2_Pos 18 /**< \brief (TCC_INTENSET) Match or Capture Channel 2 Interrupt Enable */
  917. #define TCC_INTENSET_MC2 (_U_(1) << TCC_INTENSET_MC2_Pos)
  918. #define TCC_INTENSET_MC3_Pos 19 /**< \brief (TCC_INTENSET) Match or Capture Channel 3 Interrupt Enable */
  919. #define TCC_INTENSET_MC3 (_U_(1) << TCC_INTENSET_MC3_Pos)
  920. #define TCC_INTENSET_MC_Pos 16 /**< \brief (TCC_INTENSET) Match or Capture Channel x Interrupt Enable */
  921. #define TCC_INTENSET_MC_Msk (_U_(0xF) << TCC_INTENSET_MC_Pos)
  922. #define TCC_INTENSET_MC(value) (TCC_INTENSET_MC_Msk & ((value) << TCC_INTENSET_MC_Pos))
  923. #define TCC_INTENSET_MASK _U_(0x000FF80F) /**< \brief (TCC_INTENSET) MASK Register */
  924. /* -------- TCC_INTFLAG : (TCC Offset: 0x2C) (R/W 32) Interrupt Flag Status and Clear -------- */
  925. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  926. typedef union { // __I to avoid read-modify-write on write-to-clear register
  927. struct {
  928. __I uint32_t OVF:1; /*!< bit: 0 Overflow */
  929. __I uint32_t TRG:1; /*!< bit: 1 Retrigger */
  930. __I uint32_t CNT:1; /*!< bit: 2 Counter */
  931. __I uint32_t ERR:1; /*!< bit: 3 Error */
  932. __I uint32_t :7; /*!< bit: 4..10 Reserved */
  933. __I uint32_t DFS:1; /*!< bit: 11 Non-Recoverable Debug Fault */
  934. __I uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A */
  935. __I uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B */
  936. __I uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 */
  937. __I uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 */
  938. __I uint32_t MC0:1; /*!< bit: 16 Match or Capture 0 */
  939. __I uint32_t MC1:1; /*!< bit: 17 Match or Capture 1 */
  940. __I uint32_t MC2:1; /*!< bit: 18 Match or Capture 2 */
  941. __I uint32_t MC3:1; /*!< bit: 19 Match or Capture 3 */
  942. __I uint32_t :12; /*!< bit: 20..31 Reserved */
  943. } bit; /*!< Structure used for bit access */
  944. struct {
  945. __I uint32_t :16; /*!< bit: 0..15 Reserved */
  946. __I uint32_t MC:4; /*!< bit: 16..19 Match or Capture x */
  947. __I uint32_t :12; /*!< bit: 20..31 Reserved */
  948. } vec; /*!< Structure used for vec access */
  949. uint32_t reg; /*!< Type used for register access */
  950. } TCC_INTFLAG_Type;
  951. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  952. #define TCC_INTFLAG_OFFSET 0x2C /**< \brief (TCC_INTFLAG offset) Interrupt Flag Status and Clear */
  953. #define TCC_INTFLAG_RESETVALUE _U_(0x00000000) /**< \brief (TCC_INTFLAG reset_value) Interrupt Flag Status and Clear */
  954. #define TCC_INTFLAG_OVF_Pos 0 /**< \brief (TCC_INTFLAG) Overflow */
  955. #define TCC_INTFLAG_OVF (_U_(0x1) << TCC_INTFLAG_OVF_Pos)
  956. #define TCC_INTFLAG_TRG_Pos 1 /**< \brief (TCC_INTFLAG) Retrigger */
  957. #define TCC_INTFLAG_TRG (_U_(0x1) << TCC_INTFLAG_TRG_Pos)
  958. #define TCC_INTFLAG_CNT_Pos 2 /**< \brief (TCC_INTFLAG) Counter */
  959. #define TCC_INTFLAG_CNT (_U_(0x1) << TCC_INTFLAG_CNT_Pos)
  960. #define TCC_INTFLAG_ERR_Pos 3 /**< \brief (TCC_INTFLAG) Error */
  961. #define TCC_INTFLAG_ERR (_U_(0x1) << TCC_INTFLAG_ERR_Pos)
  962. #define TCC_INTFLAG_DFS_Pos 11 /**< \brief (TCC_INTFLAG) Non-Recoverable Debug Fault */
  963. #define TCC_INTFLAG_DFS (_U_(0x1) << TCC_INTFLAG_DFS_Pos)
  964. #define TCC_INTFLAG_FAULTA_Pos 12 /**< \brief (TCC_INTFLAG) Recoverable Fault A */
  965. #define TCC_INTFLAG_FAULTA (_U_(0x1) << TCC_INTFLAG_FAULTA_Pos)
  966. #define TCC_INTFLAG_FAULTB_Pos 13 /**< \brief (TCC_INTFLAG) Recoverable Fault B */
  967. #define TCC_INTFLAG_FAULTB (_U_(0x1) << TCC_INTFLAG_FAULTB_Pos)
  968. #define TCC_INTFLAG_FAULT0_Pos 14 /**< \brief (TCC_INTFLAG) Non-Recoverable Fault 0 */
  969. #define TCC_INTFLAG_FAULT0 (_U_(0x1) << TCC_INTFLAG_FAULT0_Pos)
  970. #define TCC_INTFLAG_FAULT1_Pos 15 /**< \brief (TCC_INTFLAG) Non-Recoverable Fault 1 */
  971. #define TCC_INTFLAG_FAULT1 (_U_(0x1) << TCC_INTFLAG_FAULT1_Pos)
  972. #define TCC_INTFLAG_MC0_Pos 16 /**< \brief (TCC_INTFLAG) Match or Capture 0 */
  973. #define TCC_INTFLAG_MC0 (_U_(1) << TCC_INTFLAG_MC0_Pos)
  974. #define TCC_INTFLAG_MC1_Pos 17 /**< \brief (TCC_INTFLAG) Match or Capture 1 */
  975. #define TCC_INTFLAG_MC1 (_U_(1) << TCC_INTFLAG_MC1_Pos)
  976. #define TCC_INTFLAG_MC2_Pos 18 /**< \brief (TCC_INTFLAG) Match or Capture 2 */
  977. #define TCC_INTFLAG_MC2 (_U_(1) << TCC_INTFLAG_MC2_Pos)
  978. #define TCC_INTFLAG_MC3_Pos 19 /**< \brief (TCC_INTFLAG) Match or Capture 3 */
  979. #define TCC_INTFLAG_MC3 (_U_(1) << TCC_INTFLAG_MC3_Pos)
  980. #define TCC_INTFLAG_MC_Pos 16 /**< \brief (TCC_INTFLAG) Match or Capture x */
  981. #define TCC_INTFLAG_MC_Msk (_U_(0xF) << TCC_INTFLAG_MC_Pos)
  982. #define TCC_INTFLAG_MC(value) (TCC_INTFLAG_MC_Msk & ((value) << TCC_INTFLAG_MC_Pos))
  983. #define TCC_INTFLAG_MASK _U_(0x000FF80F) /**< \brief (TCC_INTFLAG) MASK Register */
  984. /* -------- TCC_STATUS : (TCC Offset: 0x30) (R/W 32) Status -------- */
  985. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  986. typedef union {
  987. struct {
  988. uint32_t STOP:1; /*!< bit: 0 Stop */
  989. uint32_t IDX:1; /*!< bit: 1 Ramp */
  990. uint32_t :1; /*!< bit: 2 Reserved */
  991. uint32_t DFS:1; /*!< bit: 3 Non-Recoverable Debug Fault State */
  992. uint32_t SLAVE:1; /*!< bit: 4 Slave */
  993. uint32_t PATTBV:1; /*!< bit: 5 Pattern Buffer Valid */
  994. uint32_t WAVEBV:1; /*!< bit: 6 Wave Buffer Valid */
  995. uint32_t PERBV:1; /*!< bit: 7 Period Buffer Valid */
  996. uint32_t FAULTAIN:1; /*!< bit: 8 Recoverable Fault A Input */
  997. uint32_t FAULTBIN:1; /*!< bit: 9 Recoverable Fault B Input */
  998. uint32_t FAULT0IN:1; /*!< bit: 10 Non-Recoverable Fault0 Input */
  999. uint32_t FAULT1IN:1; /*!< bit: 11 Non-Recoverable Fault1 Input */
  1000. uint32_t FAULTA:1; /*!< bit: 12 Recoverable Fault A State */
  1001. uint32_t FAULTB:1; /*!< bit: 13 Recoverable Fault B State */
  1002. uint32_t FAULT0:1; /*!< bit: 14 Non-Recoverable Fault 0 State */
  1003. uint32_t FAULT1:1; /*!< bit: 15 Non-Recoverable Fault 1 State */
  1004. uint32_t CCBV0:1; /*!< bit: 16 Compare Channel 0 Buffer Valid */
  1005. uint32_t CCBV1:1; /*!< bit: 17 Compare Channel 1 Buffer Valid */
  1006. uint32_t CCBV2:1; /*!< bit: 18 Compare Channel 2 Buffer Valid */
  1007. uint32_t CCBV3:1; /*!< bit: 19 Compare Channel 3 Buffer Valid */
  1008. uint32_t :4; /*!< bit: 20..23 Reserved */
  1009. uint32_t CMP0:1; /*!< bit: 24 Compare Channel 0 Value */
  1010. uint32_t CMP1:1; /*!< bit: 25 Compare Channel 1 Value */
  1011. uint32_t CMP2:1; /*!< bit: 26 Compare Channel 2 Value */
  1012. uint32_t CMP3:1; /*!< bit: 27 Compare Channel 3 Value */
  1013. uint32_t :4; /*!< bit: 28..31 Reserved */
  1014. } bit; /*!< Structure used for bit access */
  1015. struct {
  1016. uint32_t :16; /*!< bit: 0..15 Reserved */
  1017. uint32_t CCBV:4; /*!< bit: 16..19 Compare Channel x Buffer Valid */
  1018. uint32_t :4; /*!< bit: 20..23 Reserved */
  1019. uint32_t CMP:4; /*!< bit: 24..27 Compare Channel x Value */
  1020. uint32_t :4; /*!< bit: 28..31 Reserved */
  1021. } vec; /*!< Structure used for vec access */
  1022. uint32_t reg; /*!< Type used for register access */
  1023. } TCC_STATUS_Type;
  1024. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1025. #define TCC_STATUS_OFFSET 0x30 /**< \brief (TCC_STATUS offset) Status */
  1026. #define TCC_STATUS_RESETVALUE _U_(0x00000001) /**< \brief (TCC_STATUS reset_value) Status */
  1027. #define TCC_STATUS_STOP_Pos 0 /**< \brief (TCC_STATUS) Stop */
  1028. #define TCC_STATUS_STOP (_U_(0x1) << TCC_STATUS_STOP_Pos)
  1029. #define TCC_STATUS_IDX_Pos 1 /**< \brief (TCC_STATUS) Ramp */
  1030. #define TCC_STATUS_IDX (_U_(0x1) << TCC_STATUS_IDX_Pos)
  1031. #define TCC_STATUS_DFS_Pos 3 /**< \brief (TCC_STATUS) Non-Recoverable Debug Fault State */
  1032. #define TCC_STATUS_DFS (_U_(0x1) << TCC_STATUS_DFS_Pos)
  1033. #define TCC_STATUS_SLAVE_Pos 4 /**< \brief (TCC_STATUS) Slave */
  1034. #define TCC_STATUS_SLAVE (_U_(0x1) << TCC_STATUS_SLAVE_Pos)
  1035. #define TCC_STATUS_PATTBV_Pos 5 /**< \brief (TCC_STATUS) Pattern Buffer Valid */
  1036. #define TCC_STATUS_PATTBV (_U_(0x1) << TCC_STATUS_PATTBV_Pos)
  1037. #define TCC_STATUS_WAVEBV_Pos 6 /**< \brief (TCC_STATUS) Wave Buffer Valid */
  1038. #define TCC_STATUS_WAVEBV (_U_(0x1) << TCC_STATUS_WAVEBV_Pos)
  1039. #define TCC_STATUS_PERBV_Pos 7 /**< \brief (TCC_STATUS) Period Buffer Valid */
  1040. #define TCC_STATUS_PERBV (_U_(0x1) << TCC_STATUS_PERBV_Pos)
  1041. #define TCC_STATUS_FAULTAIN_Pos 8 /**< \brief (TCC_STATUS) Recoverable Fault A Input */
  1042. #define TCC_STATUS_FAULTAIN (_U_(0x1) << TCC_STATUS_FAULTAIN_Pos)
  1043. #define TCC_STATUS_FAULTBIN_Pos 9 /**< \brief (TCC_STATUS) Recoverable Fault B Input */
  1044. #define TCC_STATUS_FAULTBIN (_U_(0x1) << TCC_STATUS_FAULTBIN_Pos)
  1045. #define TCC_STATUS_FAULT0IN_Pos 10 /**< \brief (TCC_STATUS) Non-Recoverable Fault0 Input */
  1046. #define TCC_STATUS_FAULT0IN (_U_(0x1) << TCC_STATUS_FAULT0IN_Pos)
  1047. #define TCC_STATUS_FAULT1IN_Pos 11 /**< \brief (TCC_STATUS) Non-Recoverable Fault1 Input */
  1048. #define TCC_STATUS_FAULT1IN (_U_(0x1) << TCC_STATUS_FAULT1IN_Pos)
  1049. #define TCC_STATUS_FAULTA_Pos 12 /**< \brief (TCC_STATUS) Recoverable Fault A State */
  1050. #define TCC_STATUS_FAULTA (_U_(0x1) << TCC_STATUS_FAULTA_Pos)
  1051. #define TCC_STATUS_FAULTB_Pos 13 /**< \brief (TCC_STATUS) Recoverable Fault B State */
  1052. #define TCC_STATUS_FAULTB (_U_(0x1) << TCC_STATUS_FAULTB_Pos)
  1053. #define TCC_STATUS_FAULT0_Pos 14 /**< \brief (TCC_STATUS) Non-Recoverable Fault 0 State */
  1054. #define TCC_STATUS_FAULT0 (_U_(0x1) << TCC_STATUS_FAULT0_Pos)
  1055. #define TCC_STATUS_FAULT1_Pos 15 /**< \brief (TCC_STATUS) Non-Recoverable Fault 1 State */
  1056. #define TCC_STATUS_FAULT1 (_U_(0x1) << TCC_STATUS_FAULT1_Pos)
  1057. #define TCC_STATUS_CCBV0_Pos 16 /**< \brief (TCC_STATUS) Compare Channel 0 Buffer Valid */
  1058. #define TCC_STATUS_CCBV0 (_U_(1) << TCC_STATUS_CCBV0_Pos)
  1059. #define TCC_STATUS_CCBV1_Pos 17 /**< \brief (TCC_STATUS) Compare Channel 1 Buffer Valid */
  1060. #define TCC_STATUS_CCBV1 (_U_(1) << TCC_STATUS_CCBV1_Pos)
  1061. #define TCC_STATUS_CCBV2_Pos 18 /**< \brief (TCC_STATUS) Compare Channel 2 Buffer Valid */
  1062. #define TCC_STATUS_CCBV2 (_U_(1) << TCC_STATUS_CCBV2_Pos)
  1063. #define TCC_STATUS_CCBV3_Pos 19 /**< \brief (TCC_STATUS) Compare Channel 3 Buffer Valid */
  1064. #define TCC_STATUS_CCBV3 (_U_(1) << TCC_STATUS_CCBV3_Pos)
  1065. #define TCC_STATUS_CCBV_Pos 16 /**< \brief (TCC_STATUS) Compare Channel x Buffer Valid */
  1066. #define TCC_STATUS_CCBV_Msk (_U_(0xF) << TCC_STATUS_CCBV_Pos)
  1067. #define TCC_STATUS_CCBV(value) (TCC_STATUS_CCBV_Msk & ((value) << TCC_STATUS_CCBV_Pos))
  1068. #define TCC_STATUS_CMP0_Pos 24 /**< \brief (TCC_STATUS) Compare Channel 0 Value */
  1069. #define TCC_STATUS_CMP0 (_U_(1) << TCC_STATUS_CMP0_Pos)
  1070. #define TCC_STATUS_CMP1_Pos 25 /**< \brief (TCC_STATUS) Compare Channel 1 Value */
  1071. #define TCC_STATUS_CMP1 (_U_(1) << TCC_STATUS_CMP1_Pos)
  1072. #define TCC_STATUS_CMP2_Pos 26 /**< \brief (TCC_STATUS) Compare Channel 2 Value */
  1073. #define TCC_STATUS_CMP2 (_U_(1) << TCC_STATUS_CMP2_Pos)
  1074. #define TCC_STATUS_CMP3_Pos 27 /**< \brief (TCC_STATUS) Compare Channel 3 Value */
  1075. #define TCC_STATUS_CMP3 (_U_(1) << TCC_STATUS_CMP3_Pos)
  1076. #define TCC_STATUS_CMP_Pos 24 /**< \brief (TCC_STATUS) Compare Channel x Value */
  1077. #define TCC_STATUS_CMP_Msk (_U_(0xF) << TCC_STATUS_CMP_Pos)
  1078. #define TCC_STATUS_CMP(value) (TCC_STATUS_CMP_Msk & ((value) << TCC_STATUS_CMP_Pos))
  1079. #define TCC_STATUS_MASK _U_(0x0F0FFFFB) /**< \brief (TCC_STATUS) MASK Register */
  1080. /* -------- TCC_COUNT : (TCC Offset: 0x34) (R/W 32) Count -------- */
  1081. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1082. typedef union {
  1083. struct { // DITH4 mode
  1084. uint32_t :4; /*!< bit: 0.. 3 Reserved */
  1085. uint32_t COUNT:20; /*!< bit: 4..23 Counter Value */
  1086. uint32_t :8; /*!< bit: 24..31 Reserved */
  1087. } DITH4; /*!< Structure used for DITH4 */
  1088. struct { // DITH5 mode
  1089. uint32_t :5; /*!< bit: 0.. 4 Reserved */
  1090. uint32_t COUNT:19; /*!< bit: 5..23 Counter Value */
  1091. uint32_t :8; /*!< bit: 24..31 Reserved */
  1092. } DITH5; /*!< Structure used for DITH5 */
  1093. struct { // DITH6 mode
  1094. uint32_t :6; /*!< bit: 0.. 5 Reserved */
  1095. uint32_t COUNT:18; /*!< bit: 6..23 Counter Value */
  1096. uint32_t :8; /*!< bit: 24..31 Reserved */
  1097. } DITH6; /*!< Structure used for DITH6 */
  1098. struct {
  1099. uint32_t COUNT:24; /*!< bit: 0..23 Counter Value */
  1100. uint32_t :8; /*!< bit: 24..31 Reserved */
  1101. } bit; /*!< Structure used for bit access */
  1102. uint32_t reg; /*!< Type used for register access */
  1103. } TCC_COUNT_Type;
  1104. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1105. #define TCC_COUNT_OFFSET 0x34 /**< \brief (TCC_COUNT offset) Count */
  1106. #define TCC_COUNT_RESETVALUE _U_(0x00000000) /**< \brief (TCC_COUNT reset_value) Count */
  1107. // DITH4 mode
  1108. #define TCC_COUNT_DITH4_COUNT_Pos 4 /**< \brief (TCC_COUNT_DITH4) Counter Value */
  1109. #define TCC_COUNT_DITH4_COUNT_Msk (_U_(0xFFFFF) << TCC_COUNT_DITH4_COUNT_Pos)
  1110. #define TCC_COUNT_DITH4_COUNT(value) (TCC_COUNT_DITH4_COUNT_Msk & ((value) << TCC_COUNT_DITH4_COUNT_Pos))
  1111. #define TCC_COUNT_DITH4_MASK _U_(0x00FFFFF0) /**< \brief (TCC_COUNT_DITH4) MASK Register */
  1112. // DITH5 mode
  1113. #define TCC_COUNT_DITH5_COUNT_Pos 5 /**< \brief (TCC_COUNT_DITH5) Counter Value */
  1114. #define TCC_COUNT_DITH5_COUNT_Msk (_U_(0x7FFFF) << TCC_COUNT_DITH5_COUNT_Pos)
  1115. #define TCC_COUNT_DITH5_COUNT(value) (TCC_COUNT_DITH5_COUNT_Msk & ((value) << TCC_COUNT_DITH5_COUNT_Pos))
  1116. #define TCC_COUNT_DITH5_MASK _U_(0x00FFFFE0) /**< \brief (TCC_COUNT_DITH5) MASK Register */
  1117. // DITH6 mode
  1118. #define TCC_COUNT_DITH6_COUNT_Pos 6 /**< \brief (TCC_COUNT_DITH6) Counter Value */
  1119. #define TCC_COUNT_DITH6_COUNT_Msk (_U_(0x3FFFF) << TCC_COUNT_DITH6_COUNT_Pos)
  1120. #define TCC_COUNT_DITH6_COUNT(value) (TCC_COUNT_DITH6_COUNT_Msk & ((value) << TCC_COUNT_DITH6_COUNT_Pos))
  1121. #define TCC_COUNT_DITH6_MASK _U_(0x00FFFFC0) /**< \brief (TCC_COUNT_DITH6) MASK Register */
  1122. #define TCC_COUNT_COUNT_Pos 0 /**< \brief (TCC_COUNT) Counter Value */
  1123. #define TCC_COUNT_COUNT_Msk (_U_(0xFFFFFF) << TCC_COUNT_COUNT_Pos)
  1124. #define TCC_COUNT_COUNT(value) (TCC_COUNT_COUNT_Msk & ((value) << TCC_COUNT_COUNT_Pos))
  1125. #define TCC_COUNT_MASK _U_(0x00FFFFFF) /**< \brief (TCC_COUNT) MASK Register */
  1126. /* -------- TCC_PATT : (TCC Offset: 0x38) (R/W 16) Pattern -------- */
  1127. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1128. typedef union {
  1129. struct {
  1130. uint16_t PGE0:1; /*!< bit: 0 Pattern Generator 0 Output Enable */
  1131. uint16_t PGE1:1; /*!< bit: 1 Pattern Generator 1 Output Enable */
  1132. uint16_t PGE2:1; /*!< bit: 2 Pattern Generator 2 Output Enable */
  1133. uint16_t PGE3:1; /*!< bit: 3 Pattern Generator 3 Output Enable */
  1134. uint16_t PGE4:1; /*!< bit: 4 Pattern Generator 4 Output Enable */
  1135. uint16_t PGE5:1; /*!< bit: 5 Pattern Generator 5 Output Enable */
  1136. uint16_t PGE6:1; /*!< bit: 6 Pattern Generator 6 Output Enable */
  1137. uint16_t PGE7:1; /*!< bit: 7 Pattern Generator 7 Output Enable */
  1138. uint16_t PGV0:1; /*!< bit: 8 Pattern Generator 0 Output Value */
  1139. uint16_t PGV1:1; /*!< bit: 9 Pattern Generator 1 Output Value */
  1140. uint16_t PGV2:1; /*!< bit: 10 Pattern Generator 2 Output Value */
  1141. uint16_t PGV3:1; /*!< bit: 11 Pattern Generator 3 Output Value */
  1142. uint16_t PGV4:1; /*!< bit: 12 Pattern Generator 4 Output Value */
  1143. uint16_t PGV5:1; /*!< bit: 13 Pattern Generator 5 Output Value */
  1144. uint16_t PGV6:1; /*!< bit: 14 Pattern Generator 6 Output Value */
  1145. uint16_t PGV7:1; /*!< bit: 15 Pattern Generator 7 Output Value */
  1146. } bit; /*!< Structure used for bit access */
  1147. struct {
  1148. uint16_t PGE:8; /*!< bit: 0.. 7 Pattern Generator x Output Enable */
  1149. uint16_t PGV:8; /*!< bit: 8..15 Pattern Generator x Output Value */
  1150. } vec; /*!< Structure used for vec access */
  1151. uint16_t reg; /*!< Type used for register access */
  1152. } TCC_PATT_Type;
  1153. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1154. #define TCC_PATT_OFFSET 0x38 /**< \brief (TCC_PATT offset) Pattern */
  1155. #define TCC_PATT_RESETVALUE _U_(0x0000) /**< \brief (TCC_PATT reset_value) Pattern */
  1156. #define TCC_PATT_PGE0_Pos 0 /**< \brief (TCC_PATT) Pattern Generator 0 Output Enable */
  1157. #define TCC_PATT_PGE0 (_U_(1) << TCC_PATT_PGE0_Pos)
  1158. #define TCC_PATT_PGE1_Pos 1 /**< \brief (TCC_PATT) Pattern Generator 1 Output Enable */
  1159. #define TCC_PATT_PGE1 (_U_(1) << TCC_PATT_PGE1_Pos)
  1160. #define TCC_PATT_PGE2_Pos 2 /**< \brief (TCC_PATT) Pattern Generator 2 Output Enable */
  1161. #define TCC_PATT_PGE2 (_U_(1) << TCC_PATT_PGE2_Pos)
  1162. #define TCC_PATT_PGE3_Pos 3 /**< \brief (TCC_PATT) Pattern Generator 3 Output Enable */
  1163. #define TCC_PATT_PGE3 (_U_(1) << TCC_PATT_PGE3_Pos)
  1164. #define TCC_PATT_PGE4_Pos 4 /**< \brief (TCC_PATT) Pattern Generator 4 Output Enable */
  1165. #define TCC_PATT_PGE4 (_U_(1) << TCC_PATT_PGE4_Pos)
  1166. #define TCC_PATT_PGE5_Pos 5 /**< \brief (TCC_PATT) Pattern Generator 5 Output Enable */
  1167. #define TCC_PATT_PGE5 (_U_(1) << TCC_PATT_PGE5_Pos)
  1168. #define TCC_PATT_PGE6_Pos 6 /**< \brief (TCC_PATT) Pattern Generator 6 Output Enable */
  1169. #define TCC_PATT_PGE6 (_U_(1) << TCC_PATT_PGE6_Pos)
  1170. #define TCC_PATT_PGE7_Pos 7 /**< \brief (TCC_PATT) Pattern Generator 7 Output Enable */
  1171. #define TCC_PATT_PGE7 (_U_(1) << TCC_PATT_PGE7_Pos)
  1172. #define TCC_PATT_PGE_Pos 0 /**< \brief (TCC_PATT) Pattern Generator x Output Enable */
  1173. #define TCC_PATT_PGE_Msk (_U_(0xFF) << TCC_PATT_PGE_Pos)
  1174. #define TCC_PATT_PGE(value) (TCC_PATT_PGE_Msk & ((value) << TCC_PATT_PGE_Pos))
  1175. #define TCC_PATT_PGV0_Pos 8 /**< \brief (TCC_PATT) Pattern Generator 0 Output Value */
  1176. #define TCC_PATT_PGV0 (_U_(1) << TCC_PATT_PGV0_Pos)
  1177. #define TCC_PATT_PGV1_Pos 9 /**< \brief (TCC_PATT) Pattern Generator 1 Output Value */
  1178. #define TCC_PATT_PGV1 (_U_(1) << TCC_PATT_PGV1_Pos)
  1179. #define TCC_PATT_PGV2_Pos 10 /**< \brief (TCC_PATT) Pattern Generator 2 Output Value */
  1180. #define TCC_PATT_PGV2 (_U_(1) << TCC_PATT_PGV2_Pos)
  1181. #define TCC_PATT_PGV3_Pos 11 /**< \brief (TCC_PATT) Pattern Generator 3 Output Value */
  1182. #define TCC_PATT_PGV3 (_U_(1) << TCC_PATT_PGV3_Pos)
  1183. #define TCC_PATT_PGV4_Pos 12 /**< \brief (TCC_PATT) Pattern Generator 4 Output Value */
  1184. #define TCC_PATT_PGV4 (_U_(1) << TCC_PATT_PGV4_Pos)
  1185. #define TCC_PATT_PGV5_Pos 13 /**< \brief (TCC_PATT) Pattern Generator 5 Output Value */
  1186. #define TCC_PATT_PGV5 (_U_(1) << TCC_PATT_PGV5_Pos)
  1187. #define TCC_PATT_PGV6_Pos 14 /**< \brief (TCC_PATT) Pattern Generator 6 Output Value */
  1188. #define TCC_PATT_PGV6 (_U_(1) << TCC_PATT_PGV6_Pos)
  1189. #define TCC_PATT_PGV7_Pos 15 /**< \brief (TCC_PATT) Pattern Generator 7 Output Value */
  1190. #define TCC_PATT_PGV7 (_U_(1) << TCC_PATT_PGV7_Pos)
  1191. #define TCC_PATT_PGV_Pos 8 /**< \brief (TCC_PATT) Pattern Generator x Output Value */
  1192. #define TCC_PATT_PGV_Msk (_U_(0xFF) << TCC_PATT_PGV_Pos)
  1193. #define TCC_PATT_PGV(value) (TCC_PATT_PGV_Msk & ((value) << TCC_PATT_PGV_Pos))
  1194. #define TCC_PATT_MASK _U_(0xFFFF) /**< \brief (TCC_PATT) MASK Register */
  1195. /* -------- TCC_WAVE : (TCC Offset: 0x3C) (R/W 32) Waveform Control -------- */
  1196. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1197. typedef union {
  1198. struct {
  1199. uint32_t WAVEGEN:3; /*!< bit: 0.. 2 Waveform Generation */
  1200. uint32_t :1; /*!< bit: 3 Reserved */
  1201. uint32_t RAMP:2; /*!< bit: 4.. 5 Ramp Mode */
  1202. uint32_t :1; /*!< bit: 6 Reserved */
  1203. uint32_t CIPEREN:1; /*!< bit: 7 Circular period Enable */
  1204. uint32_t CICCEN0:1; /*!< bit: 8 Circular Channel 0 Enable */
  1205. uint32_t CICCEN1:1; /*!< bit: 9 Circular Channel 1 Enable */
  1206. uint32_t CICCEN2:1; /*!< bit: 10 Circular Channel 2 Enable */
  1207. uint32_t CICCEN3:1; /*!< bit: 11 Circular Channel 3 Enable */
  1208. uint32_t :4; /*!< bit: 12..15 Reserved */
  1209. uint32_t POL0:1; /*!< bit: 16 Channel 0 Polarity */
  1210. uint32_t POL1:1; /*!< bit: 17 Channel 1 Polarity */
  1211. uint32_t POL2:1; /*!< bit: 18 Channel 2 Polarity */
  1212. uint32_t POL3:1; /*!< bit: 19 Channel 3 Polarity */
  1213. uint32_t :4; /*!< bit: 20..23 Reserved */
  1214. uint32_t SWAP0:1; /*!< bit: 24 Swap DTI Output Pair 0 */
  1215. uint32_t SWAP1:1; /*!< bit: 25 Swap DTI Output Pair 1 */
  1216. uint32_t SWAP2:1; /*!< bit: 26 Swap DTI Output Pair 2 */
  1217. uint32_t SWAP3:1; /*!< bit: 27 Swap DTI Output Pair 3 */
  1218. uint32_t :4; /*!< bit: 28..31 Reserved */
  1219. } bit; /*!< Structure used for bit access */
  1220. struct {
  1221. uint32_t :8; /*!< bit: 0.. 7 Reserved */
  1222. uint32_t CICCEN:4; /*!< bit: 8..11 Circular Channel x Enable */
  1223. uint32_t :4; /*!< bit: 12..15 Reserved */
  1224. uint32_t POL:4; /*!< bit: 16..19 Channel x Polarity */
  1225. uint32_t :4; /*!< bit: 20..23 Reserved */
  1226. uint32_t SWAP:4; /*!< bit: 24..27 Swap DTI Output Pair x */
  1227. uint32_t :4; /*!< bit: 28..31 Reserved */
  1228. } vec; /*!< Structure used for vec access */
  1229. uint32_t reg; /*!< Type used for register access */
  1230. } TCC_WAVE_Type;
  1231. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1232. #define TCC_WAVE_OFFSET 0x3C /**< \brief (TCC_WAVE offset) Waveform Control */
  1233. #define TCC_WAVE_RESETVALUE _U_(0x00000000) /**< \brief (TCC_WAVE reset_value) Waveform Control */
  1234. #define TCC_WAVE_WAVEGEN_Pos 0 /**< \brief (TCC_WAVE) Waveform Generation */
  1235. #define TCC_WAVE_WAVEGEN_Msk (_U_(0x7) << TCC_WAVE_WAVEGEN_Pos)
  1236. #define TCC_WAVE_WAVEGEN(value) (TCC_WAVE_WAVEGEN_Msk & ((value) << TCC_WAVE_WAVEGEN_Pos))
  1237. #define TCC_WAVE_WAVEGEN_NFRQ_Val _U_(0x0) /**< \brief (TCC_WAVE) Normal frequency */
  1238. #define TCC_WAVE_WAVEGEN_MFRQ_Val _U_(0x1) /**< \brief (TCC_WAVE) Match frequency */
  1239. #define TCC_WAVE_WAVEGEN_NPWM_Val _U_(0x2) /**< \brief (TCC_WAVE) Normal PWM */
  1240. #define TCC_WAVE_WAVEGEN_DSCRITICAL_Val _U_(0x4) /**< \brief (TCC_WAVE) Dual-slope critical */
  1241. #define TCC_WAVE_WAVEGEN_DSBOTTOM_Val _U_(0x5) /**< \brief (TCC_WAVE) Dual-slope with interrupt/event condition when COUNT reaches ZERO */
  1242. #define TCC_WAVE_WAVEGEN_DSBOTH_Val _U_(0x6) /**< \brief (TCC_WAVE) Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP */
  1243. #define TCC_WAVE_WAVEGEN_DSTOP_Val _U_(0x7) /**< \brief (TCC_WAVE) Dual-slope with interrupt/event condition when COUNT reaches TOP */
  1244. #define TCC_WAVE_WAVEGEN_NFRQ (TCC_WAVE_WAVEGEN_NFRQ_Val << TCC_WAVE_WAVEGEN_Pos)
  1245. #define TCC_WAVE_WAVEGEN_MFRQ (TCC_WAVE_WAVEGEN_MFRQ_Val << TCC_WAVE_WAVEGEN_Pos)
  1246. #define TCC_WAVE_WAVEGEN_NPWM (TCC_WAVE_WAVEGEN_NPWM_Val << TCC_WAVE_WAVEGEN_Pos)
  1247. #define TCC_WAVE_WAVEGEN_DSCRITICAL (TCC_WAVE_WAVEGEN_DSCRITICAL_Val << TCC_WAVE_WAVEGEN_Pos)
  1248. #define TCC_WAVE_WAVEGEN_DSBOTTOM (TCC_WAVE_WAVEGEN_DSBOTTOM_Val << TCC_WAVE_WAVEGEN_Pos)
  1249. #define TCC_WAVE_WAVEGEN_DSBOTH (TCC_WAVE_WAVEGEN_DSBOTH_Val << TCC_WAVE_WAVEGEN_Pos)
  1250. #define TCC_WAVE_WAVEGEN_DSTOP (TCC_WAVE_WAVEGEN_DSTOP_Val << TCC_WAVE_WAVEGEN_Pos)
  1251. #define TCC_WAVE_RAMP_Pos 4 /**< \brief (TCC_WAVE) Ramp Mode */
  1252. #define TCC_WAVE_RAMP_Msk (_U_(0x3) << TCC_WAVE_RAMP_Pos)
  1253. #define TCC_WAVE_RAMP(value) (TCC_WAVE_RAMP_Msk & ((value) << TCC_WAVE_RAMP_Pos))
  1254. #define TCC_WAVE_RAMP_RAMP1_Val _U_(0x0) /**< \brief (TCC_WAVE) RAMP1 operation */
  1255. #define TCC_WAVE_RAMP_RAMP2A_Val _U_(0x1) /**< \brief (TCC_WAVE) Alternative RAMP2 operation */
  1256. #define TCC_WAVE_RAMP_RAMP2_Val _U_(0x2) /**< \brief (TCC_WAVE) RAMP2 operation */
  1257. #define TCC_WAVE_RAMP_RAMP2C_Val _U_(0x3) /**< \brief (TCC_WAVE) Critical RAMP2 operation */
  1258. #define TCC_WAVE_RAMP_RAMP1 (TCC_WAVE_RAMP_RAMP1_Val << TCC_WAVE_RAMP_Pos)
  1259. #define TCC_WAVE_RAMP_RAMP2A (TCC_WAVE_RAMP_RAMP2A_Val << TCC_WAVE_RAMP_Pos)
  1260. #define TCC_WAVE_RAMP_RAMP2 (TCC_WAVE_RAMP_RAMP2_Val << TCC_WAVE_RAMP_Pos)
  1261. #define TCC_WAVE_RAMP_RAMP2C (TCC_WAVE_RAMP_RAMP2C_Val << TCC_WAVE_RAMP_Pos)
  1262. #define TCC_WAVE_CIPEREN_Pos 7 /**< \brief (TCC_WAVE) Circular period Enable */
  1263. #define TCC_WAVE_CIPEREN (_U_(0x1) << TCC_WAVE_CIPEREN_Pos)
  1264. #define TCC_WAVE_CICCEN0_Pos 8 /**< \brief (TCC_WAVE) Circular Channel 0 Enable */
  1265. #define TCC_WAVE_CICCEN0 (_U_(1) << TCC_WAVE_CICCEN0_Pos)
  1266. #define TCC_WAVE_CICCEN1_Pos 9 /**< \brief (TCC_WAVE) Circular Channel 1 Enable */
  1267. #define TCC_WAVE_CICCEN1 (_U_(1) << TCC_WAVE_CICCEN1_Pos)
  1268. #define TCC_WAVE_CICCEN2_Pos 10 /**< \brief (TCC_WAVE) Circular Channel 2 Enable */
  1269. #define TCC_WAVE_CICCEN2 (_U_(1) << TCC_WAVE_CICCEN2_Pos)
  1270. #define TCC_WAVE_CICCEN3_Pos 11 /**< \brief (TCC_WAVE) Circular Channel 3 Enable */
  1271. #define TCC_WAVE_CICCEN3 (_U_(1) << TCC_WAVE_CICCEN3_Pos)
  1272. #define TCC_WAVE_CICCEN_Pos 8 /**< \brief (TCC_WAVE) Circular Channel x Enable */
  1273. #define TCC_WAVE_CICCEN_Msk (_U_(0xF) << TCC_WAVE_CICCEN_Pos)
  1274. #define TCC_WAVE_CICCEN(value) (TCC_WAVE_CICCEN_Msk & ((value) << TCC_WAVE_CICCEN_Pos))
  1275. #define TCC_WAVE_POL0_Pos 16 /**< \brief (TCC_WAVE) Channel 0 Polarity */
  1276. #define TCC_WAVE_POL0 (_U_(1) << TCC_WAVE_POL0_Pos)
  1277. #define TCC_WAVE_POL1_Pos 17 /**< \brief (TCC_WAVE) Channel 1 Polarity */
  1278. #define TCC_WAVE_POL1 (_U_(1) << TCC_WAVE_POL1_Pos)
  1279. #define TCC_WAVE_POL2_Pos 18 /**< \brief (TCC_WAVE) Channel 2 Polarity */
  1280. #define TCC_WAVE_POL2 (_U_(1) << TCC_WAVE_POL2_Pos)
  1281. #define TCC_WAVE_POL3_Pos 19 /**< \brief (TCC_WAVE) Channel 3 Polarity */
  1282. #define TCC_WAVE_POL3 (_U_(1) << TCC_WAVE_POL3_Pos)
  1283. #define TCC_WAVE_POL_Pos 16 /**< \brief (TCC_WAVE) Channel x Polarity */
  1284. #define TCC_WAVE_POL_Msk (_U_(0xF) << TCC_WAVE_POL_Pos)
  1285. #define TCC_WAVE_POL(value) (TCC_WAVE_POL_Msk & ((value) << TCC_WAVE_POL_Pos))
  1286. #define TCC_WAVE_SWAP0_Pos 24 /**< \brief (TCC_WAVE) Swap DTI Output Pair 0 */
  1287. #define TCC_WAVE_SWAP0 (_U_(1) << TCC_WAVE_SWAP0_Pos)
  1288. #define TCC_WAVE_SWAP1_Pos 25 /**< \brief (TCC_WAVE) Swap DTI Output Pair 1 */
  1289. #define TCC_WAVE_SWAP1 (_U_(1) << TCC_WAVE_SWAP1_Pos)
  1290. #define TCC_WAVE_SWAP2_Pos 26 /**< \brief (TCC_WAVE) Swap DTI Output Pair 2 */
  1291. #define TCC_WAVE_SWAP2 (_U_(1) << TCC_WAVE_SWAP2_Pos)
  1292. #define TCC_WAVE_SWAP3_Pos 27 /**< \brief (TCC_WAVE) Swap DTI Output Pair 3 */
  1293. #define TCC_WAVE_SWAP3 (_U_(1) << TCC_WAVE_SWAP3_Pos)
  1294. #define TCC_WAVE_SWAP_Pos 24 /**< \brief (TCC_WAVE) Swap DTI Output Pair x */
  1295. #define TCC_WAVE_SWAP_Msk (_U_(0xF) << TCC_WAVE_SWAP_Pos)
  1296. #define TCC_WAVE_SWAP(value) (TCC_WAVE_SWAP_Msk & ((value) << TCC_WAVE_SWAP_Pos))
  1297. #define TCC_WAVE_MASK _U_(0x0F0F0FB7) /**< \brief (TCC_WAVE) MASK Register */
  1298. /* -------- TCC_PER : (TCC Offset: 0x40) (R/W 32) Period -------- */
  1299. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1300. typedef union {
  1301. struct { // DITH4 mode
  1302. uint32_t DITHERCY:4; /*!< bit: 0.. 3 Dithering Cycle Number */
  1303. uint32_t PER:20; /*!< bit: 4..23 Period Value */
  1304. uint32_t :8; /*!< bit: 24..31 Reserved */
  1305. } DITH4; /*!< Structure used for DITH4 */
  1306. struct { // DITH5 mode
  1307. uint32_t DITHERCY:5; /*!< bit: 0.. 4 Dithering Cycle Number */
  1308. uint32_t PER:19; /*!< bit: 5..23 Period Value */
  1309. uint32_t :8; /*!< bit: 24..31 Reserved */
  1310. } DITH5; /*!< Structure used for DITH5 */
  1311. struct { // DITH6 mode
  1312. uint32_t DITHERCY:6; /*!< bit: 0.. 5 Dithering Cycle Number */
  1313. uint32_t PER:18; /*!< bit: 6..23 Period Value */
  1314. uint32_t :8; /*!< bit: 24..31 Reserved */
  1315. } DITH6; /*!< Structure used for DITH6 */
  1316. struct {
  1317. uint32_t PER:24; /*!< bit: 0..23 Period Value */
  1318. uint32_t :8; /*!< bit: 24..31 Reserved */
  1319. } bit; /*!< Structure used for bit access */
  1320. uint32_t reg; /*!< Type used for register access */
  1321. } TCC_PER_Type;
  1322. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1323. #define TCC_PER_OFFSET 0x40 /**< \brief (TCC_PER offset) Period */
  1324. #define TCC_PER_RESETVALUE _U_(0xFFFFFFFF) /**< \brief (TCC_PER reset_value) Period */
  1325. // DITH4 mode
  1326. #define TCC_PER_DITH4_DITHERCY_Pos 0 /**< \brief (TCC_PER_DITH4) Dithering Cycle Number */
  1327. #define TCC_PER_DITH4_DITHERCY_Msk (_U_(0xF) << TCC_PER_DITH4_DITHERCY_Pos)
  1328. #define TCC_PER_DITH4_DITHERCY(value) (TCC_PER_DITH4_DITHERCY_Msk & ((value) << TCC_PER_DITH4_DITHERCY_Pos))
  1329. #define TCC_PER_DITH4_PER_Pos 4 /**< \brief (TCC_PER_DITH4) Period Value */
  1330. #define TCC_PER_DITH4_PER_Msk (_U_(0xFFFFF) << TCC_PER_DITH4_PER_Pos)
  1331. #define TCC_PER_DITH4_PER(value) (TCC_PER_DITH4_PER_Msk & ((value) << TCC_PER_DITH4_PER_Pos))
  1332. #define TCC_PER_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER_DITH4) MASK Register */
  1333. // DITH5 mode
  1334. #define TCC_PER_DITH5_DITHERCY_Pos 0 /**< \brief (TCC_PER_DITH5) Dithering Cycle Number */
  1335. #define TCC_PER_DITH5_DITHERCY_Msk (_U_(0x1F) << TCC_PER_DITH5_DITHERCY_Pos)
  1336. #define TCC_PER_DITH5_DITHERCY(value) (TCC_PER_DITH5_DITHERCY_Msk & ((value) << TCC_PER_DITH5_DITHERCY_Pos))
  1337. #define TCC_PER_DITH5_PER_Pos 5 /**< \brief (TCC_PER_DITH5) Period Value */
  1338. #define TCC_PER_DITH5_PER_Msk (_U_(0x7FFFF) << TCC_PER_DITH5_PER_Pos)
  1339. #define TCC_PER_DITH5_PER(value) (TCC_PER_DITH5_PER_Msk & ((value) << TCC_PER_DITH5_PER_Pos))
  1340. #define TCC_PER_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER_DITH5) MASK Register */
  1341. // DITH6 mode
  1342. #define TCC_PER_DITH6_DITHERCY_Pos 0 /**< \brief (TCC_PER_DITH6) Dithering Cycle Number */
  1343. #define TCC_PER_DITH6_DITHERCY_Msk (_U_(0x3F) << TCC_PER_DITH6_DITHERCY_Pos)
  1344. #define TCC_PER_DITH6_DITHERCY(value) (TCC_PER_DITH6_DITHERCY_Msk & ((value) << TCC_PER_DITH6_DITHERCY_Pos))
  1345. #define TCC_PER_DITH6_PER_Pos 6 /**< \brief (TCC_PER_DITH6) Period Value */
  1346. #define TCC_PER_DITH6_PER_Msk (_U_(0x3FFFF) << TCC_PER_DITH6_PER_Pos)
  1347. #define TCC_PER_DITH6_PER(value) (TCC_PER_DITH6_PER_Msk & ((value) << TCC_PER_DITH6_PER_Pos))
  1348. #define TCC_PER_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER_DITH6) MASK Register */
  1349. #define TCC_PER_PER_Pos 0 /**< \brief (TCC_PER) Period Value */
  1350. #define TCC_PER_PER_Msk (_U_(0xFFFFFF) << TCC_PER_PER_Pos)
  1351. #define TCC_PER_PER(value) (TCC_PER_PER_Msk & ((value) << TCC_PER_PER_Pos))
  1352. #define TCC_PER_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PER) MASK Register */
  1353. /* -------- TCC_CC : (TCC Offset: 0x44) (R/W 32) Compare and Capture -------- */
  1354. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1355. typedef union {
  1356. struct { // DITH4 mode
  1357. uint32_t DITHERCY:4; /*!< bit: 0.. 3 Dithering Cycle Number */
  1358. uint32_t CC:20; /*!< bit: 4..23 Channel Compare/Capture Value */
  1359. uint32_t :8; /*!< bit: 24..31 Reserved */
  1360. } DITH4; /*!< Structure used for DITH4 */
  1361. struct { // DITH5 mode
  1362. uint32_t DITHERCY:5; /*!< bit: 0.. 4 Dithering Cycle Number */
  1363. uint32_t CC:19; /*!< bit: 5..23 Channel Compare/Capture Value */
  1364. uint32_t :8; /*!< bit: 24..31 Reserved */
  1365. } DITH5; /*!< Structure used for DITH5 */
  1366. struct { // DITH6 mode
  1367. uint32_t DITHERCY:6; /*!< bit: 0.. 5 Dithering Cycle Number */
  1368. uint32_t CC:18; /*!< bit: 6..23 Channel Compare/Capture Value */
  1369. uint32_t :8; /*!< bit: 24..31 Reserved */
  1370. } DITH6; /*!< Structure used for DITH6 */
  1371. struct {
  1372. uint32_t CC:24; /*!< bit: 0..23 Channel Compare/Capture Value */
  1373. uint32_t :8; /*!< bit: 24..31 Reserved */
  1374. } bit; /*!< Structure used for bit access */
  1375. uint32_t reg; /*!< Type used for register access */
  1376. } TCC_CC_Type;
  1377. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1378. #define TCC_CC_OFFSET 0x44 /**< \brief (TCC_CC offset) Compare and Capture */
  1379. #define TCC_CC_RESETVALUE _U_(0x00000000) /**< \brief (TCC_CC reset_value) Compare and Capture */
  1380. // DITH4 mode
  1381. #define TCC_CC_DITH4_DITHERCY_Pos 0 /**< \brief (TCC_CC_DITH4) Dithering Cycle Number */
  1382. #define TCC_CC_DITH4_DITHERCY_Msk (_U_(0xF) << TCC_CC_DITH4_DITHERCY_Pos)
  1383. #define TCC_CC_DITH4_DITHERCY(value) (TCC_CC_DITH4_DITHERCY_Msk & ((value) << TCC_CC_DITH4_DITHERCY_Pos))
  1384. #define TCC_CC_DITH4_CC_Pos 4 /**< \brief (TCC_CC_DITH4) Channel Compare/Capture Value */
  1385. #define TCC_CC_DITH4_CC_Msk (_U_(0xFFFFF) << TCC_CC_DITH4_CC_Pos)
  1386. #define TCC_CC_DITH4_CC(value) (TCC_CC_DITH4_CC_Msk & ((value) << TCC_CC_DITH4_CC_Pos))
  1387. #define TCC_CC_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC_DITH4) MASK Register */
  1388. // DITH5 mode
  1389. #define TCC_CC_DITH5_DITHERCY_Pos 0 /**< \brief (TCC_CC_DITH5) Dithering Cycle Number */
  1390. #define TCC_CC_DITH5_DITHERCY_Msk (_U_(0x1F) << TCC_CC_DITH5_DITHERCY_Pos)
  1391. #define TCC_CC_DITH5_DITHERCY(value) (TCC_CC_DITH5_DITHERCY_Msk & ((value) << TCC_CC_DITH5_DITHERCY_Pos))
  1392. #define TCC_CC_DITH5_CC_Pos 5 /**< \brief (TCC_CC_DITH5) Channel Compare/Capture Value */
  1393. #define TCC_CC_DITH5_CC_Msk (_U_(0x7FFFF) << TCC_CC_DITH5_CC_Pos)
  1394. #define TCC_CC_DITH5_CC(value) (TCC_CC_DITH5_CC_Msk & ((value) << TCC_CC_DITH5_CC_Pos))
  1395. #define TCC_CC_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC_DITH5) MASK Register */
  1396. // DITH6 mode
  1397. #define TCC_CC_DITH6_DITHERCY_Pos 0 /**< \brief (TCC_CC_DITH6) Dithering Cycle Number */
  1398. #define TCC_CC_DITH6_DITHERCY_Msk (_U_(0x3F) << TCC_CC_DITH6_DITHERCY_Pos)
  1399. #define TCC_CC_DITH6_DITHERCY(value) (TCC_CC_DITH6_DITHERCY_Msk & ((value) << TCC_CC_DITH6_DITHERCY_Pos))
  1400. #define TCC_CC_DITH6_CC_Pos 6 /**< \brief (TCC_CC_DITH6) Channel Compare/Capture Value */
  1401. #define TCC_CC_DITH6_CC_Msk (_U_(0x3FFFF) << TCC_CC_DITH6_CC_Pos)
  1402. #define TCC_CC_DITH6_CC(value) (TCC_CC_DITH6_CC_Msk & ((value) << TCC_CC_DITH6_CC_Pos))
  1403. #define TCC_CC_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC_DITH6) MASK Register */
  1404. #define TCC_CC_CC_Pos 0 /**< \brief (TCC_CC) Channel Compare/Capture Value */
  1405. #define TCC_CC_CC_Msk (_U_(0xFFFFFF) << TCC_CC_CC_Pos)
  1406. #define TCC_CC_CC(value) (TCC_CC_CC_Msk & ((value) << TCC_CC_CC_Pos))
  1407. #define TCC_CC_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CC) MASK Register */
  1408. /* -------- TCC_PATTB : (TCC Offset: 0x64) (R/W 16) Pattern Buffer -------- */
  1409. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1410. typedef union {
  1411. struct {
  1412. uint16_t PGEB0:1; /*!< bit: 0 Pattern Generator 0 Output Enable Buffer */
  1413. uint16_t PGEB1:1; /*!< bit: 1 Pattern Generator 1 Output Enable Buffer */
  1414. uint16_t PGEB2:1; /*!< bit: 2 Pattern Generator 2 Output Enable Buffer */
  1415. uint16_t PGEB3:1; /*!< bit: 3 Pattern Generator 3 Output Enable Buffer */
  1416. uint16_t PGEB4:1; /*!< bit: 4 Pattern Generator 4 Output Enable Buffer */
  1417. uint16_t PGEB5:1; /*!< bit: 5 Pattern Generator 5 Output Enable Buffer */
  1418. uint16_t PGEB6:1; /*!< bit: 6 Pattern Generator 6 Output Enable Buffer */
  1419. uint16_t PGEB7:1; /*!< bit: 7 Pattern Generator 7 Output Enable Buffer */
  1420. uint16_t PGVB0:1; /*!< bit: 8 Pattern Generator 0 Output Enable */
  1421. uint16_t PGVB1:1; /*!< bit: 9 Pattern Generator 1 Output Enable */
  1422. uint16_t PGVB2:1; /*!< bit: 10 Pattern Generator 2 Output Enable */
  1423. uint16_t PGVB3:1; /*!< bit: 11 Pattern Generator 3 Output Enable */
  1424. uint16_t PGVB4:1; /*!< bit: 12 Pattern Generator 4 Output Enable */
  1425. uint16_t PGVB5:1; /*!< bit: 13 Pattern Generator 5 Output Enable */
  1426. uint16_t PGVB6:1; /*!< bit: 14 Pattern Generator 6 Output Enable */
  1427. uint16_t PGVB7:1; /*!< bit: 15 Pattern Generator 7 Output Enable */
  1428. } bit; /*!< Structure used for bit access */
  1429. struct {
  1430. uint16_t PGEB:8; /*!< bit: 0.. 7 Pattern Generator x Output Enable Buffer */
  1431. uint16_t PGVB:8; /*!< bit: 8..15 Pattern Generator x Output Enable */
  1432. } vec; /*!< Structure used for vec access */
  1433. uint16_t reg; /*!< Type used for register access */
  1434. } TCC_PATTB_Type;
  1435. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1436. #define TCC_PATTB_OFFSET 0x64 /**< \brief (TCC_PATTB offset) Pattern Buffer */
  1437. #define TCC_PATTB_RESETVALUE _U_(0x0000) /**< \brief (TCC_PATTB reset_value) Pattern Buffer */
  1438. #define TCC_PATTB_PGEB0_Pos 0 /**< \brief (TCC_PATTB) Pattern Generator 0 Output Enable Buffer */
  1439. #define TCC_PATTB_PGEB0 (_U_(1) << TCC_PATTB_PGEB0_Pos)
  1440. #define TCC_PATTB_PGEB1_Pos 1 /**< \brief (TCC_PATTB) Pattern Generator 1 Output Enable Buffer */
  1441. #define TCC_PATTB_PGEB1 (_U_(1) << TCC_PATTB_PGEB1_Pos)
  1442. #define TCC_PATTB_PGEB2_Pos 2 /**< \brief (TCC_PATTB) Pattern Generator 2 Output Enable Buffer */
  1443. #define TCC_PATTB_PGEB2 (_U_(1) << TCC_PATTB_PGEB2_Pos)
  1444. #define TCC_PATTB_PGEB3_Pos 3 /**< \brief (TCC_PATTB) Pattern Generator 3 Output Enable Buffer */
  1445. #define TCC_PATTB_PGEB3 (_U_(1) << TCC_PATTB_PGEB3_Pos)
  1446. #define TCC_PATTB_PGEB4_Pos 4 /**< \brief (TCC_PATTB) Pattern Generator 4 Output Enable Buffer */
  1447. #define TCC_PATTB_PGEB4 (_U_(1) << TCC_PATTB_PGEB4_Pos)
  1448. #define TCC_PATTB_PGEB5_Pos 5 /**< \brief (TCC_PATTB) Pattern Generator 5 Output Enable Buffer */
  1449. #define TCC_PATTB_PGEB5 (_U_(1) << TCC_PATTB_PGEB5_Pos)
  1450. #define TCC_PATTB_PGEB6_Pos 6 /**< \brief (TCC_PATTB) Pattern Generator 6 Output Enable Buffer */
  1451. #define TCC_PATTB_PGEB6 (_U_(1) << TCC_PATTB_PGEB6_Pos)
  1452. #define TCC_PATTB_PGEB7_Pos 7 /**< \brief (TCC_PATTB) Pattern Generator 7 Output Enable Buffer */
  1453. #define TCC_PATTB_PGEB7 (_U_(1) << TCC_PATTB_PGEB7_Pos)
  1454. #define TCC_PATTB_PGEB_Pos 0 /**< \brief (TCC_PATTB) Pattern Generator x Output Enable Buffer */
  1455. #define TCC_PATTB_PGEB_Msk (_U_(0xFF) << TCC_PATTB_PGEB_Pos)
  1456. #define TCC_PATTB_PGEB(value) (TCC_PATTB_PGEB_Msk & ((value) << TCC_PATTB_PGEB_Pos))
  1457. #define TCC_PATTB_PGVB0_Pos 8 /**< \brief (TCC_PATTB) Pattern Generator 0 Output Enable */
  1458. #define TCC_PATTB_PGVB0 (_U_(1) << TCC_PATTB_PGVB0_Pos)
  1459. #define TCC_PATTB_PGVB1_Pos 9 /**< \brief (TCC_PATTB) Pattern Generator 1 Output Enable */
  1460. #define TCC_PATTB_PGVB1 (_U_(1) << TCC_PATTB_PGVB1_Pos)
  1461. #define TCC_PATTB_PGVB2_Pos 10 /**< \brief (TCC_PATTB) Pattern Generator 2 Output Enable */
  1462. #define TCC_PATTB_PGVB2 (_U_(1) << TCC_PATTB_PGVB2_Pos)
  1463. #define TCC_PATTB_PGVB3_Pos 11 /**< \brief (TCC_PATTB) Pattern Generator 3 Output Enable */
  1464. #define TCC_PATTB_PGVB3 (_U_(1) << TCC_PATTB_PGVB3_Pos)
  1465. #define TCC_PATTB_PGVB4_Pos 12 /**< \brief (TCC_PATTB) Pattern Generator 4 Output Enable */
  1466. #define TCC_PATTB_PGVB4 (_U_(1) << TCC_PATTB_PGVB4_Pos)
  1467. #define TCC_PATTB_PGVB5_Pos 13 /**< \brief (TCC_PATTB) Pattern Generator 5 Output Enable */
  1468. #define TCC_PATTB_PGVB5 (_U_(1) << TCC_PATTB_PGVB5_Pos)
  1469. #define TCC_PATTB_PGVB6_Pos 14 /**< \brief (TCC_PATTB) Pattern Generator 6 Output Enable */
  1470. #define TCC_PATTB_PGVB6 (_U_(1) << TCC_PATTB_PGVB6_Pos)
  1471. #define TCC_PATTB_PGVB7_Pos 15 /**< \brief (TCC_PATTB) Pattern Generator 7 Output Enable */
  1472. #define TCC_PATTB_PGVB7 (_U_(1) << TCC_PATTB_PGVB7_Pos)
  1473. #define TCC_PATTB_PGVB_Pos 8 /**< \brief (TCC_PATTB) Pattern Generator x Output Enable */
  1474. #define TCC_PATTB_PGVB_Msk (_U_(0xFF) << TCC_PATTB_PGVB_Pos)
  1475. #define TCC_PATTB_PGVB(value) (TCC_PATTB_PGVB_Msk & ((value) << TCC_PATTB_PGVB_Pos))
  1476. #define TCC_PATTB_MASK _U_(0xFFFF) /**< \brief (TCC_PATTB) MASK Register */
  1477. /* -------- TCC_WAVEB : (TCC Offset: 0x68) (R/W 32) Waveform Control Buffer -------- */
  1478. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1479. typedef union {
  1480. struct {
  1481. uint32_t WAVEGENB:3; /*!< bit: 0.. 2 Waveform Generation Buffer */
  1482. uint32_t :1; /*!< bit: 3 Reserved */
  1483. uint32_t RAMPB:2; /*!< bit: 4.. 5 Ramp Mode Buffer */
  1484. uint32_t :1; /*!< bit: 6 Reserved */
  1485. uint32_t CIPERENB:1; /*!< bit: 7 Circular Period Enable Buffer */
  1486. uint32_t CICCENB0:1; /*!< bit: 8 Circular Channel 0 Enable Buffer */
  1487. uint32_t CICCENB1:1; /*!< bit: 9 Circular Channel 1 Enable Buffer */
  1488. uint32_t CICCENB2:1; /*!< bit: 10 Circular Channel 2 Enable Buffer */
  1489. uint32_t CICCENB3:1; /*!< bit: 11 Circular Channel 3 Enable Buffer */
  1490. uint32_t :4; /*!< bit: 12..15 Reserved */
  1491. uint32_t POLB0:1; /*!< bit: 16 Channel 0 Polarity Buffer */
  1492. uint32_t POLB1:1; /*!< bit: 17 Channel 1 Polarity Buffer */
  1493. uint32_t POLB2:1; /*!< bit: 18 Channel 2 Polarity Buffer */
  1494. uint32_t POLB3:1; /*!< bit: 19 Channel 3 Polarity Buffer */
  1495. uint32_t :4; /*!< bit: 20..23 Reserved */
  1496. uint32_t SWAPB0:1; /*!< bit: 24 Swap DTI Output Pair 0 Buffer */
  1497. uint32_t SWAPB1:1; /*!< bit: 25 Swap DTI Output Pair 1 Buffer */
  1498. uint32_t SWAPB2:1; /*!< bit: 26 Swap DTI Output Pair 2 Buffer */
  1499. uint32_t SWAPB3:1; /*!< bit: 27 Swap DTI Output Pair 3 Buffer */
  1500. uint32_t :4; /*!< bit: 28..31 Reserved */
  1501. } bit; /*!< Structure used for bit access */
  1502. struct {
  1503. uint32_t :8; /*!< bit: 0.. 7 Reserved */
  1504. uint32_t CICCENB:4; /*!< bit: 8..11 Circular Channel x Enable Buffer */
  1505. uint32_t :4; /*!< bit: 12..15 Reserved */
  1506. uint32_t POLB:4; /*!< bit: 16..19 Channel x Polarity Buffer */
  1507. uint32_t :4; /*!< bit: 20..23 Reserved */
  1508. uint32_t SWAPB:4; /*!< bit: 24..27 Swap DTI Output Pair x Buffer */
  1509. uint32_t :4; /*!< bit: 28..31 Reserved */
  1510. } vec; /*!< Structure used for vec access */
  1511. uint32_t reg; /*!< Type used for register access */
  1512. } TCC_WAVEB_Type;
  1513. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1514. #define TCC_WAVEB_OFFSET 0x68 /**< \brief (TCC_WAVEB offset) Waveform Control Buffer */
  1515. #define TCC_WAVEB_RESETVALUE _U_(0x00000000) /**< \brief (TCC_WAVEB reset_value) Waveform Control Buffer */
  1516. #define TCC_WAVEB_WAVEGENB_Pos 0 /**< \brief (TCC_WAVEB) Waveform Generation Buffer */
  1517. #define TCC_WAVEB_WAVEGENB_Msk (_U_(0x7) << TCC_WAVEB_WAVEGENB_Pos)
  1518. #define TCC_WAVEB_WAVEGENB(value) (TCC_WAVEB_WAVEGENB_Msk & ((value) << TCC_WAVEB_WAVEGENB_Pos))
  1519. #define TCC_WAVEB_WAVEGENB_NFRQ_Val _U_(0x0) /**< \brief (TCC_WAVEB) Normal frequency */
  1520. #define TCC_WAVEB_WAVEGENB_MFRQ_Val _U_(0x1) /**< \brief (TCC_WAVEB) Match frequency */
  1521. #define TCC_WAVEB_WAVEGENB_NPWM_Val _U_(0x2) /**< \brief (TCC_WAVEB) Normal PWM */
  1522. #define TCC_WAVEB_WAVEGENB_DSCRITICAL_Val _U_(0x4) /**< \brief (TCC_WAVEB) Dual-slope critical */
  1523. #define TCC_WAVEB_WAVEGENB_DSBOTTOM_Val _U_(0x5) /**< \brief (TCC_WAVEB) Dual-slope with interrupt/event condition when COUNT reaches ZERO */
  1524. #define TCC_WAVEB_WAVEGENB_DSBOTH_Val _U_(0x6) /**< \brief (TCC_WAVEB) Dual-slope with interrupt/event condition when COUNT reaches ZERO or TOP */
  1525. #define TCC_WAVEB_WAVEGENB_DSTOP_Val _U_(0x7) /**< \brief (TCC_WAVEB) Dual-slope with interrupt/event condition when COUNT reaches TOP */
  1526. #define TCC_WAVEB_WAVEGENB_NFRQ (TCC_WAVEB_WAVEGENB_NFRQ_Val << TCC_WAVEB_WAVEGENB_Pos)
  1527. #define TCC_WAVEB_WAVEGENB_MFRQ (TCC_WAVEB_WAVEGENB_MFRQ_Val << TCC_WAVEB_WAVEGENB_Pos)
  1528. #define TCC_WAVEB_WAVEGENB_NPWM (TCC_WAVEB_WAVEGENB_NPWM_Val << TCC_WAVEB_WAVEGENB_Pos)
  1529. #define TCC_WAVEB_WAVEGENB_DSCRITICAL (TCC_WAVEB_WAVEGENB_DSCRITICAL_Val << TCC_WAVEB_WAVEGENB_Pos)
  1530. #define TCC_WAVEB_WAVEGENB_DSBOTTOM (TCC_WAVEB_WAVEGENB_DSBOTTOM_Val << TCC_WAVEB_WAVEGENB_Pos)
  1531. #define TCC_WAVEB_WAVEGENB_DSBOTH (TCC_WAVEB_WAVEGENB_DSBOTH_Val << TCC_WAVEB_WAVEGENB_Pos)
  1532. #define TCC_WAVEB_WAVEGENB_DSTOP (TCC_WAVEB_WAVEGENB_DSTOP_Val << TCC_WAVEB_WAVEGENB_Pos)
  1533. #define TCC_WAVEB_RAMPB_Pos 4 /**< \brief (TCC_WAVEB) Ramp Mode Buffer */
  1534. #define TCC_WAVEB_RAMPB_Msk (_U_(0x3) << TCC_WAVEB_RAMPB_Pos)
  1535. #define TCC_WAVEB_RAMPB(value) (TCC_WAVEB_RAMPB_Msk & ((value) << TCC_WAVEB_RAMPB_Pos))
  1536. #define TCC_WAVEB_RAMPB_RAMP1_Val _U_(0x0) /**< \brief (TCC_WAVEB) RAMP1 operation */
  1537. #define TCC_WAVEB_RAMPB_RAMP2A_Val _U_(0x1) /**< \brief (TCC_WAVEB) Alternative RAMP2 operation */
  1538. #define TCC_WAVEB_RAMPB_RAMP2_Val _U_(0x2) /**< \brief (TCC_WAVEB) RAMP2 operation */
  1539. #define TCC_WAVEB_RAMPB_RAMP1 (TCC_WAVEB_RAMPB_RAMP1_Val << TCC_WAVEB_RAMPB_Pos)
  1540. #define TCC_WAVEB_RAMPB_RAMP2A (TCC_WAVEB_RAMPB_RAMP2A_Val << TCC_WAVEB_RAMPB_Pos)
  1541. #define TCC_WAVEB_RAMPB_RAMP2 (TCC_WAVEB_RAMPB_RAMP2_Val << TCC_WAVEB_RAMPB_Pos)
  1542. #define TCC_WAVEB_CIPERENB_Pos 7 /**< \brief (TCC_WAVEB) Circular Period Enable Buffer */
  1543. #define TCC_WAVEB_CIPERENB (_U_(0x1) << TCC_WAVEB_CIPERENB_Pos)
  1544. #define TCC_WAVEB_CICCENB0_Pos 8 /**< \brief (TCC_WAVEB) Circular Channel 0 Enable Buffer */
  1545. #define TCC_WAVEB_CICCENB0 (_U_(1) << TCC_WAVEB_CICCENB0_Pos)
  1546. #define TCC_WAVEB_CICCENB1_Pos 9 /**< \brief (TCC_WAVEB) Circular Channel 1 Enable Buffer */
  1547. #define TCC_WAVEB_CICCENB1 (_U_(1) << TCC_WAVEB_CICCENB1_Pos)
  1548. #define TCC_WAVEB_CICCENB2_Pos 10 /**< \brief (TCC_WAVEB) Circular Channel 2 Enable Buffer */
  1549. #define TCC_WAVEB_CICCENB2 (_U_(1) << TCC_WAVEB_CICCENB2_Pos)
  1550. #define TCC_WAVEB_CICCENB3_Pos 11 /**< \brief (TCC_WAVEB) Circular Channel 3 Enable Buffer */
  1551. #define TCC_WAVEB_CICCENB3 (_U_(1) << TCC_WAVEB_CICCENB3_Pos)
  1552. #define TCC_WAVEB_CICCENB_Pos 8 /**< \brief (TCC_WAVEB) Circular Channel x Enable Buffer */
  1553. #define TCC_WAVEB_CICCENB_Msk (_U_(0xF) << TCC_WAVEB_CICCENB_Pos)
  1554. #define TCC_WAVEB_CICCENB(value) (TCC_WAVEB_CICCENB_Msk & ((value) << TCC_WAVEB_CICCENB_Pos))
  1555. #define TCC_WAVEB_POLB0_Pos 16 /**< \brief (TCC_WAVEB) Channel 0 Polarity Buffer */
  1556. #define TCC_WAVEB_POLB0 (_U_(1) << TCC_WAVEB_POLB0_Pos)
  1557. #define TCC_WAVEB_POLB1_Pos 17 /**< \brief (TCC_WAVEB) Channel 1 Polarity Buffer */
  1558. #define TCC_WAVEB_POLB1 (_U_(1) << TCC_WAVEB_POLB1_Pos)
  1559. #define TCC_WAVEB_POLB2_Pos 18 /**< \brief (TCC_WAVEB) Channel 2 Polarity Buffer */
  1560. #define TCC_WAVEB_POLB2 (_U_(1) << TCC_WAVEB_POLB2_Pos)
  1561. #define TCC_WAVEB_POLB3_Pos 19 /**< \brief (TCC_WAVEB) Channel 3 Polarity Buffer */
  1562. #define TCC_WAVEB_POLB3 (_U_(1) << TCC_WAVEB_POLB3_Pos)
  1563. #define TCC_WAVEB_POLB_Pos 16 /**< \brief (TCC_WAVEB) Channel x Polarity Buffer */
  1564. #define TCC_WAVEB_POLB_Msk (_U_(0xF) << TCC_WAVEB_POLB_Pos)
  1565. #define TCC_WAVEB_POLB(value) (TCC_WAVEB_POLB_Msk & ((value) << TCC_WAVEB_POLB_Pos))
  1566. #define TCC_WAVEB_SWAPB0_Pos 24 /**< \brief (TCC_WAVEB) Swap DTI Output Pair 0 Buffer */
  1567. #define TCC_WAVEB_SWAPB0 (_U_(1) << TCC_WAVEB_SWAPB0_Pos)
  1568. #define TCC_WAVEB_SWAPB1_Pos 25 /**< \brief (TCC_WAVEB) Swap DTI Output Pair 1 Buffer */
  1569. #define TCC_WAVEB_SWAPB1 (_U_(1) << TCC_WAVEB_SWAPB1_Pos)
  1570. #define TCC_WAVEB_SWAPB2_Pos 26 /**< \brief (TCC_WAVEB) Swap DTI Output Pair 2 Buffer */
  1571. #define TCC_WAVEB_SWAPB2 (_U_(1) << TCC_WAVEB_SWAPB2_Pos)
  1572. #define TCC_WAVEB_SWAPB3_Pos 27 /**< \brief (TCC_WAVEB) Swap DTI Output Pair 3 Buffer */
  1573. #define TCC_WAVEB_SWAPB3 (_U_(1) << TCC_WAVEB_SWAPB3_Pos)
  1574. #define TCC_WAVEB_SWAPB_Pos 24 /**< \brief (TCC_WAVEB) Swap DTI Output Pair x Buffer */
  1575. #define TCC_WAVEB_SWAPB_Msk (_U_(0xF) << TCC_WAVEB_SWAPB_Pos)
  1576. #define TCC_WAVEB_SWAPB(value) (TCC_WAVEB_SWAPB_Msk & ((value) << TCC_WAVEB_SWAPB_Pos))
  1577. #define TCC_WAVEB_MASK _U_(0x0F0F0FB7) /**< \brief (TCC_WAVEB) MASK Register */
  1578. /* -------- TCC_PERB : (TCC Offset: 0x6C) (R/W 32) Period Buffer -------- */
  1579. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1580. typedef union {
  1581. struct { // DITH4 mode
  1582. uint32_t DITHERCYB:4; /*!< bit: 0.. 3 Dithering Buffer Cycle Number */
  1583. uint32_t PERB:20; /*!< bit: 4..23 Period Buffer Value */
  1584. uint32_t :8; /*!< bit: 24..31 Reserved */
  1585. } DITH4; /*!< Structure used for DITH4 */
  1586. struct { // DITH5 mode
  1587. uint32_t DITHERCYB:5; /*!< bit: 0.. 4 Dithering Buffer Cycle Number */
  1588. uint32_t PERB:19; /*!< bit: 5..23 Period Buffer Value */
  1589. uint32_t :8; /*!< bit: 24..31 Reserved */
  1590. } DITH5; /*!< Structure used for DITH5 */
  1591. struct { // DITH6 mode
  1592. uint32_t DITHERCYB:6; /*!< bit: 0.. 5 Dithering Buffer Cycle Number */
  1593. uint32_t PERB:18; /*!< bit: 6..23 Period Buffer Value */
  1594. uint32_t :8; /*!< bit: 24..31 Reserved */
  1595. } DITH6; /*!< Structure used for DITH6 */
  1596. struct {
  1597. uint32_t PERB:24; /*!< bit: 0..23 Period Buffer Value */
  1598. uint32_t :8; /*!< bit: 24..31 Reserved */
  1599. } bit; /*!< Structure used for bit access */
  1600. uint32_t reg; /*!< Type used for register access */
  1601. } TCC_PERB_Type;
  1602. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1603. #define TCC_PERB_OFFSET 0x6C /**< \brief (TCC_PERB offset) Period Buffer */
  1604. #define TCC_PERB_RESETVALUE _U_(0xFFFFFFFF) /**< \brief (TCC_PERB reset_value) Period Buffer */
  1605. // DITH4 mode
  1606. #define TCC_PERB_DITH4_DITHERCYB_Pos 0 /**< \brief (TCC_PERB_DITH4) Dithering Buffer Cycle Number */
  1607. #define TCC_PERB_DITH4_DITHERCYB_Msk (_U_(0xF) << TCC_PERB_DITH4_DITHERCYB_Pos)
  1608. #define TCC_PERB_DITH4_DITHERCYB(value) (TCC_PERB_DITH4_DITHERCYB_Msk & ((value) << TCC_PERB_DITH4_DITHERCYB_Pos))
  1609. #define TCC_PERB_DITH4_PERB_Pos 4 /**< \brief (TCC_PERB_DITH4) Period Buffer Value */
  1610. #define TCC_PERB_DITH4_PERB_Msk (_U_(0xFFFFF) << TCC_PERB_DITH4_PERB_Pos)
  1611. #define TCC_PERB_DITH4_PERB(value) (TCC_PERB_DITH4_PERB_Msk & ((value) << TCC_PERB_DITH4_PERB_Pos))
  1612. #define TCC_PERB_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERB_DITH4) MASK Register */
  1613. // DITH5 mode
  1614. #define TCC_PERB_DITH5_DITHERCYB_Pos 0 /**< \brief (TCC_PERB_DITH5) Dithering Buffer Cycle Number */
  1615. #define TCC_PERB_DITH5_DITHERCYB_Msk (_U_(0x1F) << TCC_PERB_DITH5_DITHERCYB_Pos)
  1616. #define TCC_PERB_DITH5_DITHERCYB(value) (TCC_PERB_DITH5_DITHERCYB_Msk & ((value) << TCC_PERB_DITH5_DITHERCYB_Pos))
  1617. #define TCC_PERB_DITH5_PERB_Pos 5 /**< \brief (TCC_PERB_DITH5) Period Buffer Value */
  1618. #define TCC_PERB_DITH5_PERB_Msk (_U_(0x7FFFF) << TCC_PERB_DITH5_PERB_Pos)
  1619. #define TCC_PERB_DITH5_PERB(value) (TCC_PERB_DITH5_PERB_Msk & ((value) << TCC_PERB_DITH5_PERB_Pos))
  1620. #define TCC_PERB_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERB_DITH5) MASK Register */
  1621. // DITH6 mode
  1622. #define TCC_PERB_DITH6_DITHERCYB_Pos 0 /**< \brief (TCC_PERB_DITH6) Dithering Buffer Cycle Number */
  1623. #define TCC_PERB_DITH6_DITHERCYB_Msk (_U_(0x3F) << TCC_PERB_DITH6_DITHERCYB_Pos)
  1624. #define TCC_PERB_DITH6_DITHERCYB(value) (TCC_PERB_DITH6_DITHERCYB_Msk & ((value) << TCC_PERB_DITH6_DITHERCYB_Pos))
  1625. #define TCC_PERB_DITH6_PERB_Pos 6 /**< \brief (TCC_PERB_DITH6) Period Buffer Value */
  1626. #define TCC_PERB_DITH6_PERB_Msk (_U_(0x3FFFF) << TCC_PERB_DITH6_PERB_Pos)
  1627. #define TCC_PERB_DITH6_PERB(value) (TCC_PERB_DITH6_PERB_Msk & ((value) << TCC_PERB_DITH6_PERB_Pos))
  1628. #define TCC_PERB_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERB_DITH6) MASK Register */
  1629. #define TCC_PERB_PERB_Pos 0 /**< \brief (TCC_PERB) Period Buffer Value */
  1630. #define TCC_PERB_PERB_Msk (_U_(0xFFFFFF) << TCC_PERB_PERB_Pos)
  1631. #define TCC_PERB_PERB(value) (TCC_PERB_PERB_Msk & ((value) << TCC_PERB_PERB_Pos))
  1632. #define TCC_PERB_MASK _U_(0x00FFFFFF) /**< \brief (TCC_PERB) MASK Register */
  1633. /* -------- TCC_CCB : (TCC Offset: 0x70) (R/W 32) Compare and Capture Buffer -------- */
  1634. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1635. typedef union {
  1636. struct { // DITH4 mode
  1637. uint32_t DITHERCYB:4; /*!< bit: 0.. 3 Dithering Buffer Cycle Number */
  1638. uint32_t CCB:20; /*!< bit: 4..23 Channel Compare/Capture Buffer Value */
  1639. uint32_t :8; /*!< bit: 24..31 Reserved */
  1640. } DITH4; /*!< Structure used for DITH4 */
  1641. struct { // DITH5 mode
  1642. uint32_t DITHERCYB:5; /*!< bit: 0.. 4 Dithering Buffer Cycle Number */
  1643. uint32_t CCB:19; /*!< bit: 5..23 Channel Compare/Capture Buffer Value */
  1644. uint32_t :8; /*!< bit: 24..31 Reserved */
  1645. } DITH5; /*!< Structure used for DITH5 */
  1646. struct { // DITH6 mode
  1647. uint32_t DITHERCYB:6; /*!< bit: 0.. 5 Dithering Buffer Cycle Number */
  1648. uint32_t CCB:18; /*!< bit: 6..23 Channel Compare/Capture Buffer Value */
  1649. uint32_t :8; /*!< bit: 24..31 Reserved */
  1650. } DITH6; /*!< Structure used for DITH6 */
  1651. struct {
  1652. uint32_t CCB:24; /*!< bit: 0..23 Channel Compare/Capture Buffer Value */
  1653. uint32_t :8; /*!< bit: 24..31 Reserved */
  1654. } bit; /*!< Structure used for bit access */
  1655. uint32_t reg; /*!< Type used for register access */
  1656. } TCC_CCB_Type;
  1657. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1658. #define TCC_CCB_OFFSET 0x70 /**< \brief (TCC_CCB offset) Compare and Capture Buffer */
  1659. #define TCC_CCB_RESETVALUE _U_(0x00000000) /**< \brief (TCC_CCB reset_value) Compare and Capture Buffer */
  1660. // DITH4 mode
  1661. #define TCC_CCB_DITH4_DITHERCYB_Pos 0 /**< \brief (TCC_CCB_DITH4) Dithering Buffer Cycle Number */
  1662. #define TCC_CCB_DITH4_DITHERCYB_Msk (_U_(0xF) << TCC_CCB_DITH4_DITHERCYB_Pos)
  1663. #define TCC_CCB_DITH4_DITHERCYB(value) (TCC_CCB_DITH4_DITHERCYB_Msk & ((value) << TCC_CCB_DITH4_DITHERCYB_Pos))
  1664. #define TCC_CCB_DITH4_CCB_Pos 4 /**< \brief (TCC_CCB_DITH4) Channel Compare/Capture Buffer Value */
  1665. #define TCC_CCB_DITH4_CCB_Msk (_U_(0xFFFFF) << TCC_CCB_DITH4_CCB_Pos)
  1666. #define TCC_CCB_DITH4_CCB(value) (TCC_CCB_DITH4_CCB_Msk & ((value) << TCC_CCB_DITH4_CCB_Pos))
  1667. #define TCC_CCB_DITH4_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCB_DITH4) MASK Register */
  1668. // DITH5 mode
  1669. #define TCC_CCB_DITH5_DITHERCYB_Pos 0 /**< \brief (TCC_CCB_DITH5) Dithering Buffer Cycle Number */
  1670. #define TCC_CCB_DITH5_DITHERCYB_Msk (_U_(0x1F) << TCC_CCB_DITH5_DITHERCYB_Pos)
  1671. #define TCC_CCB_DITH5_DITHERCYB(value) (TCC_CCB_DITH5_DITHERCYB_Msk & ((value) << TCC_CCB_DITH5_DITHERCYB_Pos))
  1672. #define TCC_CCB_DITH5_CCB_Pos 5 /**< \brief (TCC_CCB_DITH5) Channel Compare/Capture Buffer Value */
  1673. #define TCC_CCB_DITH5_CCB_Msk (_U_(0x7FFFF) << TCC_CCB_DITH5_CCB_Pos)
  1674. #define TCC_CCB_DITH5_CCB(value) (TCC_CCB_DITH5_CCB_Msk & ((value) << TCC_CCB_DITH5_CCB_Pos))
  1675. #define TCC_CCB_DITH5_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCB_DITH5) MASK Register */
  1676. // DITH6 mode
  1677. #define TCC_CCB_DITH6_DITHERCYB_Pos 0 /**< \brief (TCC_CCB_DITH6) Dithering Buffer Cycle Number */
  1678. #define TCC_CCB_DITH6_DITHERCYB_Msk (_U_(0x3F) << TCC_CCB_DITH6_DITHERCYB_Pos)
  1679. #define TCC_CCB_DITH6_DITHERCYB(value) (TCC_CCB_DITH6_DITHERCYB_Msk & ((value) << TCC_CCB_DITH6_DITHERCYB_Pos))
  1680. #define TCC_CCB_DITH6_CCB_Pos 6 /**< \brief (TCC_CCB_DITH6) Channel Compare/Capture Buffer Value */
  1681. #define TCC_CCB_DITH6_CCB_Msk (_U_(0x3FFFF) << TCC_CCB_DITH6_CCB_Pos)
  1682. #define TCC_CCB_DITH6_CCB(value) (TCC_CCB_DITH6_CCB_Msk & ((value) << TCC_CCB_DITH6_CCB_Pos))
  1683. #define TCC_CCB_DITH6_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCB_DITH6) MASK Register */
  1684. #define TCC_CCB_CCB_Pos 0 /**< \brief (TCC_CCB) Channel Compare/Capture Buffer Value */
  1685. #define TCC_CCB_CCB_Msk (_U_(0xFFFFFF) << TCC_CCB_CCB_Pos)
  1686. #define TCC_CCB_CCB(value) (TCC_CCB_CCB_Msk & ((value) << TCC_CCB_CCB_Pos))
  1687. #define TCC_CCB_MASK _U_(0x00FFFFFF) /**< \brief (TCC_CCB) MASK Register */
  1688. /** \brief TCC hardware registers */
  1689. #if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
  1690. typedef struct {
  1691. __IO TCC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 32) Control A */
  1692. __IO TCC_CTRLBCLR_Type CTRLBCLR; /**< \brief Offset: 0x04 (R/W 8) Control B Clear */
  1693. __IO TCC_CTRLBSET_Type CTRLBSET; /**< \brief Offset: 0x05 (R/W 8) Control B Set */
  1694. RoReg8 Reserved1[0x2];
  1695. __I TCC_SYNCBUSY_Type SYNCBUSY; /**< \brief Offset: 0x08 (R/ 32) Synchronization Busy */
  1696. __IO TCC_FCTRLA_Type FCTRLA; /**< \brief Offset: 0x0C (R/W 32) Recoverable Fault A Configuration */
  1697. __IO TCC_FCTRLB_Type FCTRLB; /**< \brief Offset: 0x10 (R/W 32) Recoverable Fault B Configuration */
  1698. __IO TCC_WEXCTRL_Type WEXCTRL; /**< \brief Offset: 0x14 (R/W 32) Waveform Extension Configuration */
  1699. __IO TCC_DRVCTRL_Type DRVCTRL; /**< \brief Offset: 0x18 (R/W 32) Driver Control */
  1700. RoReg8 Reserved2[0x2];
  1701. __IO TCC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x1E (R/W 8) Debug Control */
  1702. RoReg8 Reserved3[0x1];
  1703. __IO TCC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x20 (R/W 32) Event Control */
  1704. __IO TCC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x24 (R/W 32) Interrupt Enable Clear */
  1705. __IO TCC_INTENSET_Type INTENSET; /**< \brief Offset: 0x28 (R/W 32) Interrupt Enable Set */
  1706. __IO TCC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x2C (R/W 32) Interrupt Flag Status and Clear */
  1707. __IO TCC_STATUS_Type STATUS; /**< \brief Offset: 0x30 (R/W 32) Status */
  1708. __IO TCC_COUNT_Type COUNT; /**< \brief Offset: 0x34 (R/W 32) Count */
  1709. __IO TCC_PATT_Type PATT; /**< \brief Offset: 0x38 (R/W 16) Pattern */
  1710. RoReg8 Reserved4[0x2];
  1711. __IO TCC_WAVE_Type WAVE; /**< \brief Offset: 0x3C (R/W 32) Waveform Control */
  1712. __IO TCC_PER_Type PER; /**< \brief Offset: 0x40 (R/W 32) Period */
  1713. __IO TCC_CC_Type CC[4]; /**< \brief Offset: 0x44 (R/W 32) Compare and Capture */
  1714. RoReg8 Reserved5[0x10];
  1715. __IO TCC_PATTB_Type PATTB; /**< \brief Offset: 0x64 (R/W 16) Pattern Buffer */
  1716. RoReg8 Reserved6[0x2];
  1717. __IO TCC_WAVEB_Type WAVEB; /**< \brief Offset: 0x68 (R/W 32) Waveform Control Buffer */
  1718. __IO TCC_PERB_Type PERB; /**< \brief Offset: 0x6C (R/W 32) Period Buffer */
  1719. __IO TCC_CCB_Type CCB[4]; /**< \brief Offset: 0x70 (R/W 32) Compare and Capture Buffer */
  1720. } Tcc;
  1721. #endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
  1722. /*@}*/
  1723. #endif /* _SAMD11_TCC_COMPONENT_ */