tcc_lighting.h 145 KB

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