stm32f3xx_hal_hrtim.h 231 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689
  1. /**
  2. ******************************************************************************
  3. * @file stm32f3xx_hal_hrtim.h
  4. * @author MCD Application Team
  5. * @brief Header file of HRTIM HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2016 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32F3xx_HAL_HRTIM_H
  20. #define STM32F3xx_HAL_HRTIM_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32f3xx_hal_def.h"
  26. #if defined(HRTIM1)
  27. /** @addtogroup STM32F3xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup HRTIM HRTIM
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /** @addtogroup HRTIM_Exported_Constants HRTIM Exported Constants
  35. * @{
  36. */
  37. /** @defgroup HRTIM_Max_Timer HRTIM Max Timer
  38. * @{
  39. */
  40. #define MAX_HRTIM_TIMER 6U
  41. /**
  42. * @}
  43. */
  44. /**
  45. * @}
  46. */
  47. /** @defgroup HRTIM_Exported_Types HRTIM Exported Types
  48. * @{
  49. */
  50. /**
  51. * @brief HRTIM Configuration Structure definition - Time base related parameters
  52. */
  53. typedef struct
  54. {
  55. uint32_t HRTIMInterruptResquests; /*!< Specifies which interrupts requests must enabled for the HRTIM instance.
  56. This parameter can be any combination of @ref HRTIM_Common_Interrupt_Enable */
  57. uint32_t SyncOptions; /*!< Specifies how the HRTIM instance handles the external synchronization signals.
  58. The HRTIM instance can be configured to act as a slave (waiting for a trigger
  59. to be synchronized) or a master (generating a synchronization signal) or both.
  60. This parameter can be a combination of @ref HRTIM_Synchronization_Options.*/
  61. uint32_t SyncInputSource; /*!< Specifies the external synchronization input source (significant only when
  62. the HRTIM instance is configured as a slave).
  63. This parameter can be a value of @ref HRTIM_Synchronization_Input_Source. */
  64. uint32_t SyncOutputSource; /*!< Specifies the source and event to be sent on the external synchronization outputs
  65. (significant only when the HRTIM instance is configured as a master).
  66. This parameter can be a value of @ref HRTIM_Synchronization_Output_Source */
  67. uint32_t SyncOutputPolarity; /*!< Specifies the conditioning of the event to be sent on the external synchronization
  68. outputs (significant only when the HRTIM instance is configured as a master).
  69. This parameter can be a value of @ref HRTIM_Synchronization_Output_Polarity */
  70. } HRTIM_InitTypeDef;
  71. /**
  72. * @brief HAL State structures definition
  73. */
  74. typedef enum
  75. {
  76. HAL_HRTIM_STATE_RESET = 0x00U, /*!< Peripheral is not yet Initialized */
  77. HAL_HRTIM_STATE_READY = 0x01U, /*!< Peripheral Initialized and ready for use */
  78. HAL_HRTIM_STATE_BUSY = 0x02U, /*!< an internal process is ongoing */
  79. HAL_HRTIM_STATE_TIMEOUT = 0x06U, /*!< Timeout state */
  80. HAL_HRTIM_STATE_ERROR = 0x07U, /*!< Error state */
  81. #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
  82. HAL_HRTIM_STATE_INVALID_CALLBACK = 0x08U /*!< Invalid Callback error */
  83. #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
  84. } HAL_HRTIM_StateTypeDef;
  85. /**
  86. * @brief HRTIM Timer Structure definition
  87. */
  88. typedef struct
  89. {
  90. uint32_t CaptureTrigger1; /*!< Event(s) triggering capture unit 1.
  91. When the timer operates in Simple mode, this parameter can be a value of @ref HRTIM_External_Event_Channels.
  92. When the timer operates in Waveform mode, this parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger. */
  93. uint32_t CaptureTrigger2; /*!< Event(s) triggering capture unit 2.
  94. When the timer operates in Simple mode, this parameter can be a value of @ref HRTIM_External_Event_Channels.
  95. When the timer operates in Waveform mode, this parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger. */
  96. uint32_t InterruptRequests; /*!< Interrupts requests enabled for the timer. */
  97. uint32_t DMARequests; /*!< DMA requests enabled for the timer. */
  98. uint32_t DMASrcAddress; /*!< Address of the source address of the DMA transfer. */
  99. uint32_t DMADstAddress; /*!< Address of the destination address of the DMA transfer. */
  100. uint32_t DMASize; /*!< Size of the DMA transfer */
  101. } HRTIM_TimerParamTypeDef;
  102. /**
  103. * @brief HRTIM Handle Structure definition
  104. */
  105. #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
  106. typedef struct __HRTIM_HandleTypeDef
  107. #else
  108. typedef struct
  109. #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
  110. {
  111. HRTIM_TypeDef * Instance; /*!< Register base address */
  112. HRTIM_InitTypeDef Init; /*!< HRTIM required parameters */
  113. HRTIM_TimerParamTypeDef TimerParam[MAX_HRTIM_TIMER]; /*!< HRTIM timers - including the master - parameters */
  114. HAL_LockTypeDef Lock; /*!< Locking object */
  115. __IO HAL_HRTIM_StateTypeDef State; /*!< HRTIM communication state */
  116. DMA_HandleTypeDef * hdmaMaster; /*!< Master timer DMA handle parameters */
  117. DMA_HandleTypeDef * hdmaTimerA; /*!< Timer A DMA handle parameters */
  118. DMA_HandleTypeDef * hdmaTimerB; /*!< Timer B DMA handle parameters */
  119. DMA_HandleTypeDef * hdmaTimerC; /*!< Timer C DMA handle parameters */
  120. DMA_HandleTypeDef * hdmaTimerD; /*!< Timer D DMA handle parameters */
  121. DMA_HandleTypeDef * hdmaTimerE; /*!< Timer E DMA handle parameters */
  122. #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
  123. void (* Fault1Callback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< Fault 1 interrupt callback function pointer */
  124. void (* Fault2Callback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< Fault 2 interrupt callback function pointer */
  125. void (* Fault3Callback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< Fault 3 interrupt callback function pointer */
  126. void (* Fault4Callback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< Fault 4 interrupt callback function pointer */
  127. void (* Fault5Callback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< Fault 5 interrupt callback function pointer */
  128. void (* SystemFaultCallback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< System fault interrupt callback function pointer */
  129. void (* DLLCalibrationReadyCallback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< DLL Ready interrupt callback function pointer */
  130. void (* BurstModePeriodCallback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< Burst mode period interrupt callback function pointer */
  131. void (* SynchronizationEventCallback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< Sync Input interrupt callback function pointer */
  132. void (* ErrorCallback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< DMA error callback function pointer */
  133. void (* RegistersUpdateCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Update interrupt callback function pointer */
  134. void (* RepetitionEventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Repetition interrupt callback function pointer */
  135. void (* Compare1EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Compare 1 match interrupt callback function pointer */
  136. void (* Compare2EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Compare 2 match interrupt callback function pointer */
  137. void (* Compare3EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Compare 3 match interrupt callback function pointer */
  138. void (* Compare4EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Compare 4 match interrupt callback function pointer */
  139. void (* Capture1EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Capture 1 interrupts callback function pointer */
  140. void (* Capture2EventCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Capture 2 interrupts callback function pointer */
  141. void (* DelayedProtectionCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Delayed protection interrupt callback function pointer */
  142. void (* CounterResetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x counter reset/roll-over interrupt callback function pointer */
  143. void (* Output1SetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x output 1 set interrupt callback function pointer */
  144. void (* Output1ResetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x output 1 reset interrupt callback function pointer */
  145. void (* Output2SetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x output 2 set interrupt callback function pointer */
  146. void (* Output2ResetCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x output 2 reset interrupt callback function pointer */
  147. void (* BurstDMATransferCallback)(struct __HRTIM_HandleTypeDef *hhrtim, uint32_t TimerIdx); /*!< Timer x Burst DMA completed interrupt callback function pointer */
  148. void (* MspInitCallback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< HRTIM MspInit callback function pointer */
  149. void (* MspDeInitCallback)(struct __HRTIM_HandleTypeDef *hhrtim); /*!< HRTIM MspInit callback function pointer */
  150. #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
  151. } HRTIM_HandleTypeDef;
  152. /**
  153. * @brief Simple output compare mode configuration definition
  154. */
  155. typedef struct
  156. {
  157. uint32_t Period; /*!< Specifies the timer period.
  158. The period value must be above 3 periods of the fHRTIM clock.
  159. Maximum value is = 0xFFDFU */
  160. uint32_t RepetitionCounter; /*!< Specifies the timer repetition period.
  161. This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF. */
  162. uint32_t PrescalerRatio; /*!< Specifies the timer clock prescaler ratio.
  163. This parameter can be any value of @ref HRTIM_Prescaler_Ratio */
  164. uint32_t Mode; /*!< Specifies the counter operating mode.
  165. This parameter can be any value of @ref HRTIM_Counter_Operating_Mode */
  166. } HRTIM_TimeBaseCfgTypeDef;
  167. /**
  168. * @brief Simple output compare mode configuration definition
  169. */
  170. typedef struct
  171. {
  172. uint32_t Mode; /*!< Specifies the output compare mode (toggle, active, inactive).
  173. This parameter can be any value of of @ref HRTIM_Simple_OC_Mode */
  174. uint32_t Pulse; /*!< Specifies the compare value to be loaded into the Compare Register.
  175. The compare value must be above or equal to 3 periods of the fHRTIM clock */
  176. uint32_t Polarity; /*!< Specifies the output polarity.
  177. This parameter can be any value of @ref HRTIM_Output_Polarity */
  178. uint32_t IdleLevel; /*!< Specifies whether the output level is active or inactive when in IDLE state.
  179. This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
  180. } HRTIM_SimpleOCChannelCfgTypeDef;
  181. /**
  182. * @brief Simple PWM output mode configuration definition
  183. */
  184. typedef struct
  185. {
  186. uint32_t Pulse; /*!< Specifies the compare value to be loaded into the Compare Register.
  187. The compare value must be above or equal to 3 periods of the fHRTIM clock */
  188. uint32_t Polarity; /*!< Specifies the output polarity.
  189. This parameter can be any value of @ref HRTIM_Output_Polarity */
  190. uint32_t IdleLevel; /*!< Specifies whether the output level is active or inactive when in IDLE state.
  191. This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
  192. } HRTIM_SimplePWMChannelCfgTypeDef;
  193. /**
  194. * @brief Simple capture mode configuration definition
  195. */
  196. typedef struct
  197. {
  198. uint32_t Event; /*!< Specifies the external event triggering the capture.
  199. This parameter can be any 'EEVx' value of @ref HRTIM_External_Event_Channels */
  200. uint32_t EventPolarity; /*!< Specifies the polarity of the external event (in case of level sensitivity).
  201. This parameter can be a value of @ref HRTIM_External_Event_Polarity */
  202. uint32_t EventSensitivity; /*!< Specifies the sensitivity of the external event.
  203. This parameter can be a value of @ref HRTIM_External_Event_Sensitivity */
  204. uint32_t EventFilter; /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
  205. This parameter can be a value of @ref HRTIM_External_Event_Filter */
  206. } HRTIM_SimpleCaptureChannelCfgTypeDef;
  207. /**
  208. * @brief Simple One Pulse mode configuration definition
  209. */
  210. typedef struct
  211. {
  212. uint32_t Pulse; /*!< Specifies the compare value to be loaded into the Compare Register.
  213. The compare value must be above or equal to 3 periods of the fHRTIM clock */
  214. uint32_t OutputPolarity; /*!< Specifies the output polarity.
  215. This parameter can be any value of @ref HRTIM_Output_Polarity */
  216. uint32_t OutputIdleLevel; /*!< Specifies whether the output level is active or inactive when in IDLE state.
  217. This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
  218. uint32_t Event; /*!< Specifies the external event triggering the pulse generation.
  219. This parameter can be any 'EEVx' value of @ref HRTIM_External_Event_Channels */
  220. uint32_t EventPolarity; /*!< Specifies the polarity of the external event (in case of level sensitivity).
  221. This parameter can be a value of @ref HRTIM_External_Event_Polarity */
  222. uint32_t EventSensitivity; /*!< Specifies the sensitivity of the external event.
  223. This parameter can be a value of @ref HRTIM_External_Event_Sensitivity. */
  224. uint32_t EventFilter; /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
  225. This parameter can be a value of @ref HRTIM_External_Event_Filter */
  226. } HRTIM_SimpleOnePulseChannelCfgTypeDef;
  227. /**
  228. * @brief Timer configuration definition
  229. */
  230. typedef struct
  231. {
  232. uint32_t InterruptRequests; /*!< Relevant for all HRTIM timers, including the master.
  233. Specifies which interrupts requests must enabled for the timer.
  234. This parameter can be any combination of @ref HRTIM_Master_Interrupt_Enable
  235. or @ref HRTIM_Timing_Unit_Interrupt_Enable */
  236. uint32_t DMARequests; /*!< Relevant for all HRTIM timers, including the master.
  237. Specifies which DMA requests must be enabled for the timer.
  238. This parameter can be any combination of @ref HRTIM_Master_DMA_Request_Enable
  239. or @ref HRTIM_Timing_Unit_DMA_Request_Enable */
  240. uint32_t DMASrcAddress; /*!< Relevant for all HRTIM timers, including the master.
  241. Specifies the address of the source address of the DMA transfer */
  242. uint32_t DMADstAddress; /*!< Relevant for all HRTIM timers, including the master.
  243. Specifies the address of the destination address of the DMA transfer */
  244. uint32_t DMASize; /*!< Relevant for all HRTIM timers, including the master.
  245. Specifies the size of the DMA transfer */
  246. uint32_t HalfModeEnable; /*!< Relevant for all HRTIM timers, including the master.
  247. Specifies whether or not half mode is enabled
  248. This parameter can be any value of @ref HRTIM_Half_Mode_Enable */
  249. uint32_t StartOnSync; /*!< Relevant for all HRTIM timers, including the master.
  250. Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled).
  251. This parameter can be any value of @ref HRTIM_Start_On_Sync_Input_Event */
  252. uint32_t ResetOnSync; /*!< Relevant for all HRTIM timers, including the master.
  253. Specifies whether or not timer is reset by a rising edge on the synchronization input (when enabled).
  254. This parameter can be any value of @ref HRTIM_Reset_On_Sync_Input_Event */
  255. uint32_t DACSynchro; /*!< Relevant for all HRTIM timers, including the master.
  256. Indicates whether or not the a DAC synchronization event is generated.
  257. This parameter can be any value of @ref HRTIM_DAC_Synchronization */
  258. uint32_t PreloadEnable; /*!< Relevant for all HRTIM timers, including the master.
  259. Specifies whether or not register preload is enabled.
  260. This parameter can be any value of @ref HRTIM_Register_Preload_Enable */
  261. uint32_t UpdateGating; /*!< Relevant for all HRTIM timers, including the master.
  262. Specifies how the update occurs with respect to a burst DMA transaction or
  263. update enable inputs (Slave timers only).
  264. This parameter can be any value of @ref HRTIM_Update_Gating */
  265. uint32_t BurstMode; /*!< Relevant for all HRTIM timers, including the master.
  266. Specifies how the timer behaves during a burst mode operation.
  267. This parameter can be any value of @ref HRTIM_Timer_Burst_Mode */
  268. uint32_t RepetitionUpdate; /*!< Relevant for all HRTIM timers, including the master.
  269. Specifies whether or not registers update is triggered by the repetition event.
  270. This parameter can be any value of @ref HRTIM_Timer_Repetition_Update */
  271. uint32_t PushPull; /*!< Relevant for Timer A to Timer E.
  272. Specifies whether or not the push-pull mode is enabled.
  273. This parameter can be any value of @ref HRTIM_Timer_Push_Pull_Mode */
  274. uint32_t FaultEnable; /*!< Relevant for Timer A to Timer E.
  275. Specifies which fault channels are enabled for the timer.
  276. This parameter can be a combination of @ref HRTIM_Timer_Fault_Enabling */
  277. uint32_t FaultLock; /*!< Relevant for Timer A to Timer E.
  278. Specifies whether or not fault enabling status is write protected.
  279. This parameter can be a value of @ref HRTIM_Timer_Fault_Lock */
  280. uint32_t DeadTimeInsertion; /*!< Relevant for Timer A to Timer E.
  281. Specifies whether or not dead-time insertion is enabled for the timer.
  282. This parameter can be a value of @ref HRTIM_Timer_Deadtime_Insertion */
  283. uint32_t DelayedProtectionMode; /*!< Relevant for Timer A to Timer E.
  284. Specifies the delayed protection mode.
  285. This parameter can be a value of @ref HRTIM_Timer_Delayed_Protection_Mode */
  286. uint32_t UpdateTrigger; /*!< Relevant for Timer A to Timer E.
  287. Specifies source(s) triggering the timer registers update.
  288. This parameter can be a combination of @ref HRTIM_Timer_Update_Trigger */
  289. uint32_t ResetTrigger; /*!< Relevant for Timer A to Timer E.
  290. Specifies source(s) triggering the timer counter reset.
  291. This parameter can be a combination of @ref HRTIM_Timer_Reset_Trigger */
  292. uint32_t ResetUpdate; /*!< Relevant for Timer A to Timer E.
  293. Specifies whether or not registers update is triggered when the timer counter is reset.
  294. This parameter can be a value of @ref HRTIM_Timer_Reset_Update */
  295. } HRTIM_TimerCfgTypeDef;
  296. /**
  297. * @brief Compare unit configuration definition
  298. */
  299. typedef struct
  300. {
  301. uint32_t CompareValue; /*!< Specifies the compare value of the timer compare unit.
  302. The minimum value must be greater than or equal to 3 periods of the fHRTIM clock.
  303. The maximum value must be less than or equal to 0xFFFFU - 1 periods of the fHRTIM clock */
  304. uint32_t AutoDelayedMode; /*!< Specifies the auto delayed mode for compare unit 2 or 4.
  305. This parameter can be a value of @ref HRTIM_Compare_Unit_Auto_Delayed_Mode */
  306. uint32_t AutoDelayedTimeout; /*!< Specifies compare value for timing unit 1 or 3 when auto delayed mode with time out is selected.
  307. CompareValue + AutoDelayedTimeout must be less than 0xFFFFU */
  308. } HRTIM_CompareCfgTypeDef;
  309. /**
  310. * @brief Capture unit configuration definition
  311. */
  312. typedef struct
  313. {
  314. uint32_t Trigger; /*!< Specifies source(s) triggering the capture.
  315. This parameter can be a combination of @ref HRTIM_Capture_Unit_Trigger */
  316. } HRTIM_CaptureCfgTypeDef;
  317. /**
  318. * @brief Output configuration definition
  319. */
  320. typedef struct
  321. {
  322. uint32_t Polarity; /*!< Specifies the output polarity.
  323. This parameter can be any value of @ref HRTIM_Output_Polarity */
  324. uint32_t SetSource; /*!< Specifies the event(s) transitioning the output from its inactive level to its active level.
  325. This parameter can be a combination of @ref HRTIM_Output_Set_Source */
  326. uint32_t ResetSource; /*!< Specifies the event(s) transitioning the output from its active level to its inactive level.
  327. This parameter can be a combination of @ref HRTIM_Output_Reset_Source */
  328. uint32_t IdleMode; /*!< Specifies whether or not the output is affected by a burst mode operation.
  329. This parameter can be any value of @ref HRTIM_Output_Idle_Mode */
  330. uint32_t IdleLevel; /*!< Specifies whether the output level is active or inactive when in IDLE state.
  331. This parameter can be any value of @ref HRTIM_Output_IDLE_Level */
  332. uint32_t FaultLevel; /*!< Specifies whether the output level is active or inactive when in FAULT state.
  333. This parameter can be any value of @ref HRTIM_Output_FAULT_Level */
  334. uint32_t ChopperModeEnable; /*!< Indicates whether or not the chopper mode is enabled
  335. This parameter can be any value of @ref HRTIM_Output_Chopper_Mode_Enable */
  336. uint32_t BurstModeEntryDelayed; /*!< Indicates whether or not dead-time is inserted when entering the IDLE state during a burst mode operation.
  337. This parameters can be any value of @ref HRTIM_Output_Burst_Mode_Entry_Delayed */
  338. } HRTIM_OutputCfgTypeDef;
  339. /**
  340. * @brief External event filtering in timing units configuration definition
  341. */
  342. typedef struct
  343. {
  344. uint32_t Filter; /*!< Specifies the type of event filtering within the timing unit.
  345. This parameter can be a value of @ref HRTIM_Timer_External_Event_Filter */
  346. uint32_t Latch; /*!< Specifies whether or not the signal is latched.
  347. This parameter can be a value of @ref HRTIM_Timer_External_Event_Latch */
  348. } HRTIM_TimerEventFilteringCfgTypeDef;
  349. /**
  350. * @brief Dead time feature configuration definition
  351. */
  352. typedef struct
  353. {
  354. uint32_t Prescaler; /*!< Specifies the dead-time prescaler.
  355. This parameter can be a value of @ref HRTIM_Deadtime_Prescaler_Ratio */
  356. uint32_t RisingValue; /*!< Specifies the dead-time following a rising edge.
  357. This parameter can be a number between 0x0 and 0x1FFU */
  358. uint32_t RisingSign; /*!< Specifies whether the dead-time is positive or negative on rising edge.
  359. This parameter can be a value of @ref HRTIM_Deadtime_Rising_Sign */
  360. uint32_t RisingLock; /*!< Specifies whether or not dead-time rising settings (value and sign) are write protected.
  361. This parameter can be a value of @ref HRTIM_Deadtime_Rising_Lock */
  362. uint32_t RisingSignLock; /*!< Specifies whether or not dead-time rising sign is write protected.
  363. This parameter can be a value of @ref HRTIM_Deadtime_Rising_Sign_Lock */
  364. uint32_t FallingValue; /*!< Specifies the dead-time following a falling edge.
  365. This parameter can be a number between 0x0 and 0x1FFU */
  366. uint32_t FallingSign; /*!< Specifies whether the dead-time is positive or negative on falling edge.
  367. This parameter can be a value of @ref HRTIM_Deadtime_Falling_Sign */
  368. uint32_t FallingLock; /*!< Specifies whether or not dead-time falling settings (value and sign) are write protected.
  369. This parameter can be a value of @ref HRTIM_Deadtime_Falling_Lock */
  370. uint32_t FallingSignLock; /*!< Specifies whether or not dead-time falling sign is write protected.
  371. This parameter can be a value of @ref HRTIM_Deadtime_Falling_Sign_Lock */
  372. } HRTIM_DeadTimeCfgTypeDef;
  373. /**
  374. * @brief Chopper mode configuration definition
  375. */
  376. typedef struct
  377. {
  378. uint32_t CarrierFreq; /*!< Specifies the Timer carrier frequency value.
  379. This parameter can be a value of @ref HRTIM_Chopper_Frequency */
  380. uint32_t DutyCycle; /*!< Specifies the Timer chopper duty cycle value.
  381. This parameter can be a value of @ref HRTIM_Chopper_Duty_Cycle */
  382. uint32_t StartPulse; /*!< Specifies the Timer pulse width value.
  383. This parameter can be a value of @ref HRTIM_Chopper_Start_Pulse_Width */
  384. } HRTIM_ChopperModeCfgTypeDef;
  385. /**
  386. * @brief External event channel configuration definition
  387. */
  388. typedef struct
  389. {
  390. uint32_t Source; /*!< Identifies the source of the external event.
  391. This parameter can be a value of @ref HRTIM_External_Event_Sources */
  392. uint32_t Polarity; /*!< Specifies the polarity of the external event (in case of level sensitivity).
  393. This parameter can be a value of @ref HRTIM_External_Event_Polarity */
  394. uint32_t Sensitivity; /*!< Specifies the sensitivity of the external event.
  395. This parameter can be a value of @ref HRTIM_External_Event_Sensitivity */
  396. uint32_t Filter; /*!< Defines the frequency used to sample the External Event and the length of the digital filter.
  397. This parameter can be a value of @ref HRTIM_External_Event_Filter */
  398. uint32_t FastMode; /*!< Indicates whether or not low latency mode is enabled for the external event.
  399. This parameter can be a value of @ref HRTIM_External_Event_Fast_Mode */
  400. } HRTIM_EventCfgTypeDef;
  401. /**
  402. * @brief Fault channel configuration definition
  403. */
  404. typedef struct
  405. {
  406. uint32_t Source; /*!< Identifies the source of the fault.
  407. This parameter can be a value of @ref HRTIM_Fault_Sources */
  408. uint32_t Polarity; /*!< Specifies the polarity of the fault event.
  409. This parameter can be a value of @ref HRTIM_Fault_Polarity */
  410. uint32_t Filter; /*!< Defines the frequency used to sample the Fault input and the length of the digital filter.
  411. This parameter can be a value of @ref HRTIM_Fault_Filter */
  412. uint32_t Lock; /*!< Indicates whether or not fault programming bits are write protected.
  413. This parameter can be a value of @ref HRTIM_Fault_Lock */
  414. } HRTIM_FaultCfgTypeDef;
  415. /**
  416. * @brief Burst mode configuration definition
  417. */
  418. typedef struct
  419. {
  420. uint32_t Mode; /*!< Specifies the burst mode operating mode.
  421. This parameter can be a value of @ref HRTIM_Burst_Mode_Operating_Mode */
  422. uint32_t ClockSource; /*!< Specifies the burst mode clock source.
  423. This parameter can be a value of @ref HRTIM_Burst_Mode_Clock_Source */
  424. uint32_t Prescaler; /*!< Specifies the burst mode prescaler.
  425. This parameter can be a value of @ref HRTIM_Burst_Mode_Prescaler */
  426. uint32_t PreloadEnable; /*!< Specifies whether or not preload is enabled for burst mode related registers (HRTIM_BMCMPR and HRTIM_BMPER).
  427. This parameter can be a combination of @ref HRTIM_Burst_Mode_Register_Preload_Enable */
  428. uint32_t Trigger; /*!< Specifies the event(s) triggering the burst operation.
  429. This parameter can be a combination of @ref HRTIM_Burst_Mode_Trigger */
  430. uint32_t IdleDuration; /*!< Specifies number of periods during which the selected timers are in idle state.
  431. This parameter can be a number between 0x0 and 0xFFFF */
  432. uint32_t Period; /*!< Specifies burst mode repetition period.
  433. This parameter can be a number between 0x1 and 0xFFFF */
  434. } HRTIM_BurstModeCfgTypeDef;
  435. /**
  436. * @brief ADC trigger configuration definition
  437. */
  438. typedef struct
  439. {
  440. uint32_t UpdateSource; /*!< Specifies the ADC trigger update source.
  441. This parameter can be a value of @ref HRTIM_ADC_Trigger_Update_Source */
  442. uint32_t Trigger; /*!< Specifies the event(s) triggering the ADC conversion.
  443. This parameter can be a combination of @ref HRTIM_ADC_Trigger_Event */
  444. } HRTIM_ADCTriggerCfgTypeDef;
  445. #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
  446. /**
  447. * @brief HAL HRTIM Callback ID enumeration definition
  448. */
  449. typedef enum {
  450. HAL_HRTIM_FAULT1CALLBACK_CB_ID = 0x00U, /*!< Fault 1 interrupt callback ID */
  451. HAL_HRTIM_FAULT2CALLBACK_CB_ID = 0x01U, /*!< Fault 2 interrupt callback ID */
  452. HAL_HRTIM_FAULT3CALLBACK_CB_ID = 0x02U, /*!< Fault 3 interrupt callback ID */
  453. HAL_HRTIM_FAULT4CALLBACK_CB_ID = 0x03U, /*!< Fault 4 interrupt callback ID */
  454. HAL_HRTIM_FAULT5CALLBACK_CB_ID = 0x04U, /*!< Fault 5 interrupt callback ID */
  455. HAL_HRTIM_SYSTEMFAULTCALLBACK_CB_ID = 0x05U, /*!< System fault interrupt callback ID */
  456. HAL_HRTIM_DLLCALBRATIONREADYCALLBACK_CB_ID = 0x06U, /*!< DLL Ready interrupt callback ID */
  457. HAL_HRTIM_BURSTMODEPERIODCALLBACK_CB_ID = 0x07U, /*!< Burst mode period interrupt callback ID */
  458. HAL_HRTIM_SYNCHRONIZATIONEVENTCALLBACK_CB_ID = 0x08U, /*!< Sync Input interrupt callback ID */
  459. HAL_HRTIM_ERRORCALLBACK_CB_ID = 0x09U, /*!< DMA error callback ID */
  460. HAL_HRTIM_REGISTERSUPDATECALLBACK_CB_ID = 0x10U, /*!< Timer x Update interrupt callback ID */
  461. HAL_HRTIM_REPETITIONEVENTCALLBACK_CB_ID = 0x11U, /*!< Timer x Repetition interrupt callback ID */
  462. HAL_HRTIM_COMPARE1EVENTCALLBACK_CB_ID = 0x12U, /*!< Timer x Compare 1 match interrupt callback ID */
  463. HAL_HRTIM_COMPARE2EVENTCALLBACK_CB_ID = 0x13U, /*!< Timer x Compare 2 match interrupt callback ID */
  464. HAL_HRTIM_COMPARE3EVENTCALLBACK_CB_ID = 0x14U, /*!< Timer x Compare 3 match interrupt callback ID */
  465. HAL_HRTIM_COMPARE4EVENTCALLBACK_CB_ID = 0x15U, /*!< Timer x Compare 4 match interrupt callback ID */
  466. HAL_HRTIM_CAPTURE1EVENTCALLBACK_CB_ID = 0x16U, /*!< Timer x Capture 1 interrupts callback ID */
  467. HAL_HRTIM_CAPTURE2EVENTCALLBACK_CB_ID = 0x17U, /*!< Timer x Capture 2 interrupts callback ID */
  468. HAL_HRTIM_DELAYEDPROTECTIONCALLBACK_CB_ID = 0x18U, /*!< Timer x Delayed protection interrupt callback ID */
  469. HAL_HRTIM_COUNTERRESETCALLBACK_CB_ID = 0x19U, /*!< Timer x counter reset/roll-over interrupt callback ID */
  470. HAL_HRTIM_OUTPUT1SETCALLBACK_CB_ID = 0x1AU, /*!< Timer x output 1 set interrupt callback ID */
  471. HAL_HRTIM_OUTPUT1RESETCALLBACK_CB_ID = 0x1BU, /*!< Timer x output 1 reset interrupt callback ID */
  472. HAL_HRTIM_OUTPUT2SETCALLBACK_CB_ID = 0x1CU, /*!< Timer x output 2 set interrupt callback ID */
  473. HAL_HRTIM_OUTPUT2RESETCALLBACK_CB_ID = 0x1DU, /*!< Timer x output 2 reset interrupt callback ID */
  474. HAL_HRTIM_BURSTDMATRANSFERCALLBACK_CB_ID = 0x1EU, /*!< Timer x Burst DMA completed interrupt callback ID */
  475. HAL_HRTIM_MSPINIT_CB_ID = 0x20U, /*!< HRTIM MspInit callback ID */
  476. HAL_HRTIM_MSPDEINIT_CB_ID = 0x21U, /*!< HRTIM MspInit callback ID */
  477. }HAL_HRTIM_CallbackIDTypeDef;
  478. /**
  479. * @brief HAL HRTIM Callback function pointer definitions
  480. */
  481. typedef void (* pHRTIM_CallbackTypeDef)(HRTIM_HandleTypeDef *hhrtim); /*!< HRTIM related callback function pointer */
  482. typedef void (* pHRTIM_TIMxCallbackTypeDef)(HRTIM_HandleTypeDef *hhrtim, /*!< HRTIM Timer x related callback function pointer */
  483. uint32_t TimerIdx);
  484. #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
  485. /**
  486. * @}
  487. */
  488. /* Exported constants --------------------------------------------------------*/
  489. /** @defgroup HRTIM_Exported_Constants HRTIM Exported Constants
  490. * @{
  491. */
  492. /** @defgroup HRTIM_Timer_Index HRTIM Timer Index
  493. * @{
  494. * @brief Constants defining the timer indexes
  495. */
  496. #define HRTIM_TIMERINDEX_TIMER_A 0x0U /*!< Index used to access timer A registers */
  497. #define HRTIM_TIMERINDEX_TIMER_B 0x1U /*!< Index used to access timer B registers */
  498. #define HRTIM_TIMERINDEX_TIMER_C 0x2U /*!< Index used to access timer C registers */
  499. #define HRTIM_TIMERINDEX_TIMER_D 0x3U /*!< Index used to access timer D registers */
  500. #define HRTIM_TIMERINDEX_TIMER_E 0x4U /*!< Index used to access timer E registers */
  501. #define HRTIM_TIMERINDEX_MASTER 0x5U /*!< Index used to access master registers */
  502. #define HRTIM_TIMERINDEX_COMMON 0xFFU /*!< Index used to access HRTIM common registers */
  503. /**
  504. * @}
  505. */
  506. /** @defgroup HRTIM_Timer_identifier HRTIM Timer identifier
  507. * @{
  508. * @brief Constants defining timer identifiers
  509. */
  510. #define HRTIM_TIMERID_MASTER (HRTIM_MCR_MCEN) /*!< Master identifier */
  511. #define HRTIM_TIMERID_TIMER_A (HRTIM_MCR_TACEN) /*!< Timer A identifier */
  512. #define HRTIM_TIMERID_TIMER_B (HRTIM_MCR_TBCEN) /*!< Timer B identifier */
  513. #define HRTIM_TIMERID_TIMER_C (HRTIM_MCR_TCCEN) /*!< Timer C identifier */
  514. #define HRTIM_TIMERID_TIMER_D (HRTIM_MCR_TDCEN) /*!< Timer D identifier */
  515. #define HRTIM_TIMERID_TIMER_E (HRTIM_MCR_TECEN) /*!< Timer E identifier */
  516. /**
  517. * @}
  518. */
  519. /** @defgroup HRTIM_Compare_Unit HRTIM Compare Unit
  520. * @{
  521. * @brief Constants defining compare unit identifiers
  522. */
  523. #define HRTIM_COMPAREUNIT_1 0x00000001U /*!< Compare unit 1 identifier */
  524. #define HRTIM_COMPAREUNIT_2 0x00000002U /*!< Compare unit 2 identifier */
  525. #define HRTIM_COMPAREUNIT_3 0x00000004U /*!< Compare unit 3 identifier */
  526. #define HRTIM_COMPAREUNIT_4 0x00000008U /*!< Compare unit 4 identifier */
  527. /**
  528. * @}
  529. */
  530. /** @defgroup HRTIM_Capture_Unit HRTIM Capture Unit
  531. * @{
  532. * @brief Constants defining capture unit identifiers
  533. */
  534. #define HRTIM_CAPTUREUNIT_1 0x00000001U /*!< Capture unit 1 identifier */
  535. #define HRTIM_CAPTUREUNIT_2 0x00000002U /*!< Capture unit 2 identifier */
  536. /**
  537. * @}
  538. */
  539. /** @defgroup HRTIM_Timer_Output HRTIM Timer Output
  540. * @{
  541. * @brief Constants defining timer output identifiers
  542. */
  543. #define HRTIM_OUTPUT_TA1 0x00000001U /*!< Timer A - Output 1 identifier */
  544. #define HRTIM_OUTPUT_TA2 0x00000002U /*!< Timer A - Output 2 identifier */
  545. #define HRTIM_OUTPUT_TB1 0x00000004U /*!< Timer B - Output 1 identifier */
  546. #define HRTIM_OUTPUT_TB2 0x00000008U /*!< Timer B - Output 2 identifier */
  547. #define HRTIM_OUTPUT_TC1 0x00000010U /*!< Timer C - Output 1 identifier */
  548. #define HRTIM_OUTPUT_TC2 0x00000020U /*!< Timer C - Output 2 identifier */
  549. #define HRTIM_OUTPUT_TD1 0x00000040U /*!< Timer D - Output 1 identifier */
  550. #define HRTIM_OUTPUT_TD2 0x00000080U /*!< Timer D - Output 2 identifier */
  551. #define HRTIM_OUTPUT_TE1 0x00000100U /*!< Timer E - Output 1 identifier */
  552. #define HRTIM_OUTPUT_TE2 0x00000200U /*!< Timer E - Output 2 identifier */
  553. /**
  554. * @}
  555. */
  556. /** @defgroup HRTIM_ADC_Trigger HRTIM ADC Trigger
  557. * @{
  558. * @brief Constants defining ADC triggers identifiers
  559. */
  560. #define HRTIM_ADCTRIGGER_1 0x00000001U /*!< ADC trigger 1 identifier */
  561. #define HRTIM_ADCTRIGGER_2 0x00000002U /*!< ADC trigger 2 identifier */
  562. #define HRTIM_ADCTRIGGER_3 0x00000004U /*!< ADC trigger 3 identifier */
  563. #define HRTIM_ADCTRIGGER_4 0x00000008U /*!< ADC trigger 4 identifier */
  564. #define IS_HRTIM_ADCTRIGGER(ADCTRIGGER)\
  565. (((ADCTRIGGER) == HRTIM_ADCTRIGGER_1) || \
  566. ((ADCTRIGGER) == HRTIM_ADCTRIGGER_2) || \
  567. ((ADCTRIGGER) == HRTIM_ADCTRIGGER_3) || \
  568. ((ADCTRIGGER) == HRTIM_ADCTRIGGER_4))
  569. /**
  570. * @}
  571. */
  572. /** @defgroup HRTIM_External_Event_Channels HRTIM External Event Channels
  573. * @{
  574. * @brief Constants defining external event channel identifiers
  575. */
  576. #define HRTIM_EVENT_NONE (0x00000000U) /*!< Undefined event channel */
  577. #define HRTIM_EVENT_1 (0x00000001U) /*!< External event channel 1 identifier */
  578. #define HRTIM_EVENT_2 (0x00000002U) /*!< External event channel 2 identifier */
  579. #define HRTIM_EVENT_3 (0x00000003U) /*!< External event channel 3 identifier */
  580. #define HRTIM_EVENT_4 (0x00000004U) /*!< External event channel 4 identifier */
  581. #define HRTIM_EVENT_5 (0x00000005U) /*!< External event channel 5 identifier */
  582. #define HRTIM_EVENT_6 (0x00000006U) /*!< External event channel 6 identifier */
  583. #define HRTIM_EVENT_7 (0x00000007U) /*!< External event channel 7 identifier */
  584. #define HRTIM_EVENT_8 (0x00000008U) /*!< External event channel 8 identifier */
  585. #define HRTIM_EVENT_9 (0x00000009U) /*!< External event channel 9 identifier */
  586. #define HRTIM_EVENT_10 (0x0000000AU) /*!< External event channel 10 identifier */
  587. /**
  588. * @}
  589. */
  590. /** @defgroup HRTIM_Fault_Channel HRTIM Fault Channel
  591. * @{
  592. * @brief Constants defining fault channel identifiers
  593. */
  594. #define HRTIM_FAULT_1 (0x01U) /*!< Fault channel 1 identifier */
  595. #define HRTIM_FAULT_2 (0x02U) /*!< Fault channel 2 identifier */
  596. #define HRTIM_FAULT_3 (0x04U) /*!< Fault channel 3 identifier */
  597. #define HRTIM_FAULT_4 (0x08U) /*!< Fault channel 4 identifier */
  598. #define HRTIM_FAULT_5 (0x10U) /*!< Fault channel 5 identifier */
  599. /**
  600. * @}
  601. */
  602. /** @defgroup HRTIM_Prescaler_Ratio HRTIM Prescaler Ratio
  603. * @{
  604. * @brief Constants defining timer high-resolution clock prescaler ratio.
  605. */
  606. #define HRTIM_PRESCALERRATIO_MUL32 (0x00000000U) /*!< fHRCK: fHRTIM x 32U = 4.608 GHz - Resolution: 217 ps - Min PWM frequency: 70.3 kHz (fHRTIM=144MHz) */
  607. #define HRTIM_PRESCALERRATIO_MUL16 (0x00000001U) /*!< fHRCK: fHRTIM x 16U = 2.304 GHz - Resolution: 434 ps - Min PWM frequency: 35.1 KHz (fHRTIM=144MHz) */
  608. #define HRTIM_PRESCALERRATIO_MUL8 (0x00000002U) /*!< fHRCK: fHRTIM x 8U = 1.152 GHz - Resolution: 868 ps - Min PWM frequency: 17.6 kHz (fHRTIM=144MHz) */
  609. #define HRTIM_PRESCALERRATIO_MUL4 (0x00000003U) /*!< fHRCK: fHRTIM x 4U = 576 MHz - Resolution: 1.73 ns - Min PWM frequency: 8.8 kHz (fHRTIM=144MHz) */
  610. #define HRTIM_PRESCALERRATIO_MUL2 (0x00000004U) /*!< fHRCK: fHRTIM x 2U = 288 MHz - Resolution: 3.47 ns - Min PWM frequency: 4.4 kHz (fHRTIM=144MHz) */
  611. #define HRTIM_PRESCALERRATIO_DIV1 (0x00000005U) /*!< fHRCK: fHRTIM = 144 MHz - Resolution: 6.95 ns - Min PWM frequency: 2.2 kHz (fHRTIM=144MHz) */
  612. #define HRTIM_PRESCALERRATIO_DIV2 (0x00000006U) /*!< fHRCK: fHRTIM / 2U = 72 MHz - Resolution: 13.88 ns- Min PWM frequency: 1.1 kHz (fHRTIM=144MHz) */
  613. #define HRTIM_PRESCALERRATIO_DIV4 (0x00000007U) /*!< fHRCK: fHRTIM / 4U = 36 MHz - Resolution: 27.7 ns- Min PWM frequency: 550Hz (fHRTIM=144MHz) */
  614. /**
  615. * @}
  616. */
  617. /** @defgroup HRTIM_Counter_Operating_Mode HRTIM Counter Operating Mode
  618. * @{
  619. * @brief Constants defining timer counter operating mode.
  620. */
  621. #define HRTIM_MODE_CONTINUOUS (0x00000008U) /*!< The timer operates in continuous (free-running) mode */
  622. #define HRTIM_MODE_SINGLESHOT (0x00000000U) /*!< The timer operates in non retriggerable single-shot mode */
  623. #define HRTIM_MODE_SINGLESHOT_RETRIGGERABLE (0x00000010U) /*!< The timer operates in retriggerable single-shot mode */
  624. /**
  625. * @}
  626. */
  627. /** @defgroup HRTIM_Half_Mode_Enable HRTIM Half Mode Enable
  628. * @{
  629. * @brief Constants defining half mode enabling status.
  630. */
  631. #define HRTIM_HALFMODE_DISABLED (0x00000000U) /*!< Half mode is disabled */
  632. #define HRTIM_HALFMODE_ENABLED (0x00000020U) /*!< Half mode is enabled */
  633. /**
  634. * @}
  635. */
  636. /** @defgroup HRTIM_Start_On_Sync_Input_Event HRTIM Start On Sync Input Event
  637. * @{
  638. * @brief Constants defining the timer behavior following the synchronization event
  639. */
  640. #define HRTIM_SYNCSTART_DISABLED (0x00000000U) /*!< Synchronization input event has effect on the timer */
  641. #define HRTIM_SYNCSTART_ENABLED (HRTIM_MCR_SYNCSTRTM) /*!< Synchronization input event starts the timer */
  642. /**
  643. * @}
  644. */
  645. /** @defgroup HRTIM_Reset_On_Sync_Input_Event HRTIM Reset On Sync Input Event
  646. * @{
  647. * @brief Constants defining the timer behavior following the synchronization event
  648. */
  649. #define HRTIM_SYNCRESET_DISABLED (0x00000000U) /*!< Synchronization input event has effect on the timer */
  650. #define HRTIM_SYNCRESET_ENABLED (HRTIM_MCR_SYNCRSTM) /*!< Synchronization input event resets the timer */
  651. /**
  652. * @}
  653. */
  654. /** @defgroup HRTIM_DAC_Synchronization HRTIM DAC Synchronization
  655. * @{
  656. * @brief Constants defining on which output the DAC synchronization event is sent
  657. */
  658. #define HRTIM_DACSYNC_NONE 0x00000000U /*!< No DAC synchronization event generated */
  659. #define HRTIM_DACSYNC_DACTRIGOUT_1 (HRTIM_MCR_DACSYNC_0) /*!< DAC synchronization event generated on DACTrigOut1 output upon timer update */
  660. #define HRTIM_DACSYNC_DACTRIGOUT_2 (HRTIM_MCR_DACSYNC_1) /*!< DAC synchronization event generated on DACTrigOut2 output upon timer update */
  661. #define HRTIM_DACSYNC_DACTRIGOUT_3 (HRTIM_MCR_DACSYNC_1 | HRTIM_MCR_DACSYNC_0) /*!< DAC update generated on DACTrigOut3 output upon timer update */
  662. /**
  663. * @}
  664. */
  665. /** @defgroup HRTIM_Register_Preload_Enable HRTIM Register Preload Enable
  666. * @{
  667. * @brief Constants defining whether a write access into a preloadable
  668. * register is done into the active or the preload register.
  669. */
  670. #define HRTIM_PRELOAD_DISABLED (0x00000000U) /*!< Preload disabled: the write access is directly done into the active register */
  671. #define HRTIM_PRELOAD_ENABLED (HRTIM_MCR_PREEN) /*!< Preload enabled: the write access is done into the preload register */
  672. /**
  673. * @}
  674. */
  675. /** @defgroup HRTIM_Update_Gating HRTIM Update Gating
  676. * @{
  677. * @brief Constants defining how the update occurs relatively to the burst DMA
  678. * transaction and the external update request on update enable inputs 1 to 3.
  679. */
  680. #define HRTIM_UPDATEGATING_INDEPENDENT 0x00000000U /*!< Update done independently from the DMA burst transfer completion */
  681. #define HRTIM_UPDATEGATING_DMABURST (HRTIM_TIMCR_UPDGAT_0) /*!< Update done when the DMA burst transfer is completed */
  682. #define HRTIM_UPDATEGATING_DMABURST_UPDATE (HRTIM_TIMCR_UPDGAT_1) /*!< Update done on timer roll-over following a DMA burst transfer completion*/
  683. #define HRTIM_UPDATEGATING_UPDEN1 (HRTIM_TIMCR_UPDGAT_1 | HRTIM_TIMCR_UPDGAT_0) /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 1U */
  684. #define HRTIM_UPDATEGATING_UPDEN2 (HRTIM_TIMCR_UPDGAT_2) /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 2U */
  685. #define HRTIM_UPDATEGATING_UPDEN3 (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_0) /*!< Slave timer only - Update done on a rising edge of HRTIM update enable input 3U */
  686. #define HRTIM_UPDATEGATING_UPDEN1_UPDATE (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_1) /*!< Slave timer only - Update done on the update event following a rising edge of HRTIM update enable input 1U */
  687. #define HRTIM_UPDATEGATING_UPDEN2_UPDATE (HRTIM_TIMCR_UPDGAT_2 | HRTIM_TIMCR_UPDGAT_1 | HRTIM_TIMCR_UPDGAT_0) /*!< Slave timer only - Update done on the update event following a rising edge of HRTIM update enable input 2U */
  688. #define HRTIM_UPDATEGATING_UPDEN3_UPDATE (HRTIM_TIMCR_UPDGAT_3) /*!< Slave timer only - Update done on the update event following a rising edge of HRTIM update enable input 3U */
  689. /**
  690. * @}
  691. */
  692. /** @defgroup HRTIM_Timer_Burst_Mode HRTIM Timer Burst Mode
  693. * @{
  694. * @brief Constants defining how the timer behaves during a burst
  695. mode operation.
  696. */
  697. #define HRTIM_TIMERBURSTMODE_MAINTAINCLOCK 0x00000000U /*!< Timer counter clock is maintained and the timer operates normally */
  698. #define HRTIM_TIMERBURSTMODE_RESETCOUNTER (HRTIM_BMCR_MTBM) /*!< Timer counter clock is stopped and the counter is reset */
  699. /**
  700. * @}
  701. */
  702. /** @defgroup HRTIM_Timer_Repetition_Update HRTIM Timer Repetition Update
  703. * @{
  704. * @brief Constants defining whether registers are updated when the timer
  705. * repetition period is completed (either due to roll-over or
  706. * reset events)
  707. */
  708. #define HRTIM_UPDATEONREPETITION_DISABLED 0x00000000U /*!< Update on repetition disabled */
  709. #define HRTIM_UPDATEONREPETITION_ENABLED (HRTIM_MCR_MREPU) /*!< Update on repetition enabled */
  710. /**
  711. * @}
  712. */
  713. /** @defgroup HRTIM_Timer_Push_Pull_Mode HRTIM Timer Push Pull Mode
  714. * @{
  715. * @brief Constants defining whether or not the push-pull mode is enabled for
  716. * a timer.
  717. */
  718. #define HRTIM_TIMPUSHPULLMODE_DISABLED 0x00000000U /*!< Push-Pull mode disabled */
  719. #define HRTIM_TIMPUSHPULLMODE_ENABLED (HRTIM_TIMCR_PSHPLL) /*!< Push-Pull mode enabled */
  720. /**
  721. * @}
  722. */
  723. /** @defgroup HRTIM_Timer_Fault_Enabling HRTIM Timer Fault Enabling
  724. * @{
  725. * @brief Constants defining whether a fault channel is enabled for a timer
  726. */
  727. #define HRTIM_TIMFAULTENABLE_NONE 0x00000000U /*!< No fault enabled */
  728. #define HRTIM_TIMFAULTENABLE_FAULT1 (HRTIM_FLTR_FLT1EN) /*!< Fault 1 enabled */
  729. #define HRTIM_TIMFAULTENABLE_FAULT2 (HRTIM_FLTR_FLT2EN) /*!< Fault 2 enabled */
  730. #define HRTIM_TIMFAULTENABLE_FAULT3 (HRTIM_FLTR_FLT3EN) /*!< Fault 3 enabled */
  731. #define HRTIM_TIMFAULTENABLE_FAULT4 (HRTIM_FLTR_FLT4EN) /*!< Fault 4 enabled */
  732. #define HRTIM_TIMFAULTENABLE_FAULT5 (HRTIM_FLTR_FLT5EN) /*!< Fault 5 enabled */
  733. /**
  734. * @}
  735. */
  736. /** @defgroup HRTIM_Timer_Fault_Lock HRTIM Timer Fault Lock
  737. * @{
  738. * @brief Constants defining whether or not fault enabling bits are write
  739. * protected for a timer
  740. */
  741. #define HRTIM_TIMFAULTLOCK_READWRITE (0x00000000U) /*!< Timer fault enabling bits are read/write */
  742. #define HRTIM_TIMFAULTLOCK_READONLY (HRTIM_FLTR_FLTLCK) /*!< Timer fault enabling bits are read only */
  743. /**
  744. * @}
  745. */
  746. /** @defgroup HRTIM_Timer_Deadtime_Insertion HRTIM Timer Dead-time Insertion
  747. * @{
  748. * @brief Constants defining whether or not fault the dead time insertion
  749. * feature is enabled for a timer
  750. */
  751. #define HRTIM_TIMDEADTIMEINSERTION_DISABLED (0x00000000U) /*!< Output 1 and output 2 signals are independent */
  752. #define HRTIM_TIMDEADTIMEINSERTION_ENABLED HRTIM_OUTR_DTEN /*!< Dead-time is inserted between output 1 and output 2U */
  753. /**
  754. * @}
  755. */
  756. /** @defgroup HRTIM_Timer_Delayed_Protection_Mode HRTIM Timer Delayed Protection Mode
  757. * @{
  758. * @brief Constants defining all possible delayed protection modes
  759. * for a timer. Also define the source and outputs on which the delayed
  760. * protection schemes are applied
  761. */
  762. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED (0x00000000U) /*!< No action */
  763. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6 (HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Output 1 delayed Idle on external Event 6U */
  764. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_EEV6 (HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Output 2 delayed Idle on external Event 6U */
  765. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV6 (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Output 1 and output 2 delayed Idle on external Event 6U */
  766. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV6 (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Balanced Idle on external Event 6U */
  767. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_DEEV7 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Output 1 delayed Idle on external Event 7U */
  768. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_DEEV7 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Output 2 delayed Idle on external Event 7U */
  769. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV7 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Output 1 and output2 delayed Idle on external Event 7U */
  770. #define HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV7 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers A, B, C: Balanced Idle on external Event 7U */
  771. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DISABLED (0x00000000U) /*!< No action */
  772. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT1_EEV8 (HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Output 1 delayed Idle on external Event 6U */
  773. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT2_EEV8 (HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Output 2 delayed Idle on external Event 6U */
  774. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDBOTH_EEV8 (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Output 1 and output 2 delayed Idle on external Event 6U */
  775. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_BALANCED_EEV8 (HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Balanced Idle on external Event 6U */
  776. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT1_DEEV9 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Output 1 delayed Idle on external Event 7U */
  777. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDOUT2_DEEV9 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Output 2 delayed Idle on external Event 7U */
  778. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_DELAYEDBOTH_EEV9 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Output 1 and output2 delayed Idle on external Event 7U */
  779. #define HRTIM_TIMER_D_E_DELAYEDPROTECTION_BALANCED_EEV9 (HRTIM_OUTR_DLYPRT_2 | HRTIM_OUTR_DLYPRT_1 | HRTIM_OUTR_DLYPRT_0 | HRTIM_OUTR_DLYPRTEN) /*!< Timers D, E: Balanced Idle on external Event 7U */
  780. /**
  781. * @}
  782. */
  783. /** @defgroup HRTIM_Timer_Update_Trigger HRTIM Timer Update Trigger
  784. * @{
  785. * @brief Constants defining whether the registers update is done synchronously
  786. * with any other timer or master update
  787. */
  788. #define HRTIM_TIMUPDATETRIGGER_NONE 0x00000000U /*!< Register update is disabled */
  789. #define HRTIM_TIMUPDATETRIGGER_MASTER (HRTIM_TIMCR_MSTU) /*!< Register update is triggered by the master timer update */
  790. #define HRTIM_TIMUPDATETRIGGER_TIMER_A (HRTIM_TIMCR_TAU) /*!< Register update is triggered by the timer A update */
  791. #define HRTIM_TIMUPDATETRIGGER_TIMER_B (HRTIM_TIMCR_TBU) /*!< Register update is triggered by the timer B update */
  792. #define HRTIM_TIMUPDATETRIGGER_TIMER_C (HRTIM_TIMCR_TCU) /*!< Register update is triggered by the timer C update*/
  793. #define HRTIM_TIMUPDATETRIGGER_TIMER_D (HRTIM_TIMCR_TDU) /*!< Register update is triggered by the timer D update */
  794. #define HRTIM_TIMUPDATETRIGGER_TIMER_E (HRTIM_TIMCR_TEU) /*!< Register update is triggered by the timer E update */
  795. /**
  796. * @}
  797. */
  798. /** @defgroup HRTIM_Timer_Reset_Trigger HRTIM Timer Reset Trigger
  799. * @{
  800. * @brief Constants defining the events that can be selected to trigger the reset
  801. * of the timer counter
  802. */
  803. #define HRTIM_TIMRESETTRIGGER_NONE 0x00000000U /*!< No counter reset trigger */
  804. #define HRTIM_TIMRESETTRIGGER_UPDATE (HRTIM_RSTR_UPDATE) /*!< The timer counter is reset upon update event */
  805. #define HRTIM_TIMRESETTRIGGER_CMP2 (HRTIM_RSTR_CMP2) /*!< The timer counter is reset upon Timer Compare 2 event */
  806. #define HRTIM_TIMRESETTRIGGER_CMP4 (HRTIM_RSTR_CMP4) /*!< The timer counter is reset upon Timer Compare 4 event */
  807. #define HRTIM_TIMRESETTRIGGER_MASTER_PER (HRTIM_RSTR_MSTPER) /*!< The timer counter is reset upon master timer period event */
  808. #define HRTIM_TIMRESETTRIGGER_MASTER_CMP1 (HRTIM_RSTR_MSTCMP1) /*!< The timer counter is reset upon master timer Compare 1 event */
  809. #define HRTIM_TIMRESETTRIGGER_MASTER_CMP2 (HRTIM_RSTR_MSTCMP2) /*!< The timer counter is reset upon master timer Compare 2 event */
  810. #define HRTIM_TIMRESETTRIGGER_MASTER_CMP3 (HRTIM_RSTR_MSTCMP3) /*!< The timer counter is reset upon master timer Compare 3 event */
  811. #define HRTIM_TIMRESETTRIGGER_MASTER_CMP4 (HRTIM_RSTR_MSTCMP4) /*!< The timer counter is reset upon master timer Compare 4 event */
  812. #define HRTIM_TIMRESETTRIGGER_EEV_1 (HRTIM_RSTR_EXTEVNT1) /*!< The timer counter is reset upon external event 1U */
  813. #define HRTIM_TIMRESETTRIGGER_EEV_2 (HRTIM_RSTR_EXTEVNT2) /*!< The timer counter is reset upon external event 2U */
  814. #define HRTIM_TIMRESETTRIGGER_EEV_3 (HRTIM_RSTR_EXTEVNT3) /*!< The timer counter is reset upon external event 3U */
  815. #define HRTIM_TIMRESETTRIGGER_EEV_4 (HRTIM_RSTR_EXTEVNT4) /*!< The timer counter is reset upon external event 4U */
  816. #define HRTIM_TIMRESETTRIGGER_EEV_5 (HRTIM_RSTR_EXTEVNT5) /*!< The timer counter is reset upon external event 5U */
  817. #define HRTIM_TIMRESETTRIGGER_EEV_6 (HRTIM_RSTR_EXTEVNT6) /*!< The timer counter is reset upon external event 6U */
  818. #define HRTIM_TIMRESETTRIGGER_EEV_7 (HRTIM_RSTR_EXTEVNT7) /*!< The timer counter is reset upon external event 7U */
  819. #define HRTIM_TIMRESETTRIGGER_EEV_8 (HRTIM_RSTR_EXTEVNT8) /*!< The timer counter is reset upon external event 8U */
  820. #define HRTIM_TIMRESETTRIGGER_EEV_9 (HRTIM_RSTR_EXTEVNT9) /*!< The timer counter is reset upon external event 9U */
  821. #define HRTIM_TIMRESETTRIGGER_EEV_10 (HRTIM_RSTR_EXTEVNT10) /*!< The timer counter is reset upon external event 10U */
  822. #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP1 (HRTIM_RSTR_TIMBCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
  823. #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP2 (HRTIM_RSTR_TIMBCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
  824. #define HRTIM_TIMRESETTRIGGER_OTHER1_CMP4 (HRTIM_RSTR_TIMBCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
  825. #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP1 (HRTIM_RSTR_TIMCCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
  826. #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP2 (HRTIM_RSTR_TIMCCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
  827. #define HRTIM_TIMRESETTRIGGER_OTHER2_CMP4 (HRTIM_RSTR_TIMCCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
  828. #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP1 (HRTIM_RSTR_TIMDCMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
  829. #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP2 (HRTIM_RSTR_TIMDCMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
  830. #define HRTIM_TIMRESETTRIGGER_OTHER3_CMP4 (HRTIM_RSTR_TIMDCMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
  831. #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP1 (HRTIM_RSTR_TIMECMP1) /*!< The timer counter is reset upon other timer Compare 1 event */
  832. #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP2 (HRTIM_RSTR_TIMECMP2) /*!< The timer counter is reset upon other timer Compare 2 event */
  833. #define HRTIM_TIMRESETTRIGGER_OTHER4_CMP4 (HRTIM_RSTR_TIMECMP4) /*!< The timer counter is reset upon other timer Compare 4 event */
  834. /**
  835. * @}
  836. */
  837. /** @defgroup HRTIM_Timer_Reset_Update HRTIM Timer Reset Update
  838. * @{
  839. * @brief Constants defining whether the register are updated upon Timerx
  840. * counter reset or roll-over to 0 after reaching the period value
  841. * in continuous mode
  842. */
  843. #define HRTIM_TIMUPDATEONRESET_DISABLED 0x00000000U /*!< Update by timer x reset / roll-over disabled */
  844. #define HRTIM_TIMUPDATEONRESET_ENABLED (HRTIM_TIMCR_TRSTU) /*!< Update by timer x reset / roll-over enabled */
  845. /**
  846. * @}
  847. */
  848. /** @defgroup HRTIM_Compare_Unit_Auto_Delayed_Mode HRTIM Compare Unit Auto Delayed Mode
  849. * @{
  850. * @brief Constants defining whether the compare register is behaving in
  851. * regular mode (compare match issued as soon as counter equal compare),
  852. * or in auto-delayed mode
  853. */
  854. #define HRTIM_AUTODELAYEDMODE_REGULAR (0x00000000U) /*!< standard compare mode */
  855. #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT (HRTIM_TIMCR_DELCMP2_0) /*!< Compare event generated only if a capture has occurred */
  856. #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1 (HRTIM_TIMCR_DELCMP2_1) /*!< Compare event generated if a capture has occurred or after a Compare 1 match (timeout if capture event is missing) */
  857. #define HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3 (HRTIM_TIMCR_DELCMP2_1 | HRTIM_TIMCR_DELCMP2_0) /*!< Compare event generated if a capture has occurred or after a Compare 3 match (timeout if capture event is missing) */
  858. /**
  859. * @}
  860. */
  861. /** @defgroup HRTIM_Simple_OC_Mode HRTIM Simple OC Mode
  862. * @{
  863. * @brief Constants defining the behavior of the output signal when the timer
  864. operates in basic output compare mode
  865. */
  866. #define HRTIM_BASICOCMODE_TOGGLE (0x00000001U) /*!< Output toggles when the timer counter reaches the compare value */
  867. #define HRTIM_BASICOCMODE_INACTIVE (0x00000002U) /*!< Output forced to active level when the timer counter reaches the compare value */
  868. #define HRTIM_BASICOCMODE_ACTIVE (0x00000003U) /*!< Output forced to inactive level when the timer counter reaches the compare value */
  869. #define IS_HRTIM_BASICOCMODE(BASICOCMODE)\
  870. (((BASICOCMODE) == HRTIM_BASICOCMODE_TOGGLE) || \
  871. ((BASICOCMODE) == HRTIM_BASICOCMODE_INACTIVE) || \
  872. ((BASICOCMODE) == HRTIM_BASICOCMODE_ACTIVE))
  873. /**
  874. * @}
  875. */
  876. /** @defgroup HRTIM_Output_Polarity HRTIM Output Polarity
  877. * @{
  878. * @brief Constants defining the polarity of a timer output
  879. */
  880. #define HRTIM_OUTPUTPOLARITY_HIGH (0x00000000U) /*!< Output is active HIGH */
  881. #define HRTIM_OUTPUTPOLARITY_LOW (HRTIM_OUTR_POL1) /*!< Output is active LOW */
  882. /**
  883. * @}
  884. */
  885. /** @defgroup HRTIM_Output_Set_Source HRTIM Output Set Source
  886. * @{
  887. * @brief Constants defining the events that can be selected to configure the
  888. * set crossbar of a timer output
  889. */
  890. #define HRTIM_OUTPUTSET_NONE 0x00000000U /*!< Reset the output set crossbar */
  891. #define HRTIM_OUTPUTSET_RESYNC (HRTIM_SET1R_RESYNC) /*!< Timer reset event coming solely from software or SYNC input forces the output to its active state */
  892. #define HRTIM_OUTPUTSET_TIMPER (HRTIM_SET1R_PER) /*!< Timer period event forces the output to its active state */
  893. #define HRTIM_OUTPUTSET_TIMCMP1 (HRTIM_SET1R_CMP1) /*!< Timer compare 1 event forces the output to its active state */
  894. #define HRTIM_OUTPUTSET_TIMCMP2 (HRTIM_SET1R_CMP2) /*!< Timer compare 2 event forces the output to its active state */
  895. #define HRTIM_OUTPUTSET_TIMCMP3 (HRTIM_SET1R_CMP3) /*!< Timer compare 3 event forces the output to its active state */
  896. #define HRTIM_OUTPUTSET_TIMCMP4 (HRTIM_SET1R_CMP4) /*!< Timer compare 4 event forces the output to its active state */
  897. #define HRTIM_OUTPUTSET_MASTERPER (HRTIM_SET1R_MSTPER) /*!< The master timer period event forces the output to its active state */
  898. #define HRTIM_OUTPUTSET_MASTERCMP1 (HRTIM_SET1R_MSTCMP1) /*!< Master Timer compare 1 event forces the output to its active state */
  899. #define HRTIM_OUTPUTSET_MASTERCMP2 (HRTIM_SET1R_MSTCMP2) /*!< Master Timer compare 2 event forces the output to its active state */
  900. #define HRTIM_OUTPUTSET_MASTERCMP3 (HRTIM_SET1R_MSTCMP3) /*!< Master Timer compare 3 event forces the output to its active state */
  901. #define HRTIM_OUTPUTSET_MASTERCMP4 (HRTIM_SET1R_MSTCMP4) /*!< Master Timer compare 4 event forces the output to its active state */
  902. #define HRTIM_OUTPUTSET_TIMEV_1 (HRTIM_SET1R_TIMEVNT1) /*!< Timer event 1 forces the output to its active state */
  903. #define HRTIM_OUTPUTSET_TIMEV_2 (HRTIM_SET1R_TIMEVNT2) /*!< Timer event 2 forces the output to its active state */
  904. #define HRTIM_OUTPUTSET_TIMEV_3 (HRTIM_SET1R_TIMEVNT3) /*!< Timer event 3 forces the output to its active state */
  905. #define HRTIM_OUTPUTSET_TIMEV_4 (HRTIM_SET1R_TIMEVNT4) /*!< Timer event 4 forces the output to its active state */
  906. #define HRTIM_OUTPUTSET_TIMEV_5 (HRTIM_SET1R_TIMEVNT5) /*!< Timer event 5 forces the output to its active state */
  907. #define HRTIM_OUTPUTSET_TIMEV_6 (HRTIM_SET1R_TIMEVNT6) /*!< Timer event 6 forces the output to its active state */
  908. #define HRTIM_OUTPUTSET_TIMEV_7 (HRTIM_SET1R_TIMEVNT7) /*!< Timer event 7 forces the output to its active state */
  909. #define HRTIM_OUTPUTSET_TIMEV_8 (HRTIM_SET1R_TIMEVNT8) /*!< Timer event 8 forces the output to its active state */
  910. #define HRTIM_OUTPUTSET_TIMEV_9 (HRTIM_SET1R_TIMEVNT9) /*!< Timer event 9 forces the output to its active state */
  911. #define HRTIM_OUTPUTSET_EEV_1 (HRTIM_SET1R_EXTVNT1) /*!< External event 1 forces the output to its active state */
  912. #define HRTIM_OUTPUTSET_EEV_2 (HRTIM_SET1R_EXTVNT2) /*!< External event 2 forces the output to its active state */
  913. #define HRTIM_OUTPUTSET_EEV_3 (HRTIM_SET1R_EXTVNT3) /*!< External event 3 forces the output to its active state */
  914. #define HRTIM_OUTPUTSET_EEV_4 (HRTIM_SET1R_EXTVNT4) /*!< External event 4 forces the output to its active state */
  915. #define HRTIM_OUTPUTSET_EEV_5 (HRTIM_SET1R_EXTVNT5) /*!< External event 5 forces the output to its active state */
  916. #define HRTIM_OUTPUTSET_EEV_6 (HRTIM_SET1R_EXTVNT6) /*!< External event 6 forces the output to its active state */
  917. #define HRTIM_OUTPUTSET_EEV_7 (HRTIM_SET1R_EXTVNT7) /*!< External event 7 forces the output to its active state */
  918. #define HRTIM_OUTPUTSET_EEV_8 (HRTIM_SET1R_EXTVNT8) /*!< External event 8 forces the output to its active state */
  919. #define HRTIM_OUTPUTSET_EEV_9 (HRTIM_SET1R_EXTVNT9) /*!< External event 9 forces the output to its active state */
  920. #define HRTIM_OUTPUTSET_EEV_10 (HRTIM_SET1R_EXTVNT10) /*!< External event 10 forces the output to its active state */
  921. #define HRTIM_OUTPUTSET_UPDATE (HRTIM_SET1R_UPDATE) /*!< Timer register update event forces the output to its active state */
  922. /**
  923. * @}
  924. */
  925. /** @defgroup HRTIM_Output_Reset_Source HRTIM Output Reset Source
  926. * @{
  927. * @brief Constants defining the events that can be selected to configure the
  928. * reset crossbar of a timer output
  929. */
  930. #define HRTIM_OUTPUTRESET_NONE 0x00000000U /*!< Reset the output reset crossbar */
  931. #define HRTIM_OUTPUTRESET_RESYNC (HRTIM_RST1R_RESYNC) /*!< Timer reset event coming solely from software or SYNC input forces the output to its inactive state */
  932. #define HRTIM_OUTPUTRESET_TIMPER (HRTIM_RST1R_PER) /*!< Timer period event forces the output to its inactive state */
  933. #define HRTIM_OUTPUTRESET_TIMCMP1 (HRTIM_RST1R_CMP1) /*!< Timer compare 1 event forces the output to its inactive state */
  934. #define HRTIM_OUTPUTRESET_TIMCMP2 (HRTIM_RST1R_CMP2) /*!< Timer compare 2 event forces the output to its inactive state */
  935. #define HRTIM_OUTPUTRESET_TIMCMP3 (HRTIM_RST1R_CMP3) /*!< Timer compare 3 event forces the output to its inactive state */
  936. #define HRTIM_OUTPUTRESET_TIMCMP4 (HRTIM_RST1R_CMP4) /*!< Timer compare 4 event forces the output to its inactive state */
  937. #define HRTIM_OUTPUTRESET_MASTERPER (HRTIM_RST1R_MSTPER) /*!< The master timer period event forces the output to its inactive state */
  938. #define HRTIM_OUTPUTRESET_MASTERCMP1 (HRTIM_RST1R_MSTCMP1) /*!< Master Timer compare 1 event forces the output to its inactive state */
  939. #define HRTIM_OUTPUTRESET_MASTERCMP2 (HRTIM_RST1R_MSTCMP2) /*!< Master Timer compare 2 event forces the output to its inactive state */
  940. #define HRTIM_OUTPUTRESET_MASTERCMP3 (HRTIM_RST1R_MSTCMP3) /*!< Master Timer compare 3 event forces the output to its inactive state */
  941. #define HRTIM_OUTPUTRESET_MASTERCMP4 (HRTIM_RST1R_MSTCMP4) /*!< Master Timer compare 4 event forces the output to its inactive state */
  942. #define HRTIM_OUTPUTRESET_TIMEV_1 (HRTIM_RST1R_TIMEVNT1) /*!< Timer event 1 forces the output to its active state */
  943. #define HRTIM_OUTPUTRESET_TIMEV_2 (HRTIM_RST1R_TIMEVNT2) /*!< Timer event 2 forces the output to its active state */
  944. #define HRTIM_OUTPUTRESET_TIMEV_3 (HRTIM_RST1R_TIMEVNT3) /*!< Timer event 3 forces the output to its active state */
  945. #define HRTIM_OUTPUTRESET_TIMEV_4 (HRTIM_RST1R_TIMEVNT4) /*!< Timer event 4 forces the output to its active state */
  946. #define HRTIM_OUTPUTRESET_TIMEV_5 (HRTIM_RST1R_TIMEVNT5) /*!< Timer event 5 forces the output to its active state */
  947. #define HRTIM_OUTPUTRESET_TIMEV_6 (HRTIM_RST1R_TIMEVNT6) /*!< Timer event 6 forces the output to its active state */
  948. #define HRTIM_OUTPUTRESET_TIMEV_7 (HRTIM_RST1R_TIMEVNT7) /*!< Timer event 7 forces the output to its active state */
  949. #define HRTIM_OUTPUTRESET_TIMEV_8 (HRTIM_RST1R_TIMEVNT8) /*!< Timer event 8 forces the output to its active state */
  950. #define HRTIM_OUTPUTRESET_TIMEV_9 (HRTIM_RST1R_TIMEVNT9) /*!< Timer event 9 forces the output to its active state */
  951. #define HRTIM_OUTPUTRESET_EEV_1 (HRTIM_RST1R_EXTVNT1) /*!< External event 1 forces the output to its inactive state */
  952. #define HRTIM_OUTPUTRESET_EEV_2 (HRTIM_RST1R_EXTVNT2) /*!< External event 2 forces the output to its inactive state */
  953. #define HRTIM_OUTPUTRESET_EEV_3 (HRTIM_RST1R_EXTVNT3) /*!< External event 3 forces the output to its inactive state */
  954. #define HRTIM_OUTPUTRESET_EEV_4 (HRTIM_RST1R_EXTVNT4) /*!< External event 4 forces the output to its inactive state */
  955. #define HRTIM_OUTPUTRESET_EEV_5 (HRTIM_RST1R_EXTVNT5) /*!< External event 5 forces the output to its inactive state */
  956. #define HRTIM_OUTPUTRESET_EEV_6 (HRTIM_RST1R_EXTVNT6) /*!< External event 6 forces the output to its inactive state */
  957. #define HRTIM_OUTPUTRESET_EEV_7 (HRTIM_RST1R_EXTVNT7) /*!< External event 7 forces the output to its inactive state */
  958. #define HRTIM_OUTPUTRESET_EEV_8 (HRTIM_RST1R_EXTVNT8) /*!< External event 8 forces the output to its inactive state */
  959. #define HRTIM_OUTPUTRESET_EEV_9 (HRTIM_RST1R_EXTVNT9) /*!< External event 9 forces the output to its inactive state */
  960. #define HRTIM_OUTPUTRESET_EEV_10 (HRTIM_RST1R_EXTVNT10) /*!< External event 10 forces the output to its inactive state */
  961. #define HRTIM_OUTPUTRESET_UPDATE (HRTIM_RST1R_UPDATE) /*!< Timer register update event forces the output to its inactive state */
  962. /**
  963. * @}
  964. */
  965. /** @defgroup HRTIM_Output_Idle_Mode HRTIM Output Idle Mode
  966. * @{
  967. * @brief Constants defining whether or not the timer output transition to its
  968. IDLE state when burst mode is entered
  969. */
  970. #define HRTIM_OUTPUTIDLEMODE_NONE 0x00000000U /*!< The output is not affected by the burst mode operation */
  971. #define HRTIM_OUTPUTIDLEMODE_IDLE (HRTIM_OUTR_IDLM1) /*!< The output is in idle state when requested by the burst mode controller */
  972. /**
  973. * @}
  974. */
  975. /** @defgroup HRTIM_Output_IDLE_Level HRTIM Output IDLE Level
  976. * @{
  977. * @brief Constants defining the output level when output is in IDLE state
  978. */
  979. #define HRTIM_OUTPUTIDLELEVEL_INACTIVE 0x00000000U /*!< Output at inactive level when in IDLE state */
  980. #define HRTIM_OUTPUTIDLELEVEL_ACTIVE (HRTIM_OUTR_IDLES1) /*!< Output at active level when in IDLE state */
  981. /**
  982. * @}
  983. */
  984. /** @defgroup HRTIM_Output_FAULT_Level HRTIM Output FAULT Level
  985. * @{
  986. * @brief Constants defining the output level when output is in FAULT state
  987. */
  988. #define HRTIM_OUTPUTFAULTLEVEL_NONE 0x00000000U /*!< The output is not affected by the fault input */
  989. #define HRTIM_OUTPUTFAULTLEVEL_ACTIVE (HRTIM_OUTR_FAULT1_0) /*!< Output at active level when in FAULT state */
  990. #define HRTIM_OUTPUTFAULTLEVEL_INACTIVE (HRTIM_OUTR_FAULT1_1) /*!< Output at inactive level when in FAULT state */
  991. #define HRTIM_OUTPUTFAULTLEVEL_HIGHZ (HRTIM_OUTR_FAULT1_1 | HRTIM_OUTR_FAULT1_0) /*!< Output is tri-stated when in FAULT state */
  992. /**
  993. * @}
  994. */
  995. /** @defgroup HRTIM_Output_Chopper_Mode_Enable HRTIM Output Chopper Mode Enable
  996. * @{
  997. * @brief Constants defining whether or not chopper mode is enabled for a timer
  998. output
  999. */
  1000. #define HRTIM_OUTPUTCHOPPERMODE_DISABLED 0x00000000U /*!< Output signal is not altered */
  1001. #define HRTIM_OUTPUTCHOPPERMODE_ENABLED (HRTIM_OUTR_CHP1) /*!< Output signal is chopped by a carrier signal */
  1002. /**
  1003. * @}
  1004. */
  1005. /** @defgroup HRTIM_Output_Burst_Mode_Entry_Delayed HRTIM Output Burst Mode Entry Delayed
  1006. * @{
  1007. * @brief Constants defining the idle mode entry is delayed by forcing a
  1008. dead-time insertion before switching the outputs to their idle state
  1009. */
  1010. #define HRTIM_OUTPUTBURSTMODEENTRY_REGULAR 0x00000000U /*!< The programmed Idle state is applied immediately to the Output */
  1011. #define HRTIM_OUTPUTBURSTMODEENTRY_DELAYED (HRTIM_OUTR_DIDL1) /*!< Dead-time is inserted on output before entering the idle mode */
  1012. /**
  1013. * @}
  1014. */
  1015. /** @defgroup HRTIM_Capture_Unit_Trigger HRTIM Capture Unit Trigger
  1016. * @{
  1017. * @brief Constants defining the events that can be selected to trigger the
  1018. * capture of the timing unit counter
  1019. */
  1020. #define HRTIM_CAPTURETRIGGER_NONE 0x00000000U /*!< Capture trigger is disabled */
  1021. #define HRTIM_CAPTURETRIGGER_UPDATE (HRTIM_CPT1CR_UPDCPT) /*!< The update event triggers the Capture */
  1022. #define HRTIM_CAPTURETRIGGER_EEV_1 (HRTIM_CPT1CR_EXEV1CPT) /*!< The External event 1 triggers the Capture */
  1023. #define HRTIM_CAPTURETRIGGER_EEV_2 (HRTIM_CPT1CR_EXEV2CPT) /*!< The External event 2 triggers the Capture */
  1024. #define HRTIM_CAPTURETRIGGER_EEV_3 (HRTIM_CPT1CR_EXEV3CPT) /*!< The External event 3 triggers the Capture */
  1025. #define HRTIM_CAPTURETRIGGER_EEV_4 (HRTIM_CPT1CR_EXEV4CPT) /*!< The External event 4 triggers the Capture */
  1026. #define HRTIM_CAPTURETRIGGER_EEV_5 (HRTIM_CPT1CR_EXEV5CPT) /*!< The External event 5 triggers the Capture */
  1027. #define HRTIM_CAPTURETRIGGER_EEV_6 (HRTIM_CPT1CR_EXEV6CPT) /*!< The External event 6 triggers the Capture */
  1028. #define HRTIM_CAPTURETRIGGER_EEV_7 (HRTIM_CPT1CR_EXEV7CPT) /*!< The External event 7 triggers the Capture */
  1029. #define HRTIM_CAPTURETRIGGER_EEV_8 (HRTIM_CPT1CR_EXEV8CPT) /*!< The External event 8 triggers the Capture */
  1030. #define HRTIM_CAPTURETRIGGER_EEV_9 (HRTIM_CPT1CR_EXEV9CPT) /*!< The External event 9 triggers the Capture */
  1031. #define HRTIM_CAPTURETRIGGER_EEV_10 (HRTIM_CPT1CR_EXEV10CPT) /*!< The External event 10 triggers the Capture */
  1032. #define HRTIM_CAPTURETRIGGER_TA1_SET (HRTIM_CPT1CR_TA1SET) /*!< Capture is triggered by TA1 output inactive to active transition */
  1033. #define HRTIM_CAPTURETRIGGER_TA1_RESET (HRTIM_CPT1CR_TA1RST) /*!< Capture is triggered by TA1 output active to inactive transition */
  1034. #define HRTIM_CAPTURETRIGGER_TIMERA_CMP1 (HRTIM_CPT1CR_TIMACMP1) /*!< Timer A Compare 1 triggers Capture */
  1035. #define HRTIM_CAPTURETRIGGER_TIMERA_CMP2 (HRTIM_CPT1CR_TIMACMP2) /*!< Timer A Compare 2 triggers Capture */
  1036. #define HRTIM_CAPTURETRIGGER_TB1_SET (HRTIM_CPT1CR_TB1SET) /*!< Capture is triggered by TB1 output inactive to active transition */
  1037. #define HRTIM_CAPTURETRIGGER_TB1_RESET (HRTIM_CPT1CR_TB1RST) /*!< Capture is triggered by TB1 output active to inactive transition */
  1038. #define HRTIM_CAPTURETRIGGER_TIMERB_CMP1 (HRTIM_CPT1CR_TIMBCMP1) /*!< Timer B Compare 1 triggers Capture */
  1039. #define HRTIM_CAPTURETRIGGER_TIMERB_CMP2 (HRTIM_CPT1CR_TIMBCMP2) /*!< Timer B Compare 2 triggers Capture */
  1040. #define HRTIM_CAPTURETRIGGER_TC1_SET (HRTIM_CPT1CR_TC1SET) /*!< Capture is triggered by TC1 output inactive to active transition */
  1041. #define HRTIM_CAPTURETRIGGER_TC1_RESET (HRTIM_CPT1CR_TC1RST) /*!< Capture is triggered by TC1 output active to inactive transition */
  1042. #define HRTIM_CAPTURETRIGGER_TIMERC_CMP1 (HRTIM_CPT1CR_TIMCCMP1) /*!< Timer C Compare 1 triggers Capture */
  1043. #define HRTIM_CAPTURETRIGGER_TIMERC_CMP2 (HRTIM_CPT1CR_TIMCCMP2) /*!< Timer C Compare 2 triggers Capture */
  1044. #define HRTIM_CAPTURETRIGGER_TD1_SET (HRTIM_CPT1CR_TD1SET) /*!< Capture is triggered by TD1 output inactive to active transition */
  1045. #define HRTIM_CAPTURETRIGGER_TD1_RESET (HRTIM_CPT1CR_TD1RST) /*!< Capture is triggered by TD1 output active to inactive transition */
  1046. #define HRTIM_CAPTURETRIGGER_TIMERD_CMP1 (HRTIM_CPT1CR_TIMDCMP1) /*!< Timer D Compare 1 triggers Capture */
  1047. #define HRTIM_CAPTURETRIGGER_TIMERD_CMP2 (HRTIM_CPT1CR_TIMDCMP2) /*!< Timer D Compare 2 triggers Capture */
  1048. #define HRTIM_CAPTURETRIGGER_TE1_SET (HRTIM_CPT1CR_TE1SET) /*!< Capture is triggered by TE1 output inactive to active transition */
  1049. #define HRTIM_CAPTURETRIGGER_TE1_RESET (HRTIM_CPT1CR_TE1RST) /*!< Capture is triggered by TE1 output active to inactive transition */
  1050. #define HRTIM_CAPTURETRIGGER_TIMERE_CMP1 (HRTIM_CPT1CR_TIMECMP1) /*!< Timer E Compare 1 triggers Capture */
  1051. #define HRTIM_CAPTURETRIGGER_TIMERE_CMP2 (HRTIM_CPT1CR_TIMECMP2) /*!< Timer E Compare 2 triggers Capture */
  1052. /**
  1053. * @}
  1054. */
  1055. /** @defgroup HRTIM_Timer_External_Event_Filter HRTIM Timer External Event Filter
  1056. * @{
  1057. * @brief Constants defining the event filtering applied to external events
  1058. * by a timer
  1059. */
  1060. #define HRTIM_TIMEVENTFILTER_NONE (0x00000000U)
  1061. #define HRTIM_TIMEVENTFILTER_BLANKINGCMP1 (HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from counter reset/roll-over to Compare 1U */
  1062. #define HRTIM_TIMEVENTFILTER_BLANKINGCMP2 (HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from counter reset/roll-over to Compare 2U */
  1063. #define HRTIM_TIMEVENTFILTER_BLANKINGCMP3 (HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from counter reset/roll-over to Compare 3U */
  1064. #define HRTIM_TIMEVENTFILTER_BLANKINGCMP4 (HRTIM_EEFR1_EE1FLTR_2) /*!< Blanking from counter reset/roll-over to Compare 4U */
  1065. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR1 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR1 source */
  1066. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR2 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from another timing unit: TIMFLTR2 source */
  1067. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR3 (HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR3 source */
  1068. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR4 (HRTIM_EEFR1_EE1FLTR_3) /*!< Blanking from another timing unit: TIMFLTR4 source */
  1069. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR5 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR5 source */
  1070. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR6 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1) /*!< Blanking from another timing unit: TIMFLTR6 source */
  1071. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR7 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Blanking from another timing unit: TIMFLTR7 source */
  1072. #define HRTIM_TIMEVENTFILTER_BLANKINGFLTR8 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2) /*!< Blanking from another timing unit: TIMFLTR8 source */
  1073. #define HRTIM_TIMEVENTFILTER_WINDOWINGCMP2 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_0) /*!< Windowing from counter reset/roll-over to Compare 2U */
  1074. #define HRTIM_TIMEVENTFILTER_WINDOWINGCMP3 (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1) /*!< Windowing from counter reset/roll-over to Compare 3U */
  1075. #define HRTIM_TIMEVENTFILTER_WINDOWINGTIM (HRTIM_EEFR1_EE1FLTR_3 | HRTIM_EEFR1_EE1FLTR_2 | HRTIM_EEFR1_EE1FLTR_1 | HRTIM_EEFR1_EE1FLTR_0) /*!< Windowing from another timing unit: TIMWIN source */
  1076. /**
  1077. * @}
  1078. */
  1079. /** @defgroup HRTIM_Timer_External_Event_Latch HRTIM Timer External Event Latch
  1080. * @{
  1081. * @brief Constants defining whether or not the external event is
  1082. * memorized (latched) and generated as soon as the blanking period
  1083. * is completed or the window ends
  1084. */
  1085. #define HRTIM_TIMEVENTLATCH_DISABLED (0x00000000U) /*!< Event is ignored if it happens during a blank, or passed through during a window */
  1086. #define HRTIM_TIMEVENTLATCH_ENABLED HRTIM_EEFR1_EE1LTCH /*!< Event is latched and delayed till the end of the blanking or windowing period */
  1087. /**
  1088. * @}
  1089. */
  1090. /** @defgroup HRTIM_Deadtime_Prescaler_Ratio HRTIM Dead-time Prescaler Ratio
  1091. * @{
  1092. * @brief Constants defining division ratio between the timer clock frequency
  1093. * (fHRTIM) and the dead-time generator clock (fDTG)
  1094. */
  1095. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8 (0x00000000U) /*!< fDTG = fHRTIM * 8U */
  1096. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4 (HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM * 4U */
  1097. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2 (HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM * 2U */
  1098. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1 (HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM */
  1099. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2 (HRTIM_DTR_DTPRSC_2) /*!< fDTG = fHRTIM / 2U */
  1100. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM / 4U */
  1101. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1) /*!< fDTG = fHRTIM / 8U */
  1102. #define HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16 (HRTIM_DTR_DTPRSC_2 | HRTIM_DTR_DTPRSC_1 | HRTIM_DTR_DTPRSC_0) /*!< fDTG = fHRTIM / 16U */
  1103. /**
  1104. * @}
  1105. */
  1106. /** @defgroup HRTIM_Deadtime_Rising_Sign HRTIM Dead-time Rising Sign
  1107. * @{
  1108. * @brief Constants defining whether the dead-time is positive or negative
  1109. * (overlapping signal) on rising edge
  1110. */
  1111. #define HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE (0x00000000U) /*!< Positive dead-time on rising edge */
  1112. #define HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE (HRTIM_DTR_SDTR) /*!< Negative dead-time on rising edge */
  1113. /**
  1114. * @}
  1115. */
  1116. /** @defgroup HRTIM_Deadtime_Rising_Lock HRTIM Dead-time Rising Lock
  1117. * @{
  1118. * @brief Constants defining whether or not the dead-time (rising sign and
  1119. * value) is write protected
  1120. */
  1121. #define HRTIM_TIMDEADTIME_RISINGLOCK_WRITE (0x00000000U) /*!< Dead-time rising value and sign is writeable */
  1122. #define HRTIM_TIMDEADTIME_RISINGLOCK_READONLY (HRTIM_DTR_DTRLK) /*!< Dead-time rising value and sign is read-only */
  1123. /**
  1124. * @}
  1125. */
  1126. /** @defgroup HRTIM_Deadtime_Rising_Sign_Lock HRTIM Dead-time Rising Sign Lock
  1127. * @{
  1128. * @brief Constants defining whether or not the dead-time rising sign is write
  1129. * protected
  1130. */
  1131. #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE (0x00000000U) /*!< Dead-time rising sign is writeable */
  1132. #define HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY (HRTIM_DTR_DTRSLK) /*!< Dead-time rising sign is read-only */
  1133. /**
  1134. * @}
  1135. */
  1136. /** @defgroup HRTIM_Deadtime_Falling_Sign HRTIM Dead-time Falling Sign
  1137. * @{
  1138. * @brief Constants defining whether the dead-time is positive or negative
  1139. * (overlapping signal) on falling edge
  1140. */
  1141. #define HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE (0x00000000U) /*!< Positive dead-time on falling edge */
  1142. #define HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE (HRTIM_DTR_SDTF) /*!< Negative dead-time on falling edge */
  1143. /**
  1144. * @}
  1145. */
  1146. /** @defgroup HRTIM_Deadtime_Falling_Lock HRTIM Dead-time Falling Lock
  1147. * @{
  1148. * @brief Constants defining whether or not the dead-time (falling sign and
  1149. * value) is write protected
  1150. */
  1151. #define HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE (0x00000000U) /*!< Dead-time falling value and sign is writeable */
  1152. #define HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY (HRTIM_DTR_DTFLK) /*!< Dead-time falling value and sign is read-only */
  1153. /**
  1154. * @}
  1155. */
  1156. /** @defgroup HRTIM_Deadtime_Falling_Sign_Lock HRTIM Dead-time Falling Sign Lock
  1157. * @{
  1158. * @brief Constants defining whether or not the dead-time falling sign is write
  1159. * protected
  1160. */
  1161. #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE (0x00000000U) /*!< Dead-time falling sign is writeable */
  1162. #define HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY (HRTIM_DTR_DTFSLK) /*!< Dead-time falling sign is read-only */
  1163. /**
  1164. * @}
  1165. */
  1166. /** @defgroup HRTIM_Chopper_Frequency HRTIM Chopper Frequency
  1167. * @{
  1168. * @brief Constants defining the frequency of the generated high frequency carrier
  1169. */
  1170. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV16 (0x000000U) /*!< fCHPFRQ = fHRTIM / 16 */
  1171. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV32 (HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 32 */
  1172. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV48 (HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 48 */
  1173. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV64 (HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 64 */
  1174. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV80 (HRTIM_CHPR_CARFRQ_2) /*!< fCHPFRQ = fHRTIM / 80 */
  1175. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV96 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 96 */
  1176. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV112 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 112 */
  1177. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV128 (HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 128 */
  1178. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV144 (HRTIM_CHPR_CARFRQ_3) /*!< fCHPFRQ = fHRTIM / 144 */
  1179. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV160 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 160 */
  1180. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV176 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 176 */
  1181. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV192 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 192 */
  1182. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV208 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2) /*!< fCHPFRQ = fHRTIM / 208 */
  1183. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV224 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 224 */
  1184. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV240 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1) /*!< fCHPFRQ = fHRTIM / 240 */
  1185. #define HRTIM_CHOPPER_PRESCALERRATIO_DIV256 (HRTIM_CHPR_CARFRQ_3 | HRTIM_CHPR_CARFRQ_2 | HRTIM_CHPR_CARFRQ_1 | HRTIM_CHPR_CARFRQ_0) /*!< fCHPFRQ = fHRTIM / 256 */
  1186. /**
  1187. * @}
  1188. */
  1189. /** @defgroup HRTIM_Chopper_Duty_Cycle HRTIM Chopper Duty Cycle
  1190. * @{
  1191. * @brief Constants defining the duty cycle of the generated high frequency carrier
  1192. * Duty cycle can be adjusted by 1/8 step (from 0/8 up to 7/8)
  1193. */
  1194. #define HRTIM_CHOPPER_DUTYCYCLE_0 (0x000000U) /*!< Only 1st pulse is present */
  1195. #define HRTIM_CHOPPER_DUTYCYCLE_125 (HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 12.5U % */
  1196. #define HRTIM_CHOPPER_DUTYCYCLE_250 (HRTIM_CHPR_CARDTY_1) /*!< Duty cycle of the carrier signal is 25U % */
  1197. #define HRTIM_CHOPPER_DUTYCYCLE_375 (HRTIM_CHPR_CARDTY_1 | HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 37.5U % */
  1198. #define HRTIM_CHOPPER_DUTYCYCLE_500 (HRTIM_CHPR_CARDTY_2) /*!< Duty cycle of the carrier signal is 50U % */
  1199. #define HRTIM_CHOPPER_DUTYCYCLE_625 (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 62.5U % */
  1200. #define HRTIM_CHOPPER_DUTYCYCLE_750 (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_1) /*!< Duty cycle of the carrier signal is 75U % */
  1201. #define HRTIM_CHOPPER_DUTYCYCLE_875 (HRTIM_CHPR_CARDTY_2 | HRTIM_CHPR_CARDTY_1 | HRTIM_CHPR_CARDTY_0) /*!< Duty cycle of the carrier signal is 87.5U % */
  1202. /**
  1203. * @}
  1204. */
  1205. /** @defgroup HRTIM_Chopper_Start_Pulse_Width HRTIM Chopper Start Pulse Width
  1206. * @{
  1207. * @brief Constants defining the pulse width of the first pulse of the generated
  1208. * high frequency carrier
  1209. */
  1210. #define HRTIM_CHOPPER_PULSEWIDTH_16 (0x000000U) /*!< tSTPW = tHRTIM x 16 */
  1211. #define HRTIM_CHOPPER_PULSEWIDTH_32 (HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 32 */
  1212. #define HRTIM_CHOPPER_PULSEWIDTH_48 (HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 48 */
  1213. #define HRTIM_CHOPPER_PULSEWIDTH_64 (HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 64 */
  1214. #define HRTIM_CHOPPER_PULSEWIDTH_80 (HRTIM_CHPR_STRPW_2) /*!< tSTPW = tHRTIM x 80 */
  1215. #define HRTIM_CHOPPER_PULSEWIDTH_96 (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 96 */
  1216. #define HRTIM_CHOPPER_PULSEWIDTH_112 (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 112 */
  1217. #define HRTIM_CHOPPER_PULSEWIDTH_128 (HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 128 */
  1218. #define HRTIM_CHOPPER_PULSEWIDTH_144 (HRTIM_CHPR_STRPW_3) /*!< tSTPW = tHRTIM x 144 */
  1219. #define HRTIM_CHOPPER_PULSEWIDTH_160 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 160 */
  1220. #define HRTIM_CHOPPER_PULSEWIDTH_176 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 176 */
  1221. #define HRTIM_CHOPPER_PULSEWIDTH_192 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 192 */
  1222. #define HRTIM_CHOPPER_PULSEWIDTH_208 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2) /*!< tSTPW = tHRTIM x 208 */
  1223. #define HRTIM_CHOPPER_PULSEWIDTH_224 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 224 */
  1224. #define HRTIM_CHOPPER_PULSEWIDTH_240 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1) /*!< tSTPW = tHRTIM x 240 */
  1225. #define HRTIM_CHOPPER_PULSEWIDTH_256 (HRTIM_CHPR_STRPW_3 | HRTIM_CHPR_STRPW_2 | HRTIM_CHPR_STRPW_1 | HRTIM_CHPR_STRPW_0) /*!< tSTPW = tHRTIM x 256 */
  1226. /**
  1227. * @}
  1228. */
  1229. /** @defgroup HRTIM_Synchronization_Options HRTIM Synchronization Options
  1230. * @{
  1231. * @brief Constants defining the options for synchronizing multiple HRTIM
  1232. * instances, as a master unit (generating a synchronization signal)
  1233. * or as a slave (waiting for a trigger to be synchronized)
  1234. */
  1235. #define HRTIM_SYNCOPTION_NONE 0x00000000U /*!< HRTIM instance doesn't handle external synchronization signals (SYNCIN, SYNCOUT) */
  1236. #define HRTIM_SYNCOPTION_MASTER 0x00000001U /*!< HRTIM instance acts as a MASTER, i.e. generates external synchronization output (SYNCOUT)*/
  1237. #define HRTIM_SYNCOPTION_SLAVE 0x00000002U /*!< HRTIM instance acts as a SLAVE, i.e. it is synchronized by external sources (SYNCIN) */
  1238. /**
  1239. * @}
  1240. */
  1241. /** @defgroup HRTIM_Synchronization_Input_Source HRTIM Synchronization Input Source
  1242. * @{
  1243. * @brief Constants defining defining the synchronization input source
  1244. */
  1245. #define HRTIM_SYNCINPUTSOURCE_NONE 0x00000000U /*!< disabled. HRTIM is not synchronized and runs in standalone mode */
  1246. #define HRTIM_SYNCINPUTSOURCE_INTERNALEVENT HRTIM_MCR_SYNC_IN_1 /*!< The HRTIM is synchronized with the on-chip timer */
  1247. #define HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT (HRTIM_MCR_SYNC_IN_1 | HRTIM_MCR_SYNC_IN_0) /*!< A positive pulse on SYNCIN input triggers the HRTIM */
  1248. /**
  1249. * @}
  1250. */
  1251. /** @defgroup HRTIM_Synchronization_Output_Source HRTIM Synchronization Output Source
  1252. * @{
  1253. * @brief Constants defining the source and event to be sent on the
  1254. * synchronization outputs
  1255. */
  1256. #define HRTIM_SYNCOUTPUTSOURCE_MASTER_START 0x00000000U /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon master timer start event */
  1257. #define HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1 (HRTIM_MCR_SYNC_SRC_0) /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon master timer compare 1 event */
  1258. #define HRTIM_SYNCOUTPUTSOURCE_TIMA_START (HRTIM_MCR_SYNC_SRC_1) /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon timer A start or reset events */
  1259. #define HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1 (HRTIM_MCR_SYNC_SRC_1 | HRTIM_MCR_SYNC_SRC_0) /*!< A pulse is sent on HRTIM_SCOUT output and hrtim_out_sync2 upon timer A compare 1 event */
  1260. /**
  1261. * @}
  1262. */
  1263. /** @defgroup HRTIM_Synchronization_Output_Polarity HRTIM Synchronization Output Polarity
  1264. * @{
  1265. * @brief Constants defining the routing and conditioning of the synchronization output event
  1266. */
  1267. #define HRTIM_SYNCOUTPUTPOLARITY_NONE 0x00000000U /*!< Synchronization output event is disabled */
  1268. #define HRTIM_SYNCOUTPUTPOLARITY_POSITIVE (HRTIM_MCR_SYNC_OUT_1) /*!< SCOUT pin has a low idle level and issues a positive pulse of 16 fHRTIM clock cycles length for the synchronization */
  1269. #define HRTIM_SYNCOUTPUTPOLARITY_NEGATIVE (HRTIM_MCR_SYNC_OUT_1 | HRTIM_MCR_SYNC_OUT_0) /*!< SCOUT pin has a high idle level and issues a negative pulse of 16 fHRTIM clock cycles length for the synchronization */
  1270. /**
  1271. * @}
  1272. */
  1273. /** @defgroup HRTIM_External_Event_Sources HRTIM External Event Sources
  1274. * @{
  1275. * @brief Constants defining available sources associated to external events
  1276. */
  1277. #define HRTIM_EVENTSRC_1 (0x00000000U) /*!< External event source 1U */
  1278. #define HRTIM_EVENTSRC_2 (HRTIM_EECR1_EE1SRC_0) /*!< External event source 2U */
  1279. #define HRTIM_EVENTSRC_3 (HRTIM_EECR1_EE1SRC_1) /*!< External event source 3U */
  1280. #define HRTIM_EVENTSRC_4 (HRTIM_EECR1_EE1SRC_1 | HRTIM_EECR1_EE1SRC_0) /*!< External event source 4U */
  1281. /**
  1282. * @}
  1283. */
  1284. /** @defgroup HRTIM_External_Event_Polarity HRTIM External Event Polarity
  1285. * @{
  1286. * @brief Constants defining the polarity of an external event
  1287. */
  1288. #define HRTIM_EVENTPOLARITY_HIGH (0x00000000U) /*!< External event is active high */
  1289. #define HRTIM_EVENTPOLARITY_LOW (HRTIM_EECR1_EE1POL) /*!< External event is active low */
  1290. /**
  1291. * @}
  1292. */
  1293. /** @defgroup HRTIM_External_Event_Sensitivity HRTIM External Event Sensitivity
  1294. * @{
  1295. * @brief Constants defining the sensitivity (level-sensitive or edge-sensitive)
  1296. * of an external event
  1297. */
  1298. #define HRTIM_EVENTSENSITIVITY_LEVEL (0x00000000U) /*!< External event is active on level */
  1299. #define HRTIM_EVENTSENSITIVITY_RISINGEDGE (HRTIM_EECR1_EE1SNS_0) /*!< External event is active on Rising edge */
  1300. #define HRTIM_EVENTSENSITIVITY_FALLINGEDGE (HRTIM_EECR1_EE1SNS_1) /*!< External event is active on Falling edge */
  1301. #define HRTIM_EVENTSENSITIVITY_BOTHEDGES (HRTIM_EECR1_EE1SNS_1 | HRTIM_EECR1_EE1SNS_0) /*!< External event is active on Rising and Falling edges */
  1302. /**
  1303. * @}
  1304. */
  1305. /** @defgroup HRTIM_External_Event_Fast_Mode HRTIM External Event Fast Mode
  1306. * @{
  1307. * @brief Constants defining whether or not an external event is programmed in
  1308. fast mode
  1309. */
  1310. #define HRTIM_EVENTFASTMODE_DISABLE (0x00000000U) /*!< External Event is re-synchronized by the HRTIM logic before acting on outputs */
  1311. #define HRTIM_EVENTFASTMODE_ENABLE (HRTIM_EECR1_EE1FAST) /*!< External Event is acting asynchronously on outputs (low latency mode) */
  1312. /**
  1313. * @}
  1314. */
  1315. /** @defgroup HRTIM_External_Event_Filter HRTIM External Event Filter
  1316. * @{
  1317. * @brief Constants defining the frequency used to sample an external event 6
  1318. * input and the length (N) of the digital filter applied
  1319. */
  1320. #define HRTIM_EVENTFILTER_NONE (0x00000000U) /*!< Filter disabled */
  1321. #define HRTIM_EVENTFILTER_1 (HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fHRTIM, N=2U */
  1322. #define HRTIM_EVENTFILTER_2 (HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fHRTIM, N=4U */
  1323. #define HRTIM_EVENTFILTER_3 (HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fHRTIM, N=8U */
  1324. #define HRTIM_EVENTFILTER_4 (HRTIM_EECR3_EE6F_2) /*!< fSAMPLING= fEEVS/2U, N=6U */
  1325. #define HRTIM_EVENTFILTER_5 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/2U, N=8U */
  1326. #define HRTIM_EVENTFILTER_6 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/4U, N=6U */
  1327. #define HRTIM_EVENTFILTER_7 (HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/4U, N=8U */
  1328. #define HRTIM_EVENTFILTER_8 (HRTIM_EECR3_EE6F_3) /*!< fSAMPLING= fEEVS/8U, N=6U */
  1329. #define HRTIM_EVENTFILTER_9 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/8U, N=8U */
  1330. #define HRTIM_EVENTFILTER_10 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/16U, N=5U */
  1331. #define HRTIM_EVENTFILTER_11 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/16U, N=6U */
  1332. #define HRTIM_EVENTFILTER_12 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2) /*!< fSAMPLING= fEEVS/16U, N=8U */
  1333. #define HRTIM_EVENTFILTER_13 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/32U, N=5U */
  1334. #define HRTIM_EVENTFILTER_14 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1) /*!< fSAMPLING= fEEVS/32U, N=6U */
  1335. #define HRTIM_EVENTFILTER_15 (HRTIM_EECR3_EE6F_3 | HRTIM_EECR3_EE6F_2 | HRTIM_EECR3_EE6F_1 | HRTIM_EECR3_EE6F_0) /*!< fSAMPLING= fEEVS/32U, N=8U */
  1336. /**
  1337. * @}
  1338. */
  1339. /** @defgroup HRTIM_External_Event_Prescaler HRTIM External Event Prescaler
  1340. * @{
  1341. * @brief Constants defining division ratio between the timer clock frequency
  1342. * fHRTIM) and the external event signal sampling clock (fEEVS)
  1343. * used by the digital filters
  1344. */
  1345. #define HRTIM_EVENTPRESCALER_DIV1 (0x00000000U) /*!< fEEVS=fHRTIM */
  1346. #define HRTIM_EVENTPRESCALER_DIV2 (HRTIM_EECR3_EEVSD_0) /*!< fEEVS=fHRTIM / 2U */
  1347. #define HRTIM_EVENTPRESCALER_DIV4 (HRTIM_EECR3_EEVSD_1) /*!< fEEVS=fHRTIM / 4U */
  1348. #define HRTIM_EVENTPRESCALER_DIV8 (HRTIM_EECR3_EEVSD_1 | HRTIM_EECR3_EEVSD_0) /*!< fEEVS=fHRTIM / 8U */
  1349. /**
  1350. * @}
  1351. */
  1352. /** @defgroup HRTIM_Fault_Sources HRTIM Fault Sources
  1353. * @{
  1354. * @brief Constants defining whether a fault is triggered by any external
  1355. * or internal fault source
  1356. */
  1357. #define HRTIM_FAULTSOURCE_DIGITALINPUT (0x00000000U) /*!< Fault input is FLT input pin */
  1358. #define HRTIM_FAULTSOURCE_INTERNAL (HRTIM_FLTINR1_FLT1SRC) /*!< Fault input is FLT_Int signal (e.g. internal comparator) */
  1359. /**
  1360. * @}
  1361. */
  1362. /** @defgroup HRTIM_Fault_Polarity HRTIM Fault Polarity
  1363. * @{
  1364. * @brief Constants defining the polarity of a fault event
  1365. */
  1366. #define HRTIM_FAULTPOLARITY_LOW (0x00000000U) /*!< Fault input is active low */
  1367. #define HRTIM_FAULTPOLARITY_HIGH (HRTIM_FLTINR1_FLT1P) /*!< Fault input is active high */
  1368. /**
  1369. * @}
  1370. */
  1371. /** @defgroup HRTIM_Fault_Filter HRTIM Fault Filter
  1372. * @{
  1373. * @ brief Constants defining the frequency used to sample the fault input and
  1374. * the length (N) of the digital filter applied
  1375. */
  1376. #define HRTIM_FAULTFILTER_NONE (0x00000000U) /*!< Filter disabled */
  1377. #define HRTIM_FAULTFILTER_1 (HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fHRTIM, N=2U */
  1378. #define HRTIM_FAULTFILTER_2 (HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fHRTIM, N=4U */
  1379. #define HRTIM_FAULTFILTER_3 (HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fHRTIM, N=8U */
  1380. #define HRTIM_FAULTFILTER_4 (HRTIM_FLTINR1_FLT1F_2) /*!< fSAMPLING= fFLTS/2U, N=6U */
  1381. #define HRTIM_FAULTFILTER_5 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/2U, N=8U */
  1382. #define HRTIM_FAULTFILTER_6 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/4U, N=6U */
  1383. #define HRTIM_FAULTFILTER_7 (HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/4U, N=8U */
  1384. #define HRTIM_FAULTFILTER_8 (HRTIM_FLTINR1_FLT1F_3) /*!< fSAMPLING= fFLTS/8U, N=6U */
  1385. #define HRTIM_FAULTFILTER_9 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/8U, N=8U */
  1386. #define HRTIM_FAULTFILTER_10 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/16U, N=5U */
  1387. #define HRTIM_FAULTFILTER_11 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/16U, N=6U */
  1388. #define HRTIM_FAULTFILTER_12 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2) /*!< fSAMPLING= fFLTS/16U, N=8U */
  1389. #define HRTIM_FAULTFILTER_13 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/32U, N=5U */
  1390. #define HRTIM_FAULTFILTER_14 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1) /*!< fSAMPLING= fFLTS/32U, N=6U */
  1391. #define HRTIM_FAULTFILTER_15 (HRTIM_FLTINR1_FLT1F_3 | HRTIM_FLTINR1_FLT1F_2 | HRTIM_FLTINR1_FLT1F_1 | HRTIM_FLTINR1_FLT1F_0) /*!< fSAMPLING= fFLTS/32U, N=8U */
  1392. /**
  1393. * @}
  1394. */
  1395. /** @defgroup HRTIM_Fault_Lock HRTIM Fault Lock
  1396. * @{
  1397. * @brief Constants defining whether or not the fault programming bits are
  1398. write protected
  1399. */
  1400. #define HRTIM_FAULTLOCK_READWRITE (0x00000000U) /*!< Fault settings bits are read/write */
  1401. #define HRTIM_FAULTLOCK_READONLY (HRTIM_FLTINR1_FLT1LCK) /*!< Fault settings bits are read only */
  1402. /**
  1403. * @}
  1404. */
  1405. /** @defgroup HRTIM_External_Fault_Prescaler HRTIM External Fault Prescaler
  1406. * @{
  1407. * @brief Constants defining the division ratio between the timer clock
  1408. * frequency (fHRTIM) and the fault signal sampling clock (fFLTS) used
  1409. * by the digital filters.
  1410. */
  1411. #define HRTIM_FAULTPRESCALER_DIV1 (0x00000000U) /*!< fFLTS=fHRTIM */
  1412. #define HRTIM_FAULTPRESCALER_DIV2 (HRTIM_FLTINR2_FLTSD_0) /*!< fFLTS=fHRTIM / 2U */
  1413. #define HRTIM_FAULTPRESCALER_DIV4 (HRTIM_FLTINR2_FLTSD_1) /*!< fFLTS=fHRTIM / 4U */
  1414. #define HRTIM_FAULTPRESCALER_DIV8 (HRTIM_FLTINR2_FLTSD_1 | HRTIM_FLTINR2_FLTSD_0) /*!< fFLTS=fHRTIM / 8U */
  1415. /**
  1416. * @}
  1417. */
  1418. /** @defgroup HRTIM_Burst_Mode_Operating_Mode HRTIM Burst Mode Operating Mode
  1419. * @{
  1420. * @brief Constants defining if the burst mode is entered once or if it is
  1421. * continuously operating
  1422. */
  1423. #define HRTIM_BURSTMODE_SINGLESHOT (0x00000000U) /*!< Burst mode operates in single shot mode */
  1424. #define HRTIM_BURSTMODE_CONTINOUS (HRTIM_BMCR_BMOM) /*!< Burst mode operates in continuous mode */
  1425. /**
  1426. * @}
  1427. */
  1428. /** @defgroup HRTIM_Burst_Mode_Clock_Source HRTIM Burst Mode Clock Source
  1429. * @{
  1430. * @brief Constants defining the clock source for the burst mode counter
  1431. */
  1432. #define HRTIM_BURSTMODECLOCKSOURCE_MASTER (0x00000000U) /*!< Master timer counter reset/roll-over is used as clock source for the burst mode counter */
  1433. #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_A (HRTIM_BMCR_BMCLK_0) /*!< Timer A counter reset/roll-over is used as clock source for the burst mode counter */
  1434. #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_B (HRTIM_BMCR_BMCLK_1) /*!< Timer B counter reset/roll-over is used as clock source for the burst mode counter */
  1435. #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_C (HRTIM_BMCR_BMCLK_1 | HRTIM_BMCR_BMCLK_0) /*!< Timer C counter reset/roll-over is used as clock source for the burst mode counter */
  1436. #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_D (HRTIM_BMCR_BMCLK_2) /*!< Timer D counter reset/roll-over is used as clock source for the burst mode counter */
  1437. #define HRTIM_BURSTMODECLOCKSOURCE_TIMER_E (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_0) /*!< Timer E counter reset/roll-over is used as clock source for the burst mode counter */
  1438. #define HRTIM_BURSTMODECLOCKSOURCE_TIM16_OC (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_1) /*!< On-chip Event 1 (BMClk[1]), acting as a burst mode counter clock */
  1439. #define HRTIM_BURSTMODECLOCKSOURCE_TIM17_OC (HRTIM_BMCR_BMCLK_2 | HRTIM_BMCR_BMCLK_1 | HRTIM_BMCR_BMCLK_0) /*!< On-chip Event 2 (BMClk[2]), acting as a burst mode counter clock */
  1440. #define HRTIM_BURSTMODECLOCKSOURCE_TIM7_TRGO (HRTIM_BMCR_BMCLK_3) /*!< On-chip Event 3 (BMClk[3]), acting as a burst mode counter clock */
  1441. #define HRTIM_BURSTMODECLOCKSOURCE_FHRTIM (HRTIM_BMCR_BMCLK_3 | HRTIM_BMCR_BMCLK_1) /*!< Prescaled fHRTIM clock is used as clock source for the burst mode counter */
  1442. /**
  1443. * @}
  1444. */
  1445. /** @defgroup HRTIM_Burst_Mode_Prescaler HRTIM Burst Mode Prescaler
  1446. * @{
  1447. * @brief Constants defining the prescaling ratio of the fHRTIM clock
  1448. * for the burst mode controller
  1449. */
  1450. #define HRTIM_BURSTMODEPRESCALER_DIV1 (0x00000000U) /*!< fBRST = fHRTIM */
  1451. #define HRTIM_BURSTMODEPRESCALER_DIV2 (HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/2U */
  1452. #define HRTIM_BURSTMODEPRESCALER_DIV4 (HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/4U */
  1453. #define HRTIM_BURSTMODEPRESCALER_DIV8 (HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/8U */
  1454. #define HRTIM_BURSTMODEPRESCALER_DIV16 (HRTIM_BMCR_BMPRSC_2) /*!< fBRST = fHRTIM/16U */
  1455. #define HRTIM_BURSTMODEPRESCALER_DIV32 (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/32U */
  1456. #define HRTIM_BURSTMODEPRESCALER_DIV64 (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/64U */
  1457. #define HRTIM_BURSTMODEPRESCALER_DIV128 (HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/128U */
  1458. #define HRTIM_BURSTMODEPRESCALER_DIV256 (HRTIM_BMCR_BMPRSC_3) /*!< fBRST = fHRTIM/256U */
  1459. #define HRTIM_BURSTMODEPRESCALER_DIV512 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/512U */
  1460. #define HRTIM_BURSTMODEPRESCALER_DIV1024 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/1024U */
  1461. #define HRTIM_BURSTMODEPRESCALER_DIV2048 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/2048U*/
  1462. #define HRTIM_BURSTMODEPRESCALER_DIV4096 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2) /*!< fBRST = fHRTIM/4096U */
  1463. #define HRTIM_BURSTMODEPRESCALER_DIV8192 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/8192U */
  1464. #define HRTIM_BURSTMODEPRESCALER_DIV16384 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1) /*!< fBRST = fHRTIM/16384U */
  1465. #define HRTIM_BURSTMODEPRESCALER_DIV32768 (HRTIM_BMCR_BMPRSC_3 | HRTIM_BMCR_BMPRSC_2 | HRTIM_BMCR_BMPRSC_1 | HRTIM_BMCR_BMPRSC_0) /*!< fBRST = fHRTIM/32768U */
  1466. /**
  1467. * @}
  1468. */
  1469. /** @defgroup HRTIM_Burst_Mode_Register_Preload_Enable HRTIM Burst Mode Register Preload Enable
  1470. * @{
  1471. * @brief Constants defining whether or not burst mode registers preload
  1472. mechanism is enabled, i.e. a write access into a preloadable register
  1473. (HRTIM_BMCMPR, HRTIM_BMPER) is done into the active or the preload register
  1474. */
  1475. #define HRIM_BURSTMODEPRELOAD_DISABLED (0x00000000U) /*!< Preload disabled: the write access is directly done into active registers */
  1476. #define HRIM_BURSTMODEPRELOAD_ENABLED (HRTIM_BMCR_BMPREN) /*!< Preload enabled: the write access is done into preload registers */
  1477. /**
  1478. * @}
  1479. */
  1480. /** @defgroup HRTIM_Burst_Mode_Trigger HRTIM Burst Mode Trigger
  1481. * @{
  1482. * @brief Constants defining the events that can be used to trig the burst
  1483. * mode operation
  1484. */
  1485. #define HRTIM_BURSTMODETRIGGER_NONE 0x00000000U /*!< No trigger */
  1486. #define HRTIM_BURSTMODETRIGGER_MASTER_RESET (HRTIM_BMTRGR_MSTRST) /*!< Master reset */
  1487. #define HRTIM_BURSTMODETRIGGER_MASTER_REPETITION (HRTIM_BMTRGR_MSTREP) /*!< Master repetition */
  1488. #define HRTIM_BURSTMODETRIGGER_MASTER_CMP1 (HRTIM_BMTRGR_MSTCMP1) /*!< Master compare 1U */
  1489. #define HRTIM_BURSTMODETRIGGER_MASTER_CMP2 (HRTIM_BMTRGR_MSTCMP2) /*!< Master compare 2U */
  1490. #define HRTIM_BURSTMODETRIGGER_MASTER_CMP3 (HRTIM_BMTRGR_MSTCMP3) /*!< Master compare 3U */
  1491. #define HRTIM_BURSTMODETRIGGER_MASTER_CMP4 (HRTIM_BMTRGR_MSTCMP4) /*!< Master compare 4U */
  1492. #define HRTIM_BURSTMODETRIGGER_TIMERA_RESET (HRTIM_BMTRGR_TARST) /*!< Timer A reset */
  1493. #define HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION (HRTIM_BMTRGR_TAREP) /*!< Timer A repetition */
  1494. #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP1 (HRTIM_BMTRGR_TACMP1) /*!< Timer A compare 1 */
  1495. #define HRTIM_BURSTMODETRIGGER_TIMERA_CMP2 (HRTIM_BMTRGR_TACMP2) /*!< Timer A compare 2 */
  1496. #define HRTIM_BURSTMODETRIGGER_TIMERB_RESET (HRTIM_BMTRGR_TBRST) /*!< Timer B reset */
  1497. #define HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION (HRTIM_BMTRGR_TBREP) /*!< Timer B repetition */
  1498. #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP1 (HRTIM_BMTRGR_TBCMP1) /*!< Timer B compare 1 */
  1499. #define HRTIM_BURSTMODETRIGGER_TIMERB_CMP2 (HRTIM_BMTRGR_TBCMP2) /*!< Timer B compare 2 */
  1500. #define HRTIM_BURSTMODETRIGGER_TIMERC_RESET (HRTIM_BMTRGR_TCRST) /*!< Timer C reset */
  1501. #define HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION (HRTIM_BMTRGR_TCREP) /*!< Timer C repetition */
  1502. #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP1 (HRTIM_BMTRGR_TCCMP1) /*!< Timer C compare 1 */
  1503. #define HRTIM_BURSTMODETRIGGER_TIMERC_CMP2 (HRTIM_BMTRGR_TCCMP2) /*!< Timer C compare 2 */
  1504. #define HRTIM_BURSTMODETRIGGER_TIMERD_RESET (HRTIM_BMTRGR_TDRST) /*!< Timer D reset */
  1505. #define HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION (HRTIM_BMTRGR_TDREP) /*!< Timer D repetition */
  1506. #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP1 (HRTIM_BMTRGR_TDCMP1) /*!< Timer D compare 1 */
  1507. #define HRTIM_BURSTMODETRIGGER_TIMERD_CMP2 (HRTIM_BMTRGR_TDCMP2) /*!< Timer D compare 2 */
  1508. #define HRTIM_BURSTMODETRIGGER_TIMERE_RESET (HRTIM_BMTRGR_TERST) /*!< Timer E reset */
  1509. #define HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION (HRTIM_BMTRGR_TEREP) /*!< Timer E repetition */
  1510. #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP1 (HRTIM_BMTRGR_TECMP1) /*!< Timer E compare 1 */
  1511. #define HRTIM_BURSTMODETRIGGER_TIMERE_CMP2 (HRTIM_BMTRGR_TECMP2) /*!< Timer E compare 2 */
  1512. #define HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7 (HRTIM_BMTRGR_TAEEV7) /*!< Timer A period following External Event 7 */
  1513. #define HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8 (HRTIM_BMTRGR_TDEEV8) /*!< Timer D period following External Event 8 */
  1514. #define HRTIM_BURSTMODETRIGGER_EVENT_7 (HRTIM_BMTRGR_EEV7) /*!< External Event 7 (timer A filters applied) */
  1515. #define HRTIM_BURSTMODETRIGGER_EVENT_8 (HRTIM_BMTRGR_EEV8) /*!< External Event 8 (timer D filters applied)*/
  1516. #define HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP (HRTIM_BMTRGR_OCHPEV) /*!< On-chip Event */
  1517. /**
  1518. * @}
  1519. */
  1520. /** @defgroup HRTIM_ADC_Trigger_Update_Source HRTIM ADC Trigger Update Source
  1521. * @{
  1522. * @brief constants defining the source triggering the update of the
  1523. HRTIM_ADCxR register (transfer from preload to active register).
  1524. */
  1525. #define HRTIM_ADCTRIGGERUPDATE_MASTER 0x00000000U /*!< Master timer */
  1526. #define HRTIM_ADCTRIGGERUPDATE_TIMER_A (HRTIM_CR1_ADC1USRC_0) /*!< Timer A */
  1527. #define HRTIM_ADCTRIGGERUPDATE_TIMER_B (HRTIM_CR1_ADC1USRC_1) /*!< Timer B */
  1528. #define HRTIM_ADCTRIGGERUPDATE_TIMER_C (HRTIM_CR1_ADC1USRC_1 | HRTIM_CR1_ADC1USRC_0) /*!< Timer C */
  1529. #define HRTIM_ADCTRIGGERUPDATE_TIMER_D (HRTIM_CR1_ADC1USRC_2) /*!< Timer D */
  1530. #define HRTIM_ADCTRIGGERUPDATE_TIMER_E (HRTIM_CR1_ADC1USRC_2 | HRTIM_CR1_ADC1USRC_0) /*!< Timer E */
  1531. /**
  1532. * @}
  1533. */
  1534. /** @defgroup HRTIM_ADC_Trigger_Event HRTIM ADC Trigger Event
  1535. * @{
  1536. * @brief constants defining the events triggering ADC conversion.
  1537. * HRTIM_ADCTRIGGEREVENT13_*: ADC Triggers 1 and 3
  1538. * HRTIM_ADCTRIGGEREVENT24_*: ADC Triggers 2 and 4
  1539. */
  1540. #define HRTIM_ADCTRIGGEREVENT13_NONE 0x00000000U /*!< No ADC trigger event */
  1541. #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP1 (HRTIM_ADC1R_AD1MC1) /*!< ADC Trigger on master compare 1U */
  1542. #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP2 (HRTIM_ADC1R_AD1MC2) /*!< ADC Trigger on master compare 2U */
  1543. #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP3 (HRTIM_ADC1R_AD1MC3) /*!< ADC Trigger on master compare 3U */
  1544. #define HRTIM_ADCTRIGGEREVENT13_MASTER_CMP4 (HRTIM_ADC1R_AD1MC4) /*!< ADC Trigger on master compare 4U */
  1545. #define HRTIM_ADCTRIGGEREVENT13_MASTER_PERIOD (HRTIM_ADC1R_AD1MPER) /*!< ADC Trigger on master period */
  1546. #define HRTIM_ADCTRIGGEREVENT13_EVENT_1 (HRTIM_ADC1R_AD1EEV1) /*!< ADC Trigger on external event 1U */
  1547. #define HRTIM_ADCTRIGGEREVENT13_EVENT_2 (HRTIM_ADC1R_AD1EEV2) /*!< ADC Trigger on external event 2U */
  1548. #define HRTIM_ADCTRIGGEREVENT13_EVENT_3 (HRTIM_ADC1R_AD1EEV3) /*!< ADC Trigger on external event 3U */
  1549. #define HRTIM_ADCTRIGGEREVENT13_EVENT_4 (HRTIM_ADC1R_AD1EEV4) /*!< ADC Trigger on external event 4U */
  1550. #define HRTIM_ADCTRIGGEREVENT13_EVENT_5 (HRTIM_ADC1R_AD1EEV5) /*!< ADC Trigger on external event 5U */
  1551. #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP2 (HRTIM_ADC1R_AD1TAC2) /*!< ADC Trigger on Timer A compare 2U */
  1552. #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP3 (HRTIM_ADC1R_AD1TAC3) /*!< ADC Trigger on Timer A compare 3U */
  1553. #define HRTIM_ADCTRIGGEREVENT13_TIMERA_CMP4 (HRTIM_ADC1R_AD1TAC4) /*!< ADC Trigger on Timer A compare 4U */
  1554. #define HRTIM_ADCTRIGGEREVENT13_TIMERA_PERIOD (HRTIM_ADC1R_AD1TAPER) /*!< ADC Trigger on Timer A period */
  1555. #define HRTIM_ADCTRIGGEREVENT13_TIMERA_RESET (HRTIM_ADC1R_AD1TARST) /*!< ADC Trigger on Timer A reset */
  1556. #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP2 (HRTIM_ADC1R_AD1TBC2) /*!< ADC Trigger on Timer B compare 2U */
  1557. #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP3 (HRTIM_ADC1R_AD1TBC3) /*!< ADC Trigger on Timer B compare 3U */
  1558. #define HRTIM_ADCTRIGGEREVENT13_TIMERB_CMP4 (HRTIM_ADC1R_AD1TBC4) /*!< ADC Trigger on Timer B compare 4U */
  1559. #define HRTIM_ADCTRIGGEREVENT13_TIMERB_PERIOD (HRTIM_ADC1R_AD1TBPER) /*!< ADC Trigger on Timer B period */
  1560. #define HRTIM_ADCTRIGGEREVENT13_TIMERB_RESET (HRTIM_ADC1R_AD1TBRST) /*!< ADC Trigger on Timer B reset */
  1561. #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP2 (HRTIM_ADC1R_AD1TCC2) /*!< ADC Trigger on Timer C compare 2U */
  1562. #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP3 (HRTIM_ADC1R_AD1TCC3) /*!< ADC Trigger on Timer C compare 3U */
  1563. #define HRTIM_ADCTRIGGEREVENT13_TIMERC_CMP4 (HRTIM_ADC1R_AD1TCC4) /*!< ADC Trigger on Timer C compare 4U */
  1564. #define HRTIM_ADCTRIGGEREVENT13_TIMERC_PERIOD (HRTIM_ADC1R_AD1TCPER) /*!< ADC Trigger on Timer C period */
  1565. #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP2 (HRTIM_ADC1R_AD1TDC2) /*!< ADC Trigger on Timer D compare 2U */
  1566. #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP3 (HRTIM_ADC1R_AD1TDC3) /*!< ADC Trigger on Timer D compare 3U */
  1567. #define HRTIM_ADCTRIGGEREVENT13_TIMERD_CMP4 (HRTIM_ADC1R_AD1TDC4) /*!< ADC Trigger on Timer D compare 4U */
  1568. #define HRTIM_ADCTRIGGEREVENT13_TIMERD_PERIOD (HRTIM_ADC1R_AD1TDPER) /*!< ADC Trigger on Timer D period */
  1569. #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP2 (HRTIM_ADC1R_AD1TEC2) /*!< ADC Trigger on Timer E compare 2U */
  1570. #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP3 (HRTIM_ADC1R_AD1TEC3) /*!< ADC Trigger on Timer E compare 3U */
  1571. #define HRTIM_ADCTRIGGEREVENT13_TIMERE_CMP4 (HRTIM_ADC1R_AD1TEC4) /*!< ADC Trigger on Timer E compare 4U */
  1572. #define HRTIM_ADCTRIGGEREVENT13_TIMERE_PERIOD (HRTIM_ADC1R_AD1TEPER) /*!< ADC Trigger on Timer E period */
  1573. #define HRTIM_ADCTRIGGEREVENT24_NONE 0x00000000U /*!< No ADC trigger event */
  1574. #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP1 (HRTIM_ADC2R_AD2MC1) /*!< ADC Trigger on master compare 1U */
  1575. #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP2 (HRTIM_ADC2R_AD2MC2) /*!< ADC Trigger on master compare 2U */
  1576. #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP3 (HRTIM_ADC2R_AD2MC3) /*!< ADC Trigger on master compare 3U */
  1577. #define HRTIM_ADCTRIGGEREVENT24_MASTER_CMP4 (HRTIM_ADC2R_AD2MC4) /*!< ADC Trigger on master compare 4U */
  1578. #define HRTIM_ADCTRIGGEREVENT24_MASTER_PERIOD (HRTIM_ADC2R_AD2MPER) /*!< ADC Trigger on master period */
  1579. #define HRTIM_ADCTRIGGEREVENT24_EVENT_6 (HRTIM_ADC2R_AD2EEV6) /*!< ADC Trigger on external event 6U */
  1580. #define HRTIM_ADCTRIGGEREVENT24_EVENT_7 (HRTIM_ADC2R_AD2EEV7) /*!< ADC Trigger on external event 7U */
  1581. #define HRTIM_ADCTRIGGEREVENT24_EVENT_8 (HRTIM_ADC2R_AD2EEV8) /*!< ADC Trigger on external event 8U */
  1582. #define HRTIM_ADCTRIGGEREVENT24_EVENT_9 (HRTIM_ADC2R_AD2EEV9) /*!< ADC Trigger on external event 9U */
  1583. #define HRTIM_ADCTRIGGEREVENT24_EVENT_10 (HRTIM_ADC2R_AD2EEV10) /*!< ADC Trigger on external event 10U */
  1584. #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP2 (HRTIM_ADC2R_AD2TAC2) /*!< ADC Trigger on Timer A compare 2U */
  1585. #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP3 (HRTIM_ADC2R_AD2TAC3) /*!< ADC Trigger on Timer A compare 3U */
  1586. #define HRTIM_ADCTRIGGEREVENT24_TIMERA_CMP4 (HRTIM_ADC2R_AD2TAC4) /*!< ADC Trigger on Timer A compare 4U */
  1587. #define HRTIM_ADCTRIGGEREVENT24_TIMERA_PERIOD (HRTIM_ADC2R_AD2TAPER) /*!< ADC Trigger on Timer A period */
  1588. #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP2 (HRTIM_ADC2R_AD2TBC2) /*!< ADC Trigger on Timer B compare 2U */
  1589. #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP3 (HRTIM_ADC2R_AD2TBC3) /*!< ADC Trigger on Timer B compare 3U */
  1590. #define HRTIM_ADCTRIGGEREVENT24_TIMERB_CMP4 (HRTIM_ADC2R_AD2TBC4) /*!< ADC Trigger on Timer B compare 4U */
  1591. #define HRTIM_ADCTRIGGEREVENT24_TIMERB_PERIOD (HRTIM_ADC2R_AD2TBPER) /*!< ADC Trigger on Timer B period */
  1592. #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP2 (HRTIM_ADC2R_AD2TCC2) /*!< ADC Trigger on Timer C compare 2U */
  1593. #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP3 (HRTIM_ADC2R_AD2TCC3) /*!< ADC Trigger on Timer C compare 3U */
  1594. #define HRTIM_ADCTRIGGEREVENT24_TIMERC_CMP4 (HRTIM_ADC2R_AD2TCC4) /*!< ADC Trigger on Timer C compare 4U */
  1595. #define HRTIM_ADCTRIGGEREVENT24_TIMERC_PERIOD (HRTIM_ADC2R_AD2TCPER) /*!< ADC Trigger on Timer C period */
  1596. #define HRTIM_ADCTRIGGEREVENT24_TIMERC_RESET (HRTIM_ADC2R_AD2TCRST) /*!< ADC Trigger on Timer C reset */
  1597. #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP2 (HRTIM_ADC2R_AD2TDC2) /*!< ADC Trigger on Timer D compare 2U */
  1598. #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP3 (HRTIM_ADC2R_AD2TDC3) /*!< ADC Trigger on Timer D compare 3U */
  1599. #define HRTIM_ADCTRIGGEREVENT24_TIMERD_CMP4 (HRTIM_ADC2R_AD2TDC4) /*!< ADC Trigger on Timer D compare 4U */
  1600. #define HRTIM_ADCTRIGGEREVENT24_TIMERD_PERIOD (HRTIM_ADC2R_AD2TDPER) /*!< ADC Trigger on Timer D period */
  1601. #define HRTIM_ADCTRIGGEREVENT24_TIMERD_RESET (HRTIM_ADC2R_AD2TDRST) /*!< ADC Trigger on Timer D reset */
  1602. #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP2 (HRTIM_ADC2R_AD2TEC2) /*!< ADC Trigger on Timer E compare 2U */
  1603. #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP3 (HRTIM_ADC2R_AD2TEC3) /*!< ADC Trigger on Timer E compare 3U */
  1604. #define HRTIM_ADCTRIGGEREVENT24_TIMERE_CMP4 (HRTIM_ADC2R_AD2TEC4) /*!< ADC Trigger on Timer E compare 4U */
  1605. #define HRTIM_ADCTRIGGEREVENT24_TIMERE_RESET (HRTIM_ADC2R_AD2TERST) /*!< ADC Trigger on Timer E reset */
  1606. /**
  1607. * @}
  1608. */
  1609. /** @defgroup HRTIM_DLL_Calibration_Rate HRTIM DLL Calibration Rate
  1610. * @{
  1611. * @brief Constants defining the DLL calibration periods (in micro seconds)
  1612. */
  1613. #define HRTIM_SINGLE_CALIBRATION 0xFFFFFFFFU /*!< Non periodic DLL calibration */
  1614. #define HRTIM_CALIBRATIONRATE_7300 0x00000000U /*!< Periodic DLL calibration: T = 1048576U * tHRTIM (7.300 ms) */
  1615. #define HRTIM_CALIBRATIONRATE_910 (HRTIM_DLLCR_CALRTE_0) /*!< Periodic DLL calibration: T = 131072U * tHRTIM (0.910 ms) */
  1616. #define HRTIM_CALIBRATIONRATE_114 (HRTIM_DLLCR_CALRTE_1) /*!< Periodic DLL calibration: T = 16384U * tHRTIM (0.114 ms) */
  1617. #define HRTIM_CALIBRATIONRATE_14 (HRTIM_DLLCR_CALRTE_1 | HRTIM_DLLCR_CALRTE_0) /*!< Periodic DLL calibration: T = 2048U * tHRTIM (0.014 ms) */
  1618. /**
  1619. * @}
  1620. */
  1621. /** @defgroup HRTIM_Burst_DMA_Registers_Update HRTIM Burst DMA Registers Update
  1622. * @{
  1623. * @brief Constants defining the registers that can be written during a burst
  1624. * DMA operation
  1625. */
  1626. #define HRTIM_BURSTDMA_NONE 0x00000000U /*!< No register is updated by Burst DMA accesses */
  1627. #define HRTIM_BURSTDMA_CR (HRTIM_BDTUPR_TIMCR) /*!< MCR or TIMxCR register is updated by Burst DMA accesses */
  1628. #define HRTIM_BURSTDMA_ICR (HRTIM_BDTUPR_TIMICR) /*!< MICR or TIMxICR register is updated by Burst DMA accesses */
  1629. #define HRTIM_BURSTDMA_DIER (HRTIM_BDTUPR_TIMDIER) /*!< MDIER or TIMxDIER register is updated by Burst DMA accesses */
  1630. #define HRTIM_BURSTDMA_CNT (HRTIM_BDTUPR_TIMCNT) /*!< MCNTR or CNTxCR register is updated by Burst DMA accesses */
  1631. #define HRTIM_BURSTDMA_PER (HRTIM_BDTUPR_TIMPER) /*!< MPER or PERxR register is updated by Burst DMA accesses */
  1632. #define HRTIM_BURSTDMA_REP (HRTIM_BDTUPR_TIMREP) /*!< MREPR or REPxR register is updated by Burst DMA accesses */
  1633. #define HRTIM_BURSTDMA_CMP1 (HRTIM_BDTUPR_TIMCMP1) /*!< MCMP1R or CMP1xR register is updated by Burst DMA accesses */
  1634. #define HRTIM_BURSTDMA_CMP2 (HRTIM_BDTUPR_TIMCMP2) /*!< MCMP2R or CMP2xR register is updated by Burst DMA accesses */
  1635. #define HRTIM_BURSTDMA_CMP3 (HRTIM_BDTUPR_TIMCMP3) /*!< MCMP3R or CMP3xR register is updated by Burst DMA accesses */
  1636. #define HRTIM_BURSTDMA_CMP4 (HRTIM_BDTUPR_TIMCMP4) /*!< MCMP4R or CMP4xR register is updated by Burst DMA accesses */
  1637. #define HRTIM_BURSTDMA_DTR (HRTIM_BDTUPR_TIMDTR) /*!< TDxR register is updated by Burst DMA accesses */
  1638. #define HRTIM_BURSTDMA_SET1R (HRTIM_BDTUPR_TIMSET1R) /*!< SET1R register is updated by Burst DMA accesses */
  1639. #define HRTIM_BURSTDMA_RST1R (HRTIM_BDTUPR_TIMRST1R) /*!< RST1R register is updated by Burst DMA accesses */
  1640. #define HRTIM_BURSTDMA_SET2R (HRTIM_BDTUPR_TIMSET2R) /*!< SET2R register is updated by Burst DMA accesses */
  1641. #define HRTIM_BURSTDMA_RST2R (HRTIM_BDTUPR_TIMRST2R) /*!< RST1R register is updated by Burst DMA accesses */
  1642. #define HRTIM_BURSTDMA_EEFR1 (HRTIM_BDTUPR_TIMEEFR1) /*!< EEFxR1 register is updated by Burst DMA accesses */
  1643. #define HRTIM_BURSTDMA_EEFR2 (HRTIM_BDTUPR_TIMEEFR2) /*!< EEFxR2 register is updated by Burst DMA accesses */
  1644. #define HRTIM_BURSTDMA_RSTR (HRTIM_BDTUPR_TIMRSTR) /*!< RSTxR register is updated by Burst DMA accesses */
  1645. #define HRTIM_BURSTDMA_CHPR (HRTIM_BDTUPR_TIMCHPR) /*!< CHPxR register is updated by Burst DMA accesses */
  1646. #define HRTIM_BURSTDMA_OUTR (HRTIM_BDTUPR_TIMOUTR) /*!< OUTxR register is updated by Burst DMA accesses */
  1647. #define HRTIM_BURSTDMA_FLTR (HRTIM_BDTUPR_TIMFLTR) /*!< FLTxR register is updated by Burst DMA accesses */
  1648. /**
  1649. * @}
  1650. */
  1651. /** @defgroup HRTIM_Burst_Mode_Control HRTIM Burst Mode Control
  1652. * @{
  1653. * @brief Constants used to enable or disable the burst mode controller
  1654. */
  1655. #define HRTIM_BURSTMODECTL_DISABLED 0x00000000U /*!< Burst mode disabled */
  1656. #define HRTIM_BURSTMODECTL_ENABLED (HRTIM_BMCR_BME) /*!< Burst mode enabled */
  1657. /**
  1658. * @}
  1659. */
  1660. /** @defgroup HRTIM_Fault_Mode_Control HRTIM Fault Mode Control
  1661. * @{
  1662. * @brief Constants used to enable or disable a fault channel
  1663. */
  1664. #define HRTIM_FAULTMODECTL_DISABLED 0x00000000U /*!< Fault channel is disabled */
  1665. #define HRTIM_FAULTMODECTL_ENABLED 0x00000001U /*!< Fault channel is enabled */
  1666. /**
  1667. * @}
  1668. */
  1669. /** @defgroup HRTIM_Software_Timer_Update HRTIM Software Timer Update
  1670. * @{
  1671. * @brief Constants used to force timer registers update
  1672. */
  1673. #define HRTIM_TIMERUPDATE_MASTER (HRTIM_CR2_MSWU) /*!< Force an immediate transfer from the preload to the active register in the master timer */
  1674. #define HRTIM_TIMERUPDATE_A (HRTIM_CR2_TASWU) /*!< Force an immediate transfer from the preload to the active register in the timer A */
  1675. #define HRTIM_TIMERUPDATE_B (HRTIM_CR2_TBSWU) /*!< Force an immediate transfer from the preload to the active register in the timer B */
  1676. #define HRTIM_TIMERUPDATE_C (HRTIM_CR2_TCSWU) /*!< Force an immediate transfer from the preload to the active register in the timer C */
  1677. #define HRTIM_TIMERUPDATE_D (HRTIM_CR2_TDSWU) /*!< Force an immediate transfer from the preload to the active register in the timer D */
  1678. #define HRTIM_TIMERUPDATE_E (HRTIM_CR2_TESWU) /*!< Force an immediate transfer from the preload to the active register in the timer E */
  1679. /**
  1680. * @}
  1681. */
  1682. /** @defgroup HRTIM_Software_Timer_Reset HRTIM Software Timer Reset
  1683. * @{
  1684. * @brief Constants used to force timer counter reset
  1685. */
  1686. #define HRTIM_TIMERRESET_MASTER (HRTIM_CR2_MRST) /*!< Reset the master timer counter */
  1687. #define HRTIM_TIMERRESET_TIMER_A (HRTIM_CR2_TARST) /*!< Reset the timer A counter */
  1688. #define HRTIM_TIMERRESET_TIMER_B (HRTIM_CR2_TBRST) /*!< Reset the timer B counter */
  1689. #define HRTIM_TIMERRESET_TIMER_C (HRTIM_CR2_TCRST) /*!< Reset the timer C counter */
  1690. #define HRTIM_TIMERRESET_TIMER_D (HRTIM_CR2_TDRST) /*!< Reset the timer D counter */
  1691. #define HRTIM_TIMERRESET_TIMER_E (HRTIM_CR2_TERST) /*!< Reset the timer E counter */
  1692. /**
  1693. * @}
  1694. */
  1695. /** @defgroup HRTIM_Output_Level HRTIM Output Level
  1696. * @{
  1697. * @brief Constants defining the level of a timer output
  1698. */
  1699. #define HRTIM_OUTPUTLEVEL_ACTIVE (0x00000001U) /*!< Force the output to its active state */
  1700. #define HRTIM_OUTPUTLEVEL_INACTIVE (0x00000002U) /*!< Force the output to its inactive state */
  1701. #define IS_HRTIM_OUTPUTLEVEL(OUTPUTLEVEL)\
  1702. (((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_ACTIVE) || \
  1703. ((OUTPUTLEVEL) == HRTIM_OUTPUTLEVEL_INACTIVE))
  1704. /**
  1705. * @}
  1706. */
  1707. /** @defgroup HRTIM_Output_State HRTIM Output State
  1708. * @{
  1709. * @brief Constants defining the state of a timer output
  1710. */
  1711. #define HRTIM_OUTPUTSTATE_IDLE (0x00000001U) /*!< Main operating mode, where the output can take the active or
  1712. inactive level as programmed in the crossbar unit */
  1713. #define HRTIM_OUTPUTSTATE_RUN (0x00000002U) /*!< Default operating state (e.g. after an HRTIM reset, when the
  1714. outputs are disabled by software or during a burst mode operation */
  1715. #define HRTIM_OUTPUTSTATE_FAULT (0x00000003U) /*!< Safety state, entered in case of a shut-down request on
  1716. FAULTx inputs */
  1717. /**
  1718. * @}
  1719. */
  1720. /** @defgroup HRTIM_Burst_Mode_Status HRTIM Burst Mode Status
  1721. * @{
  1722. * @brief Constants defining the operating state of the burst mode controller
  1723. */
  1724. #define HRTIM_BURSTMODESTATUS_NORMAL 0x00000000U /*!< Normal operation */
  1725. #define HRTIM_BURSTMODESTATUS_ONGOING (HRTIM_BMCR_BMSTAT) /*!< Burst operation on-going */
  1726. /**
  1727. * @}
  1728. */
  1729. /** @defgroup HRTIM_Current_Push_Pull_Status HRTIM Current Push Pull Status
  1730. * @{
  1731. * @brief Constants defining on which output the signal is currently applied
  1732. * in push-pull mode
  1733. */
  1734. #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT1 0x00000000U /*!< Signal applied on output 1 and output 2 forced inactive */
  1735. #define HRTIM_PUSHPULL_CURRENTSTATUS_OUTPUT2 (HRTIM_TIMISR_CPPSTAT) /*!< Signal applied on output 2 and output 1 forced inactive */
  1736. /**
  1737. * @}
  1738. */
  1739. /** @defgroup HRTIM_Idle_Push_Pull_Status HRTIM Idle Push Pull Status
  1740. * @{
  1741. * @brief Constants defining on which output the signal was applied, in
  1742. * push-pull mode balanced fault mode or delayed idle mode, when the
  1743. * protection was triggered
  1744. */
  1745. #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT1 0x00000000U /*!< Protection occurred when the output 1 was active and output 2 forced inactive */
  1746. #define HRTIM_PUSHPULL_IDLESTATUS_OUTPUT2 (HRTIM_TIMISR_IPPSTAT) /*!< Protection occurred when the output 2 was active and output 1 forced inactive */
  1747. /**
  1748. * @}
  1749. */
  1750. /** @defgroup HRTIM_Common_Interrupt_Enable HRTIM Common Interrupt Enable
  1751. * @{
  1752. */
  1753. #define HRTIM_IT_NONE 0x00000000U /*!< No interrupt enabled */
  1754. #define HRTIM_IT_FLT1 HRTIM_IER_FLT1 /*!< Fault 1 interrupt enable */
  1755. #define HRTIM_IT_FLT2 HRTIM_IER_FLT2 /*!< Fault 2 interrupt enable */
  1756. #define HRTIM_IT_FLT3 HRTIM_IER_FLT3 /*!< Fault 3 interrupt enable */
  1757. #define HRTIM_IT_FLT4 HRTIM_IER_FLT4 /*!< Fault 4 interrupt enable */
  1758. #define HRTIM_IT_FLT5 HRTIM_IER_FLT5 /*!< Fault 5 interrupt enable */
  1759. #define HRTIM_IT_SYSFLT HRTIM_IER_SYSFLT /*!< System Fault interrupt enable */
  1760. #define HRTIM_IT_DLLRDY HRTIM_IER_DLLRDY /*!< DLL ready interrupt enable */
  1761. #define HRTIM_IT_BMPER HRTIM_IER_BMPER /*!< Burst mode period interrupt enable */
  1762. /**
  1763. * @}
  1764. */
  1765. /** @defgroup HRTIM_Master_Interrupt_Enable HRTIM Master Interrupt Enable
  1766. * @{
  1767. */
  1768. #define HRTIM_MASTER_IT_NONE 0x00000000U /*!< No interrupt enabled */
  1769. #define HRTIM_MASTER_IT_MCMP1 HRTIM_MDIER_MCMP1IE /*!< Master compare 1 interrupt enable */
  1770. #define HRTIM_MASTER_IT_MCMP2 HRTIM_MDIER_MCMP2IE /*!< Master compare 2 interrupt enable */
  1771. #define HRTIM_MASTER_IT_MCMP3 HRTIM_MDIER_MCMP3IE /*!< Master compare 3 interrupt enable */
  1772. #define HRTIM_MASTER_IT_MCMP4 HRTIM_MDIER_MCMP4IE /*!< Master compare 4 interrupt enable */
  1773. #define HRTIM_MASTER_IT_MREP HRTIM_MDIER_MREPIE /*!< Master Repetition interrupt enable */
  1774. #define HRTIM_MASTER_IT_SYNC HRTIM_MDIER_SYNCIE /*!< Synchronization input interrupt enable */
  1775. #define HRTIM_MASTER_IT_MUPD HRTIM_MDIER_MUPDIE /*!< Master update interrupt enable */
  1776. /**
  1777. * @}
  1778. */
  1779. /** @defgroup HRTIM_Timing_Unit_Interrupt_Enable HRTIM Timing Unit Interrupt Enable
  1780. * @{
  1781. */
  1782. #define HRTIM_TIM_IT_NONE 0x00000000U /*!< No interrupt enabled */
  1783. #define HRTIM_TIM_IT_CMP1 HRTIM_TIMDIER_CMP1IE /*!< Timer compare 1 interrupt enable */
  1784. #define HRTIM_TIM_IT_CMP2 HRTIM_TIMDIER_CMP2IE /*!< Timer compare 2 interrupt enable */
  1785. #define HRTIM_TIM_IT_CMP3 HRTIM_TIMDIER_CMP3IE /*!< Timer compare 3 interrupt enable */
  1786. #define HRTIM_TIM_IT_CMP4 HRTIM_TIMDIER_CMP4IE /*!< Timer compare 4 interrupt enable */
  1787. #define HRTIM_TIM_IT_REP HRTIM_TIMDIER_REPIE /*!< Timer repetition interrupt enable */
  1788. #define HRTIM_TIM_IT_UPD HRTIM_TIMDIER_UPDIE /*!< Timer update interrupt enable */
  1789. #define HRTIM_TIM_IT_CPT1 HRTIM_TIMDIER_CPT1IE /*!< Timer capture 1 interrupt enable */
  1790. #define HRTIM_TIM_IT_CPT2 HRTIM_TIMDIER_CPT2IE /*!< Timer capture 2 interrupt enable */
  1791. #define HRTIM_TIM_IT_SET1 HRTIM_TIMDIER_SET1IE /*!< Timer output 1 set interrupt enable */
  1792. #define HRTIM_TIM_IT_RST1 HRTIM_TIMDIER_RST1IE /*!< Timer output 1 reset interrupt enable */
  1793. #define HRTIM_TIM_IT_SET2 HRTIM_TIMDIER_SET2IE /*!< Timer output 2 set interrupt enable */
  1794. #define HRTIM_TIM_IT_RST2 HRTIM_TIMDIER_RST2IE /*!< Timer output 2 reset interrupt enable */
  1795. #define HRTIM_TIM_IT_RST HRTIM_TIMDIER_RSTIE /*!< Timer reset interrupt enable */
  1796. #define HRTIM_TIM_IT_DLYPRT HRTIM_TIMDIER_DLYPRTIE /*!< Timer delay protection interrupt enable */
  1797. /**
  1798. * @}
  1799. */
  1800. /** @defgroup HRTIM_Common_Interrupt_Flag HRTIM Common Interrupt Flag
  1801. * @{
  1802. */
  1803. #define HRTIM_FLAG_FLT1 HRTIM_ISR_FLT1 /*!< Fault 1 interrupt flag */
  1804. #define HRTIM_FLAG_FLT2 HRTIM_ISR_FLT2 /*!< Fault 2 interrupt flag */
  1805. #define HRTIM_FLAG_FLT3 HRTIM_ISR_FLT3 /*!< Fault 3 interrupt flag */
  1806. #define HRTIM_FLAG_FLT4 HRTIM_ISR_FLT4 /*!< Fault 4 interrupt flag */
  1807. #define HRTIM_FLAG_FLT5 HRTIM_ISR_FLT5 /*!< Fault 5 interrupt flag */
  1808. #define HRTIM_FLAG_SYSFLT HRTIM_ISR_SYSFLT /*!< System Fault interrupt flag */
  1809. #define HRTIM_FLAG_DLLRDY HRTIM_ISR_DLLRDY /*!< DLL ready interrupt flag */
  1810. #define HRTIM_FLAG_BMPER HRTIM_ISR_BMPER /*!< Burst mode period interrupt flag */
  1811. /**
  1812. * @}
  1813. */
  1814. /** @defgroup HRTIM_Master_Interrupt_Flag HRTIM Master Interrupt Flag
  1815. * @{
  1816. */
  1817. #define HRTIM_MASTER_FLAG_MCMP1 HRTIM_MISR_MCMP1 /*!< Master compare 1 interrupt flag */
  1818. #define HRTIM_MASTER_FLAG_MCMP2 HRTIM_MISR_MCMP2 /*!< Master compare 2 interrupt flag */
  1819. #define HRTIM_MASTER_FLAG_MCMP3 HRTIM_MISR_MCMP3 /*!< Master compare 3 interrupt flag */
  1820. #define HRTIM_MASTER_FLAG_MCMP4 HRTIM_MISR_MCMP4 /*!< Master compare 4 interrupt flag */
  1821. #define HRTIM_MASTER_FLAG_MREP HRTIM_MISR_MREP /*!< Master Repetition interrupt flag */
  1822. #define HRTIM_MASTER_FLAG_SYNC HRTIM_MISR_SYNC /*!< Synchronization input interrupt flag */
  1823. #define HRTIM_MASTER_FLAG_MUPD HRTIM_MISR_MUPD /*!< Master update interrupt flag */
  1824. /**
  1825. * @}
  1826. */
  1827. /** @defgroup HRTIM_Timing_Unit_Interrupt_Flag HRTIM Timing Unit Interrupt Flag
  1828. * @{
  1829. */
  1830. #define HRTIM_TIM_FLAG_CMP1 HRTIM_TIMISR_CMP1 /*!< Timer compare 1 interrupt flag */
  1831. #define HRTIM_TIM_FLAG_CMP2 HRTIM_TIMISR_CMP2 /*!< Timer compare 2 interrupt flag */
  1832. #define HRTIM_TIM_FLAG_CMP3 HRTIM_TIMISR_CMP3 /*!< Timer compare 3 interrupt flag */
  1833. #define HRTIM_TIM_FLAG_CMP4 HRTIM_TIMISR_CMP4 /*!< Timer compare 4 interrupt flag */
  1834. #define HRTIM_TIM_FLAG_REP HRTIM_TIMISR_REP /*!< Timer repetition interrupt flag */
  1835. #define HRTIM_TIM_FLAG_UPD HRTIM_TIMISR_UPD /*!< Timer update interrupt flag */
  1836. #define HRTIM_TIM_FLAG_CPT1 HRTIM_TIMISR_CPT1 /*!< Timer capture 1 interrupt flag */
  1837. #define HRTIM_TIM_FLAG_CPT2 HRTIM_TIMISR_CPT2 /*!< Timer capture 2 interrupt flag */
  1838. #define HRTIM_TIM_FLAG_SET1 HRTIM_TIMISR_SET1 /*!< Timer output 1 set interrupt flag */
  1839. #define HRTIM_TIM_FLAG_RST1 HRTIM_TIMISR_RST1 /*!< Timer output 1 reset interrupt flag */
  1840. #define HRTIM_TIM_FLAG_SET2 HRTIM_TIMISR_SET2 /*!< Timer output 2 set interrupt flag */
  1841. #define HRTIM_TIM_FLAG_RST2 HRTIM_TIMISR_RST2 /*!< Timer output 2 reset interrupt flag */
  1842. #define HRTIM_TIM_FLAG_RST HRTIM_TIMISR_RST /*!< Timer reset interrupt flag */
  1843. #define HRTIM_TIM_FLAG_DLYPRT HRTIM_TIMISR_DLYPRT /*!< Timer delay protection interrupt flag */
  1844. /**
  1845. * @}
  1846. */
  1847. /** @defgroup HRTIM_Master_DMA_Request_Enable HRTIM Master DMA Request Enable
  1848. * @{
  1849. */
  1850. #define HRTIM_MASTER_DMA_NONE 0x00000000U /*!< No DMA request enable */
  1851. #define HRTIM_MASTER_DMA_MCMP1 HRTIM_MDIER_MCMP1DE /*!< Master compare 1 DMA request enable */
  1852. #define HRTIM_MASTER_DMA_MCMP2 HRTIM_MDIER_MCMP2DE /*!< Master compare 2 DMA request enable */
  1853. #define HRTIM_MASTER_DMA_MCMP3 HRTIM_MDIER_MCMP3DE /*!< Master compare 3 DMA request enable */
  1854. #define HRTIM_MASTER_DMA_MCMP4 HRTIM_MDIER_MCMP4DE /*!< Master compare 4 DMA request enable */
  1855. #define HRTIM_MASTER_DMA_MREP HRTIM_MDIER_MREPDE /*!< Master Repetition DMA request enable */
  1856. #define HRTIM_MASTER_DMA_SYNC HRTIM_MDIER_SYNCDE /*!< Synchronization input DMA request enable */
  1857. #define HRTIM_MASTER_DMA_MUPD HRTIM_MDIER_MUPDDE /*!< Master update DMA request enable */
  1858. /**
  1859. * @}
  1860. */
  1861. /** @defgroup HRTIM_Timing_Unit_DMA_Request_Enable HRTIM Timing Unit DMA Request Enable
  1862. * @{
  1863. */
  1864. #define HRTIM_TIM_DMA_NONE 0x00000000U /*!< No DMA request enable */
  1865. #define HRTIM_TIM_DMA_CMP1 HRTIM_TIMDIER_CMP1DE /*!< Timer compare 1 DMA request enable */
  1866. #define HRTIM_TIM_DMA_CMP2 HRTIM_TIMDIER_CMP2DE /*!< Timer compare 2 DMA request enable */
  1867. #define HRTIM_TIM_DMA_CMP3 HRTIM_TIMDIER_CMP3DE /*!< Timer compare 3 DMA request enable */
  1868. #define HRTIM_TIM_DMA_CMP4 HRTIM_TIMDIER_CMP4DE /*!< Timer compare 4 DMA request enable */
  1869. #define HRTIM_TIM_DMA_REP HRTIM_TIMDIER_REPDE /*!< Timer repetition DMA request enable */
  1870. #define HRTIM_TIM_DMA_UPD HRTIM_TIMDIER_UPDDE /*!< Timer update DMA request enable */
  1871. #define HRTIM_TIM_DMA_CPT1 HRTIM_TIMDIER_CPT1DE /*!< Timer capture 1 DMA request enable */
  1872. #define HRTIM_TIM_DMA_CPT2 HRTIM_TIMDIER_CPT2DE /*!< Timer capture 2 DMA request enable */
  1873. #define HRTIM_TIM_DMA_SET1 HRTIM_TIMDIER_SET1DE /*!< Timer output 1 set DMA request enable */
  1874. #define HRTIM_TIM_DMA_RST1 HRTIM_TIMDIER_RST1DE /*!< Timer output 1 reset DMA request enable */
  1875. #define HRTIM_TIM_DMA_SET2 HRTIM_TIMDIER_SET2DE /*!< Timer output 2 set DMA request enable */
  1876. #define HRTIM_TIM_DMA_RST2 HRTIM_TIMDIER_RST2DE /*!< Timer output 2 reset DMA request enable */
  1877. #define HRTIM_TIM_DMA_RST HRTIM_TIMDIER_RSTDE /*!< Timer reset DMA request enable */
  1878. #define HRTIM_TIM_DMA_DLYPRT HRTIM_TIMDIER_DLYPRTDE /*!< Timer delay protection DMA request enable */
  1879. /**
  1880. * @}
  1881. */
  1882. /**
  1883. * @}
  1884. */
  1885. /* Private macros --------------------------------------------------------*/
  1886. /** @addtogroup HRTIM_Private_Macros
  1887. * @{
  1888. */
  1889. #define IS_HRTIM_TIMERINDEX(TIMERINDEX)\
  1890. (((TIMERINDEX) == HRTIM_TIMERINDEX_MASTER) || \
  1891. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A) || \
  1892. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B) || \
  1893. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C) || \
  1894. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D) || \
  1895. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
  1896. #define IS_HRTIM_TIMING_UNIT(TIMERINDEX)\
  1897. (((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_A) || \
  1898. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_B) || \
  1899. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_C) || \
  1900. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_D) || \
  1901. ((TIMERINDEX) == HRTIM_TIMERINDEX_TIMER_E))
  1902. #define IS_HRTIM_TIMERID(TIMERID) (((TIMERID) & 0xFFC0FFFFU) == 0x00000000U)
  1903. #define IS_HRTIM_COMPAREUNIT(COMPAREUNIT)\
  1904. (((COMPAREUNIT) == HRTIM_COMPAREUNIT_1) || \
  1905. ((COMPAREUNIT) == HRTIM_COMPAREUNIT_2) || \
  1906. ((COMPAREUNIT) == HRTIM_COMPAREUNIT_3) || \
  1907. ((COMPAREUNIT) == HRTIM_COMPAREUNIT_4))
  1908. #define IS_HRTIM_CAPTUREUNIT(CAPTUREUNIT)\
  1909. (((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_1) || \
  1910. ((CAPTUREUNIT) == HRTIM_CAPTUREUNIT_2))
  1911. #define IS_HRTIM_OUTPUT(OUTPUT) (((OUTPUT) & 0xFFFFFC00U) == 0x00000000U)
  1912. #define IS_HRTIM_TIMER_OUTPUT(TIMER, OUTPUT)\
  1913. ((((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && \
  1914. (((OUTPUT) == HRTIM_OUTPUT_TA1) || \
  1915. ((OUTPUT) == HRTIM_OUTPUT_TA2))) \
  1916. || \
  1917. (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && \
  1918. (((OUTPUT) == HRTIM_OUTPUT_TB1) || \
  1919. ((OUTPUT) == HRTIM_OUTPUT_TB2))) \
  1920. || \
  1921. (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && \
  1922. (((OUTPUT) == HRTIM_OUTPUT_TC1) || \
  1923. ((OUTPUT) == HRTIM_OUTPUT_TC2))) \
  1924. || \
  1925. (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && \
  1926. (((OUTPUT) == HRTIM_OUTPUT_TD1) || \
  1927. ((OUTPUT) == HRTIM_OUTPUT_TD2))) \
  1928. || \
  1929. (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && \
  1930. (((OUTPUT) == HRTIM_OUTPUT_TE1) || \
  1931. ((OUTPUT) == HRTIM_OUTPUT_TE2))))
  1932. #define IS_HRTIM_EVENT(EVENT)\
  1933. (((EVENT) == HRTIM_EVENT_NONE)|| \
  1934. ((EVENT) == HRTIM_EVENT_1) || \
  1935. ((EVENT) == HRTIM_EVENT_2) || \
  1936. ((EVENT) == HRTIM_EVENT_3) || \
  1937. ((EVENT) == HRTIM_EVENT_4) || \
  1938. ((EVENT) == HRTIM_EVENT_5) || \
  1939. ((EVENT) == HRTIM_EVENT_6) || \
  1940. ((EVENT) == HRTIM_EVENT_7) || \
  1941. ((EVENT) == HRTIM_EVENT_8) || \
  1942. ((EVENT) == HRTIM_EVENT_9) || \
  1943. ((EVENT) == HRTIM_EVENT_10))
  1944. #define IS_HRTIM_FAULT(FAULT)\
  1945. (((FAULT) == HRTIM_FAULT_1) || \
  1946. ((FAULT) == HRTIM_FAULT_2) || \
  1947. ((FAULT) == HRTIM_FAULT_3) || \
  1948. ((FAULT) == HRTIM_FAULT_4) || \
  1949. ((FAULT) == HRTIM_FAULT_5))
  1950. #define IS_HRTIM_PRESCALERRATIO(PRESCALERRATIO)\
  1951. (((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL32) || \
  1952. ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL16) || \
  1953. ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL8) || \
  1954. ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL4) || \
  1955. ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_MUL2) || \
  1956. ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV1) || \
  1957. ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV2) || \
  1958. ((PRESCALERRATIO) == HRTIM_PRESCALERRATIO_DIV4))
  1959. #define IS_HRTIM_MODE(MODE)\
  1960. (((MODE) == HRTIM_MODE_CONTINUOUS) || \
  1961. ((MODE) == HRTIM_MODE_SINGLESHOT) || \
  1962. ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
  1963. #define IS_HRTIM_MODE_ONEPULSE(MODE)\
  1964. (((MODE) == HRTIM_MODE_SINGLESHOT) || \
  1965. ((MODE) == HRTIM_MODE_SINGLESHOT_RETRIGGERABLE))
  1966. #define IS_HRTIM_HALFMODE(HALFMODE)\
  1967. (((HALFMODE) == HRTIM_HALFMODE_DISABLED) || \
  1968. ((HALFMODE) == HRTIM_HALFMODE_ENABLED))
  1969. #define IS_HRTIM_SYNCSTART(SYNCSTART)\
  1970. (((SYNCSTART) == HRTIM_SYNCSTART_DISABLED) || \
  1971. ((SYNCSTART) == HRTIM_SYNCSTART_ENABLED))
  1972. #define IS_HRTIM_SYNCRESET(SYNCRESET)\
  1973. (((SYNCRESET) == HRTIM_SYNCRESET_DISABLED) || \
  1974. ((SYNCRESET) == HRTIM_SYNCRESET_ENABLED))
  1975. #define IS_HRTIM_DACSYNC(DACSYNC)\
  1976. (((DACSYNC) == HRTIM_DACSYNC_NONE) || \
  1977. ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_1) || \
  1978. ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_2) || \
  1979. ((DACSYNC) == HRTIM_DACSYNC_DACTRIGOUT_3))
  1980. #define IS_HRTIM_PRELOAD(PRELOAD)\
  1981. (((PRELOAD) == HRTIM_PRELOAD_DISABLED) || \
  1982. ((PRELOAD) == HRTIM_PRELOAD_ENABLED))
  1983. #define IS_HRTIM_UPDATEGATING_MASTER(UPDATEGATING)\
  1984. (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT) || \
  1985. ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST) || \
  1986. ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE))
  1987. #define IS_HRTIM_UPDATEGATING_TIM(UPDATEGATING)\
  1988. (((UPDATEGATING) == HRTIM_UPDATEGATING_INDEPENDENT) || \
  1989. ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST) || \
  1990. ((UPDATEGATING) == HRTIM_UPDATEGATING_DMABURST_UPDATE) || \
  1991. ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1) || \
  1992. ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2) || \
  1993. ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3) || \
  1994. ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN1_UPDATE) || \
  1995. ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN2_UPDATE) || \
  1996. ((UPDATEGATING) == HRTIM_UPDATEGATING_UPDEN3_UPDATE))
  1997. #define IS_HRTIM_TIMERBURSTMODE(MODE) \
  1998. (((MODE) == HRTIM_TIMERBURSTMODE_MAINTAINCLOCK) || \
  1999. ((MODE) == HRTIM_TIMERBURSTMODE_RESETCOUNTER))
  2000. #define IS_HRTIM_UPDATEONREPETITION(UPDATEONREPETITION) \
  2001. (((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_DISABLED) || \
  2002. ((UPDATEONREPETITION) == HRTIM_UPDATEONREPETITION_ENABLED))
  2003. #define IS_HRTIM_TIMPUSHPULLMODE(TIMPUSHPULLMODE)\
  2004. (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_DISABLED) || \
  2005. ((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED))
  2006. #define IS_HRTIM_TIMFAULTENABLE(TIMFAULTENABLE) (((TIMFAULTENABLE) & 0xFFFFFFE0U) == 0x00000000U)
  2007. #define IS_HRTIM_TIMFAULTLOCK(TIMFAULTLOCK)\
  2008. (((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READWRITE) || \
  2009. ((TIMFAULTLOCK) == HRTIM_TIMFAULTLOCK_READONLY))
  2010. #define IS_HRTIM_TIMDEADTIMEINSERTION(TIMPUSHPULLMODE, TIMDEADTIMEINSERTION)\
  2011. ((((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_DISABLED) && \
  2012. ((((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_DISABLED) || \
  2013. ((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_ENABLED)))) \
  2014. || \
  2015. (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED) && \
  2016. ((TIMDEADTIMEINSERTION) == HRTIM_TIMDEADTIMEINSERTION_DISABLED)))
  2017. #define IS_HRTIM_TIMDELAYEDPROTECTION(TIMPUSHPULLMODE, TIMDELAYEDPROTECTION)\
  2018. ((((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DISABLED) || \
  2019. ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_EEV6) || \
  2020. ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_EEV6) || \
  2021. ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV6) || \
  2022. ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT1_DEEV7) || \
  2023. ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDOUT2_DEEV7) || \
  2024. ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_DELAYEDBOTH_EEV7)) \
  2025. || \
  2026. (((TIMPUSHPULLMODE) == HRTIM_TIMPUSHPULLMODE_ENABLED) && \
  2027. (((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV6) || \
  2028. ((TIMDELAYEDPROTECTION) == HRTIM_TIMER_A_B_C_DELAYEDPROTECTION_BALANCED_EEV7))))
  2029. #define IS_HRTIM_TIMUPDATETRIGGER(TIMUPDATETRIGGER) (((TIMUPDATETRIGGER) & 0xFE07FFFFU) == 0x00000000U)
  2030. #define IS_HRTIM_TIMRESETTRIGGER(TIMRESETTRIGGER) (((TIMRESETTRIGGER) & 0x80000001U) == 0x00000000U)
  2031. #define IS_HRTIM_TIMUPDATEONRESET(TIMUPDATEONRESET) \
  2032. (((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_DISABLED) || \
  2033. ((TIMUPDATEONRESET) == HRTIM_TIMUPDATEONRESET_ENABLED))
  2034. #define IS_HRTIM_AUTODELAYEDMODE(AUTODELAYEDMODE)\
  2035. (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
  2036. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
  2037. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
  2038. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))
  2039. /* Auto delayed mode is only available for compare units 2 and 4U */
  2040. #define IS_HRTIM_COMPAREUNIT_AUTODELAYEDMODE(COMPAREUNIT, AUTODELAYEDMODE) \
  2041. ((((COMPAREUNIT) == HRTIM_COMPAREUNIT_2) && \
  2042. (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
  2043. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
  2044. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
  2045. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))) \
  2046. || \
  2047. (((COMPAREUNIT) == HRTIM_COMPAREUNIT_4) && \
  2048. (((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_REGULAR) || \
  2049. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_NOTIMEOUT) || \
  2050. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP1) || \
  2051. ((AUTODELAYEDMODE) == HRTIM_AUTODELAYEDMODE_AUTODELAYED_TIMEOUTCMP3))))
  2052. #define IS_HRTIM_OUTPUTPOLARITY(OUTPUTPOLARITY)\
  2053. (((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_HIGH) || \
  2054. ((OUTPUTPOLARITY) == HRTIM_OUTPUTPOLARITY_LOW))
  2055. #define IS_HRTIM_OUTPUTPULSE(OUTPUTPULSE) ((OUTPUTPULSE) <= 0x0000FFFFU)
  2056. #define IS_HRTIM_OUTPUTSET(OUTPUTSET)\
  2057. (((OUTPUTSET) == HRTIM_OUTPUTSET_NONE) || \
  2058. ((OUTPUTSET) == HRTIM_OUTPUTSET_RESYNC) || \
  2059. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMPER) || \
  2060. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP1) || \
  2061. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP2) || \
  2062. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP3) || \
  2063. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMCMP4) || \
  2064. ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERPER) || \
  2065. ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP1) || \
  2066. ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP2) || \
  2067. ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP3) || \
  2068. ((OUTPUTSET) == HRTIM_OUTPUTSET_MASTERCMP4) || \
  2069. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_1) || \
  2070. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_2) || \
  2071. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_3) || \
  2072. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_4) || \
  2073. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_5) || \
  2074. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_6) || \
  2075. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_7) || \
  2076. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_8) || \
  2077. ((OUTPUTSET) == HRTIM_OUTPUTSET_TIMEV_9) || \
  2078. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_1) || \
  2079. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_2) || \
  2080. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_3) || \
  2081. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_4) || \
  2082. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_5) || \
  2083. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_6) || \
  2084. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_7) || \
  2085. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_8) || \
  2086. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_9) || \
  2087. ((OUTPUTSET) == HRTIM_OUTPUTSET_EEV_10) || \
  2088. ((OUTPUTSET) == HRTIM_OUTPUTSET_UPDATE))
  2089. #define IS_HRTIM_OUTPUTRESET(OUTPUTRESET)\
  2090. (((OUTPUTRESET) == HRTIM_OUTPUTRESET_NONE) || \
  2091. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_RESYNC) || \
  2092. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMPER) || \
  2093. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP1) || \
  2094. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP2) || \
  2095. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP3) || \
  2096. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMCMP4) || \
  2097. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERPER) || \
  2098. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP1) || \
  2099. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP2) || \
  2100. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP3) || \
  2101. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_MASTERCMP4) || \
  2102. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_1) || \
  2103. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_2) || \
  2104. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_3) || \
  2105. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_4) || \
  2106. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_5) || \
  2107. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_6) || \
  2108. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_7) || \
  2109. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_8) || \
  2110. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_TIMEV_9) || \
  2111. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_1) || \
  2112. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_2) || \
  2113. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_3) || \
  2114. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_4) || \
  2115. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_5) || \
  2116. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_6) || \
  2117. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_7) || \
  2118. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_8) || \
  2119. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_9) || \
  2120. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_EEV_10) || \
  2121. ((OUTPUTRESET) == HRTIM_OUTPUTRESET_UPDATE))
  2122. #define IS_HRTIM_OUTPUTIDLEMODE(OUTPUTIDLEMODE)\
  2123. (((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_NONE) || \
  2124. ((OUTPUTIDLEMODE) == HRTIM_OUTPUTIDLEMODE_IDLE))
  2125. #define IS_HRTIM_OUTPUTIDLELEVEL(OUTPUTIDLELEVEL)\
  2126. (((OUTPUTIDLELEVEL) == HRTIM_OUTPUTIDLELEVEL_INACTIVE) || \
  2127. ((OUTPUTIDLELEVEL) == HRTIM_OUTPUTIDLELEVEL_ACTIVE))
  2128. #define IS_HRTIM_OUTPUTFAULTLEVEL(OUTPUTFAULTLEVEL)\
  2129. (((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_NONE) || \
  2130. ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_ACTIVE) || \
  2131. ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_INACTIVE) || \
  2132. ((OUTPUTFAULTLEVEL) == HRTIM_OUTPUTFAULTLEVEL_HIGHZ))
  2133. #define IS_HRTIM_OUTPUTCHOPPERMODE(OUTPUTCHOPPERMODE)\
  2134. (((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_DISABLED) || \
  2135. ((OUTPUTCHOPPERMODE) == HRTIM_OUTPUTCHOPPERMODE_ENABLED))
  2136. #define IS_HRTIM_OUTPUTBURSTMODEENTRY(OUTPUTBURSTMODEENTRY)\
  2137. (((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_REGULAR) || \
  2138. ((OUTPUTBURSTMODEENTRY) == HRTIM_OUTPUTBURSTMODEENTRY_DELAYED))
  2139. #define IS_HRTIM_TIMER_CAPTURETRIGGER(TIMER, CAPTURETRIGGER) \
  2140. (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_NONE) || \
  2141. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_UPDATE) || \
  2142. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_1) || \
  2143. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_2) || \
  2144. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_3) || \
  2145. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_4) || \
  2146. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_5) || \
  2147. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_6) || \
  2148. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_7) || \
  2149. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_8) || \
  2150. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_9) || \
  2151. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_EEV_10) \
  2152. || \
  2153. (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && \
  2154. (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
  2155. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
  2156. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
  2157. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
  2158. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
  2159. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
  2160. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
  2161. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
  2162. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
  2163. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
  2164. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
  2165. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
  2166. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
  2167. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
  2168. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
  2169. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
  2170. || \
  2171. (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && \
  2172. (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
  2173. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
  2174. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
  2175. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
  2176. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
  2177. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
  2178. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
  2179. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
  2180. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
  2181. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
  2182. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
  2183. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
  2184. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
  2185. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
  2186. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
  2187. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
  2188. || \
  2189. (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && \
  2190. (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
  2191. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
  2192. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
  2193. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
  2194. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
  2195. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
  2196. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
  2197. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
  2198. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
  2199. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
  2200. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
  2201. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2) || \
  2202. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
  2203. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
  2204. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
  2205. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
  2206. || \
  2207. (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && \
  2208. (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
  2209. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
  2210. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
  2211. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
  2212. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
  2213. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
  2214. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
  2215. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
  2216. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
  2217. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
  2218. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
  2219. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
  2220. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_SET) || \
  2221. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TE1_RESET) || \
  2222. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP1) || \
  2223. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERE_CMP2))) \
  2224. || \
  2225. (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && \
  2226. (((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_SET) || \
  2227. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TA1_RESET) || \
  2228. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP1) || \
  2229. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERA_CMP2) || \
  2230. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_SET) || \
  2231. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TB1_RESET) || \
  2232. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP1) || \
  2233. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERB_CMP2) || \
  2234. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_SET) || \
  2235. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TC1_RESET) || \
  2236. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP1) || \
  2237. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERC_CMP2) || \
  2238. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_SET) || \
  2239. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TD1_RESET) || \
  2240. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP1) || \
  2241. ((CAPTURETRIGGER) == HRTIM_CAPTURETRIGGER_TIMERD_CMP2))))
  2242. #define IS_HRTIM_TIMEVENTFILTER(TIMEVENTFILTER)\
  2243. (((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_NONE) || \
  2244. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP1) || \
  2245. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP2) || \
  2246. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP3) || \
  2247. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGCMP4) || \
  2248. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR1) || \
  2249. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR2) || \
  2250. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR3) || \
  2251. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR4) || \
  2252. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR5) || \
  2253. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR6) || \
  2254. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR7) || \
  2255. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_BLANKINGFLTR8) || \
  2256. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP2) || \
  2257. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGCMP3) || \
  2258. ((TIMEVENTFILTER) == HRTIM_TIMEVENTFILTER_WINDOWINGTIM))
  2259. #define IS_HRTIM_TIMEVENTLATCH(TIMEVENTLATCH)\
  2260. (((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_DISABLED) || \
  2261. ((TIMEVENTLATCH) == HRTIM_TIMEVENTLATCH_ENABLED))
  2262. #define IS_HRTIM_TIMDEADTIME_PRESCALERRATIO(PRESCALERRATIO)\
  2263. (((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL8) || \
  2264. ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL4) || \
  2265. ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_MUL2) || \
  2266. ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV1) || \
  2267. ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV2) || \
  2268. ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV4) || \
  2269. ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV8) || \
  2270. ((PRESCALERRATIO) == HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16))
  2271. #define IS_HRTIM_TIMDEADTIME_RISINGSIGN(RISINGSIGN)\
  2272. (((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE) || \
  2273. ((RISINGSIGN) == HRTIM_TIMDEADTIME_RISINGSIGN_NEGATIVE))
  2274. #define IS_HRTIM_TIMDEADTIME_RISINGLOCK(RISINGLOCK)\
  2275. (((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_WRITE) || \
  2276. ((RISINGLOCK) == HRTIM_TIMDEADTIME_RISINGLOCK_READONLY))
  2277. #define IS_HRTIM_TIMDEADTIME_RISINGSIGNLOCK(RISINGSIGNLOCK)\
  2278. (((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_WRITE) || \
  2279. ((RISINGSIGNLOCK) == HRTIM_TIMDEADTIME_RISINGSIGNLOCK_READONLY))
  2280. #define IS_HRTIM_TIMDEADTIME_FALLINGSIGN(FALLINGSIGN)\
  2281. (((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE) || \
  2282. ((FALLINGSIGN) == HRTIM_TIMDEADTIME_FALLINGSIGN_NEGATIVE))
  2283. #define IS_HRTIM_TIMDEADTIME_FALLINGLOCK(FALLINGLOCK)\
  2284. (((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_WRITE) || \
  2285. ((FALLINGLOCK) == HRTIM_TIMDEADTIME_FALLINGLOCK_READONLY))
  2286. #define IS_HRTIM_TIMDEADTIME_FALLINGSIGNLOCK(FALLINGSIGNLOCK)\
  2287. (((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_WRITE) || \
  2288. ((FALLINGSIGNLOCK) == HRTIM_TIMDEADTIME_FALLINGSIGNLOCK_READONLY))
  2289. #define IS_HRTIM_CHOPPER_PRESCALERRATIO(PRESCALERRATIO)\
  2290. (((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV16) || \
  2291. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV32) || \
  2292. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV48) || \
  2293. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV64) || \
  2294. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV80) || \
  2295. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV96) || \
  2296. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV112) || \
  2297. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV128) || \
  2298. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV144) || \
  2299. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV160) || \
  2300. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV176) || \
  2301. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV192) || \
  2302. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV208) || \
  2303. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV224) || \
  2304. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV240) || \
  2305. ((PRESCALERRATIO) == HRTIM_CHOPPER_PRESCALERRATIO_DIV256))
  2306. #define IS_HRTIM_CHOPPER_DUTYCYCLE(DUTYCYCLE)\
  2307. (((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_0) || \
  2308. ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_125) || \
  2309. ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_250) || \
  2310. ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_375) || \
  2311. ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_500) || \
  2312. ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_625) || \
  2313. ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_750) || \
  2314. ((DUTYCYCLE) == HRTIM_CHOPPER_DUTYCYCLE_875))
  2315. #define IS_HRTIM_CHOPPER_PULSEWIDTH(PULSEWIDTH)\
  2316. (((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_16) || \
  2317. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_32) || \
  2318. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_48) || \
  2319. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_64) || \
  2320. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_80) || \
  2321. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_96) || \
  2322. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_112) || \
  2323. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_128) || \
  2324. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_144) || \
  2325. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_160) || \
  2326. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_176) || \
  2327. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_192) || \
  2328. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_208) || \
  2329. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_224) || \
  2330. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_240) || \
  2331. ((PULSEWIDTH) == HRTIM_CHOPPER_PULSEWIDTH_256))
  2332. #define IS_HRTIM_SYNCINPUTSOURCE(SYNCINPUTSOURCE)\
  2333. (((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_NONE) || \
  2334. ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_INTERNALEVENT) || \
  2335. ((SYNCINPUTSOURCE) == HRTIM_SYNCINPUTSOURCE_EXTERNALEVENT))
  2336. #define IS_HRTIM_SYNCOUTPUTSOURCE(SYNCOUTPUTSOURCE)\
  2337. (((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_START) || \
  2338. ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_MASTER_CMP1) || \
  2339. ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_START) || \
  2340. ((SYNCOUTPUTSOURCE) == HRTIM_SYNCOUTPUTSOURCE_TIMA_CMP1))
  2341. #define IS_HRTIM_SYNCOUTPUTPOLARITY(SYNCOUTPUTPOLARITY)\
  2342. (((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NONE) || \
  2343. ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_POSITIVE) || \
  2344. ((SYNCOUTPUTPOLARITY) == HRTIM_SYNCOUTPUTPOLARITY_NEGATIVE))
  2345. #define IS_HRTIM_EVENTSRC(EVENTSRC)\
  2346. (((EVENTSRC) == HRTIM_EVENTSRC_1) || \
  2347. ((EVENTSRC) == HRTIM_EVENTSRC_2) || \
  2348. ((EVENTSRC) == HRTIM_EVENTSRC_3) || \
  2349. ((EVENTSRC) == HRTIM_EVENTSRC_4))
  2350. #define IS_HRTIM_EVENTPOLARITY(EVENTSENSITIVITY, EVENTPOLARITY)\
  2351. ((((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_LEVEL) && \
  2352. (((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_HIGH) || \
  2353. ((EVENTPOLARITY) == HRTIM_EVENTPOLARITY_LOW))) \
  2354. || \
  2355. (((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_RISINGEDGE) || \
  2356. ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_FALLINGEDGE)|| \
  2357. ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_BOTHEDGES)))
  2358. #define IS_HRTIM_EVENTSENSITIVITY(EVENTSENSITIVITY)\
  2359. (((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_LEVEL) || \
  2360. ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_RISINGEDGE) || \
  2361. ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_FALLINGEDGE) || \
  2362. ((EVENTSENSITIVITY) == HRTIM_EVENTSENSITIVITY_BOTHEDGES))
  2363. #define IS_HRTIM_EVENTFASTMODE(EVENT, FASTMODE)\
  2364. (((((EVENT) == HRTIM_EVENT_1) || \
  2365. ((EVENT) == HRTIM_EVENT_2) || \
  2366. ((EVENT) == HRTIM_EVENT_3) || \
  2367. ((EVENT) == HRTIM_EVENT_4) || \
  2368. ((EVENT) == HRTIM_EVENT_5)) && \
  2369. (((FASTMODE) == HRTIM_EVENTFASTMODE_ENABLE) || \
  2370. ((FASTMODE) == HRTIM_EVENTFASTMODE_DISABLE))) \
  2371. || \
  2372. (((EVENT) == HRTIM_EVENT_6) || \
  2373. ((EVENT) == HRTIM_EVENT_7) || \
  2374. ((EVENT) == HRTIM_EVENT_8) || \
  2375. ((EVENT) == HRTIM_EVENT_9) || \
  2376. ((EVENT) == HRTIM_EVENT_10)))
  2377. #define IS_HRTIM_EVENTFILTER(EVENT, FILTER)\
  2378. ((((EVENT) == HRTIM_EVENT_1) || \
  2379. ((EVENT) == HRTIM_EVENT_2) || \
  2380. ((EVENT) == HRTIM_EVENT_3) || \
  2381. ((EVENT) == HRTIM_EVENT_4) || \
  2382. ((EVENT) == HRTIM_EVENT_5)) \
  2383. || \
  2384. ((((EVENT) == HRTIM_EVENT_6) || \
  2385. ((EVENT) == HRTIM_EVENT_7) || \
  2386. ((EVENT) == HRTIM_EVENT_8) || \
  2387. ((EVENT) == HRTIM_EVENT_9) || \
  2388. ((EVENT) == HRTIM_EVENT_10)) && \
  2389. (((FILTER) == HRTIM_EVENTFILTER_NONE) || \
  2390. ((FILTER) == HRTIM_EVENTFILTER_1) || \
  2391. ((FILTER) == HRTIM_EVENTFILTER_2) || \
  2392. ((FILTER) == HRTIM_EVENTFILTER_3) || \
  2393. ((FILTER) == HRTIM_EVENTFILTER_4) || \
  2394. ((FILTER) == HRTIM_EVENTFILTER_5) || \
  2395. ((FILTER) == HRTIM_EVENTFILTER_6) || \
  2396. ((FILTER) == HRTIM_EVENTFILTER_7) || \
  2397. ((FILTER) == HRTIM_EVENTFILTER_8) || \
  2398. ((FILTER) == HRTIM_EVENTFILTER_9) || \
  2399. ((FILTER) == HRTIM_EVENTFILTER_10) || \
  2400. ((FILTER) == HRTIM_EVENTFILTER_11) || \
  2401. ((FILTER) == HRTIM_EVENTFILTER_12) || \
  2402. ((FILTER) == HRTIM_EVENTFILTER_13) || \
  2403. ((FILTER) == HRTIM_EVENTFILTER_14) || \
  2404. ((FILTER) == HRTIM_EVENTFILTER_15))))
  2405. #define IS_HRTIM_EVENTPRESCALER(EVENTPRESCALER)\
  2406. (((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV1) || \
  2407. ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV2) || \
  2408. ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV4) || \
  2409. ((EVENTPRESCALER) == HRTIM_EVENTPRESCALER_DIV8))
  2410. #define IS_HRTIM_FAULTSOURCE(FAULTSOURCE)\
  2411. (((FAULTSOURCE) == HRTIM_FAULTSOURCE_DIGITALINPUT) || \
  2412. ((FAULTSOURCE) == HRTIM_FAULTSOURCE_INTERNAL))
  2413. #define IS_HRTIM_FAULTPOLARITY(HRTIM_FAULTPOLARITY)\
  2414. (((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_LOW) || \
  2415. ((HRTIM_FAULTPOLARITY) == HRTIM_FAULTPOLARITY_HIGH))
  2416. #define IS_HRTIM_FAULTMODECTL(FAULTMODECTL)\
  2417. (((FAULTMODECTL) == HRTIM_FAULTMODECTL_DISABLED) || \
  2418. ((FAULTMODECTL) == HRTIM_FAULTMODECTL_ENABLED))
  2419. #define IS_HRTIM_FAULTFILTER(FAULTFILTER)\
  2420. (((FAULTFILTER) == HRTIM_FAULTFILTER_NONE) || \
  2421. ((FAULTFILTER) == HRTIM_FAULTFILTER_1) || \
  2422. ((FAULTFILTER) == HRTIM_FAULTFILTER_2) || \
  2423. ((FAULTFILTER) == HRTIM_FAULTFILTER_3) || \
  2424. ((FAULTFILTER) == HRTIM_FAULTFILTER_4) || \
  2425. ((FAULTFILTER) == HRTIM_FAULTFILTER_5) || \
  2426. ((FAULTFILTER) == HRTIM_FAULTFILTER_6) || \
  2427. ((FAULTFILTER) == HRTIM_FAULTFILTER_7) || \
  2428. ((FAULTFILTER) == HRTIM_FAULTFILTER_8) || \
  2429. ((FAULTFILTER) == HRTIM_FAULTFILTER_9) || \
  2430. ((FAULTFILTER) == HRTIM_FAULTFILTER_10) || \
  2431. ((FAULTFILTER) == HRTIM_FAULTFILTER_11) || \
  2432. ((FAULTFILTER) == HRTIM_FAULTFILTER_12) || \
  2433. ((FAULTFILTER) == HRTIM_FAULTFILTER_13) || \
  2434. ((FAULTFILTER) == HRTIM_FAULTFILTER_14) || \
  2435. ((FAULTFILTER) == HRTIM_FAULTFILTER_15))
  2436. #define IS_HRTIM_FAULTLOCK(FAULTLOCK)\
  2437. (((FAULTLOCK) == HRTIM_FAULTLOCK_READWRITE) || \
  2438. ((FAULTLOCK) == HRTIM_FAULTLOCK_READONLY))
  2439. #define IS_HRTIM_FAULTPRESCALER(FAULTPRESCALER)\
  2440. (((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV1) || \
  2441. ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV2) || \
  2442. ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV4) || \
  2443. ((FAULTPRESCALER) == HRTIM_FAULTPRESCALER_DIV8))
  2444. #define IS_HRTIM_BURSTMODE(BURSTMODE)\
  2445. (((BURSTMODE) == HRTIM_BURSTMODE_SINGLESHOT) || \
  2446. ((BURSTMODE) == HRTIM_BURSTMODE_CONTINOUS))
  2447. #define IS_HRTIM_BURSTMODECLOCKSOURCE(BURSTMODECLOCKSOURCE)\
  2448. (((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_MASTER) || \
  2449. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_A) || \
  2450. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_B) || \
  2451. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_C) || \
  2452. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_D) || \
  2453. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIMER_E) || \
  2454. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM16_OC) || \
  2455. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM17_OC) || \
  2456. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_TIM7_TRGO) || \
  2457. ((BURSTMODECLOCKSOURCE) == HRTIM_BURSTMODECLOCKSOURCE_FHRTIM))
  2458. #define IS_HRTIM_HRTIM_BURSTMODEPRESCALER(BURSTMODEPRESCALER)\
  2459. (((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1) || \
  2460. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2) || \
  2461. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4) || \
  2462. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8) || \
  2463. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16) || \
  2464. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32) || \
  2465. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV64) || \
  2466. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV128) || \
  2467. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV256) || \
  2468. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV512) || \
  2469. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV1024) || \
  2470. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV2048) || \
  2471. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV4096) || \
  2472. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV8192) || \
  2473. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV16384) || \
  2474. ((BURSTMODEPRESCALER) == HRTIM_BURSTMODEPRESCALER_DIV32768))
  2475. #define IS_HRTIM_BURSTMODEPRELOAD(BURSTMODEPRELOAD)\
  2476. (((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_DISABLED) || \
  2477. ((BURSTMODEPRELOAD) == HRIM_BURSTMODEPRELOAD_ENABLED))
  2478. #define IS_HRTIM_BURSTMODETRIGGER(BURSTMODETRIGGER)\
  2479. (((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_NONE) || \
  2480. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_RESET) || \
  2481. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_REPETITION) || \
  2482. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP1) || \
  2483. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP2) || \
  2484. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP3) || \
  2485. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_MASTER_CMP4) || \
  2486. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_RESET) || \
  2487. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_REPETITION) || \
  2488. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_CMP1) || \
  2489. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_CMP2) || \
  2490. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_RESET) || \
  2491. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_REPETITION) || \
  2492. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_CMP1) || \
  2493. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERB_CMP2) || \
  2494. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_RESET) || \
  2495. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_REPETITION) || \
  2496. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_CMP1) || \
  2497. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERC_CMP2) || \
  2498. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_RESET) || \
  2499. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_REPETITION) || \
  2500. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_CMP1) || \
  2501. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_CMP2) || \
  2502. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_RESET) || \
  2503. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_REPETITION) || \
  2504. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_CMP1) || \
  2505. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERE_CMP2) || \
  2506. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERA_EVENT7) || \
  2507. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_TIMERD_EVENT8) || \
  2508. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_7) || \
  2509. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_8) || \
  2510. ((BURSTMODETRIGGER) == HRTIM_BURSTMODETRIGGER_EVENT_ONCHIP))
  2511. #define IS_HRTIM_ADCTRIGGERUPDATE(ADCTRIGGERUPDATE)\
  2512. (((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_MASTER) || \
  2513. ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_A) || \
  2514. ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_B) || \
  2515. ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_C) || \
  2516. ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_D) || \
  2517. ((ADCTRIGGERUPDATE) == HRTIM_ADCTRIGGERUPDATE_TIMER_E))
  2518. #define IS_HRTIM_CALIBRATIONRATE(CALIBRATIONRATE)\
  2519. (((CALIBRATIONRATE) == HRTIM_SINGLE_CALIBRATION) || \
  2520. ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_7300) || \
  2521. ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_910) || \
  2522. ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_114) || \
  2523. ((CALIBRATIONRATE) == HRTIM_CALIBRATIONRATE_14))
  2524. #define IS_HRTIM_TIMER_BURSTDMA(TIMER, BURSTDMA) \
  2525. ((((TIMER) == HRTIM_TIMERINDEX_MASTER) && (((BURSTDMA) & 0xFFFFC000U) == 0x00000000U)) \
  2526. || (((TIMER) == HRTIM_TIMERINDEX_TIMER_A) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
  2527. || (((TIMER) == HRTIM_TIMERINDEX_TIMER_B) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
  2528. || (((TIMER) == HRTIM_TIMERINDEX_TIMER_C) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
  2529. || (((TIMER) == HRTIM_TIMERINDEX_TIMER_D) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)) \
  2530. || (((TIMER) == HRTIM_TIMERINDEX_TIMER_E) && (((BURSTDMA) & 0xFFE00000U) == 0x00000000U)))
  2531. #define IS_HRTIM_BURSTMODECTL(BURSTMODECTL)\
  2532. (((BURSTMODECTL) == HRTIM_BURSTMODECTL_DISABLED) || \
  2533. ((BURSTMODECTL) == HRTIM_BURSTMODECTL_ENABLED))
  2534. #define IS_HRTIM_TIMERUPDATE(TIMERUPDATE) (((TIMERUPDATE) & 0xFFFFFFC0U) == 0x00000000U)
  2535. #define IS_HRTIM_TIMERRESET(TIMERRESET) (((TIMERRESET) & 0xFFFFC0FFU) == 0x00000000U)
  2536. #define IS_HRTIM_IT(IT) (((IT) & 0xFFFCFFC0U) == 0x00000000U)
  2537. #define IS_HRTIM_MASTER_IT(MASTER_IT) (((MASTER_IT) & 0xFFFFFF80U) == 0x00000000U)
  2538. #define IS_HRTIM_TIM_IT(TIM_IT) (((TIM_IT) & 0xFFFF8020U) == 0x00000000U)
  2539. #define IS_HRTIM_MASTER_DMA(MASTER_DMA) (((MASTER_DMA) & 0xFF80FFFFU) == 0x00000000U)
  2540. #define IS_HRTIM_TIM_DMA(TIM_DMA) (((TIM_DMA) & 0x8020FFFFU) == 0x00000000U)
  2541. /**
  2542. * @}
  2543. */
  2544. /* Exported macros -----------------------------------------------------------*/
  2545. /** @defgroup HRTIM_Exported_Macros HRTIM Exported Macros
  2546. * @{
  2547. */
  2548. /** @brief Reset HRTIM handle state
  2549. * @param __HANDLE__ HRTIM handle.
  2550. * @retval None
  2551. */
  2552. #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
  2553. #define __HAL_HRTIM_RESET_HANDLE_STATE(__HANDLE__) do{ \
  2554. (__HANDLE__)->State = HAL_HRTIM_STATE_RESET; \
  2555. (__HANDLE__)->MspInitCallback = NULL; \
  2556. (__HANDLE__)->MspDeInitCallback = NULL; \
  2557. } while(0)
  2558. #else
  2559. #define __HAL_HRTIM_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_HRTIM_STATE_RESET)
  2560. #endif
  2561. /** @brief Enables or disables the timer counter(s)
  2562. * @param __HANDLE__ specifies the HRTIM Handle.
  2563. * @param __TIMERS__ timers to enable/disable
  2564. * This parameter can be any combinations of the following values:
  2565. * @arg HRTIM_TIMERID_MASTER: Master timer identifier
  2566. * @arg HRTIM_TIMERID_TIMER_A: Timer A identifier
  2567. * @arg HRTIM_TIMERID_TIMER_B: Timer B identifier
  2568. * @arg HRTIM_TIMERID_TIMER_C: Timer C identifier
  2569. * @arg HRTIM_TIMERID_TIMER_D: Timer D identifier
  2570. * @arg HRTIM_TIMERID_TIMER_E: Timer E identifier
  2571. * @retval None
  2572. */
  2573. #define __HAL_HRTIM_ENABLE(__HANDLE__, __TIMERS__) ((__HANDLE__)->Instance->sMasterRegs.MCR |= (__TIMERS__))
  2574. /* The counter of a timing unit is disabled only if all the timer outputs */
  2575. /* are disabled and no capture is configured */
  2576. #define HRTIM_TAOEN_MASK (HRTIM_OENR_TA2OEN | HRTIM_OENR_TA1OEN)
  2577. #define HRTIM_TBOEN_MASK (HRTIM_OENR_TB2OEN | HRTIM_OENR_TB1OEN)
  2578. #define HRTIM_TCOEN_MASK (HRTIM_OENR_TC2OEN | HRTIM_OENR_TC1OEN)
  2579. #define HRTIM_TDOEN_MASK (HRTIM_OENR_TD2OEN | HRTIM_OENR_TD1OEN)
  2580. #define HRTIM_TEOEN_MASK (HRTIM_OENR_TE2OEN | HRTIM_OENR_TE1OEN)
  2581. #define __HAL_HRTIM_DISABLE(__HANDLE__, __TIMERS__)\
  2582. do {\
  2583. if (((__TIMERS__) & HRTIM_TIMERID_MASTER) == HRTIM_TIMERID_MASTER)\
  2584. {\
  2585. ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_MASTER);\
  2586. }\
  2587. if (((__TIMERS__) & HRTIM_TIMERID_TIMER_A) == HRTIM_TIMERID_TIMER_A)\
  2588. {\
  2589. if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TAOEN_MASK) == (uint32_t)RESET)\
  2590. {\
  2591. ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_A);\
  2592. }\
  2593. }\
  2594. if (((__TIMERS__) & HRTIM_TIMERID_TIMER_B) == HRTIM_TIMERID_TIMER_B)\
  2595. {\
  2596. if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TBOEN_MASK) == (uint32_t)RESET)\
  2597. {\
  2598. ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_B);\
  2599. }\
  2600. }\
  2601. if (((__TIMERS__) & HRTIM_TIMERID_TIMER_C) == HRTIM_TIMERID_TIMER_C)\
  2602. {\
  2603. if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TCOEN_MASK) == (uint32_t)RESET)\
  2604. {\
  2605. ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_C);\
  2606. }\
  2607. }\
  2608. if (((__TIMERS__) & HRTIM_TIMERID_TIMER_D) == HRTIM_TIMERID_TIMER_D)\
  2609. {\
  2610. if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TDOEN_MASK) == (uint32_t)RESET)\
  2611. {\
  2612. ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_D);\
  2613. }\
  2614. }\
  2615. if (((__TIMERS__) & HRTIM_TIMERID_TIMER_E) == HRTIM_TIMERID_TIMER_E)\
  2616. {\
  2617. if (((__HANDLE__)->Instance->sCommonRegs.OENR & HRTIM_TEOEN_MASK) == (uint32_t)RESET)\
  2618. {\
  2619. ((__HANDLE__)->Instance->sMasterRegs.MCR &= ~HRTIM_TIMERID_TIMER_E);\
  2620. }\
  2621. }\
  2622. } while(0U)
  2623. /** @brief Enables or disables the specified HRTIM common interrupts.
  2624. * @param __HANDLE__ specifies the HRTIM Handle.
  2625. * @param __INTERRUPT__ specifies the interrupt source to enable or disable.
  2626. * This parameter can be one of the following values:
  2627. * @arg HRTIM_IT_FLT1: Fault 1 interrupt enable
  2628. * @arg HRTIM_IT_FLT2: Fault 2 interrupt enable
  2629. * @arg HRTIM_IT_FLT3: Fault 3 interrupt enable
  2630. * @arg HRTIM_IT_FLT4: Fault 4 interrupt enable
  2631. * @arg HRTIM_IT_FLT5: Fault 5 interrupt enable
  2632. * @arg HRTIM_IT_SYSFLT: System Fault interrupt enable
  2633. * @arg HRTIM_IT_DLLRDY: DLL ready interrupt enable
  2634. * @arg HRTIM_IT_BMPER: Burst mode period interrupt enable
  2635. * @retval None
  2636. */
  2637. #define __HAL_HRTIM_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sCommonRegs.IER |= (__INTERRUPT__))
  2638. #define __HAL_HRTIM_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sCommonRegs.IER &= ~(__INTERRUPT__))
  2639. /** @brief Enables or disables the specified HRTIM Master timer interrupts.
  2640. * @param __HANDLE__ specifies the HRTIM Handle.
  2641. * @param __INTERRUPT__ specifies the interrupt source to enable or disable.
  2642. * This parameter can be one of the following values:
  2643. * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
  2644. * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
  2645. * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
  2646. * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
  2647. * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
  2648. * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
  2649. * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
  2650. * @retval None
  2651. */
  2652. #define __HAL_HRTIM_MASTER_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sMasterRegs.MDIER |= (__INTERRUPT__))
  2653. #define __HAL_HRTIM_MASTER_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sMasterRegs.MDIER &= ~(__INTERRUPT__))
  2654. /** @brief Enables or disables the specified HRTIM Timerx interrupts.
  2655. * @param __HANDLE__ specifies the HRTIM Handle.
  2656. * @param __TIMER__ specified the timing unit (Timer A to E)
  2657. * @param __INTERRUPT__ specifies the interrupt source to enable or disable.
  2658. * This parameter can be one of the following values:
  2659. * @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt enable
  2660. * @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt enable
  2661. * @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt enable
  2662. * @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt enable
  2663. * @arg HRTIM_TIM_IT_REP: Timer repetition interrupt enable
  2664. * @arg HRTIM_TIM_IT_UPD: Timer update interrupt enable
  2665. * @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt enable
  2666. * @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt enable
  2667. * @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt enable
  2668. * @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt enable
  2669. * @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt enable
  2670. * @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt enable
  2671. * @arg HRTIM_TIM_IT_RST: Timer reset interrupt enable
  2672. * @arg HRTIM_TIM_IT_DLYPRT: Timer delay protection interrupt enable
  2673. * @retval None
  2674. */
  2675. #define __HAL_HRTIM_TIMER_ENABLE_IT(__HANDLE__, __TIMER__, __INTERRUPT__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER |= (__INTERRUPT__))
  2676. #define __HAL_HRTIM_TIMER_DISABLE_IT(__HANDLE__, __TIMER__, __INTERRUPT__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER &= ~(__INTERRUPT__))
  2677. /** @brief Checks if the specified HRTIM common interrupt source is enabled or disabled.
  2678. * @param __HANDLE__ specifies the HRTIM Handle.
  2679. * @param __INTERRUPT__ specifies the interrupt source to check.
  2680. * This parameter can be one of the following values:
  2681. * @arg HRTIM_IT_FLT1: Fault 1 interrupt enable
  2682. * @arg HRTIM_IT_FLT2: Fault 2 interrupt enable
  2683. * @arg HRTIM_IT_FLT3: Fault 3 enable
  2684. * @arg HRTIM_IT_FLT4: Fault 4 enable
  2685. * @arg HRTIM_IT_FLT5: Fault 5 enable
  2686. * @arg HRTIM_IT_SYSFLT: System Fault interrupt enable
  2687. * @arg HRTIM_IT_DLLRDY: DLL ready interrupt enable
  2688. * @arg HRTIM_IT_BMPER: Burst mode period interrupt enable
  2689. * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
  2690. */
  2691. #define __HAL_HRTIM_GET_ITSTATUS(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->sCommonRegs.IER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
  2692. /** @brief Checks if the specified HRTIM Master interrupt source is enabled or disabled.
  2693. * @param __HANDLE__ specifies the HRTIM Handle.
  2694. * @param __INTERRUPT__ specifies the interrupt source to check.
  2695. * This parameter can be one of the following values:
  2696. * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
  2697. * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
  2698. * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
  2699. * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
  2700. * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
  2701. * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
  2702. * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
  2703. * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
  2704. */
  2705. #define __HAL_HRTIM_MASTER_GET_ITSTATUS(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->sMasterRegs.MDIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
  2706. /** @brief Checks if the specified HRTIM Timerx interrupt source is enabled or disabled.
  2707. * @param __HANDLE__ specifies the HRTIM Handle.
  2708. * @param __TIMER__ specified the timing unit (Timer A to E)
  2709. * @param __INTERRUPT__ specifies the interrupt source to check.
  2710. * This parameter can be one of the following values:
  2711. * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt enable
  2712. * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt enable
  2713. * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt enable
  2714. * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt enable
  2715. * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt enable
  2716. * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt enable
  2717. * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt enable
  2718. * @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt enable
  2719. * @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt enable
  2720. * @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt enable
  2721. * @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt enable
  2722. * @arg HRTIM_TIM_IT_REP: Timer repetition interrupt enable
  2723. * @arg HRTIM_TIM_IT_UPD: Timer update interrupt enable
  2724. * @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt enable
  2725. * @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt enable
  2726. * @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt enable
  2727. * @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt enable
  2728. * @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt enable
  2729. * @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt enable
  2730. * @arg HRTIM_TIM_IT_RST: Timer reset interrupt enable
  2731. * @arg HRTIM_TIM_IT_DLYPRT: Timer delay protection interrupt enable
  2732. * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
  2733. */
  2734. #define __HAL_HRTIM_TIMER_GET_ITSTATUS(__HANDLE__, __TIMER__, __INTERRUPT__) ((((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
  2735. /** @brief Clears the specified HRTIM common pending flag.
  2736. * @param __HANDLE__ specifies the HRTIM Handle.
  2737. * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
  2738. * This parameter can be one of the following values:
  2739. * @arg HRTIM_IT_FLT1: Fault 1 interrupt clear flag
  2740. * @arg HRTIM_IT_FLT2: Fault 2 interrupt clear flag
  2741. * @arg HRTIM_IT_FLT3: Fault 3 clear flag
  2742. * @arg HRTIM_IT_FLT4: Fault 4 clear flag
  2743. * @arg HRTIM_IT_FLT5: Fault 5 clear flag
  2744. * @arg HRTIM_IT_SYSFLT: System Fault interrupt clear flag
  2745. * @arg HRTIM_IT_DLLRDY: DLL ready interrupt clear flag
  2746. * @arg HRTIM_IT_BMPER: Burst mode period interrupt clear flag
  2747. * @retval None
  2748. */
  2749. #define __HAL_HRTIM_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sCommonRegs.ICR = (__INTERRUPT__))
  2750. /** @brief Clears the specified HRTIM Master pending flag.
  2751. * @param __HANDLE__ specifies the HRTIM Handle.
  2752. * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
  2753. * This parameter can be one of the following values:
  2754. * @arg HRTIM_MASTER_IT_MCMP1: Master compare 1 interrupt clear flag
  2755. * @arg HRTIM_MASTER_IT_MCMP2: Master compare 2 interrupt clear flag
  2756. * @arg HRTIM_MASTER_IT_MCMP3: Master compare 3 interrupt clear flag
  2757. * @arg HRTIM_MASTER_IT_MCMP4: Master compare 4 interrupt clear flag
  2758. * @arg HRTIM_MASTER_IT_MREP: Master Repetition interrupt clear flag
  2759. * @arg HRTIM_MASTER_IT_SYNC: Synchronization input interrupt clear flag
  2760. * @arg HRTIM_MASTER_IT_MUPD: Master update interrupt clear flag
  2761. * @retval None
  2762. */
  2763. #define __HAL_HRTIM_MASTER_CLEAR_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->sMasterRegs.MICR = (__INTERRUPT__))
  2764. /** @brief Clears the specified HRTIM Timerx pending flag.
  2765. * @param __HANDLE__ specifies the HRTIM Handle.
  2766. * @param __TIMER__ specified the timing unit (Timer A to E)
  2767. * @param __INTERRUPT__ specifies the interrupt pending bit to clear.
  2768. * This parameter can be one of the following values:
  2769. * @arg HRTIM_TIM_IT_CMP1: Timer compare 1 interrupt clear flag
  2770. * @arg HRTIM_TIM_IT_CMP2: Timer compare 2 interrupt clear flag
  2771. * @arg HRTIM_TIM_IT_CMP3: Timer compare 3 interrupt clear flag
  2772. * @arg HRTIM_TIM_IT_CMP4: Timer compare 4 interrupt clear flag
  2773. * @arg HRTIM_TIM_IT_REP: Timer repetition interrupt clear flag
  2774. * @arg HRTIM_TIM_IT_UPD: Timer update interrupt clear flag
  2775. * @arg HRTIM_TIM_IT_CPT1: Timer capture 1 interrupt clear flag
  2776. * @arg HRTIM_TIM_IT_CPT2: Timer capture 2 interrupt clear flag
  2777. * @arg HRTIM_TIM_IT_SET1: Timer output 1 set interrupt clear flag
  2778. * @arg HRTIM_TIM_IT_RST1: Timer output 1 reset interrupt clear flag
  2779. * @arg HRTIM_TIM_IT_SET2: Timer output 2 set interrupt clear flag
  2780. * @arg HRTIM_TIM_IT_RST2: Timer output 2 reset interrupt clear flag
  2781. * @arg HRTIM_TIM_IT_RST: Timer reset interrupt clear flag
  2782. * @arg HRTIM_TIM_IT_DLYPRT: Timer output 1 delay protection interrupt clear flag
  2783. * @retval None
  2784. */
  2785. #define __HAL_HRTIM_TIMER_CLEAR_IT(__HANDLE__, __TIMER__, __INTERRUPT__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxICR = (__INTERRUPT__))
  2786. /* DMA HANDLING */
  2787. /** @brief Enables or disables the specified HRTIM Master timer DMA requests.
  2788. * @param __HANDLE__ specifies the HRTIM Handle.
  2789. * @param __DMA__ specifies the DMA request to enable or disable.
  2790. * This parameter can be one of the following values:
  2791. * @arg HRTIM_MASTER_DMA_MCMP1: Master compare 1 DMA request enable
  2792. * @arg HRTIM_MASTER_DMA_MCMP2: Master compare 2 DMA request enable
  2793. * @arg HRTIM_MASTER_DMA_MCMP3: Master compare 3 DMA request enable
  2794. * @arg HRTIM_MASTER_DMA_MCMP4: Master compare 4 DMA request enable
  2795. * @arg HRTIM_MASTER_DMA_MREP: Master Repetition DMA request enable
  2796. * @arg HRTIM_MASTER_DMA_SYNC: Synchronization input DMA request enable
  2797. * @arg HRTIM_MASTER_DMA_MUPD: Master update DMA request enable
  2798. * @retval None
  2799. */
  2800. #define __HAL_HRTIM_MASTER_ENABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->sMasterRegs.MDIER |= (__DMA__))
  2801. #define __HAL_HRTIM_MASTER_DISABLE_DMA(__HANDLE__, __DMA__) ((__HANDLE__)->Instance->sMasterRegs.MDIER &= ~(__DMA__))
  2802. /** @brief Enables or disables the specified HRTIM Timerx DMA requests.
  2803. * @param __HANDLE__ specifies the HRTIM Handle.
  2804. * @param __TIMER__ specified the timing unit (Timer A to E)
  2805. * @param __DMA__ specifies the DMA request to enable or disable.
  2806. * This parameter can be one of the following values:
  2807. * @arg HRTIM_TIM_DMA_CMP1: Timer compare 1 DMA request enable
  2808. * @arg HRTIM_TIM_DMA_CMP2: Timer compare 2 DMA request enable
  2809. * @arg HRTIM_TIM_DMA_CMP3: Timer compare 3 DMA request enable
  2810. * @arg HRTIM_TIM_DMA_CMP4: Timer compare 4 DMA request enable
  2811. * @arg HRTIM_TIM_DMA_REP: Timer repetition DMA request enable
  2812. * @arg HRTIM_TIM_DMA_UPD: Timer update DMA request enable
  2813. * @arg HRTIM_TIM_DMA_CPT1: Timer capture 1 DMA request enable
  2814. * @arg HRTIM_TIM_DMA_CPT2: Timer capture 2 DMA request enable
  2815. * @arg HRTIM_TIM_DMA_SET1: Timer output 1 set DMA request enable
  2816. * @arg HRTIM_TIM_DMA_RST1: Timer output 1 reset DMA request enable
  2817. * @arg HRTIM_TIM_DMA_SET2: Timer output 2 set DMA request enable
  2818. * @arg HRTIM_TIM_DMA_RST2: Timer output 2 reset DMA request enable
  2819. * @arg HRTIM_TIM_DMA_RST: Timer reset DMA request enable
  2820. * @arg HRTIM_TIM_DMA_DLYPRT: Timer delay protection DMA request enable
  2821. * @retval None
  2822. */
  2823. #define __HAL_HRTIM_TIMER_ENABLE_DMA(__HANDLE__, __TIMER__, __DMA__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER |= (__DMA__))
  2824. #define __HAL_HRTIM_TIMER_DISABLE_DMA(__HANDLE__, __TIMER__, __DMA__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxDIER &= ~(__DMA__))
  2825. #define __HAL_HRTIM_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->sCommonRegs.ISR & (__FLAG__)) == (__FLAG__))
  2826. #define __HAL_HRTIM_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->sCommonRegs.ICR = (__FLAG__))
  2827. #define __HAL_HRTIM_MASTER_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->sMasterRegs.MISR & (__FLAG__)) == (__FLAG__))
  2828. #define __HAL_HRTIM_MASTER_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->sMasterRegs.MICR = (__FLAG__))
  2829. #define __HAL_HRTIM_TIMER_GET_FLAG(__HANDLE__, __TIMER__, __FLAG__) (((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxISR & (__FLAG__)) == (__FLAG__))
  2830. #define __HAL_HRTIM_TIMER_CLEAR_FLAG(__HANDLE__, __TIMER__, __FLAG__) ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxICR = (__FLAG__))
  2831. /** @brief Sets the HRTIM timer Counter Register value on runtime
  2832. * @param __HANDLE__ HRTIM Handle.
  2833. * @param __TIMER__ HRTIM timer
  2834. * This parameter can be one of the following values:
  2835. * @arg 0x5 for master timer
  2836. * @arg 0x0 to 0x4 for timers A to E
  2837. * @param __COUNTER__ specifies the Counter Register new value.
  2838. * @retval None
  2839. */
  2840. #define __HAL_HRTIM_SETCOUNTER(__HANDLE__, __TIMER__, __COUNTER__) \
  2841. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCNTR = (__COUNTER__)) :\
  2842. ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CNTxR = (__COUNTER__)))
  2843. /** @brief Gets the HRTIM timer Counter Register value on runtime
  2844. * @param __HANDLE__ HRTIM Handle.
  2845. * @param __TIMER__ HRTIM timer
  2846. * This parameter can be one of the following values:
  2847. * @arg 0x5 for master timer
  2848. * @arg 0x0 to 0x4 for timers A to E
  2849. * @retval HRTIM timer Counter Register value
  2850. */
  2851. #define __HAL_HRTIM_GETCOUNTER(__HANDLE__, __TIMER__) \
  2852. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCNTR) :\
  2853. ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CNTxR))
  2854. /** @brief Sets the HRTIM timer Period value on runtime
  2855. * @param __HANDLE__ HRTIM Handle.
  2856. * @param __TIMER__ HRTIM timer
  2857. * This parameter can be one of the following values:
  2858. * @arg 0x5 for master timer
  2859. * @arg 0x0 to 0x4 for timers A to E
  2860. * @param __PERIOD__ specifies the Period Register new value.
  2861. * @retval None
  2862. */
  2863. #define __HAL_HRTIM_SETPERIOD(__HANDLE__, __TIMER__, __PERIOD__) \
  2864. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MPER = (__PERIOD__)) :\
  2865. ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].PERxR = (__PERIOD__)))
  2866. /** @brief Gets the HRTIM timer Period Register value on runtime
  2867. * @param __HANDLE__ HRTIM Handle.
  2868. * @param __TIMER__ HRTIM timer
  2869. * This parameter can be one of the following values:
  2870. * @arg 0x5 for master timer
  2871. * @arg 0x0 to 0x4 for timers A to E
  2872. * @retval timer Period Register
  2873. */
  2874. #define __HAL_HRTIM_GETPERIOD(__HANDLE__, __TIMER__) \
  2875. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MPER) :\
  2876. ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].PERxR))
  2877. /** @brief Sets the HRTIM timer clock prescaler value on runtime
  2878. * @param __HANDLE__ HRTIM Handle.
  2879. * @param __TIMER__ HRTIM timer
  2880. * This parameter can be one of the following values:
  2881. * @arg 0x5 for master timer
  2882. * @arg 0x0 to 0x4 for timers A to E
  2883. * @param __PRESCALER__ specifies the clock prescaler new value.
  2884. * This parameter can be one of the following values:
  2885. * @arg HRTIM_PRESCALERRATIO_MUL32: fHRCK: 4.608 GHz - Resolution: 217 ps - Min PWM frequency: 70.3 kHz (fHRTIM=144MHz)
  2886. * @arg HRTIM_PRESCALERRATIO_MUL16: fHRCK: 2.304 GHz - Resolution: 434 ps - Min PWM frequency: 35.1 KHz (fHRTIM=144MHz)
  2887. * @arg HRTIM_PRESCALERRATIO_MUL8: fHRCK: 1.152 GHz - Resolution: 868 ps - Min PWM frequency: 17.6 kHz (fHRTIM=144MHz)
  2888. * @arg HRTIM_PRESCALERRATIO_MUL4: fHRCK: 576 MHz - Resolution: 1.73 ns - Min PWM frequency: 8.8 kHz (fHRTIM=144MHz)
  2889. * @arg HRTIM_PRESCALERRATIO_MUL2: fHRCK: 288 MHz - Resolution: 3.47 ns - Min PWM frequency: 4.4 kHz (fHRTIM=144MHz)
  2890. * @arg HRTIM_PRESCALERRATIO_DIV1: fHRCK: 144 MHz - Resolution: 6.95 ns - Min PWM frequency: 2.2 kHz (fHRTIM=144MHz)
  2891. * @arg HRTIM_PRESCALERRATIO_DIV2: fHRCK: 72 MHz - Resolution: 13.88 ns- Min PWM frequency: 1.1 kHz (fHRTIM=144MHz)
  2892. * @arg HRTIM_PRESCALERRATIO_DIV4: fHRCK: 36 MHz - Resolution: 27.7 ns- Min PWM frequency: 550Hz (fHRTIM=144MHz)
  2893. * @retval None
  2894. */
  2895. #define __HAL_HRTIM_SETCLOCKPRESCALER(__HANDLE__, __TIMER__, __PRESCALER__) \
  2896. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? (MODIFY_REG((__HANDLE__)->Instance->sMasterRegs.MCR, HRTIM_MCR_CK_PSC, (__PRESCALER__))) :\
  2897. (MODIFY_REG((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxCR, HRTIM_TIMCR_CK_PSC, (__PRESCALER__))))
  2898. /** @brief Gets the HRTIM timer clock prescaler value on runtime
  2899. * @param __HANDLE__ HRTIM Handle.
  2900. * @param __TIMER__ HRTIM timer
  2901. * This parameter can be one of the following values:
  2902. * @arg 0x5 for master timer
  2903. * @arg 0x0 to 0x4 for timers A to E
  2904. * @retval timer clock prescaler value
  2905. */
  2906. #define __HAL_HRTIM_GETCLOCKPRESCALER(__HANDLE__, __TIMER__) \
  2907. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? ((__HANDLE__)->Instance->sMasterRegs.MCR & HRTIM_MCR_CK_PSC) :\
  2908. ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].TIMxCR & HRTIM_TIMCR_CK_PSC))
  2909. /** @brief Sets the HRTIM timer Compare Register value on runtime
  2910. * @param __HANDLE__ HRTIM Handle.
  2911. * @param __TIMER__ HRTIM timer
  2912. * This parameter can be one of the following values:
  2913. * @arg 0x0 to 0x4 for timers A to E
  2914. * @param __COMPAREUNIT__ timer compare unit
  2915. * This parameter can be one of the following values:
  2916. * @arg HRTIM_COMPAREUNIT_1: Compare unit 1
  2917. * @arg HRTIM_COMPAREUNIT_2: Compare unit 2
  2918. * @arg HRTIM_COMPAREUNIT_3: Compare unit 3
  2919. * @arg HRTIM_COMPAREUNIT_4: Compare unit 4
  2920. * @param __COMPARE__ specifies the Compare new value.
  2921. * @retval None
  2922. */
  2923. #define __HAL_HRTIM_SETCOMPARE(__HANDLE__, __TIMER__, __COMPAREUNIT__, __COMPARE__) \
  2924. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? \
  2925. (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP1R = (__COMPARE__)) :\
  2926. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP2R = (__COMPARE__)) :\
  2927. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP3R = (__COMPARE__)) :\
  2928. ((__HANDLE__)->Instance->sMasterRegs.MCMP4R = (__COMPARE__))) \
  2929. : \
  2930. (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP1xR = (__COMPARE__)) :\
  2931. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP2xR = (__COMPARE__)) :\
  2932. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP3xR = (__COMPARE__)) :\
  2933. ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP4xR = (__COMPARE__))))
  2934. /** @brief Gets the HRTIM timer Compare Register value on runtime
  2935. * @param __HANDLE__ HRTIM Handle.
  2936. * @param __TIMER__ HRTIM timer
  2937. * This parameter can be one of the following values:
  2938. * @arg 0x0 to 0x4 for timers A to E
  2939. * @param __COMPAREUNIT__ timer compare unit
  2940. * This parameter can be one of the following values:
  2941. * @arg HRTIM_COMPAREUNIT_1: Compare unit 1
  2942. * @arg HRTIM_COMPAREUNIT_2: Compare unit 2
  2943. * @arg HRTIM_COMPAREUNIT_3: Compare unit 3
  2944. * @arg HRTIM_COMPAREUNIT_4: Compare unit 4
  2945. * @retval Compare value
  2946. */
  2947. #define __HAL_HRTIM_GETCOMPARE(__HANDLE__, __TIMER__, __COMPAREUNIT__) \
  2948. (((__TIMER__) == HRTIM_TIMERINDEX_MASTER) ? \
  2949. (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP1R) :\
  2950. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP2R) :\
  2951. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sMasterRegs.MCMP3R) :\
  2952. ((__HANDLE__)->Instance->sMasterRegs.MCMP4R)) \
  2953. : \
  2954. (((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_1) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP1xR) :\
  2955. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_2) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP2xR) :\
  2956. ((__COMPAREUNIT__) == HRTIM_COMPAREUNIT_3) ? ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP3xR) :\
  2957. ((__HANDLE__)->Instance->sTimerxRegs[(__TIMER__)].CMP4xR)))
  2958. /**
  2959. * @}
  2960. */
  2961. /* Exported functions --------------------------------------------------------*/
  2962. /** @addtogroup HRTIM_Exported_Functions
  2963. * @{
  2964. */
  2965. /** @addtogroup HRTIM_Exported_Functions_Group1
  2966. * @{
  2967. */
  2968. /* Initialization and Configuration functions ********************************/
  2969. HAL_StatusTypeDef HAL_HRTIM_Init(HRTIM_HandleTypeDef *hhrtim);
  2970. HAL_StatusTypeDef HAL_HRTIM_DeInit (HRTIM_HandleTypeDef *hhrtim);
  2971. void HAL_HRTIM_MspInit(HRTIM_HandleTypeDef *hhrtim);
  2972. void HAL_HRTIM_MspDeInit(HRTIM_HandleTypeDef *hhrtim);
  2973. HAL_StatusTypeDef HAL_HRTIM_TimeBaseConfig(HRTIM_HandleTypeDef *hhrtim,
  2974. uint32_t TimerIdx,
  2975. const HRTIM_TimeBaseCfgTypeDef * pTimeBaseCfg);
  2976. HAL_StatusTypeDef HAL_HRTIM_DLLCalibrationStart(HRTIM_HandleTypeDef *hhrtim,
  2977. uint32_t CalibrationRate);
  2978. HAL_StatusTypeDef HAL_HRTIM_DLLCalibrationStart_IT(HRTIM_HandleTypeDef *hhrtim,
  2979. uint32_t CalibrationRate);
  2980. HAL_StatusTypeDef HAL_HRTIM_PollForDLLCalibration(HRTIM_HandleTypeDef *hhrtim,
  2981. uint32_t Timeout);
  2982. /**
  2983. * @}
  2984. */
  2985. /** @addtogroup HRTIM_Exported_Functions_Group2
  2986. * @{
  2987. */
  2988. /* Simple time base related functions *****************************************/
  2989. HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStart(HRTIM_HandleTypeDef *hhrtim,
  2990. uint32_t TimerIdx);
  2991. HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStop(HRTIM_HandleTypeDef *hhrtim,
  2992. uint32_t TimerIdx);
  2993. HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStart_IT(HRTIM_HandleTypeDef *hhrtim,
  2994. uint32_t TimerIdx);
  2995. HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStop_IT(HRTIM_HandleTypeDef *hhrtim,
  2996. uint32_t TimerIdx);
  2997. HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStart_DMA(HRTIM_HandleTypeDef *hhrtim,
  2998. uint32_t TimerIdx,
  2999. uint32_t SrcAddr,
  3000. uint32_t DestAddr,
  3001. uint32_t Length);
  3002. HAL_StatusTypeDef HAL_HRTIM_SimpleBaseStop_DMA(HRTIM_HandleTypeDef *hhrtim,
  3003. uint32_t TimerIdx);
  3004. /**
  3005. * @}
  3006. */
  3007. /** @addtogroup HRTIM_Exported_Functions_Group3
  3008. * @{
  3009. */
  3010. /* Simple output compare related functions ************************************/
  3011. HAL_StatusTypeDef HAL_HRTIM_SimpleOCChannelConfig(HRTIM_HandleTypeDef *hhrtim,
  3012. uint32_t TimerIdx,
  3013. uint32_t OCChannel,
  3014. const HRTIM_SimpleOCChannelCfgTypeDef* pSimpleOCChannelCfg);
  3015. HAL_StatusTypeDef HAL_HRTIM_SimpleOCStart(HRTIM_HandleTypeDef *hhrtim,
  3016. uint32_t TimerIdx,
  3017. uint32_t OCChannel);
  3018. HAL_StatusTypeDef HAL_HRTIM_SimpleOCStop(HRTIM_HandleTypeDef *hhrtim,
  3019. uint32_t TimerIdx,
  3020. uint32_t OCChannel);
  3021. HAL_StatusTypeDef HAL_HRTIM_SimpleOCStart_IT(HRTIM_HandleTypeDef *hhrtim,
  3022. uint32_t TimerIdx,
  3023. uint32_t OCChannel);
  3024. HAL_StatusTypeDef HAL_HRTIM_SimpleOCStop_IT(HRTIM_HandleTypeDef *hhrtim,
  3025. uint32_t TimerIdx,
  3026. uint32_t OCChannel);
  3027. HAL_StatusTypeDef HAL_HRTIM_SimpleOCStart_DMA(HRTIM_HandleTypeDef *hhrtim,
  3028. uint32_t TimerIdx,
  3029. uint32_t OCChannel,
  3030. uint32_t SrcAddr,
  3031. uint32_t DestAddr,
  3032. uint32_t Length);
  3033. HAL_StatusTypeDef HAL_HRTIM_SimpleOCStop_DMA(HRTIM_HandleTypeDef *hhrtim,
  3034. uint32_t TimerIdx,
  3035. uint32_t OCChannel);
  3036. /**
  3037. * @}
  3038. */
  3039. /** @addtogroup HRTIM_Exported_Functions_Group4
  3040. * @{
  3041. */
  3042. /* Simple PWM output related functions ****************************************/
  3043. HAL_StatusTypeDef HAL_HRTIM_SimplePWMChannelConfig(HRTIM_HandleTypeDef *hhrtim,
  3044. uint32_t TimerIdx,
  3045. uint32_t PWMChannel,
  3046. const HRTIM_SimplePWMChannelCfgTypeDef* pSimplePWMChannelCfg);
  3047. HAL_StatusTypeDef HAL_HRTIM_SimplePWMStart(HRTIM_HandleTypeDef *hhrtim,
  3048. uint32_t TimerIdx,
  3049. uint32_t PWMChannel);
  3050. HAL_StatusTypeDef HAL_HRTIM_SimplePWMStop(HRTIM_HandleTypeDef *hhrtim,
  3051. uint32_t TimerIdx,
  3052. uint32_t PWMChannel);
  3053. HAL_StatusTypeDef HAL_HRTIM_SimplePWMStart_IT(HRTIM_HandleTypeDef *hhrtim,
  3054. uint32_t TimerIdx,
  3055. uint32_t PWMChannel);
  3056. HAL_StatusTypeDef HAL_HRTIM_SimplePWMStop_IT(HRTIM_HandleTypeDef *hhrtim,
  3057. uint32_t TimerIdx,
  3058. uint32_t PWMChannel);
  3059. HAL_StatusTypeDef HAL_HRTIM_SimplePWMStart_DMA(HRTIM_HandleTypeDef *hhrtim,
  3060. uint32_t TimerIdx,
  3061. uint32_t PWMChannel,
  3062. uint32_t SrcAddr,
  3063. uint32_t DestAddr,
  3064. uint32_t Length);
  3065. HAL_StatusTypeDef HAL_HRTIM_SimplePWMStop_DMA(HRTIM_HandleTypeDef *hhrtim,
  3066. uint32_t TimerIdx,
  3067. uint32_t PWMChannel);
  3068. /**
  3069. * @}
  3070. */
  3071. /** @addtogroup HRTIM_Exported_Functions_Group5
  3072. * @{
  3073. */
  3074. /* Simple capture related functions *******************************************/
  3075. HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureChannelConfig(HRTIM_HandleTypeDef *hhrtim,
  3076. uint32_t TimerIdx,
  3077. uint32_t CaptureChannel,
  3078. const HRTIM_SimpleCaptureChannelCfgTypeDef* pSimpleCaptureChannelCfg);
  3079. HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStart(HRTIM_HandleTypeDef *hhrtim,
  3080. uint32_t TimerIdx,
  3081. uint32_t CaptureChannel);
  3082. HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStop(HRTIM_HandleTypeDef *hhrtim,
  3083. uint32_t TimerIdx,
  3084. uint32_t CaptureChannel);
  3085. HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStart_IT(HRTIM_HandleTypeDef *hhrtim,
  3086. uint32_t TimerIdx,
  3087. uint32_t CaptureChannel);
  3088. HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStop_IT(HRTIM_HandleTypeDef *hhrtim,
  3089. uint32_t TimerIdx,
  3090. uint32_t CaptureChannel);
  3091. HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStart_DMA(HRTIM_HandleTypeDef *hhrtim,
  3092. uint32_t TimerIdx,
  3093. uint32_t CaptureChannel,
  3094. uint32_t SrcAddr,
  3095. uint32_t DestAddr,
  3096. uint32_t Length);
  3097. HAL_StatusTypeDef HAL_HRTIM_SimpleCaptureStop_DMA(HRTIM_HandleTypeDef *hhrtim,
  3098. uint32_t TimerIdx,
  3099. uint32_t CaptureChannel);
  3100. /**
  3101. * @}
  3102. */
  3103. /** @addtogroup HRTIM_Exported_Functions_Group6
  3104. * @{
  3105. */
  3106. /* Simple one pulse related functions *****************************************/
  3107. HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseChannelConfig(HRTIM_HandleTypeDef *hhrtim,
  3108. uint32_t TimerIdx,
  3109. uint32_t OnePulseChannel,
  3110. const HRTIM_SimpleOnePulseChannelCfgTypeDef* pSimpleOnePulseChannelCfg);
  3111. HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStart(HRTIM_HandleTypeDef *hhrtim,
  3112. uint32_t TimerIdx,
  3113. uint32_t OnePulseChannel);
  3114. HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStop(HRTIM_HandleTypeDef *hhrtim,
  3115. uint32_t TimerIdx,
  3116. uint32_t OnePulseChannel);
  3117. HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStart_IT(HRTIM_HandleTypeDef *hhrtim,
  3118. uint32_t TimerIdx,
  3119. uint32_t OnePulseChannel);
  3120. HAL_StatusTypeDef HAL_HRTIM_SimpleOnePulseStop_IT(HRTIM_HandleTypeDef *hhrtim,
  3121. uint32_t TimerIdx,
  3122. uint32_t OnePulseChannel);
  3123. /**
  3124. * @}
  3125. */
  3126. /** @addtogroup HRTIM_Exported_Functions_Group7
  3127. * @{
  3128. */
  3129. HAL_StatusTypeDef HAL_HRTIM_BurstModeConfig(HRTIM_HandleTypeDef *hhrtim,
  3130. const HRTIM_BurstModeCfgTypeDef* pBurstModeCfg);
  3131. HAL_StatusTypeDef HAL_HRTIM_EventConfig(HRTIM_HandleTypeDef *hhrtim,
  3132. uint32_t Event,
  3133. const HRTIM_EventCfgTypeDef* pEventCfg);
  3134. HAL_StatusTypeDef HAL_HRTIM_EventPrescalerConfig(HRTIM_HandleTypeDef *hhrtim,
  3135. uint32_t Prescaler);
  3136. HAL_StatusTypeDef HAL_HRTIM_FaultConfig(HRTIM_HandleTypeDef *hhrtim,
  3137. uint32_t Fault,
  3138. const HRTIM_FaultCfgTypeDef* pFaultCfg);
  3139. HAL_StatusTypeDef HAL_HRTIM_FaultPrescalerConfig(HRTIM_HandleTypeDef *hhrtim,
  3140. uint32_t Prescaler);
  3141. void HAL_HRTIM_FaultModeCtl(HRTIM_HandleTypeDef * hhrtim,
  3142. uint32_t Faults,
  3143. uint32_t Enable);
  3144. HAL_StatusTypeDef HAL_HRTIM_ADCTriggerConfig(HRTIM_HandleTypeDef *hhrtim,
  3145. uint32_t ADCTrigger,
  3146. const HRTIM_ADCTriggerCfgTypeDef* pADCTriggerCfg);
  3147. /**
  3148. * @}
  3149. */
  3150. /** @addtogroup HRTIM_Exported_Functions_Group8
  3151. * @{
  3152. */
  3153. /* Waveform related functions *************************************************/
  3154. HAL_StatusTypeDef HAL_HRTIM_WaveformTimerConfig(HRTIM_HandleTypeDef *hhrtim,
  3155. uint32_t TimerIdx,
  3156. const HRTIM_TimerCfgTypeDef * pTimerCfg);
  3157. HAL_StatusTypeDef HAL_HRTIM_WaveformCompareConfig(HRTIM_HandleTypeDef *hhrtim,
  3158. uint32_t TimerIdx,
  3159. uint32_t CompareUnit,
  3160. const HRTIM_CompareCfgTypeDef* pCompareCfg);
  3161. HAL_StatusTypeDef HAL_HRTIM_WaveformCaptureConfig(HRTIM_HandleTypeDef *hhrtim,
  3162. uint32_t TimerIdx,
  3163. uint32_t CaptureUnit,
  3164. const HRTIM_CaptureCfgTypeDef* pCaptureCfg);
  3165. HAL_StatusTypeDef HAL_HRTIM_WaveformOutputConfig(HRTIM_HandleTypeDef *hhrtim,
  3166. uint32_t TimerIdx,
  3167. uint32_t Output,
  3168. const HRTIM_OutputCfgTypeDef * pOutputCfg);
  3169. HAL_StatusTypeDef HAL_HRTIM_WaveformSetOutputLevel(HRTIM_HandleTypeDef *hhrtim,
  3170. uint32_t TimerIdx,
  3171. uint32_t Output,
  3172. uint32_t OutputLevel);
  3173. HAL_StatusTypeDef HAL_HRTIM_TimerEventFilteringConfig(HRTIM_HandleTypeDef *hhrtim,
  3174. uint32_t TimerIdx,
  3175. uint32_t Event,
  3176. const HRTIM_TimerEventFilteringCfgTypeDef * pTimerEventFilteringCfg);
  3177. HAL_StatusTypeDef HAL_HRTIM_DeadTimeConfig(HRTIM_HandleTypeDef *hhrtim,
  3178. uint32_t TimerIdx,
  3179. const HRTIM_DeadTimeCfgTypeDef* pDeadTimeCfg);
  3180. HAL_StatusTypeDef HAL_HRTIM_ChopperModeConfig(HRTIM_HandleTypeDef *hhrtim,
  3181. uint32_t TimerIdx,
  3182. const HRTIM_ChopperModeCfgTypeDef* pChopperModeCfg);
  3183. HAL_StatusTypeDef HAL_HRTIM_BurstDMAConfig(HRTIM_HandleTypeDef *hhrtim,
  3184. uint32_t TimerIdx,
  3185. uint32_t RegistersToUpdate);
  3186. HAL_StatusTypeDef HAL_HRTIM_WaveformCountStart(HRTIM_HandleTypeDef *hhrtim,
  3187. uint32_t Timers);
  3188. HAL_StatusTypeDef HAL_HRTIM_WaveformCountStop(HRTIM_HandleTypeDef *hhrtim,
  3189. uint32_t Timers);
  3190. HAL_StatusTypeDef HAL_HRTIM_WaveformCountStart_IT(HRTIM_HandleTypeDef *hhrtim,
  3191. uint32_t Timers);
  3192. HAL_StatusTypeDef HAL_HRTIM_WaveformCountStop_IT(HRTIM_HandleTypeDef *hhrtim,
  3193. uint32_t Timers);
  3194. HAL_StatusTypeDef HAL_HRTIM_WaveformCountStart_DMA(HRTIM_HandleTypeDef *hhrtim,
  3195. uint32_t Timers);
  3196. HAL_StatusTypeDef HAL_HRTIM_WaveformCountStop_DMA(HRTIM_HandleTypeDef *hhrtim,
  3197. uint32_t Timers);
  3198. HAL_StatusTypeDef HAL_HRTIM_WaveformOutputStart(HRTIM_HandleTypeDef *hhrtim,
  3199. uint32_t OutputsToStart);
  3200. HAL_StatusTypeDef HAL_HRTIM_WaveformOutputStop(HRTIM_HandleTypeDef *hhrtim,
  3201. uint32_t OutputsToStop);
  3202. HAL_StatusTypeDef HAL_HRTIM_BurstModeCtl(HRTIM_HandleTypeDef *hhrtim,
  3203. uint32_t Enable);
  3204. HAL_StatusTypeDef HAL_HRTIM_BurstModeSoftwareTrigger(HRTIM_HandleTypeDef *hhrtim);
  3205. HAL_StatusTypeDef HAL_HRTIM_SoftwareCapture(HRTIM_HandleTypeDef *hhrtim,
  3206. uint32_t TimerIdx,
  3207. uint32_t CaptureUnit);
  3208. HAL_StatusTypeDef HAL_HRTIM_SoftwareUpdate(HRTIM_HandleTypeDef *hhrtim,
  3209. uint32_t Timers);
  3210. HAL_StatusTypeDef HAL_HRTIM_SoftwareReset(HRTIM_HandleTypeDef *hhrtim,
  3211. uint32_t Timers);
  3212. HAL_StatusTypeDef HAL_HRTIM_BurstDMATransfer(HRTIM_HandleTypeDef *hhrtim,
  3213. uint32_t TimerIdx,
  3214. uint32_t BurstBufferAddress,
  3215. uint32_t BurstBufferLength);
  3216. HAL_StatusTypeDef HAL_HRTIM_UpdateEnable(HRTIM_HandleTypeDef *hhrtim,
  3217. uint32_t Timers);
  3218. HAL_StatusTypeDef HAL_HRTIM_UpdateDisable(HRTIM_HandleTypeDef *hhrtim,
  3219. uint32_t Timers);
  3220. /**
  3221. * @}
  3222. */
  3223. /** @addtogroup HRTIM_Exported_Functions_Group9
  3224. * @{
  3225. */
  3226. /* HRTIM peripheral state functions */
  3227. HAL_HRTIM_StateTypeDef HAL_HRTIM_GetState(const HRTIM_HandleTypeDef* hhrtim);
  3228. uint32_t HAL_HRTIM_GetCapturedValue(const HRTIM_HandleTypeDef * hhrtim,
  3229. uint32_t TimerIdx,
  3230. uint32_t CaptureUnit);
  3231. uint32_t HAL_HRTIM_WaveformGetOutputLevel(const HRTIM_HandleTypeDef *hhrtim,
  3232. uint32_t TimerIdx,
  3233. uint32_t Output);
  3234. uint32_t HAL_HRTIM_WaveformGetOutputState(const HRTIM_HandleTypeDef * hhrtim,
  3235. uint32_t TimerIdx,
  3236. uint32_t Output);
  3237. uint32_t HAL_HRTIM_GetDelayedProtectionStatus(const HRTIM_HandleTypeDef *hhrtim,
  3238. uint32_t TimerIdx,
  3239. uint32_t Output);
  3240. uint32_t HAL_HRTIM_GetBurstStatus(const HRTIM_HandleTypeDef *hhrtim);
  3241. uint32_t HAL_HRTIM_GetCurrentPushPullStatus(const HRTIM_HandleTypeDef *hhrtim,
  3242. uint32_t TimerIdx);
  3243. uint32_t HAL_HRTIM_GetIdlePushPullStatus(const HRTIM_HandleTypeDef *hhrtim,
  3244. uint32_t TimerIdx);
  3245. /**
  3246. * @}
  3247. */
  3248. /** @addtogroup HRTIM_Exported_Functions_Group10
  3249. * @{
  3250. */
  3251. /* IRQ handler */
  3252. void HAL_HRTIM_IRQHandler(HRTIM_HandleTypeDef *hhrtim,
  3253. uint32_t TimerIdx);
  3254. /* HRTIM events related callback functions */
  3255. void HAL_HRTIM_Fault1Callback(HRTIM_HandleTypeDef *hhrtim);
  3256. void HAL_HRTIM_Fault2Callback(HRTIM_HandleTypeDef *hhrtim);
  3257. void HAL_HRTIM_Fault3Callback(HRTIM_HandleTypeDef *hhrtim);
  3258. void HAL_HRTIM_Fault4Callback(HRTIM_HandleTypeDef *hhrtim);
  3259. void HAL_HRTIM_Fault5Callback(HRTIM_HandleTypeDef *hhrtim);
  3260. void HAL_HRTIM_SystemFaultCallback(HRTIM_HandleTypeDef *hhrtim);
  3261. void HAL_HRTIM_DLLCalibrationReadyCallback(HRTIM_HandleTypeDef *hhrtim);
  3262. void HAL_HRTIM_BurstModePeriodCallback(HRTIM_HandleTypeDef *hhrtim);
  3263. void HAL_HRTIM_SynchronizationEventCallback(HRTIM_HandleTypeDef *hhrtim);
  3264. /* Timer events related callback functions */
  3265. void HAL_HRTIM_RegistersUpdateCallback(HRTIM_HandleTypeDef *hhrtim,
  3266. uint32_t TimerIdx);
  3267. void HAL_HRTIM_RepetitionEventCallback(HRTIM_HandleTypeDef *hhrtim,
  3268. uint32_t TimerIdx);
  3269. void HAL_HRTIM_Compare1EventCallback(HRTIM_HandleTypeDef *hhrtim,
  3270. uint32_t TimerIdx);
  3271. void HAL_HRTIM_Compare2EventCallback(HRTIM_HandleTypeDef *hhrtim,
  3272. uint32_t TimerIdx);
  3273. void HAL_HRTIM_Compare3EventCallback(HRTIM_HandleTypeDef *hhrtim,
  3274. uint32_t TimerIdx);
  3275. void HAL_HRTIM_Compare4EventCallback(HRTIM_HandleTypeDef *hhrtim,
  3276. uint32_t TimerIdx);
  3277. void HAL_HRTIM_Capture1EventCallback(HRTIM_HandleTypeDef *hhrtim,
  3278. uint32_t TimerIdx);
  3279. void HAL_HRTIM_Capture2EventCallback(HRTIM_HandleTypeDef *hhrtim,
  3280. uint32_t TimerIdx);
  3281. void HAL_HRTIM_DelayedProtectionCallback(HRTIM_HandleTypeDef *hhrtim,
  3282. uint32_t TimerIdx);
  3283. void HAL_HRTIM_CounterResetCallback(HRTIM_HandleTypeDef *hhrtim,
  3284. uint32_t TimerIdx);
  3285. void HAL_HRTIM_Output1SetCallback(HRTIM_HandleTypeDef *hhrtim,
  3286. uint32_t TimerIdx);
  3287. void HAL_HRTIM_Output1ResetCallback(HRTIM_HandleTypeDef *hhrtim,
  3288. uint32_t TimerIdx);
  3289. void HAL_HRTIM_Output2SetCallback(HRTIM_HandleTypeDef *hhrtim,
  3290. uint32_t TimerIdx);
  3291. void HAL_HRTIM_Output2ResetCallback(HRTIM_HandleTypeDef *hhrtim,
  3292. uint32_t TimerIdx);
  3293. void HAL_HRTIM_BurstDMATransferCallback(HRTIM_HandleTypeDef *hhrtim,
  3294. uint32_t TimerIdx);
  3295. void HAL_HRTIM_ErrorCallback(HRTIM_HandleTypeDef *hhrtim);
  3296. #if (USE_HAL_HRTIM_REGISTER_CALLBACKS == 1)
  3297. HAL_StatusTypeDef HAL_HRTIM_RegisterCallback(HRTIM_HandleTypeDef * hhrtim,
  3298. HAL_HRTIM_CallbackIDTypeDef CallbackID,
  3299. pHRTIM_CallbackTypeDef pCallback);
  3300. HAL_StatusTypeDef HAL_HRTIM_UnRegisterCallback(HRTIM_HandleTypeDef * hhrtim,
  3301. HAL_HRTIM_CallbackIDTypeDef CallbackID);
  3302. HAL_StatusTypeDef HAL_HRTIM_TIMxRegisterCallback(HRTIM_HandleTypeDef * hhrtim,
  3303. HAL_HRTIM_CallbackIDTypeDef CallbackID,
  3304. pHRTIM_TIMxCallbackTypeDef pCallback);
  3305. HAL_StatusTypeDef HAL_HRTIM_TIMxUnRegisterCallback(HRTIM_HandleTypeDef * hhrtim,
  3306. HAL_HRTIM_CallbackIDTypeDef CallbackID);
  3307. #endif /* USE_HAL_HRTIM_REGISTER_CALLBACKS */
  3308. /**
  3309. * @}
  3310. */
  3311. /**
  3312. * @}
  3313. */
  3314. /**
  3315. * @}
  3316. */
  3317. /**
  3318. * @}
  3319. */
  3320. #endif /* HRTIM1 */
  3321. #ifdef __cplusplus
  3322. }
  3323. #endif
  3324. #endif /* STM32F3xx_HAL_HRTIM_H */