stm32f030x8.h 231 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446
  1. /**
  2. ******************************************************************************
  3. * @file stm32f030x8.h
  4. * @author MCD Application Team
  5. * @version V2.2.3
  6. * @date 29-January-2016
  7. * @brief CMSIS Cortex-M0 Device Peripheral Access Layer Header File.
  8. * This file contains all the peripheral register's definitions, bits
  9. * definitions and memory mapping for STM32F0xx devices.
  10. *
  11. * This file contains:
  12. * - Data structures and the address mapping for all peripherals
  13. * - Peripheral's registers declarations and bits definition
  14. * - Macros to access peripheral’s registers hardware
  15. *
  16. ******************************************************************************
  17. * @attention
  18. *
  19. * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
  20. *
  21. * Redistribution and use in source and binary forms, with or without modification,
  22. * are permitted provided that the following conditions are met:
  23. * 1. Redistributions of source code must retain the above copyright notice,
  24. * this list of conditions and the following disclaimer.
  25. * 2. Redistributions in binary form must reproduce the above copyright notice,
  26. * this list of conditions and the following disclaimer in the documentation
  27. * and/or other materials provided with the distribution.
  28. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  29. * may be used to endorse or promote products derived from this software
  30. * without specific prior written permission.
  31. *
  32. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  33. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  34. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  35. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  36. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  37. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  38. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  39. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  40. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  41. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  42. *
  43. ******************************************************************************
  44. */
  45. /** @addtogroup CMSIS
  46. * @{
  47. */
  48. /** @addtogroup stm32f030x8
  49. * @{
  50. */
  51. #ifndef __STM32F030x8_H
  52. #define __STM32F030x8_H
  53. #ifdef __cplusplus
  54. extern "C" {
  55. #endif /* __cplusplus */
  56. /** @addtogroup Configuration_section_for_CMSIS
  57. * @{
  58. */
  59. /**
  60. * @brief Configuration of the Cortex-M0 Processor and Core Peripherals
  61. */
  62. #define __CM0_REV 0 /*!< Core Revision r0p0 */
  63. #define __MPU_PRESENT 0 /*!< STM32F0xx do not provide MPU */
  64. #define __NVIC_PRIO_BITS 2 /*!< STM32F0xx uses 2 Bits for the Priority Levels */
  65. #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
  66. /**
  67. * @}
  68. */
  69. /** @addtogroup Peripheral_interrupt_number_definition
  70. * @{
  71. */
  72. /**
  73. * @brief STM32F0xx Interrupt Number Definition, according to the selected device
  74. * in @ref Library_configuration_section
  75. */
  76. /*!< Interrupt Number Definition */
  77. typedef enum
  78. {
  79. /****** Cortex-M0 Processor Exceptions Numbers **************************************************************/
  80. NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
  81. HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */
  82. SVC_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */
  83. PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */
  84. SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */
  85. /****** STM32F0 specific Interrupt Numbers ******************************************************************/
  86. WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
  87. RTC_IRQn = 2, /*!< RTC Interrupt through EXTI Lines 17, 19 and 20 */
  88. FLASH_IRQn = 3, /*!< FLASH global Interrupt */
  89. RCC_IRQn = 4, /*!< RCC global Interrupt */
  90. EXTI0_1_IRQn = 5, /*!< EXTI Line 0 and 1 Interrupt */
  91. EXTI2_3_IRQn = 6, /*!< EXTI Line 2 and 3 Interrupt */
  92. EXTI4_15_IRQn = 7, /*!< EXTI Line 4 to 15 Interrupt */
  93. DMA1_Channel1_IRQn = 9, /*!< DMA1 Channel 1 Interrupt */
  94. DMA1_Channel2_3_IRQn = 10, /*!< DMA1 Channel 2 and Channel 3 Interrupt */
  95. DMA1_Channel4_5_IRQn = 11, /*!< DMA1 Channel 4 and Channel 5 Interrupt */
  96. ADC1_IRQn = 12, /*!< ADC1 Interrupt */
  97. TIM1_BRK_UP_TRG_COM_IRQn = 13, /*!< TIM1 Break, Update, Trigger and Commutation Interrupt */
  98. TIM1_CC_IRQn = 14, /*!< TIM1 Capture Compare Interrupt */
  99. TIM3_IRQn = 16, /*!< TIM3 global Interrupt */
  100. TIM6_IRQn = 17, /*!< TIM6 global Interrupt */
  101. TIM14_IRQn = 19, /*!< TIM14 global Interrupt */
  102. TIM15_IRQn = 20, /*!< TIM15 global Interrupt */
  103. TIM16_IRQn = 21, /*!< TIM16 global Interrupt */
  104. TIM17_IRQn = 22, /*!< TIM17 global Interrupt */
  105. I2C1_IRQn = 23, /*!< I2C1 Event Interrupt */
  106. I2C2_IRQn = 24, /*!< I2C2 Event Interrupt */
  107. SPI1_IRQn = 25, /*!< SPI1 global Interrupt */
  108. SPI2_IRQn = 26, /*!< SPI2 global Interrupt */
  109. USART1_IRQn = 27, /*!< USART1 global Interrupt */
  110. USART2_IRQn = 28 /*!< USART2 global Interrupt */
  111. } IRQn_Type;
  112. /**
  113. * @}
  114. */
  115. #include "core_cm0.h" /* Cortex-M0 processor and core peripherals */
  116. #include "system_stm32f0xx.h" /* STM32F0xx System Header */
  117. #include <stdint.h>
  118. /** @addtogroup Peripheral_registers_structures
  119. * @{
  120. */
  121. /**
  122. * @brief Analog to Digital Converter
  123. */
  124. typedef struct
  125. {
  126. __IO uint32_t ISR; /*!< ADC interrupt and status register, Address offset: 0x00 */
  127. __IO uint32_t IER; /*!< ADC interrupt enable register, Address offset: 0x04 */
  128. __IO uint32_t CR; /*!< ADC control register, Address offset: 0x08 */
  129. __IO uint32_t CFGR1; /*!< ADC configuration register 1, Address offset: 0x0C */
  130. __IO uint32_t CFGR2; /*!< ADC configuration register 2, Address offset: 0x10 */
  131. __IO uint32_t SMPR; /*!< ADC sampling time register, Address offset: 0x14 */
  132. uint32_t RESERVED1; /*!< Reserved, 0x18 */
  133. uint32_t RESERVED2; /*!< Reserved, 0x1C */
  134. __IO uint32_t TR; /*!< ADC analog watchdog 1 threshold register, Address offset: 0x20 */
  135. uint32_t RESERVED3; /*!< Reserved, 0x24 */
  136. __IO uint32_t CHSELR; /*!< ADC group regular sequencer register, Address offset: 0x28 */
  137. uint32_t RESERVED4[5]; /*!< Reserved, 0x2C */
  138. __IO uint32_t DR; /*!< ADC group regular data register, Address offset: 0x40 */
  139. } ADC_TypeDef;
  140. typedef struct
  141. {
  142. __IO uint32_t CCR; /*!< ADC common configuration register, Address offset: ADC1 base address + 0x308 */
  143. } ADC_Common_TypeDef;
  144. /**
  145. * @brief CRC calculation unit
  146. */
  147. typedef struct
  148. {
  149. __IO uint32_t DR; /*!< CRC Data register, Address offset: 0x00 */
  150. __IO uint8_t IDR; /*!< CRC Independent data register, Address offset: 0x04 */
  151. uint8_t RESERVED0; /*!< Reserved, 0x05 */
  152. uint16_t RESERVED1; /*!< Reserved, 0x06 */
  153. __IO uint32_t CR; /*!< CRC Control register, Address offset: 0x08 */
  154. uint32_t RESERVED2; /*!< Reserved, 0x0C */
  155. __IO uint32_t INIT; /*!< Initial CRC value register, Address offset: 0x10 */
  156. __IO uint32_t RESERVED3; /*!< Reserved, 0x14 */
  157. } CRC_TypeDef;
  158. /**
  159. * @brief Debug MCU
  160. */
  161. typedef struct
  162. {
  163. __IO uint32_t IDCODE; /*!< MCU device ID code, Address offset: 0x00 */
  164. __IO uint32_t CR; /*!< Debug MCU configuration register, Address offset: 0x04 */
  165. __IO uint32_t APB1FZ; /*!< Debug MCU APB1 freeze register, Address offset: 0x08 */
  166. __IO uint32_t APB2FZ; /*!< Debug MCU APB2 freeze register, Address offset: 0x0C */
  167. }DBGMCU_TypeDef;
  168. /**
  169. * @brief DMA Controller
  170. */
  171. typedef struct
  172. {
  173. __IO uint32_t CCR; /*!< DMA channel x configuration register */
  174. __IO uint32_t CNDTR; /*!< DMA channel x number of data register */
  175. __IO uint32_t CPAR; /*!< DMA channel x peripheral address register */
  176. __IO uint32_t CMAR; /*!< DMA channel x memory address register */
  177. } DMA_Channel_TypeDef;
  178. typedef struct
  179. {
  180. __IO uint32_t ISR; /*!< DMA interrupt status register, Address offset: 0x00 */
  181. __IO uint32_t IFCR; /*!< DMA interrupt flag clear register, Address offset: 0x04 */
  182. } DMA_TypeDef;
  183. /**
  184. * @brief External Interrupt/Event Controller
  185. */
  186. typedef struct
  187. {
  188. __IO uint32_t IMR; /*!<EXTI Interrupt mask register, Address offset: 0x00 */
  189. __IO uint32_t EMR; /*!<EXTI Event mask register, Address offset: 0x04 */
  190. __IO uint32_t RTSR; /*!<EXTI Rising trigger selection register , Address offset: 0x08 */
  191. __IO uint32_t FTSR; /*!<EXTI Falling trigger selection register, Address offset: 0x0C */
  192. __IO uint32_t SWIER; /*!<EXTI Software interrupt event register, Address offset: 0x10 */
  193. __IO uint32_t PR; /*!<EXTI Pending register, Address offset: 0x14 */
  194. } EXTI_TypeDef;
  195. /**
  196. * @brief FLASH Registers
  197. */
  198. typedef struct
  199. {
  200. __IO uint32_t ACR; /*!<FLASH access control register, Address offset: 0x00 */
  201. __IO uint32_t KEYR; /*!<FLASH key register, Address offset: 0x04 */
  202. __IO uint32_t OPTKEYR; /*!<FLASH OPT key register, Address offset: 0x08 */
  203. __IO uint32_t SR; /*!<FLASH status register, Address offset: 0x0C */
  204. __IO uint32_t CR; /*!<FLASH control register, Address offset: 0x10 */
  205. __IO uint32_t AR; /*!<FLASH address register, Address offset: 0x14 */
  206. __IO uint32_t RESERVED; /*!< Reserved, 0x18 */
  207. __IO uint32_t OBR; /*!<FLASH option bytes register, Address offset: 0x1C */
  208. __IO uint32_t WRPR; /*!<FLASH option bytes register, Address offset: 0x20 */
  209. } FLASH_TypeDef;
  210. /**
  211. * @brief Option Bytes Registers
  212. */
  213. typedef struct
  214. {
  215. __IO uint16_t RDP; /*!< FLASH option byte Read protection, Address offset: 0x00 */
  216. __IO uint16_t USER; /*!< FLASH option byte user options, Address offset: 0x02 */
  217. __IO uint16_t DATA0; /*!< User data byte 0 (stored in FLASH_OBR[23:16]), Address offset: 0x04 */
  218. __IO uint16_t DATA1; /*!< User data byte 1 (stored in FLASH_OBR[31:24]), Address offset: 0x06 */
  219. __IO uint16_t WRP0; /*!< FLASH option byte write protection 0, Address offset: 0x08 */
  220. __IO uint16_t WRP1; /*!< FLASH option byte write protection 1, Address offset: 0x0A */
  221. } OB_TypeDef;
  222. /**
  223. * @brief General Purpose I/O
  224. */
  225. typedef struct
  226. {
  227. __IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
  228. __IO uint32_t OTYPER; /*!< GPIO port output type register, Address offset: 0x04 */
  229. __IO uint32_t OSPEEDR; /*!< GPIO port output speed register, Address offset: 0x08 */
  230. __IO uint32_t PUPDR; /*!< GPIO port pull-up/pull-down register, Address offset: 0x0C */
  231. __IO uint32_t IDR; /*!< GPIO port input data register, Address offset: 0x10 */
  232. __IO uint32_t ODR; /*!< GPIO port output data register, Address offset: 0x14 */
  233. __IO uint32_t BSRR; /*!< GPIO port bit set/reset register, Address offset: 0x1A */
  234. __IO uint32_t LCKR; /*!< GPIO port configuration lock register, Address offset: 0x1C */
  235. __IO uint32_t AFR[2]; /*!< GPIO alternate function low register, Address offset: 0x20-0x24 */
  236. __IO uint32_t BRR; /*!< GPIO bit reset register, Address offset: 0x28 */
  237. } GPIO_TypeDef;
  238. /**
  239. * @brief SysTem Configuration
  240. */
  241. typedef struct
  242. {
  243. __IO uint32_t CFGR1; /*!< SYSCFG configuration register 1, Address offset: 0x00 */
  244. uint32_t RESERVED; /*!< Reserved, 0x04 */
  245. __IO uint32_t EXTICR[4]; /*!< SYSCFG external interrupt configuration register, Address offset: 0x14-0x08 */
  246. __IO uint32_t CFGR2; /*!< SYSCFG configuration register 2, Address offset: 0x18 */
  247. } SYSCFG_TypeDef;
  248. /**
  249. * @brief Inter-integrated Circuit Interface
  250. */
  251. typedef struct
  252. {
  253. __IO uint32_t CR1; /*!< I2C Control register 1, Address offset: 0x00 */
  254. __IO uint32_t CR2; /*!< I2C Control register 2, Address offset: 0x04 */
  255. __IO uint32_t OAR1; /*!< I2C Own address 1 register, Address offset: 0x08 */
  256. __IO uint32_t OAR2; /*!< I2C Own address 2 register, Address offset: 0x0C */
  257. __IO uint32_t TIMINGR; /*!< I2C Timing register, Address offset: 0x10 */
  258. __IO uint32_t TIMEOUTR; /*!< I2C Timeout register, Address offset: 0x14 */
  259. __IO uint32_t ISR; /*!< I2C Interrupt and status register, Address offset: 0x18 */
  260. __IO uint32_t ICR; /*!< I2C Interrupt clear register, Address offset: 0x1C */
  261. __IO uint32_t PECR; /*!< I2C PEC register, Address offset: 0x20 */
  262. __IO uint32_t RXDR; /*!< I2C Receive data register, Address offset: 0x24 */
  263. __IO uint32_t TXDR; /*!< I2C Transmit data register, Address offset: 0x28 */
  264. } I2C_TypeDef;
  265. /**
  266. * @brief Independent WATCHDOG
  267. */
  268. typedef struct
  269. {
  270. __IO uint32_t KR; /*!< IWDG Key register, Address offset: 0x00 */
  271. __IO uint32_t PR; /*!< IWDG Prescaler register, Address offset: 0x04 */
  272. __IO uint32_t RLR; /*!< IWDG Reload register, Address offset: 0x08 */
  273. __IO uint32_t SR; /*!< IWDG Status register, Address offset: 0x0C */
  274. __IO uint32_t WINR; /*!< IWDG Window register, Address offset: 0x10 */
  275. } IWDG_TypeDef;
  276. /**
  277. * @brief Power Control
  278. */
  279. typedef struct
  280. {
  281. __IO uint32_t CR; /*!< PWR power control register, Address offset: 0x00 */
  282. __IO uint32_t CSR; /*!< PWR power control/status register, Address offset: 0x04 */
  283. } PWR_TypeDef;
  284. /**
  285. * @brief Reset and Clock Control
  286. */
  287. typedef struct
  288. {
  289. __IO uint32_t CR; /*!< RCC clock control register, Address offset: 0x00 */
  290. __IO uint32_t CFGR; /*!< RCC clock configuration register, Address offset: 0x04 */
  291. __IO uint32_t CIR; /*!< RCC clock interrupt register, Address offset: 0x08 */
  292. __IO uint32_t APB2RSTR; /*!< RCC APB2 peripheral reset register, Address offset: 0x0C */
  293. __IO uint32_t APB1RSTR; /*!< RCC APB1 peripheral reset register, Address offset: 0x10 */
  294. __IO uint32_t AHBENR; /*!< RCC AHB peripheral clock register, Address offset: 0x14 */
  295. __IO uint32_t APB2ENR; /*!< RCC APB2 peripheral clock enable register, Address offset: 0x18 */
  296. __IO uint32_t APB1ENR; /*!< RCC APB1 peripheral clock enable register, Address offset: 0x1C */
  297. __IO uint32_t BDCR; /*!< RCC Backup domain control register, Address offset: 0x20 */
  298. __IO uint32_t CSR; /*!< RCC clock control & status register, Address offset: 0x24 */
  299. __IO uint32_t AHBRSTR; /*!< RCC AHB peripheral reset register, Address offset: 0x28 */
  300. __IO uint32_t CFGR2; /*!< RCC clock configuration register 2, Address offset: 0x2C */
  301. __IO uint32_t CFGR3; /*!< RCC clock configuration register 3, Address offset: 0x30 */
  302. __IO uint32_t CR2; /*!< RCC clock control register 2, Address offset: 0x34 */
  303. } RCC_TypeDef;
  304. /**
  305. * @brief Real-Time Clock
  306. */
  307. typedef struct
  308. {
  309. __IO uint32_t TR; /*!< RTC time register, Address offset: 0x00 */
  310. __IO uint32_t DR; /*!< RTC date register, Address offset: 0x04 */
  311. __IO uint32_t CR; /*!< RTC control register, Address offset: 0x08 */
  312. __IO uint32_t ISR; /*!< RTC initialization and status register, Address offset: 0x0C */
  313. __IO uint32_t PRER; /*!< RTC prescaler register, Address offset: 0x10 */
  314. uint32_t RESERVED1; /*!< Reserved, Address offset: 0x14 */
  315. uint32_t RESERVED2; /*!< Reserved, Address offset: 0x18 */
  316. __IO uint32_t ALRMAR; /*!< RTC alarm A register, Address offset: 0x1C */
  317. uint32_t RESERVED3; /*!< Reserved, Address offset: 0x20 */
  318. __IO uint32_t WPR; /*!< RTC write protection register, Address offset: 0x24 */
  319. __IO uint32_t SSR; /*!< RTC sub second register, Address offset: 0x28 */
  320. __IO uint32_t SHIFTR; /*!< RTC shift control register, Address offset: 0x2C */
  321. __IO uint32_t TSTR; /*!< RTC time stamp time register, Address offset: 0x30 */
  322. __IO uint32_t TSDR; /*!< RTC time stamp date register, Address offset: 0x34 */
  323. __IO uint32_t TSSSR; /*!< RTC time-stamp sub second register, Address offset: 0x38 */
  324. __IO uint32_t CALR; /*!< RTC calibration register, Address offset: 0x3C */
  325. __IO uint32_t TAFCR; /*!< RTC tamper and alternate function configuration register, Address offset: 0x40 */
  326. __IO uint32_t ALRMASSR; /*!< RTC alarm A sub second register, Address offset: 0x44 */
  327. } RTC_TypeDef;
  328. /**
  329. * @brief Serial Peripheral Interface
  330. */
  331. typedef struct
  332. {
  333. __IO uint32_t CR1; /*!< SPI Control register 1 (not used in I2S mode), Address offset: 0x00 */
  334. __IO uint32_t CR2; /*!< SPI Control register 2, Address offset: 0x04 */
  335. __IO uint32_t SR; /*!< SPI Status register, Address offset: 0x08 */
  336. __IO uint32_t DR; /*!< SPI data register, Address offset: 0x0C */
  337. __IO uint32_t CRCPR; /*!< SPI CRC polynomial register (not used in I2S mode), Address offset: 0x10 */
  338. __IO uint32_t RXCRCR; /*!< SPI Rx CRC register (not used in I2S mode), Address offset: 0x14 */
  339. __IO uint32_t TXCRCR; /*!< SPI Tx CRC register (not used in I2S mode), Address offset: 0x18 */
  340. __IO uint32_t I2SCFGR; /*!< SPI_I2S configuration register, Address offset: 0x1C */
  341. } SPI_TypeDef;
  342. /**
  343. * @brief TIM
  344. */
  345. typedef struct
  346. {
  347. __IO uint32_t CR1; /*!< TIM control register 1, Address offset: 0x00 */
  348. __IO uint32_t CR2; /*!< TIM control register 2, Address offset: 0x04 */
  349. __IO uint32_t SMCR; /*!< TIM slave Mode Control register, Address offset: 0x08 */
  350. __IO uint32_t DIER; /*!< TIM DMA/interrupt enable register, Address offset: 0x0C */
  351. __IO uint32_t SR; /*!< TIM status register, Address offset: 0x10 */
  352. __IO uint32_t EGR; /*!< TIM event generation register, Address offset: 0x14 */
  353. __IO uint32_t CCMR1; /*!< TIM capture/compare mode register 1, Address offset: 0x18 */
  354. __IO uint32_t CCMR2; /*!< TIM capture/compare mode register 2, Address offset: 0x1C */
  355. __IO uint32_t CCER; /*!< TIM capture/compare enable register, Address offset: 0x20 */
  356. __IO uint32_t CNT; /*!< TIM counter register, Address offset: 0x24 */
  357. __IO uint32_t PSC; /*!< TIM prescaler register, Address offset: 0x28 */
  358. __IO uint32_t ARR; /*!< TIM auto-reload register, Address offset: 0x2C */
  359. __IO uint32_t RCR; /*!< TIM repetition counter register, Address offset: 0x30 */
  360. __IO uint32_t CCR1; /*!< TIM capture/compare register 1, Address offset: 0x34 */
  361. __IO uint32_t CCR2; /*!< TIM capture/compare register 2, Address offset: 0x38 */
  362. __IO uint32_t CCR3; /*!< TIM capture/compare register 3, Address offset: 0x3C */
  363. __IO uint32_t CCR4; /*!< TIM capture/compare register 4, Address offset: 0x40 */
  364. __IO uint32_t BDTR; /*!< TIM break and dead-time register, Address offset: 0x44 */
  365. __IO uint32_t DCR; /*!< TIM DMA control register, Address offset: 0x48 */
  366. __IO uint32_t DMAR; /*!< TIM DMA address for full transfer register, Address offset: 0x4C */
  367. __IO uint32_t OR; /*!< TIM option register, Address offset: 0x50 */
  368. } TIM_TypeDef;
  369. /**
  370. * @brief Universal Synchronous Asynchronous Receiver Transmitter
  371. */
  372. typedef struct
  373. {
  374. __IO uint32_t CR1; /*!< USART Control register 1, Address offset: 0x00 */
  375. __IO uint32_t CR2; /*!< USART Control register 2, Address offset: 0x04 */
  376. __IO uint32_t CR3; /*!< USART Control register 3, Address offset: 0x08 */
  377. __IO uint32_t BRR; /*!< USART Baud rate register, Address offset: 0x0C */
  378. __IO uint32_t GTPR; /*!< USART Guard time and prescaler register, Address offset: 0x10 */
  379. __IO uint32_t RTOR; /*!< USART Receiver Time Out register, Address offset: 0x14 */
  380. __IO uint32_t RQR; /*!< USART Request register, Address offset: 0x18 */
  381. __IO uint32_t ISR; /*!< USART Interrupt and status register, Address offset: 0x1C */
  382. __IO uint32_t ICR; /*!< USART Interrupt flag Clear register, Address offset: 0x20 */
  383. __IO uint16_t RDR; /*!< USART Receive Data register, Address offset: 0x24 */
  384. uint16_t RESERVED1; /*!< Reserved, 0x26 */
  385. __IO uint16_t TDR; /*!< USART Transmit Data register, Address offset: 0x28 */
  386. uint16_t RESERVED2; /*!< Reserved, 0x2A */
  387. } USART_TypeDef;
  388. /**
  389. * @brief Window WATCHDOG
  390. */
  391. typedef struct
  392. {
  393. __IO uint32_t CR; /*!< WWDG Control register, Address offset: 0x00 */
  394. __IO uint32_t CFR; /*!< WWDG Configuration register, Address offset: 0x04 */
  395. __IO uint32_t SR; /*!< WWDG Status register, Address offset: 0x08 */
  396. } WWDG_TypeDef;
  397. /**
  398. * @}
  399. */
  400. /** @addtogroup Peripheral_memory_map
  401. * @{
  402. */
  403. #define FLASH_BASE ((uint32_t)0x08000000U) /*!< FLASH base address in the alias region */
  404. #define FLASH_BANK1_END ((uint32_t)0x0800FFFFU) /*!< FLASH END address of bank1 */
  405. #define SRAM_BASE ((uint32_t)0x20000000U) /*!< SRAM base address in the alias region */
  406. #define PERIPH_BASE ((uint32_t)0x40000000U) /*!< Peripheral base address in the alias region */
  407. /*!< Peripheral memory map */
  408. #define APBPERIPH_BASE PERIPH_BASE
  409. #define AHBPERIPH_BASE (PERIPH_BASE + 0x00020000)
  410. #define AHB2PERIPH_BASE (PERIPH_BASE + 0x08000000)
  411. /*!< APB peripherals */
  412. #define TIM3_BASE (APBPERIPH_BASE + 0x00000400)
  413. #define TIM6_BASE (APBPERIPH_BASE + 0x00001000)
  414. #define TIM14_BASE (APBPERIPH_BASE + 0x00002000)
  415. #define RTC_BASE (APBPERIPH_BASE + 0x00002800)
  416. #define WWDG_BASE (APBPERIPH_BASE + 0x00002C00)
  417. #define IWDG_BASE (APBPERIPH_BASE + 0x00003000)
  418. #define SPI2_BASE (APBPERIPH_BASE + 0x00003800)
  419. #define USART2_BASE (APBPERIPH_BASE + 0x00004400)
  420. #define I2C1_BASE (APBPERIPH_BASE + 0x00005400)
  421. #define I2C2_BASE (APBPERIPH_BASE + 0x00005800)
  422. #define PWR_BASE (APBPERIPH_BASE + 0x00007000)
  423. #define SYSCFG_BASE (APBPERIPH_BASE + 0x00010000)
  424. #define EXTI_BASE (APBPERIPH_BASE + 0x00010400)
  425. #define ADC1_BASE (APBPERIPH_BASE + 0x00012400)
  426. #define ADC_BASE (APBPERIPH_BASE + 0x00012708)
  427. #define TIM1_BASE (APBPERIPH_BASE + 0x00012C00)
  428. #define SPI1_BASE (APBPERIPH_BASE + 0x00013000)
  429. #define USART1_BASE (APBPERIPH_BASE + 0x00013800)
  430. #define TIM15_BASE (APBPERIPH_BASE + 0x00014000)
  431. #define TIM16_BASE (APBPERIPH_BASE + 0x00014400)
  432. #define TIM17_BASE (APBPERIPH_BASE + 0x00014800)
  433. #define DBGMCU_BASE (APBPERIPH_BASE + 0x00015800)
  434. /*!< AHB peripherals */
  435. #define DMA1_BASE (AHBPERIPH_BASE + 0x00000000)
  436. #define DMA1_Channel1_BASE (DMA1_BASE + 0x00000008)
  437. #define DMA1_Channel2_BASE (DMA1_BASE + 0x0000001C)
  438. #define DMA1_Channel3_BASE (DMA1_BASE + 0x00000030)
  439. #define DMA1_Channel4_BASE (DMA1_BASE + 0x00000044)
  440. #define DMA1_Channel5_BASE (DMA1_BASE + 0x00000058)
  441. #define RCC_BASE (AHBPERIPH_BASE + 0x00001000)
  442. #define FLASH_R_BASE (AHBPERIPH_BASE + 0x00002000) /*!< FLASH registers base address */
  443. #define OB_BASE ((uint32_t)0x1FFFF800U) /*!< FLASH Option Bytes base address */
  444. #define FLASHSIZE_BASE ((uint32_t)0x1FFFF7CCU) /*!< FLASH Size register base address */
  445. #define UID_BASE ((uint32_t)0x1FFFF7ACU) /*!< Unique device ID register base address */
  446. #define CRC_BASE (AHBPERIPH_BASE + 0x00003000)
  447. /*!< AHB2 peripherals */
  448. #define GPIOA_BASE (AHB2PERIPH_BASE + 0x00000000)
  449. #define GPIOB_BASE (AHB2PERIPH_BASE + 0x00000400)
  450. #define GPIOC_BASE (AHB2PERIPH_BASE + 0x00000800)
  451. #define GPIOD_BASE (AHB2PERIPH_BASE + 0x00000C00)
  452. #define GPIOF_BASE (AHB2PERIPH_BASE + 0x00001400)
  453. /**
  454. * @}
  455. */
  456. /** @addtogroup Peripheral_declaration
  457. * @{
  458. */
  459. #define TIM3 ((TIM_TypeDef *) TIM3_BASE)
  460. #define TIM6 ((TIM_TypeDef *) TIM6_BASE)
  461. #define TIM14 ((TIM_TypeDef *) TIM14_BASE)
  462. #define RTC ((RTC_TypeDef *) RTC_BASE)
  463. #define WWDG ((WWDG_TypeDef *) WWDG_BASE)
  464. #define IWDG ((IWDG_TypeDef *) IWDG_BASE)
  465. #define USART2 ((USART_TypeDef *) USART2_BASE)
  466. #define I2C1 ((I2C_TypeDef *) I2C1_BASE)
  467. #define I2C2 ((I2C_TypeDef *) I2C2_BASE)
  468. #define PWR ((PWR_TypeDef *) PWR_BASE)
  469. #define SYSCFG ((SYSCFG_TypeDef *) SYSCFG_BASE)
  470. #define EXTI ((EXTI_TypeDef *) EXTI_BASE)
  471. #define ADC1 ((ADC_TypeDef *) ADC1_BASE)
  472. #define ADC1_COMMON ((ADC_Common_TypeDef *) ADC_BASE)
  473. #define ADC ((ADC_Common_TypeDef *) ADC_BASE) /* Kept for legacy purpose */
  474. #define TIM1 ((TIM_TypeDef *) TIM1_BASE)
  475. #define SPI1 ((SPI_TypeDef *) SPI1_BASE)
  476. #define SPI2 ((SPI_TypeDef *) SPI2_BASE)
  477. #define USART1 ((USART_TypeDef *) USART1_BASE)
  478. #define TIM15 ((TIM_TypeDef *) TIM15_BASE)
  479. #define TIM16 ((TIM_TypeDef *) TIM16_BASE)
  480. #define TIM17 ((TIM_TypeDef *) TIM17_BASE)
  481. #define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
  482. #define DMA1 ((DMA_TypeDef *) DMA1_BASE)
  483. #define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
  484. #define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
  485. #define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
  486. #define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
  487. #define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
  488. #define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
  489. #define OB ((OB_TypeDef *) OB_BASE)
  490. #define RCC ((RCC_TypeDef *) RCC_BASE)
  491. #define CRC ((CRC_TypeDef *) CRC_BASE)
  492. #define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
  493. #define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
  494. #define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
  495. #define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
  496. #define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
  497. /**
  498. * @}
  499. */
  500. /** @addtogroup Exported_constants
  501. * @{
  502. */
  503. /** @addtogroup Peripheral_Registers_Bits_Definition
  504. * @{
  505. */
  506. /******************************************************************************/
  507. /* Peripheral Registers Bits Definition */
  508. /******************************************************************************/
  509. /******************************************************************************/
  510. /* */
  511. /* Analog to Digital Converter (ADC) */
  512. /* */
  513. /******************************************************************************/
  514. /*
  515. * @brief Specific device feature definitions (not present on all devices in the STM32F0 family)
  516. */
  517. /* Note: No specific macro feature on this device */
  518. /******************** Bits definition for ADC_ISR register ******************/
  519. #define ADC_ISR_ADRDY ((uint32_t)0x00000001U) /*!< ADC ready flag */
  520. #define ADC_ISR_EOSMP ((uint32_t)0x00000002U) /*!< ADC group regular end of sampling flag */
  521. #define ADC_ISR_EOC ((uint32_t)0x00000004U) /*!< ADC group regular end of unitary conversion flag */
  522. #define ADC_ISR_EOS ((uint32_t)0x00000008U) /*!< ADC group regular end of sequence conversions flag */
  523. #define ADC_ISR_OVR ((uint32_t)0x00000010U) /*!< ADC group regular overrun flag */
  524. #define ADC_ISR_AWD1 ((uint32_t)0x00000080U) /*!< ADC analog watchdog 1 flag */
  525. /* Legacy defines */
  526. #define ADC_ISR_AWD (ADC_ISR_AWD1)
  527. #define ADC_ISR_EOSEQ (ADC_ISR_EOS)
  528. /******************** Bits definition for ADC_IER register ******************/
  529. #define ADC_IER_ADRDYIE ((uint32_t)0x00000001U) /*!< ADC ready interrupt */
  530. #define ADC_IER_EOSMPIE ((uint32_t)0x00000002U) /*!< ADC group regular end of sampling interrupt */
  531. #define ADC_IER_EOCIE ((uint32_t)0x00000004U) /*!< ADC group regular end of unitary conversion interrupt */
  532. #define ADC_IER_EOSIE ((uint32_t)0x00000008U) /*!< ADC group regular end of sequence conversions interrupt */
  533. #define ADC_IER_OVRIE ((uint32_t)0x00000010U) /*!< ADC group regular overrun interrupt */
  534. #define ADC_IER_AWD1IE ((uint32_t)0x00000080U) /*!< ADC analog watchdog 1 interrupt */
  535. /* Legacy defines */
  536. #define ADC_IER_AWDIE (ADC_IER_AWD1IE)
  537. #define ADC_IER_EOSEQIE (ADC_IER_EOSIE)
  538. /******************** Bits definition for ADC_CR register *******************/
  539. #define ADC_CR_ADEN ((uint32_t)0x00000001U) /*!< ADC enable */
  540. #define ADC_CR_ADDIS ((uint32_t)0x00000002U) /*!< ADC disable */
  541. #define ADC_CR_ADSTART ((uint32_t)0x00000004U) /*!< ADC group regular conversion start */
  542. #define ADC_CR_ADSTP ((uint32_t)0x00000010U) /*!< ADC group regular conversion stop */
  543. #define ADC_CR_ADCAL ((uint32_t)0x80000000U) /*!< ADC calibration */
  544. /******************* Bits definition for ADC_CFGR1 register *****************/
  545. #define ADC_CFGR1_DMAEN ((uint32_t)0x00000001U) /*!< ADC DMA transfer enable */
  546. #define ADC_CFGR1_DMACFG ((uint32_t)0x00000002U) /*!< ADC DMA transfer configuration */
  547. #define ADC_CFGR1_SCANDIR ((uint32_t)0x00000004U) /*!< ADC group regular sequencer scan direction */
  548. #define ADC_CFGR1_RES ((uint32_t)0x00000018U) /*!< ADC data resolution */
  549. #define ADC_CFGR1_RES_0 ((uint32_t)0x00000008U) /*!< bit 0 */
  550. #define ADC_CFGR1_RES_1 ((uint32_t)0x00000010U) /*!< bit 1 */
  551. #define ADC_CFGR1_ALIGN ((uint32_t)0x00000020U) /*!< ADC data alignement */
  552. #define ADC_CFGR1_EXTSEL ((uint32_t)0x000001C0U) /*!< ADC group regular external trigger source */
  553. #define ADC_CFGR1_EXTSEL_0 ((uint32_t)0x00000040U) /*!< bit 0 */
  554. #define ADC_CFGR1_EXTSEL_1 ((uint32_t)0x00000080U) /*!< bit 1 */
  555. #define ADC_CFGR1_EXTSEL_2 ((uint32_t)0x00000100U) /*!< bit 2 */
  556. #define ADC_CFGR1_EXTEN ((uint32_t)0x00000C00U) /*!< ADC group regular external trigger polarity */
  557. #define ADC_CFGR1_EXTEN_0 ((uint32_t)0x00000400U) /*!< bit 0 */
  558. #define ADC_CFGR1_EXTEN_1 ((uint32_t)0x00000800U) /*!< bit 1 */
  559. #define ADC_CFGR1_OVRMOD ((uint32_t)0x00001000U) /*!< ADC group regular overrun configuration */
  560. #define ADC_CFGR1_CONT ((uint32_t)0x00002000U) /*!< ADC group regular continuous conversion mode */
  561. #define ADC_CFGR1_WAIT ((uint32_t)0x00004000U) /*!< ADC low power auto wait */
  562. #define ADC_CFGR1_AUTOFF ((uint32_t)0x00008000U) /*!< ADC low power auto power off */
  563. #define ADC_CFGR1_DISCEN ((uint32_t)0x00010000U) /*!< ADC group regular sequencer discontinuous mode */
  564. #define ADC_CFGR1_AWD1SGL ((uint32_t)0x00400000U) /*!< ADC analog watchdog 1 monitoring a single channel or all channels */
  565. #define ADC_CFGR1_AWD1EN ((uint32_t)0x00800000U) /*!< ADC analog watchdog 1 enable on scope ADC group regular */
  566. #define ADC_CFGR1_AWD1CH ((uint32_t)0x7C000000U) /*!< ADC analog watchdog 1 monitored channel selection */
  567. #define ADC_CFGR1_AWD1CH_0 ((uint32_t)0x04000000U) /*!< bit 0 */
  568. #define ADC_CFGR1_AWD1CH_1 ((uint32_t)0x08000000U) /*!< bit 1 */
  569. #define ADC_CFGR1_AWD1CH_2 ((uint32_t)0x10000000U) /*!< bit 2 */
  570. #define ADC_CFGR1_AWD1CH_3 ((uint32_t)0x20000000U) /*!< bit 3 */
  571. #define ADC_CFGR1_AWD1CH_4 ((uint32_t)0x40000000U) /*!< bit 4 */
  572. /* Legacy defines */
  573. #define ADC_CFGR1_AUTDLY (ADC_CFGR1_WAIT)
  574. #define ADC_CFGR1_AWDSGL (ADC_CFGR1_AWD1SGL)
  575. #define ADC_CFGR1_AWDEN (ADC_CFGR1_AWD1EN)
  576. #define ADC_CFGR1_AWDCH (ADC_CFGR1_AWD1CH)
  577. #define ADC_CFGR1_AWDCH_0 (ADC_CFGR1_AWD1CH_0)
  578. #define ADC_CFGR1_AWDCH_1 (ADC_CFGR1_AWD1CH_1)
  579. #define ADC_CFGR1_AWDCH_2 (ADC_CFGR1_AWD1CH_2)
  580. #define ADC_CFGR1_AWDCH_3 (ADC_CFGR1_AWD1CH_3)
  581. #define ADC_CFGR1_AWDCH_4 (ADC_CFGR1_AWD1CH_4)
  582. /******************* Bits definition for ADC_CFGR2 register *****************/
  583. #define ADC_CFGR2_CKMODE ((uint32_t)0xC0000000U) /*!< ADC clock source and prescaler (prescaler only for clock source synchronous) */
  584. #define ADC_CFGR2_CKMODE_1 ((uint32_t)0x80000000U) /*!< bit 1 */
  585. #define ADC_CFGR2_CKMODE_0 ((uint32_t)0x40000000U) /*!< bit 0 */
  586. /* Legacy defines */
  587. #define ADC_CFGR2_JITOFFDIV4 (ADC_CFGR2_CKMODE_1) /*!< ADC clocked by PCLK div4 */
  588. #define ADC_CFGR2_JITOFFDIV2 (ADC_CFGR2_CKMODE_0) /*!< ADC clocked by PCLK div2 */
  589. /****************** Bit definition for ADC_SMPR register ********************/
  590. #define ADC_SMPR_SMP ((uint32_t)0x00000007U) /*!< ADC group of channels sampling time 2 */
  591. #define ADC_SMPR_SMP_0 ((uint32_t)0x00000001U) /*!< bit 0 */
  592. #define ADC_SMPR_SMP_1 ((uint32_t)0x00000002U) /*!< bit 1 */
  593. #define ADC_SMPR_SMP_2 ((uint32_t)0x00000004U) /*!< bit 2 */
  594. /* Legacy defines */
  595. #define ADC_SMPR1_SMPR (ADC_SMPR_SMP) /*!< SMP[2:0] bits (Sampling time selection) */
  596. #define ADC_SMPR1_SMPR_0 (ADC_SMPR_SMP_0) /*!< bit 0 */
  597. #define ADC_SMPR1_SMPR_1 (ADC_SMPR_SMP_1) /*!< bit 1 */
  598. #define ADC_SMPR1_SMPR_2 (ADC_SMPR_SMP_2) /*!< bit 2 */
  599. /******************* Bit definition for ADC_TR register ********************/
  600. #define ADC_TR1_LT1 ((uint32_t)0x00000FFFU) /*!< ADC analog watchdog 1 threshold low */
  601. #define ADC_TR1_LT1_0 ((uint32_t)0x00000001U) /*!< bit 0 */
  602. #define ADC_TR1_LT1_1 ((uint32_t)0x00000002U) /*!< bit 1 */
  603. #define ADC_TR1_LT1_2 ((uint32_t)0x00000004U) /*!< bit 2 */
  604. #define ADC_TR1_LT1_3 ((uint32_t)0x00000008U) /*!< bit 3 */
  605. #define ADC_TR1_LT1_4 ((uint32_t)0x00000010U) /*!< bit 4 */
  606. #define ADC_TR1_LT1_5 ((uint32_t)0x00000020U) /*!< bit 5 */
  607. #define ADC_TR1_LT1_6 ((uint32_t)0x00000040U) /*!< bit 6 */
  608. #define ADC_TR1_LT1_7 ((uint32_t)0x00000080U) /*!< bit 7 */
  609. #define ADC_TR1_LT1_8 ((uint32_t)0x00000100U) /*!< bit 8 */
  610. #define ADC_TR1_LT1_9 ((uint32_t)0x00000200U) /*!< bit 9 */
  611. #define ADC_TR1_LT1_10 ((uint32_t)0x00000400U) /*!< bit 10 */
  612. #define ADC_TR1_LT1_11 ((uint32_t)0x00000800U) /*!< bit 11 */
  613. #define ADC_TR1_HT1 ((uint32_t)0x0FFF0000U) /*!< ADC Analog watchdog 1 threshold high */
  614. #define ADC_TR1_HT1_0 ((uint32_t)0x00010000U) /*!< bit 0 */
  615. #define ADC_TR1_HT1_1 ((uint32_t)0x00020000U) /*!< bit 1 */
  616. #define ADC_TR1_HT1_2 ((uint32_t)0x00040000U) /*!< bit 2 */
  617. #define ADC_TR1_HT1_3 ((uint32_t)0x00080000U) /*!< bit 3 */
  618. #define ADC_TR1_HT1_4 ((uint32_t)0x00100000U) /*!< bit 4 */
  619. #define ADC_TR1_HT1_5 ((uint32_t)0x00200000U) /*!< bit 5 */
  620. #define ADC_TR1_HT1_6 ((uint32_t)0x00400000U) /*!< bit 6 */
  621. #define ADC_TR1_HT1_7 ((uint32_t)0x00800000U) /*!< bit 7 */
  622. #define ADC_TR1_HT1_8 ((uint32_t)0x01000000U) /*!< bit 8 */
  623. #define ADC_TR1_HT1_9 ((uint32_t)0x02000000U) /*!< bit 9 */
  624. #define ADC_TR1_HT1_10 ((uint32_t)0x04000000U) /*!< bit 10 */
  625. #define ADC_TR1_HT1_11 ((uint32_t)0x08000000U) /*!< bit 11 */
  626. /* Legacy defines */
  627. #define ADC_TR_HT (ADC_TR1_HT1)
  628. #define ADC_TR_LT (ADC_TR1_LT1)
  629. #define ADC_HTR_HT (ADC_TR1_HT1)
  630. #define ADC_LTR_LT (ADC_TR1_LT1)
  631. /****************** Bit definition for ADC_CHSELR register ******************/
  632. #define ADC_CHSELR_CHSEL ((uint32_t)0x0007FFFFU) /*!< ADC group regular sequencer channels, available when ADC_CFGR1_CHSELRMOD is reset */
  633. #define ADC_CHSELR_CHSEL18 ((uint32_t)0x00040000U) /*!< ADC group regular sequencer channel 18, available when ADC_CFGR1_CHSELRMOD is reset */
  634. #define ADC_CHSELR_CHSEL17 ((uint32_t)0x00020000U) /*!< ADC group regular sequencer channel 17, available when ADC_CFGR1_CHSELRMOD is reset */
  635. #define ADC_CHSELR_CHSEL16 ((uint32_t)0x00010000U) /*!< ADC group regular sequencer channel 16, available when ADC_CFGR1_CHSELRMOD is reset */
  636. #define ADC_CHSELR_CHSEL15 ((uint32_t)0x00008000U) /*!< ADC group regular sequencer channel 15, available when ADC_CFGR1_CHSELRMOD is reset */
  637. #define ADC_CHSELR_CHSEL14 ((uint32_t)0x00004000U) /*!< ADC group regular sequencer channel 14, available when ADC_CFGR1_CHSELRMOD is reset */
  638. #define ADC_CHSELR_CHSEL13 ((uint32_t)0x00002000U) /*!< ADC group regular sequencer channel 13, available when ADC_CFGR1_CHSELRMOD is reset */
  639. #define ADC_CHSELR_CHSEL12 ((uint32_t)0x00001000U) /*!< ADC group regular sequencer channel 12, available when ADC_CFGR1_CHSELRMOD is reset */
  640. #define ADC_CHSELR_CHSEL11 ((uint32_t)0x00000800U) /*!< ADC group regular sequencer channel 11, available when ADC_CFGR1_CHSELRMOD is reset */
  641. #define ADC_CHSELR_CHSEL10 ((uint32_t)0x00000400U) /*!< ADC group regular sequencer channel 10, available when ADC_CFGR1_CHSELRMOD is reset */
  642. #define ADC_CHSELR_CHSEL9 ((uint32_t)0x00000200U) /*!< ADC group regular sequencer channel 9, available when ADC_CFGR1_CHSELRMOD is reset */
  643. #define ADC_CHSELR_CHSEL8 ((uint32_t)0x00000100U) /*!< ADC group regular sequencer channel 8, available when ADC_CFGR1_CHSELRMOD is reset */
  644. #define ADC_CHSELR_CHSEL7 ((uint32_t)0x00000080U) /*!< ADC group regular sequencer channel 7, available when ADC_CFGR1_CHSELRMOD is reset */
  645. #define ADC_CHSELR_CHSEL6 ((uint32_t)0x00000040U) /*!< ADC group regular sequencer channel 6, available when ADC_CFGR1_CHSELRMOD is reset */
  646. #define ADC_CHSELR_CHSEL5 ((uint32_t)0x00000020U) /*!< ADC group regular sequencer channel 5, available when ADC_CFGR1_CHSELRMOD is reset */
  647. #define ADC_CHSELR_CHSEL4 ((uint32_t)0x00000010U) /*!< ADC group regular sequencer channel 4, available when ADC_CFGR1_CHSELRMOD is reset */
  648. #define ADC_CHSELR_CHSEL3 ((uint32_t)0x00000008U) /*!< ADC group regular sequencer channel 3, available when ADC_CFGR1_CHSELRMOD is reset */
  649. #define ADC_CHSELR_CHSEL2 ((uint32_t)0x00000004U) /*!< ADC group regular sequencer channel 2, available when ADC_CFGR1_CHSELRMOD is reset */
  650. #define ADC_CHSELR_CHSEL1 ((uint32_t)0x00000002U) /*!< ADC group regular sequencer channel 1, available when ADC_CFGR1_CHSELRMOD is reset */
  651. #define ADC_CHSELR_CHSEL0 ((uint32_t)0x00000001U) /*!< ADC group regular sequencer channel 0, available when ADC_CFGR1_CHSELRMOD is reset */
  652. /******************** Bit definition for ADC_DR register ********************/
  653. #define ADC_DR_DATA ((uint32_t)0x0000FFFFU) /*!< ADC group regular conversion data */
  654. #define ADC_DR_DATA_0 ((uint32_t)0x00000001U) /*!< bit 0 */
  655. #define ADC_DR_DATA_1 ((uint32_t)0x00000002U) /*!< bit 1 */
  656. #define ADC_DR_DATA_2 ((uint32_t)0x00000004U) /*!< bit 2 */
  657. #define ADC_DR_DATA_3 ((uint32_t)0x00000008U) /*!< bit 3 */
  658. #define ADC_DR_DATA_4 ((uint32_t)0x00000010U) /*!< bit 4 */
  659. #define ADC_DR_DATA_5 ((uint32_t)0x00000020U) /*!< bit 5 */
  660. #define ADC_DR_DATA_6 ((uint32_t)0x00000040U) /*!< bit 6 */
  661. #define ADC_DR_DATA_7 ((uint32_t)0x00000080U) /*!< bit 7 */
  662. #define ADC_DR_DATA_8 ((uint32_t)0x00000100U) /*!< bit 8 */
  663. #define ADC_DR_DATA_9 ((uint32_t)0x00000200U) /*!< bit 9 */
  664. #define ADC_DR_DATA_10 ((uint32_t)0x00000400U) /*!< bit 10 */
  665. #define ADC_DR_DATA_11 ((uint32_t)0x00000800U) /*!< bit 11 */
  666. #define ADC_DR_DATA_12 ((uint32_t)0x00001000U) /*!< bit 12 */
  667. #define ADC_DR_DATA_13 ((uint32_t)0x00002000U) /*!< bit 13 */
  668. #define ADC_DR_DATA_14 ((uint32_t)0x00004000U) /*!< bit 14 */
  669. #define ADC_DR_DATA_15 ((uint32_t)0x00008000U) /*!< bit 15 */
  670. /************************* ADC Common registers *****************************/
  671. /******************* Bit definition for ADC_CCR register ********************/
  672. #define ADC_CCR_VREFEN ((uint32_t)0x00400000U) /*!< ADC internal path to VrefInt enable */
  673. #define ADC_CCR_TSEN ((uint32_t)0x00800000U) /*!< ADC internal path to temperature sensor enable */
  674. /******************************************************************************/
  675. /* */
  676. /* CRC calculation unit (CRC) */
  677. /* */
  678. /******************************************************************************/
  679. /******************* Bit definition for CRC_DR register *********************/
  680. #define CRC_DR_DR ((uint32_t)0xFFFFFFFFU) /*!< Data register bits */
  681. /******************* Bit definition for CRC_IDR register ********************/
  682. #define CRC_IDR_IDR ((uint8_t)0xFFU) /*!< General-purpose 8-bit data register bits */
  683. /******************** Bit definition for CRC_CR register ********************/
  684. #define CRC_CR_RESET ((uint32_t)0x00000001U) /*!< RESET the CRC computation unit bit */
  685. #define CRC_CR_REV_IN ((uint32_t)0x00000060U) /*!< REV_IN Reverse Input Data bits */
  686. #define CRC_CR_REV_IN_0 ((uint32_t)0x00000020U) /*!< REV_IN Bit 0 */
  687. #define CRC_CR_REV_IN_1 ((uint32_t)0x00000040U) /*!< REV_IN Bit 1 */
  688. #define CRC_CR_REV_OUT ((uint32_t)0x00000080U) /*!< REV_OUT Reverse Output Data bits */
  689. /******************* Bit definition for CRC_INIT register *******************/
  690. #define CRC_INIT_INIT ((uint32_t)0xFFFFFFFFU) /*!< Initial CRC value bits */
  691. /******************************************************************************/
  692. /* */
  693. /* Debug MCU (DBGMCU) */
  694. /* */
  695. /******************************************************************************/
  696. /**************** Bit definition for DBGMCU_IDCODE register *****************/
  697. #define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFFU) /*!< Device Identifier */
  698. #define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000U) /*!< REV_ID[15:0] bits (Revision Identifier) */
  699. #define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000U) /*!< Bit 0 */
  700. #define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000U) /*!< Bit 1 */
  701. #define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000U) /*!< Bit 2 */
  702. #define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000U) /*!< Bit 3 */
  703. #define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000U) /*!< Bit 4 */
  704. #define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000U) /*!< Bit 5 */
  705. #define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000U) /*!< Bit 6 */
  706. #define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000U) /*!< Bit 7 */
  707. #define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000U) /*!< Bit 8 */
  708. #define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000U) /*!< Bit 9 */
  709. #define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000U) /*!< Bit 10 */
  710. #define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000U) /*!< Bit 11 */
  711. #define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000U) /*!< Bit 12 */
  712. #define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000U) /*!< Bit 13 */
  713. #define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000U) /*!< Bit 14 */
  714. #define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000U) /*!< Bit 15 */
  715. /****************** Bit definition for DBGMCU_CR register *******************/
  716. #define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002U) /*!< Debug Stop Mode */
  717. #define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004U) /*!< Debug Standby mode */
  718. /****************** Bit definition for DBGMCU_APB1_FZ register **************/
  719. #define DBGMCU_APB1_FZ_DBG_TIM3_STOP ((uint32_t)0x00000002U) /*!< TIM3 counter stopped when core is halted */
  720. #define DBGMCU_APB1_FZ_DBG_TIM6_STOP ((uint32_t)0x00000010U) /*!< TIM6 counter stopped when core is halted */
  721. #define DBGMCU_APB1_FZ_DBG_TIM14_STOP ((uint32_t)0x00000100U) /*!< TIM14 counter stopped when core is halted */
  722. #define DBGMCU_APB1_FZ_DBG_RTC_STOP ((uint32_t)0x00000400U) /*!< RTC Calendar frozen when core is halted */
  723. #define DBGMCU_APB1_FZ_DBG_WWDG_STOP ((uint32_t)0x00000800U) /*!< Debug Window Watchdog stopped when Core is halted */
  724. #define DBGMCU_APB1_FZ_DBG_IWDG_STOP ((uint32_t)0x00001000U) /*!< Debug Independent Watchdog stopped when Core is halted */
  725. #define DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00200000U) /*!< I2C1 SMBUS timeout mode stopped when Core is halted */
  726. /****************** Bit definition for DBGMCU_APB2_FZ register **************/
  727. #define DBGMCU_APB2_FZ_DBG_TIM1_STOP ((uint32_t)0x00000800U) /*!< TIM1 counter stopped when core is halted */
  728. #define DBGMCU_APB2_FZ_DBG_TIM15_STOP ((uint32_t)0x00010000U) /*!< TIM15 counter stopped when core is halted */
  729. #define DBGMCU_APB2_FZ_DBG_TIM16_STOP ((uint32_t)0x00020000U) /*!< TIM16 counter stopped when core is halted */
  730. #define DBGMCU_APB2_FZ_DBG_TIM17_STOP ((uint32_t)0x00040000U) /*!< TIM17 counter stopped when core is halted */
  731. /******************************************************************************/
  732. /* */
  733. /* DMA Controller (DMA) */
  734. /* */
  735. /******************************************************************************/
  736. /******************* Bit definition for DMA_ISR register ********************/
  737. #define DMA_ISR_GIF1 ((uint32_t)0x00000001U) /*!< Channel 1 Global interrupt flag */
  738. #define DMA_ISR_TCIF1 ((uint32_t)0x00000002U) /*!< Channel 1 Transfer Complete flag */
  739. #define DMA_ISR_HTIF1 ((uint32_t)0x00000004U) /*!< Channel 1 Half Transfer flag */
  740. #define DMA_ISR_TEIF1 ((uint32_t)0x00000008U) /*!< Channel 1 Transfer Error flag */
  741. #define DMA_ISR_GIF2 ((uint32_t)0x00000010U) /*!< Channel 2 Global interrupt flag */
  742. #define DMA_ISR_TCIF2 ((uint32_t)0x00000020U) /*!< Channel 2 Transfer Complete flag */
  743. #define DMA_ISR_HTIF2 ((uint32_t)0x00000040U) /*!< Channel 2 Half Transfer flag */
  744. #define DMA_ISR_TEIF2 ((uint32_t)0x00000080U) /*!< Channel 2 Transfer Error flag */
  745. #define DMA_ISR_GIF3 ((uint32_t)0x00000100U) /*!< Channel 3 Global interrupt flag */
  746. #define DMA_ISR_TCIF3 ((uint32_t)0x00000200U) /*!< Channel 3 Transfer Complete flag */
  747. #define DMA_ISR_HTIF3 ((uint32_t)0x00000400U) /*!< Channel 3 Half Transfer flag */
  748. #define DMA_ISR_TEIF3 ((uint32_t)0x00000800U) /*!< Channel 3 Transfer Error flag */
  749. #define DMA_ISR_GIF4 ((uint32_t)0x00001000U) /*!< Channel 4 Global interrupt flag */
  750. #define DMA_ISR_TCIF4 ((uint32_t)0x00002000U) /*!< Channel 4 Transfer Complete flag */
  751. #define DMA_ISR_HTIF4 ((uint32_t)0x00004000U) /*!< Channel 4 Half Transfer flag */
  752. #define DMA_ISR_TEIF4 ((uint32_t)0x00008000U) /*!< Channel 4 Transfer Error flag */
  753. #define DMA_ISR_GIF5 ((uint32_t)0x00010000U) /*!< Channel 5 Global interrupt flag */
  754. #define DMA_ISR_TCIF5 ((uint32_t)0x00020000U) /*!< Channel 5 Transfer Complete flag */
  755. #define DMA_ISR_HTIF5 ((uint32_t)0x00040000U) /*!< Channel 5 Half Transfer flag */
  756. #define DMA_ISR_TEIF5 ((uint32_t)0x00080000U) /*!< Channel 5 Transfer Error flag */
  757. /******************* Bit definition for DMA_IFCR register *******************/
  758. #define DMA_IFCR_CGIF1 ((uint32_t)0x00000001U) /*!< Channel 1 Global interrupt clear */
  759. #define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002U) /*!< Channel 1 Transfer Complete clear */
  760. #define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004U) /*!< Channel 1 Half Transfer clear */
  761. #define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008U) /*!< Channel 1 Transfer Error clear */
  762. #define DMA_IFCR_CGIF2 ((uint32_t)0x00000010U) /*!< Channel 2 Global interrupt clear */
  763. #define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020U) /*!< Channel 2 Transfer Complete clear */
  764. #define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040U) /*!< Channel 2 Half Transfer clear */
  765. #define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080U) /*!< Channel 2 Transfer Error clear */
  766. #define DMA_IFCR_CGIF3 ((uint32_t)0x00000100U) /*!< Channel 3 Global interrupt clear */
  767. #define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200U) /*!< Channel 3 Transfer Complete clear */
  768. #define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400U) /*!< Channel 3 Half Transfer clear */
  769. #define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800U) /*!< Channel 3 Transfer Error clear */
  770. #define DMA_IFCR_CGIF4 ((uint32_t)0x00001000U) /*!< Channel 4 Global interrupt clear */
  771. #define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000U) /*!< Channel 4 Transfer Complete clear */
  772. #define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000U) /*!< Channel 4 Half Transfer clear */
  773. #define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000U) /*!< Channel 4 Transfer Error clear */
  774. #define DMA_IFCR_CGIF5 ((uint32_t)0x00010000U) /*!< Channel 5 Global interrupt clear */
  775. #define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000U) /*!< Channel 5 Transfer Complete clear */
  776. #define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000U) /*!< Channel 5 Half Transfer clear */
  777. #define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000U) /*!< Channel 5 Transfer Error clear */
  778. /******************* Bit definition for DMA_CCR register ********************/
  779. #define DMA_CCR_EN ((uint32_t)0x00000001U) /*!< Channel enable */
  780. #define DMA_CCR_TCIE ((uint32_t)0x00000002U) /*!< Transfer complete interrupt enable */
  781. #define DMA_CCR_HTIE ((uint32_t)0x00000004U) /*!< Half Transfer interrupt enable */
  782. #define DMA_CCR_TEIE ((uint32_t)0x00000008U) /*!< Transfer error interrupt enable */
  783. #define DMA_CCR_DIR ((uint32_t)0x00000010U) /*!< Data transfer direction */
  784. #define DMA_CCR_CIRC ((uint32_t)0x00000020U) /*!< Circular mode */
  785. #define DMA_CCR_PINC ((uint32_t)0x00000040U) /*!< Peripheral increment mode */
  786. #define DMA_CCR_MINC ((uint32_t)0x00000080U) /*!< Memory increment mode */
  787. #define DMA_CCR_PSIZE ((uint32_t)0x00000300U) /*!< PSIZE[1:0] bits (Peripheral size) */
  788. #define DMA_CCR_PSIZE_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  789. #define DMA_CCR_PSIZE_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  790. #define DMA_CCR_MSIZE ((uint32_t)0x00000C00U) /*!< MSIZE[1:0] bits (Memory size) */
  791. #define DMA_CCR_MSIZE_0 ((uint32_t)0x00000400U) /*!< Bit 0 */
  792. #define DMA_CCR_MSIZE_1 ((uint32_t)0x00000800U) /*!< Bit 1 */
  793. #define DMA_CCR_PL ((uint32_t)0x00003000U) /*!< PL[1:0] bits(Channel Priority level)*/
  794. #define DMA_CCR_PL_0 ((uint32_t)0x00001000U) /*!< Bit 0 */
  795. #define DMA_CCR_PL_1 ((uint32_t)0x00002000U) /*!< Bit 1 */
  796. #define DMA_CCR_MEM2MEM ((uint32_t)0x00004000U) /*!< Memory to memory mode */
  797. /****************** Bit definition for DMA_CNDTR register *******************/
  798. #define DMA_CNDTR_NDT ((uint32_t)0x0000FFFFU) /*!< Number of data to Transfer */
  799. /****************** Bit definition for DMA_CPAR register ********************/
  800. #define DMA_CPAR_PA ((uint32_t)0xFFFFFFFFU) /*!< Peripheral Address */
  801. /****************** Bit definition for DMA_CMAR register ********************/
  802. #define DMA_CMAR_MA ((uint32_t)0xFFFFFFFFU) /*!< Memory Address */
  803. /******************************************************************************/
  804. /* */
  805. /* External Interrupt/Event Controller (EXTI) */
  806. /* */
  807. /******************************************************************************/
  808. /******************* Bit definition for EXTI_IMR register *******************/
  809. #define EXTI_IMR_MR0 ((uint32_t)0x00000001U) /*!< Interrupt Mask on line 0 */
  810. #define EXTI_IMR_MR1 ((uint32_t)0x00000002U) /*!< Interrupt Mask on line 1 */
  811. #define EXTI_IMR_MR2 ((uint32_t)0x00000004U) /*!< Interrupt Mask on line 2 */
  812. #define EXTI_IMR_MR3 ((uint32_t)0x00000008U) /*!< Interrupt Mask on line 3 */
  813. #define EXTI_IMR_MR4 ((uint32_t)0x00000010U) /*!< Interrupt Mask on line 4 */
  814. #define EXTI_IMR_MR5 ((uint32_t)0x00000020U) /*!< Interrupt Mask on line 5 */
  815. #define EXTI_IMR_MR6 ((uint32_t)0x00000040U) /*!< Interrupt Mask on line 6 */
  816. #define EXTI_IMR_MR7 ((uint32_t)0x00000080U) /*!< Interrupt Mask on line 7 */
  817. #define EXTI_IMR_MR8 ((uint32_t)0x00000100U) /*!< Interrupt Mask on line 8 */
  818. #define EXTI_IMR_MR9 ((uint32_t)0x00000200U) /*!< Interrupt Mask on line 9 */
  819. #define EXTI_IMR_MR10 ((uint32_t)0x00000400U) /*!< Interrupt Mask on line 10 */
  820. #define EXTI_IMR_MR11 ((uint32_t)0x00000800U) /*!< Interrupt Mask on line 11 */
  821. #define EXTI_IMR_MR12 ((uint32_t)0x00001000U) /*!< Interrupt Mask on line 12 */
  822. #define EXTI_IMR_MR13 ((uint32_t)0x00002000U) /*!< Interrupt Mask on line 13 */
  823. #define EXTI_IMR_MR14 ((uint32_t)0x00004000U) /*!< Interrupt Mask on line 14 */
  824. #define EXTI_IMR_MR15 ((uint32_t)0x00008000U) /*!< Interrupt Mask on line 15 */
  825. #define EXTI_IMR_MR17 ((uint32_t)0x00020000U) /*!< Interrupt Mask on line 17 */
  826. #define EXTI_IMR_MR18 ((uint32_t)0x00040000U) /*!< Interrupt Mask on line 18 */
  827. #define EXTI_IMR_MR19 ((uint32_t)0x00080000U) /*!< Interrupt Mask on line 19 */
  828. #define EXTI_IMR_MR23 ((uint32_t)0x00800000U) /*!< Interrupt Mask on line 23 */
  829. /* References Defines */
  830. #define EXTI_IMR_IM0 EXTI_IMR_MR0
  831. #define EXTI_IMR_IM1 EXTI_IMR_MR1
  832. #define EXTI_IMR_IM2 EXTI_IMR_MR2
  833. #define EXTI_IMR_IM3 EXTI_IMR_MR3
  834. #define EXTI_IMR_IM4 EXTI_IMR_MR4
  835. #define EXTI_IMR_IM5 EXTI_IMR_MR5
  836. #define EXTI_IMR_IM6 EXTI_IMR_MR6
  837. #define EXTI_IMR_IM7 EXTI_IMR_MR7
  838. #define EXTI_IMR_IM8 EXTI_IMR_MR8
  839. #define EXTI_IMR_IM9 EXTI_IMR_MR9
  840. #define EXTI_IMR_IM10 EXTI_IMR_MR10
  841. #define EXTI_IMR_IM11 EXTI_IMR_MR11
  842. #define EXTI_IMR_IM12 EXTI_IMR_MR12
  843. #define EXTI_IMR_IM13 EXTI_IMR_MR13
  844. #define EXTI_IMR_IM14 EXTI_IMR_MR14
  845. #define EXTI_IMR_IM15 EXTI_IMR_MR15
  846. #define EXTI_IMR_IM17 EXTI_IMR_MR17
  847. #define EXTI_IMR_IM18 EXTI_IMR_MR18
  848. #define EXTI_IMR_IM19 EXTI_IMR_MR19
  849. #define EXTI_IMR_IM23 EXTI_IMR_MR23
  850. /****************** Bit definition for EXTI_EMR register ********************/
  851. #define EXTI_EMR_MR0 ((uint32_t)0x00000001U) /*!< Event Mask on line 0 */
  852. #define EXTI_EMR_MR1 ((uint32_t)0x00000002U) /*!< Event Mask on line 1 */
  853. #define EXTI_EMR_MR2 ((uint32_t)0x00000004U) /*!< Event Mask on line 2 */
  854. #define EXTI_EMR_MR3 ((uint32_t)0x00000008U) /*!< Event Mask on line 3 */
  855. #define EXTI_EMR_MR4 ((uint32_t)0x00000010U) /*!< Event Mask on line 4 */
  856. #define EXTI_EMR_MR5 ((uint32_t)0x00000020U) /*!< Event Mask on line 5 */
  857. #define EXTI_EMR_MR6 ((uint32_t)0x00000040U) /*!< Event Mask on line 6 */
  858. #define EXTI_EMR_MR7 ((uint32_t)0x00000080U) /*!< Event Mask on line 7 */
  859. #define EXTI_EMR_MR8 ((uint32_t)0x00000100U) /*!< Event Mask on line 8 */
  860. #define EXTI_EMR_MR9 ((uint32_t)0x00000200U) /*!< Event Mask on line 9 */
  861. #define EXTI_EMR_MR10 ((uint32_t)0x00000400U) /*!< Event Mask on line 10 */
  862. #define EXTI_EMR_MR11 ((uint32_t)0x00000800U) /*!< Event Mask on line 11 */
  863. #define EXTI_EMR_MR12 ((uint32_t)0x00001000U) /*!< Event Mask on line 12 */
  864. #define EXTI_EMR_MR13 ((uint32_t)0x00002000U) /*!< Event Mask on line 13 */
  865. #define EXTI_EMR_MR14 ((uint32_t)0x00004000U) /*!< Event Mask on line 14 */
  866. #define EXTI_EMR_MR15 ((uint32_t)0x00008000U) /*!< Event Mask on line 15 */
  867. #define EXTI_EMR_MR17 ((uint32_t)0x00020000U) /*!< Event Mask on line 17 */
  868. #define EXTI_EMR_MR18 ((uint32_t)0x00040000U) /*!< Event Mask on line 18 */
  869. #define EXTI_EMR_MR19 ((uint32_t)0x00080000U) /*!< Event Mask on line 19 */
  870. #define EXTI_EMR_MR23 ((uint32_t)0x00800000U) /*!< Event Mask on line 23 */
  871. /* References Defines */
  872. #define EXTI_EMR_EM0 EXTI_EMR_MR0
  873. #define EXTI_EMR_EM1 EXTI_EMR_MR1
  874. #define EXTI_EMR_EM2 EXTI_EMR_MR2
  875. #define EXTI_EMR_EM3 EXTI_EMR_MR3
  876. #define EXTI_EMR_EM4 EXTI_EMR_MR4
  877. #define EXTI_EMR_EM5 EXTI_EMR_MR5
  878. #define EXTI_EMR_EM6 EXTI_EMR_MR6
  879. #define EXTI_EMR_EM7 EXTI_EMR_MR7
  880. #define EXTI_EMR_EM8 EXTI_EMR_MR8
  881. #define EXTI_EMR_EM9 EXTI_EMR_MR9
  882. #define EXTI_EMR_EM10 EXTI_EMR_MR10
  883. #define EXTI_EMR_EM11 EXTI_EMR_MR11
  884. #define EXTI_EMR_EM12 EXTI_EMR_MR12
  885. #define EXTI_EMR_EM13 EXTI_EMR_MR13
  886. #define EXTI_EMR_EM14 EXTI_EMR_MR14
  887. #define EXTI_EMR_EM15 EXTI_EMR_MR15
  888. #define EXTI_EMR_EM17 EXTI_EMR_MR17
  889. #define EXTI_EMR_EM18 EXTI_EMR_MR18
  890. #define EXTI_EMR_EM19 EXTI_EMR_MR19
  891. #define EXTI_EMR_EM23 EXTI_EMR_MR23
  892. /******************* Bit definition for EXTI_RTSR register ******************/
  893. #define EXTI_RTSR_TR0 ((uint32_t)0x00000001U) /*!< Rising trigger event configuration bit of line 0 */
  894. #define EXTI_RTSR_TR1 ((uint32_t)0x00000002U) /*!< Rising trigger event configuration bit of line 1 */
  895. #define EXTI_RTSR_TR2 ((uint32_t)0x00000004U) /*!< Rising trigger event configuration bit of line 2 */
  896. #define EXTI_RTSR_TR3 ((uint32_t)0x00000008U) /*!< Rising trigger event configuration bit of line 3 */
  897. #define EXTI_RTSR_TR4 ((uint32_t)0x00000010U) /*!< Rising trigger event configuration bit of line 4 */
  898. #define EXTI_RTSR_TR5 ((uint32_t)0x00000020U) /*!< Rising trigger event configuration bit of line 5 */
  899. #define EXTI_RTSR_TR6 ((uint32_t)0x00000040U) /*!< Rising trigger event configuration bit of line 6 */
  900. #define EXTI_RTSR_TR7 ((uint32_t)0x00000080U) /*!< Rising trigger event configuration bit of line 7 */
  901. #define EXTI_RTSR_TR8 ((uint32_t)0x00000100U) /*!< Rising trigger event configuration bit of line 8 */
  902. #define EXTI_RTSR_TR9 ((uint32_t)0x00000200U) /*!< Rising trigger event configuration bit of line 9 */
  903. #define EXTI_RTSR_TR10 ((uint32_t)0x00000400U) /*!< Rising trigger event configuration bit of line 10 */
  904. #define EXTI_RTSR_TR11 ((uint32_t)0x00000800U) /*!< Rising trigger event configuration bit of line 11 */
  905. #define EXTI_RTSR_TR12 ((uint32_t)0x00001000U) /*!< Rising trigger event configuration bit of line 12 */
  906. #define EXTI_RTSR_TR13 ((uint32_t)0x00002000U) /*!< Rising trigger event configuration bit of line 13 */
  907. #define EXTI_RTSR_TR14 ((uint32_t)0x00004000U) /*!< Rising trigger event configuration bit of line 14 */
  908. #define EXTI_RTSR_TR15 ((uint32_t)0x00008000U) /*!< Rising trigger event configuration bit of line 15 */
  909. #define EXTI_RTSR_TR16 ((uint32_t)0x00010000U) /*!< Rising trigger event configuration bit of line 16 */
  910. #define EXTI_RTSR_TR17 ((uint32_t)0x00020000U) /*!< Rising trigger event configuration bit of line 17 */
  911. #define EXTI_RTSR_TR19 ((uint32_t)0x00080000U) /*!< Rising trigger event configuration bit of line 19 */
  912. /* References Defines */
  913. #define EXTI_RTSR_RT0 EXTI_RTSR_TR0
  914. #define EXTI_RTSR_RT1 EXTI_RTSR_TR1
  915. #define EXTI_RTSR_RT2 EXTI_RTSR_TR2
  916. #define EXTI_RTSR_RT3 EXTI_RTSR_TR3
  917. #define EXTI_RTSR_RT4 EXTI_RTSR_TR4
  918. #define EXTI_RTSR_RT5 EXTI_RTSR_TR5
  919. #define EXTI_RTSR_RT6 EXTI_RTSR_TR6
  920. #define EXTI_RTSR_RT7 EXTI_RTSR_TR7
  921. #define EXTI_RTSR_RT8 EXTI_RTSR_TR8
  922. #define EXTI_RTSR_RT9 EXTI_RTSR_TR9
  923. #define EXTI_RTSR_RT10 EXTI_RTSR_TR10
  924. #define EXTI_RTSR_RT11 EXTI_RTSR_TR11
  925. #define EXTI_RTSR_RT12 EXTI_RTSR_TR12
  926. #define EXTI_RTSR_RT13 EXTI_RTSR_TR13
  927. #define EXTI_RTSR_RT14 EXTI_RTSR_TR14
  928. #define EXTI_RTSR_RT15 EXTI_RTSR_TR15
  929. #define EXTI_RTSR_RT16 EXTI_RTSR_TR16
  930. #define EXTI_RTSR_RT17 EXTI_RTSR_TR17
  931. #define EXTI_RTSR_RT19 EXTI_RTSR_TR19
  932. /******************* Bit definition for EXTI_FTSR register *******************/
  933. #define EXTI_FTSR_TR0 ((uint32_t)0x00000001U) /*!< Falling trigger event configuration bit of line 0 */
  934. #define EXTI_FTSR_TR1 ((uint32_t)0x00000002U) /*!< Falling trigger event configuration bit of line 1 */
  935. #define EXTI_FTSR_TR2 ((uint32_t)0x00000004U) /*!< Falling trigger event configuration bit of line 2 */
  936. #define EXTI_FTSR_TR3 ((uint32_t)0x00000008U) /*!< Falling trigger event configuration bit of line 3 */
  937. #define EXTI_FTSR_TR4 ((uint32_t)0x00000010U) /*!< Falling trigger event configuration bit of line 4 */
  938. #define EXTI_FTSR_TR5 ((uint32_t)0x00000020U) /*!< Falling trigger event configuration bit of line 5 */
  939. #define EXTI_FTSR_TR6 ((uint32_t)0x00000040U) /*!< Falling trigger event configuration bit of line 6 */
  940. #define EXTI_FTSR_TR7 ((uint32_t)0x00000080U) /*!< Falling trigger event configuration bit of line 7 */
  941. #define EXTI_FTSR_TR8 ((uint32_t)0x00000100U) /*!< Falling trigger event configuration bit of line 8 */
  942. #define EXTI_FTSR_TR9 ((uint32_t)0x00000200U) /*!< Falling trigger event configuration bit of line 9 */
  943. #define EXTI_FTSR_TR10 ((uint32_t)0x00000400U) /*!< Falling trigger event configuration bit of line 10 */
  944. #define EXTI_FTSR_TR11 ((uint32_t)0x00000800U) /*!< Falling trigger event configuration bit of line 11 */
  945. #define EXTI_FTSR_TR12 ((uint32_t)0x00001000U) /*!< Falling trigger event configuration bit of line 12 */
  946. #define EXTI_FTSR_TR13 ((uint32_t)0x00002000U) /*!< Falling trigger event configuration bit of line 13 */
  947. #define EXTI_FTSR_TR14 ((uint32_t)0x00004000U) /*!< Falling trigger event configuration bit of line 14 */
  948. #define EXTI_FTSR_TR15 ((uint32_t)0x00008000U) /*!< Falling trigger event configuration bit of line 15 */
  949. #define EXTI_FTSR_TR16 ((uint32_t)0x00010000U) /*!< Falling trigger event configuration bit of line 16 */
  950. #define EXTI_FTSR_TR17 ((uint32_t)0x00020000U) /*!< Falling trigger event configuration bit of line 17 */
  951. #define EXTI_FTSR_TR19 ((uint32_t)0x00080000U) /*!< Falling trigger event configuration bit of line 19 */
  952. /* References Defines */
  953. #define EXTI_FTSR_FT0 EXTI_FTSR_TR0
  954. #define EXTI_FTSR_FT1 EXTI_FTSR_TR1
  955. #define EXTI_FTSR_FT2 EXTI_FTSR_TR2
  956. #define EXTI_FTSR_FT3 EXTI_FTSR_TR3
  957. #define EXTI_FTSR_FT4 EXTI_FTSR_TR4
  958. #define EXTI_FTSR_FT5 EXTI_FTSR_TR5
  959. #define EXTI_FTSR_FT6 EXTI_FTSR_TR6
  960. #define EXTI_FTSR_FT7 EXTI_FTSR_TR7
  961. #define EXTI_FTSR_FT8 EXTI_FTSR_TR8
  962. #define EXTI_FTSR_FT9 EXTI_FTSR_TR9
  963. #define EXTI_FTSR_FT10 EXTI_FTSR_TR10
  964. #define EXTI_FTSR_FT11 EXTI_FTSR_TR11
  965. #define EXTI_FTSR_FT12 EXTI_FTSR_TR12
  966. #define EXTI_FTSR_FT13 EXTI_FTSR_TR13
  967. #define EXTI_FTSR_FT14 EXTI_FTSR_TR14
  968. #define EXTI_FTSR_FT15 EXTI_FTSR_TR15
  969. #define EXTI_FTSR_FT16 EXTI_FTSR_TR16
  970. #define EXTI_FTSR_FT17 EXTI_FTSR_TR17
  971. #define EXTI_FTSR_FT19 EXTI_FTSR_TR19
  972. /******************* Bit definition for EXTI_SWIER register *******************/
  973. #define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001U) /*!< Software Interrupt on line 0 */
  974. #define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002U) /*!< Software Interrupt on line 1 */
  975. #define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004U) /*!< Software Interrupt on line 2 */
  976. #define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008U) /*!< Software Interrupt on line 3 */
  977. #define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010U) /*!< Software Interrupt on line 4 */
  978. #define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020U) /*!< Software Interrupt on line 5 */
  979. #define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040U) /*!< Software Interrupt on line 6 */
  980. #define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080U) /*!< Software Interrupt on line 7 */
  981. #define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100U) /*!< Software Interrupt on line 8 */
  982. #define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200U) /*!< Software Interrupt on line 9 */
  983. #define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400U) /*!< Software Interrupt on line 10 */
  984. #define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800U) /*!< Software Interrupt on line 11 */
  985. #define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000U) /*!< Software Interrupt on line 12 */
  986. #define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000U) /*!< Software Interrupt on line 13 */
  987. #define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000U) /*!< Software Interrupt on line 14 */
  988. #define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000U) /*!< Software Interrupt on line 15 */
  989. #define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000U) /*!< Software Interrupt on line 16 */
  990. #define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000U) /*!< Software Interrupt on line 17 */
  991. #define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000U) /*!< Software Interrupt on line 19 */
  992. /* References Defines */
  993. #define EXTI_SWIER_SWI0 EXTI_SWIER_SWIER0
  994. #define EXTI_SWIER_SWI1 EXTI_SWIER_SWIER1
  995. #define EXTI_SWIER_SWI2 EXTI_SWIER_SWIER2
  996. #define EXTI_SWIER_SWI3 EXTI_SWIER_SWIER3
  997. #define EXTI_SWIER_SWI4 EXTI_SWIER_SWIER4
  998. #define EXTI_SWIER_SWI5 EXTI_SWIER_SWIER5
  999. #define EXTI_SWIER_SWI6 EXTI_SWIER_SWIER6
  1000. #define EXTI_SWIER_SWI7 EXTI_SWIER_SWIER7
  1001. #define EXTI_SWIER_SWI8 EXTI_SWIER_SWIER8
  1002. #define EXTI_SWIER_SWI9 EXTI_SWIER_SWIER9
  1003. #define EXTI_SWIER_SWI10 EXTI_SWIER_SWIER10
  1004. #define EXTI_SWIER_SWI11 EXTI_SWIER_SWIER11
  1005. #define EXTI_SWIER_SWI12 EXTI_SWIER_SWIER12
  1006. #define EXTI_SWIER_SWI13 EXTI_SWIER_SWIER13
  1007. #define EXTI_SWIER_SWI14 EXTI_SWIER_SWIER14
  1008. #define EXTI_SWIER_SWI15 EXTI_SWIER_SWIER15
  1009. #define EXTI_SWIER_SWI16 EXTI_SWIER_SWIER16
  1010. #define EXTI_SWIER_SWI17 EXTI_SWIER_SWIER17
  1011. #define EXTI_SWIER_SWI19 EXTI_SWIER_SWIER19
  1012. /****************** Bit definition for EXTI_PR register *********************/
  1013. #define EXTI_PR_PR0 ((uint32_t)0x00000001U) /*!< Pending bit 0 */
  1014. #define EXTI_PR_PR1 ((uint32_t)0x00000002U) /*!< Pending bit 1 */
  1015. #define EXTI_PR_PR2 ((uint32_t)0x00000004U) /*!< Pending bit 2 */
  1016. #define EXTI_PR_PR3 ((uint32_t)0x00000008U) /*!< Pending bit 3 */
  1017. #define EXTI_PR_PR4 ((uint32_t)0x00000010U) /*!< Pending bit 4 */
  1018. #define EXTI_PR_PR5 ((uint32_t)0x00000020U) /*!< Pending bit 5 */
  1019. #define EXTI_PR_PR6 ((uint32_t)0x00000040U) /*!< Pending bit 6 */
  1020. #define EXTI_PR_PR7 ((uint32_t)0x00000080U) /*!< Pending bit 7 */
  1021. #define EXTI_PR_PR8 ((uint32_t)0x00000100U) /*!< Pending bit 8 */
  1022. #define EXTI_PR_PR9 ((uint32_t)0x00000200U) /*!< Pending bit 9 */
  1023. #define EXTI_PR_PR10 ((uint32_t)0x00000400U) /*!< Pending bit 10 */
  1024. #define EXTI_PR_PR11 ((uint32_t)0x00000800U) /*!< Pending bit 11 */
  1025. #define EXTI_PR_PR12 ((uint32_t)0x00001000U) /*!< Pending bit 12 */
  1026. #define EXTI_PR_PR13 ((uint32_t)0x00002000U) /*!< Pending bit 13 */
  1027. #define EXTI_PR_PR14 ((uint32_t)0x00004000U) /*!< Pending bit 14 */
  1028. #define EXTI_PR_PR15 ((uint32_t)0x00008000U) /*!< Pending bit 15 */
  1029. #define EXTI_PR_PR16 ((uint32_t)0x00010000U) /*!< Pending bit 16 */
  1030. #define EXTI_PR_PR17 ((uint32_t)0x00020000U) /*!< Pending bit 17 */
  1031. #define EXTI_PR_PR19 ((uint32_t)0x00080000U) /*!< Pending bit 19 */
  1032. /* References Defines */
  1033. #define EXTI_PR_PIF0 EXTI_PR_PR0
  1034. #define EXTI_PR_PIF1 EXTI_PR_PR1
  1035. #define EXTI_PR_PIF2 EXTI_PR_PR2
  1036. #define EXTI_PR_PIF3 EXTI_PR_PR3
  1037. #define EXTI_PR_PIF4 EXTI_PR_PR4
  1038. #define EXTI_PR_PIF5 EXTI_PR_PR5
  1039. #define EXTI_PR_PIF6 EXTI_PR_PR6
  1040. #define EXTI_PR_PIF7 EXTI_PR_PR7
  1041. #define EXTI_PR_PIF8 EXTI_PR_PR8
  1042. #define EXTI_PR_PIF9 EXTI_PR_PR9
  1043. #define EXTI_PR_PIF10 EXTI_PR_PR10
  1044. #define EXTI_PR_PIF11 EXTI_PR_PR11
  1045. #define EXTI_PR_PIF12 EXTI_PR_PR12
  1046. #define EXTI_PR_PIF13 EXTI_PR_PR13
  1047. #define EXTI_PR_PIF14 EXTI_PR_PR14
  1048. #define EXTI_PR_PIF15 EXTI_PR_PR15
  1049. #define EXTI_PR_PIF16 EXTI_PR_PR16
  1050. #define EXTI_PR_PIF17 EXTI_PR_PR17
  1051. #define EXTI_PR_PIF19 EXTI_PR_PR19
  1052. /******************************************************************************/
  1053. /* */
  1054. /* FLASH and Option Bytes Registers */
  1055. /* */
  1056. /******************************************************************************/
  1057. /******************* Bit definition for FLASH_ACR register ******************/
  1058. #define FLASH_ACR_LATENCY ((uint32_t)0x00000001U) /*!< LATENCY bit (Latency) */
  1059. #define FLASH_ACR_PRFTBE ((uint32_t)0x00000010U) /*!< Prefetch Buffer Enable */
  1060. #define FLASH_ACR_PRFTBS ((uint32_t)0x00000020U) /*!< Prefetch Buffer Status */
  1061. /****************** Bit definition for FLASH_KEYR register ******************/
  1062. #define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFFU) /*!< FPEC Key */
  1063. /***************** Bit definition for FLASH_OPTKEYR register ****************/
  1064. #define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFFU) /*!< Option Byte Key */
  1065. /****************** FLASH Keys **********************************************/
  1066. #define FLASH_KEY1 ((uint32_t)0x45670123U) /*!< Flash program erase key1 */
  1067. #define FLASH_KEY2 ((uint32_t)0xCDEF89ABU) /*!< Flash program erase key2: used with FLASH_PEKEY1
  1068. to unlock the write access to the FPEC. */
  1069. #define FLASH_OPTKEY1 ((uint32_t)0x45670123U) /*!< Flash option key1 */
  1070. #define FLASH_OPTKEY2 ((uint32_t)0xCDEF89ABU) /*!< Flash option key2: used with FLASH_OPTKEY1 to
  1071. unlock the write access to the option byte block */
  1072. /****************** Bit definition for FLASH_SR register *******************/
  1073. #define FLASH_SR_BSY ((uint32_t)0x00000001U) /*!< Busy */
  1074. #define FLASH_SR_PGERR ((uint32_t)0x00000004U) /*!< Programming Error */
  1075. #define FLASH_SR_WRPRTERR ((uint32_t)0x00000010U) /*!< Write Protection Error */
  1076. #define FLASH_SR_EOP ((uint32_t)0x00000020U) /*!< End of operation */
  1077. #define FLASH_SR_WRPERR FLASH_SR_WRPRTERR /*!< Legacy of Write Protection Error */
  1078. /******************* Bit definition for FLASH_CR register *******************/
  1079. #define FLASH_CR_PG ((uint32_t)0x00000001U) /*!< Programming */
  1080. #define FLASH_CR_PER ((uint32_t)0x00000002U) /*!< Page Erase */
  1081. #define FLASH_CR_MER ((uint32_t)0x00000004U) /*!< Mass Erase */
  1082. #define FLASH_CR_OPTPG ((uint32_t)0x00000010U) /*!< Option Byte Programming */
  1083. #define FLASH_CR_OPTER ((uint32_t)0x00000020U) /*!< Option Byte Erase */
  1084. #define FLASH_CR_STRT ((uint32_t)0x00000040U) /*!< Start */
  1085. #define FLASH_CR_LOCK ((uint32_t)0x00000080U) /*!< Lock */
  1086. #define FLASH_CR_OPTWRE ((uint32_t)0x00000200U) /*!< Option Bytes Write Enable */
  1087. #define FLASH_CR_ERRIE ((uint32_t)0x00000400U) /*!< Error Interrupt Enable */
  1088. #define FLASH_CR_EOPIE ((uint32_t)0x00001000U) /*!< End of operation interrupt enable */
  1089. #define FLASH_CR_OBL_LAUNCH ((uint32_t)0x00002000U) /*!< Option Bytes Loader Launch */
  1090. /******************* Bit definition for FLASH_AR register *******************/
  1091. #define FLASH_AR_FAR ((uint32_t)0xFFFFFFFFU) /*!< Flash Address */
  1092. /****************** Bit definition for FLASH_OBR register *******************/
  1093. #define FLASH_OBR_OPTERR ((uint32_t)0x00000001U) /*!< Option Byte Error */
  1094. #define FLASH_OBR_RDPRT1 ((uint32_t)0x00000002U) /*!< Read protection Level 1 */
  1095. #define FLASH_OBR_RDPRT2 ((uint32_t)0x00000004U) /*!< Read protection Level 2 */
  1096. #define FLASH_OBR_USER ((uint32_t)0x00007700U) /*!< User Option Bytes */
  1097. #define FLASH_OBR_IWDG_SW ((uint32_t)0x00000100U) /*!< IWDG SW */
  1098. #define FLASH_OBR_nRST_STOP ((uint32_t)0x00000200U) /*!< nRST_STOP */
  1099. #define FLASH_OBR_nRST_STDBY ((uint32_t)0x00000400U) /*!< nRST_STDBY */
  1100. #define FLASH_OBR_nBOOT1 ((uint32_t)0x00001000U) /*!< nBOOT1 */
  1101. #define FLASH_OBR_VDDA_MONITOR ((uint32_t)0x00002000U) /*!< VDDA power supply supervisor */
  1102. #define FLASH_OBR_RAM_PARITY_CHECK ((uint32_t)0x00004000U) /*!< RAM parity check */
  1103. #define FLASH_OBR_DATA0 ((uint32_t)0x00FF0000U) /*!< Data0 */
  1104. #define FLASH_OBR_DATA1 ((uint32_t)0xFF000000U) /*!< Data1 */
  1105. /* Old BOOT1 bit definition, maintained for legacy purpose */
  1106. #define FLASH_OBR_BOOT1 FLASH_OBR_nBOOT1
  1107. /* Old OBR_VDDA bit definition, maintained for legacy purpose */
  1108. #define FLASH_OBR_VDDA_ANALOG FLASH_OBR_VDDA_MONITOR
  1109. /****************** Bit definition for FLASH_WRPR register ******************/
  1110. #define FLASH_WRPR_WRP ((uint32_t)0x0000FFFFU) /*!< Write Protect */
  1111. /*----------------------------------------------------------------------------*/
  1112. /****************** Bit definition for OB_RDP register **********************/
  1113. #define OB_RDP_RDP ((uint32_t)0x000000FFU) /*!< Read protection option byte */
  1114. #define OB_RDP_nRDP ((uint32_t)0x0000FF00U) /*!< Read protection complemented option byte */
  1115. /****************** Bit definition for OB_USER register *********************/
  1116. #define OB_USER_USER ((uint32_t)0x00FF0000U) /*!< User option byte */
  1117. #define OB_USER_nUSER ((uint32_t)0xFF000000U) /*!< User complemented option byte */
  1118. /****************** Bit definition for OB_WRP0 register *********************/
  1119. #define OB_WRP0_WRP0 ((uint32_t)0x000000FFU) /*!< Flash memory write protection option bytes */
  1120. #define OB_WRP0_nWRP0 ((uint32_t)0x0000FF00U) /*!< Flash memory write protection complemented option bytes */
  1121. /****************** Bit definition for OB_WRP1 register *********************/
  1122. #define OB_WRP1_WRP1 ((uint32_t)0x00FF0000U) /*!< Flash memory write protection option bytes */
  1123. #define OB_WRP1_nWRP1 ((uint32_t)0xFF000000U) /*!< Flash memory write protection complemented option bytes */
  1124. /******************************************************************************/
  1125. /* */
  1126. /* General Purpose IOs (GPIO) */
  1127. /* */
  1128. /******************************************************************************/
  1129. /******************* Bit definition for GPIO_MODER register *****************/
  1130. #define GPIO_MODER_MODER0 ((uint32_t)0x00000003U)
  1131. #define GPIO_MODER_MODER0_0 ((uint32_t)0x00000001U)
  1132. #define GPIO_MODER_MODER0_1 ((uint32_t)0x00000002U)
  1133. #define GPIO_MODER_MODER1 ((uint32_t)0x0000000CU)
  1134. #define GPIO_MODER_MODER1_0 ((uint32_t)0x00000004U)
  1135. #define GPIO_MODER_MODER1_1 ((uint32_t)0x00000008U)
  1136. #define GPIO_MODER_MODER2 ((uint32_t)0x00000030U)
  1137. #define GPIO_MODER_MODER2_0 ((uint32_t)0x00000010U)
  1138. #define GPIO_MODER_MODER2_1 ((uint32_t)0x00000020U)
  1139. #define GPIO_MODER_MODER3 ((uint32_t)0x000000C0U)
  1140. #define GPIO_MODER_MODER3_0 ((uint32_t)0x00000040U)
  1141. #define GPIO_MODER_MODER3_1 ((uint32_t)0x00000080U)
  1142. #define GPIO_MODER_MODER4 ((uint32_t)0x00000300U)
  1143. #define GPIO_MODER_MODER4_0 ((uint32_t)0x00000100U)
  1144. #define GPIO_MODER_MODER4_1 ((uint32_t)0x00000200U)
  1145. #define GPIO_MODER_MODER5 ((uint32_t)0x00000C00U)
  1146. #define GPIO_MODER_MODER5_0 ((uint32_t)0x00000400U)
  1147. #define GPIO_MODER_MODER5_1 ((uint32_t)0x00000800U)
  1148. #define GPIO_MODER_MODER6 ((uint32_t)0x00003000U)
  1149. #define GPIO_MODER_MODER6_0 ((uint32_t)0x00001000U)
  1150. #define GPIO_MODER_MODER6_1 ((uint32_t)0x00002000U)
  1151. #define GPIO_MODER_MODER7 ((uint32_t)0x0000C000U)
  1152. #define GPIO_MODER_MODER7_0 ((uint32_t)0x00004000U)
  1153. #define GPIO_MODER_MODER7_1 ((uint32_t)0x00008000U)
  1154. #define GPIO_MODER_MODER8 ((uint32_t)0x00030000U)
  1155. #define GPIO_MODER_MODER8_0 ((uint32_t)0x00010000U)
  1156. #define GPIO_MODER_MODER8_1 ((uint32_t)0x00020000U)
  1157. #define GPIO_MODER_MODER9 ((uint32_t)0x000C0000U)
  1158. #define GPIO_MODER_MODER9_0 ((uint32_t)0x00040000U)
  1159. #define GPIO_MODER_MODER9_1 ((uint32_t)0x00080000U)
  1160. #define GPIO_MODER_MODER10 ((uint32_t)0x00300000U)
  1161. #define GPIO_MODER_MODER10_0 ((uint32_t)0x00100000U)
  1162. #define GPIO_MODER_MODER10_1 ((uint32_t)0x00200000U)
  1163. #define GPIO_MODER_MODER11 ((uint32_t)0x00C00000U)
  1164. #define GPIO_MODER_MODER11_0 ((uint32_t)0x00400000U)
  1165. #define GPIO_MODER_MODER11_1 ((uint32_t)0x00800000U)
  1166. #define GPIO_MODER_MODER12 ((uint32_t)0x03000000U)
  1167. #define GPIO_MODER_MODER12_0 ((uint32_t)0x01000000U)
  1168. #define GPIO_MODER_MODER12_1 ((uint32_t)0x02000000U)
  1169. #define GPIO_MODER_MODER13 ((uint32_t)0x0C000000U)
  1170. #define GPIO_MODER_MODER13_0 ((uint32_t)0x04000000U)
  1171. #define GPIO_MODER_MODER13_1 ((uint32_t)0x08000000U)
  1172. #define GPIO_MODER_MODER14 ((uint32_t)0x30000000U)
  1173. #define GPIO_MODER_MODER14_0 ((uint32_t)0x10000000U)
  1174. #define GPIO_MODER_MODER14_1 ((uint32_t)0x20000000U)
  1175. #define GPIO_MODER_MODER15 ((uint32_t)0xC0000000U)
  1176. #define GPIO_MODER_MODER15_0 ((uint32_t)0x40000000U)
  1177. #define GPIO_MODER_MODER15_1 ((uint32_t)0x80000000U)
  1178. /****************** Bit definition for GPIO_OTYPER register *****************/
  1179. #define GPIO_OTYPER_OT_0 ((uint32_t)0x00000001U)
  1180. #define GPIO_OTYPER_OT_1 ((uint32_t)0x00000002U)
  1181. #define GPIO_OTYPER_OT_2 ((uint32_t)0x00000004U)
  1182. #define GPIO_OTYPER_OT_3 ((uint32_t)0x00000008U)
  1183. #define GPIO_OTYPER_OT_4 ((uint32_t)0x00000010U)
  1184. #define GPIO_OTYPER_OT_5 ((uint32_t)0x00000020U)
  1185. #define GPIO_OTYPER_OT_6 ((uint32_t)0x00000040U)
  1186. #define GPIO_OTYPER_OT_7 ((uint32_t)0x00000080U)
  1187. #define GPIO_OTYPER_OT_8 ((uint32_t)0x00000100U)
  1188. #define GPIO_OTYPER_OT_9 ((uint32_t)0x00000200U)
  1189. #define GPIO_OTYPER_OT_10 ((uint32_t)0x00000400U)
  1190. #define GPIO_OTYPER_OT_11 ((uint32_t)0x00000800U)
  1191. #define GPIO_OTYPER_OT_12 ((uint32_t)0x00001000U)
  1192. #define GPIO_OTYPER_OT_13 ((uint32_t)0x00002000U)
  1193. #define GPIO_OTYPER_OT_14 ((uint32_t)0x00004000U)
  1194. #define GPIO_OTYPER_OT_15 ((uint32_t)0x00008000U)
  1195. /**************** Bit definition for GPIO_OSPEEDR register ******************/
  1196. #define GPIO_OSPEEDR_OSPEEDR0 ((uint32_t)0x00000003U)
  1197. #define GPIO_OSPEEDR_OSPEEDR0_0 ((uint32_t)0x00000001U)
  1198. #define GPIO_OSPEEDR_OSPEEDR0_1 ((uint32_t)0x00000002U)
  1199. #define GPIO_OSPEEDR_OSPEEDR1 ((uint32_t)0x0000000CU)
  1200. #define GPIO_OSPEEDR_OSPEEDR1_0 ((uint32_t)0x00000004U)
  1201. #define GPIO_OSPEEDR_OSPEEDR1_1 ((uint32_t)0x00000008U)
  1202. #define GPIO_OSPEEDR_OSPEEDR2 ((uint32_t)0x00000030U)
  1203. #define GPIO_OSPEEDR_OSPEEDR2_0 ((uint32_t)0x00000010U)
  1204. #define GPIO_OSPEEDR_OSPEEDR2_1 ((uint32_t)0x00000020U)
  1205. #define GPIO_OSPEEDR_OSPEEDR3 ((uint32_t)0x000000C0U)
  1206. #define GPIO_OSPEEDR_OSPEEDR3_0 ((uint32_t)0x00000040U)
  1207. #define GPIO_OSPEEDR_OSPEEDR3_1 ((uint32_t)0x00000080U)
  1208. #define GPIO_OSPEEDR_OSPEEDR4 ((uint32_t)0x00000300U)
  1209. #define GPIO_OSPEEDR_OSPEEDR4_0 ((uint32_t)0x00000100U)
  1210. #define GPIO_OSPEEDR_OSPEEDR4_1 ((uint32_t)0x00000200U)
  1211. #define GPIO_OSPEEDR_OSPEEDR5 ((uint32_t)0x00000C00U)
  1212. #define GPIO_OSPEEDR_OSPEEDR5_0 ((uint32_t)0x00000400U)
  1213. #define GPIO_OSPEEDR_OSPEEDR5_1 ((uint32_t)0x00000800U)
  1214. #define GPIO_OSPEEDR_OSPEEDR6 ((uint32_t)0x00003000U)
  1215. #define GPIO_OSPEEDR_OSPEEDR6_0 ((uint32_t)0x00001000U)
  1216. #define GPIO_OSPEEDR_OSPEEDR6_1 ((uint32_t)0x00002000U)
  1217. #define GPIO_OSPEEDR_OSPEEDR7 ((uint32_t)0x0000C000U)
  1218. #define GPIO_OSPEEDR_OSPEEDR7_0 ((uint32_t)0x00004000U)
  1219. #define GPIO_OSPEEDR_OSPEEDR7_1 ((uint32_t)0x00008000U)
  1220. #define GPIO_OSPEEDR_OSPEEDR8 ((uint32_t)0x00030000U)
  1221. #define GPIO_OSPEEDR_OSPEEDR8_0 ((uint32_t)0x00010000U)
  1222. #define GPIO_OSPEEDR_OSPEEDR8_1 ((uint32_t)0x00020000U)
  1223. #define GPIO_OSPEEDR_OSPEEDR9 ((uint32_t)0x000C0000U)
  1224. #define GPIO_OSPEEDR_OSPEEDR9_0 ((uint32_t)0x00040000U)
  1225. #define GPIO_OSPEEDR_OSPEEDR9_1 ((uint32_t)0x00080000U)
  1226. #define GPIO_OSPEEDR_OSPEEDR10 ((uint32_t)0x00300000U)
  1227. #define GPIO_OSPEEDR_OSPEEDR10_0 ((uint32_t)0x00100000U)
  1228. #define GPIO_OSPEEDR_OSPEEDR10_1 ((uint32_t)0x00200000U)
  1229. #define GPIO_OSPEEDR_OSPEEDR11 ((uint32_t)0x00C00000U)
  1230. #define GPIO_OSPEEDR_OSPEEDR11_0 ((uint32_t)0x00400000U)
  1231. #define GPIO_OSPEEDR_OSPEEDR11_1 ((uint32_t)0x00800000U)
  1232. #define GPIO_OSPEEDR_OSPEEDR12 ((uint32_t)0x03000000U)
  1233. #define GPIO_OSPEEDR_OSPEEDR12_0 ((uint32_t)0x01000000U)
  1234. #define GPIO_OSPEEDR_OSPEEDR12_1 ((uint32_t)0x02000000U)
  1235. #define GPIO_OSPEEDR_OSPEEDR13 ((uint32_t)0x0C000000U)
  1236. #define GPIO_OSPEEDR_OSPEEDR13_0 ((uint32_t)0x04000000U)
  1237. #define GPIO_OSPEEDR_OSPEEDR13_1 ((uint32_t)0x08000000U)
  1238. #define GPIO_OSPEEDR_OSPEEDR14 ((uint32_t)0x30000000U)
  1239. #define GPIO_OSPEEDR_OSPEEDR14_0 ((uint32_t)0x10000000U)
  1240. #define GPIO_OSPEEDR_OSPEEDR14_1 ((uint32_t)0x20000000U)
  1241. #define GPIO_OSPEEDR_OSPEEDR15 ((uint32_t)0xC0000000U)
  1242. #define GPIO_OSPEEDR_OSPEEDR15_0 ((uint32_t)0x40000000U)
  1243. #define GPIO_OSPEEDR_OSPEEDR15_1 ((uint32_t)0x80000000U)
  1244. /* Old Bit definition for GPIO_OSPEEDR register maintained for legacy purpose */
  1245. #define GPIO_OSPEEDER_OSPEEDR0 GPIO_OSPEEDR_OSPEEDR0
  1246. #define GPIO_OSPEEDER_OSPEEDR0_0 GPIO_OSPEEDR_OSPEEDR0_0
  1247. #define GPIO_OSPEEDER_OSPEEDR0_1 GPIO_OSPEEDR_OSPEEDR0_1
  1248. #define GPIO_OSPEEDER_OSPEEDR1 GPIO_OSPEEDR_OSPEEDR1
  1249. #define GPIO_OSPEEDER_OSPEEDR1_0 GPIO_OSPEEDR_OSPEEDR1_0
  1250. #define GPIO_OSPEEDER_OSPEEDR1_1 GPIO_OSPEEDR_OSPEEDR1_1
  1251. #define GPIO_OSPEEDER_OSPEEDR2 GPIO_OSPEEDR_OSPEEDR2
  1252. #define GPIO_OSPEEDER_OSPEEDR2_0 GPIO_OSPEEDR_OSPEEDR2_0
  1253. #define GPIO_OSPEEDER_OSPEEDR2_1 GPIO_OSPEEDR_OSPEEDR2_1
  1254. #define GPIO_OSPEEDER_OSPEEDR3 GPIO_OSPEEDR_OSPEEDR3
  1255. #define GPIO_OSPEEDER_OSPEEDR3_0 GPIO_OSPEEDR_OSPEEDR3_0
  1256. #define GPIO_OSPEEDER_OSPEEDR3_1 GPIO_OSPEEDR_OSPEEDR3_1
  1257. #define GPIO_OSPEEDER_OSPEEDR4 GPIO_OSPEEDR_OSPEEDR4
  1258. #define GPIO_OSPEEDER_OSPEEDR4_0 GPIO_OSPEEDR_OSPEEDR4_0
  1259. #define GPIO_OSPEEDER_OSPEEDR4_1 GPIO_OSPEEDR_OSPEEDR4_1
  1260. #define GPIO_OSPEEDER_OSPEEDR5 GPIO_OSPEEDR_OSPEEDR5
  1261. #define GPIO_OSPEEDER_OSPEEDR5_0 GPIO_OSPEEDR_OSPEEDR5_0
  1262. #define GPIO_OSPEEDER_OSPEEDR5_1 GPIO_OSPEEDR_OSPEEDR5_1
  1263. #define GPIO_OSPEEDER_OSPEEDR6 GPIO_OSPEEDR_OSPEEDR6
  1264. #define GPIO_OSPEEDER_OSPEEDR6_0 GPIO_OSPEEDR_OSPEEDR6_0
  1265. #define GPIO_OSPEEDER_OSPEEDR6_1 GPIO_OSPEEDR_OSPEEDR6_1
  1266. #define GPIO_OSPEEDER_OSPEEDR7 GPIO_OSPEEDR_OSPEEDR7
  1267. #define GPIO_OSPEEDER_OSPEEDR7_0 GPIO_OSPEEDR_OSPEEDR7_0
  1268. #define GPIO_OSPEEDER_OSPEEDR7_1 GPIO_OSPEEDR_OSPEEDR7_1
  1269. #define GPIO_OSPEEDER_OSPEEDR8 GPIO_OSPEEDR_OSPEEDR8
  1270. #define GPIO_OSPEEDER_OSPEEDR8_0 GPIO_OSPEEDR_OSPEEDR8_0
  1271. #define GPIO_OSPEEDER_OSPEEDR8_1 GPIO_OSPEEDR_OSPEEDR8_1
  1272. #define GPIO_OSPEEDER_OSPEEDR9 GPIO_OSPEEDR_OSPEEDR9
  1273. #define GPIO_OSPEEDER_OSPEEDR9_0 GPIO_OSPEEDR_OSPEEDR9_0
  1274. #define GPIO_OSPEEDER_OSPEEDR9_1 GPIO_OSPEEDR_OSPEEDR9_1
  1275. #define GPIO_OSPEEDER_OSPEEDR10 GPIO_OSPEEDR_OSPEEDR10
  1276. #define GPIO_OSPEEDER_OSPEEDR10_0 GPIO_OSPEEDR_OSPEEDR10_0
  1277. #define GPIO_OSPEEDER_OSPEEDR10_1 GPIO_OSPEEDR_OSPEEDR10_1
  1278. #define GPIO_OSPEEDER_OSPEEDR11 GPIO_OSPEEDR_OSPEEDR11
  1279. #define GPIO_OSPEEDER_OSPEEDR11_0 GPIO_OSPEEDR_OSPEEDR11_0
  1280. #define GPIO_OSPEEDER_OSPEEDR11_1 GPIO_OSPEEDR_OSPEEDR11_1
  1281. #define GPIO_OSPEEDER_OSPEEDR12 GPIO_OSPEEDR_OSPEEDR12
  1282. #define GPIO_OSPEEDER_OSPEEDR12_0 GPIO_OSPEEDR_OSPEEDR12_0
  1283. #define GPIO_OSPEEDER_OSPEEDR12_1 GPIO_OSPEEDR_OSPEEDR12_1
  1284. #define GPIO_OSPEEDER_OSPEEDR13 GPIO_OSPEEDR_OSPEEDR13
  1285. #define GPIO_OSPEEDER_OSPEEDR13_0 GPIO_OSPEEDR_OSPEEDR13_0
  1286. #define GPIO_OSPEEDER_OSPEEDR13_1 GPIO_OSPEEDR_OSPEEDR13_1
  1287. #define GPIO_OSPEEDER_OSPEEDR14 GPIO_OSPEEDR_OSPEEDR14
  1288. #define GPIO_OSPEEDER_OSPEEDR14_0 GPIO_OSPEEDR_OSPEEDR14_0
  1289. #define GPIO_OSPEEDER_OSPEEDR14_1 GPIO_OSPEEDR_OSPEEDR14_1
  1290. #define GPIO_OSPEEDER_OSPEEDR15 GPIO_OSPEEDR_OSPEEDR15
  1291. #define GPIO_OSPEEDER_OSPEEDR15_0 GPIO_OSPEEDR_OSPEEDR15_0
  1292. #define GPIO_OSPEEDER_OSPEEDR15_1 GPIO_OSPEEDR_OSPEEDR15_1
  1293. /******************* Bit definition for GPIO_PUPDR register ******************/
  1294. #define GPIO_PUPDR_PUPDR0 ((uint32_t)0x00000003U)
  1295. #define GPIO_PUPDR_PUPDR0_0 ((uint32_t)0x00000001U)
  1296. #define GPIO_PUPDR_PUPDR0_1 ((uint32_t)0x00000002U)
  1297. #define GPIO_PUPDR_PUPDR1 ((uint32_t)0x0000000CU)
  1298. #define GPIO_PUPDR_PUPDR1_0 ((uint32_t)0x00000004U)
  1299. #define GPIO_PUPDR_PUPDR1_1 ((uint32_t)0x00000008U)
  1300. #define GPIO_PUPDR_PUPDR2 ((uint32_t)0x00000030U)
  1301. #define GPIO_PUPDR_PUPDR2_0 ((uint32_t)0x00000010U)
  1302. #define GPIO_PUPDR_PUPDR2_1 ((uint32_t)0x00000020U)
  1303. #define GPIO_PUPDR_PUPDR3 ((uint32_t)0x000000C0U)
  1304. #define GPIO_PUPDR_PUPDR3_0 ((uint32_t)0x00000040U)
  1305. #define GPIO_PUPDR_PUPDR3_1 ((uint32_t)0x00000080U)
  1306. #define GPIO_PUPDR_PUPDR4 ((uint32_t)0x00000300U)
  1307. #define GPIO_PUPDR_PUPDR4_0 ((uint32_t)0x00000100U)
  1308. #define GPIO_PUPDR_PUPDR4_1 ((uint32_t)0x00000200U)
  1309. #define GPIO_PUPDR_PUPDR5 ((uint32_t)0x00000C00U)
  1310. #define GPIO_PUPDR_PUPDR5_0 ((uint32_t)0x00000400U)
  1311. #define GPIO_PUPDR_PUPDR5_1 ((uint32_t)0x00000800U)
  1312. #define GPIO_PUPDR_PUPDR6 ((uint32_t)0x00003000U)
  1313. #define GPIO_PUPDR_PUPDR6_0 ((uint32_t)0x00001000U)
  1314. #define GPIO_PUPDR_PUPDR6_1 ((uint32_t)0x00002000U)
  1315. #define GPIO_PUPDR_PUPDR7 ((uint32_t)0x0000C000U)
  1316. #define GPIO_PUPDR_PUPDR7_0 ((uint32_t)0x00004000U)
  1317. #define GPIO_PUPDR_PUPDR7_1 ((uint32_t)0x00008000U)
  1318. #define GPIO_PUPDR_PUPDR8 ((uint32_t)0x00030000U)
  1319. #define GPIO_PUPDR_PUPDR8_0 ((uint32_t)0x00010000U)
  1320. #define GPIO_PUPDR_PUPDR8_1 ((uint32_t)0x00020000U)
  1321. #define GPIO_PUPDR_PUPDR9 ((uint32_t)0x000C0000U)
  1322. #define GPIO_PUPDR_PUPDR9_0 ((uint32_t)0x00040000U)
  1323. #define GPIO_PUPDR_PUPDR9_1 ((uint32_t)0x00080000U)
  1324. #define GPIO_PUPDR_PUPDR10 ((uint32_t)0x00300000U)
  1325. #define GPIO_PUPDR_PUPDR10_0 ((uint32_t)0x00100000U)
  1326. #define GPIO_PUPDR_PUPDR10_1 ((uint32_t)0x00200000U)
  1327. #define GPIO_PUPDR_PUPDR11 ((uint32_t)0x00C00000U)
  1328. #define GPIO_PUPDR_PUPDR11_0 ((uint32_t)0x00400000U)
  1329. #define GPIO_PUPDR_PUPDR11_1 ((uint32_t)0x00800000U)
  1330. #define GPIO_PUPDR_PUPDR12 ((uint32_t)0x03000000U)
  1331. #define GPIO_PUPDR_PUPDR12_0 ((uint32_t)0x01000000U)
  1332. #define GPIO_PUPDR_PUPDR12_1 ((uint32_t)0x02000000U)
  1333. #define GPIO_PUPDR_PUPDR13 ((uint32_t)0x0C000000U)
  1334. #define GPIO_PUPDR_PUPDR13_0 ((uint32_t)0x04000000U)
  1335. #define GPIO_PUPDR_PUPDR13_1 ((uint32_t)0x08000000U)
  1336. #define GPIO_PUPDR_PUPDR14 ((uint32_t)0x30000000U)
  1337. #define GPIO_PUPDR_PUPDR14_0 ((uint32_t)0x10000000U)
  1338. #define GPIO_PUPDR_PUPDR14_1 ((uint32_t)0x20000000U)
  1339. #define GPIO_PUPDR_PUPDR15 ((uint32_t)0xC0000000U)
  1340. #define GPIO_PUPDR_PUPDR15_0 ((uint32_t)0x40000000U)
  1341. #define GPIO_PUPDR_PUPDR15_1 ((uint32_t)0x80000000U)
  1342. /******************* Bit definition for GPIO_IDR register *******************/
  1343. #define GPIO_IDR_0 ((uint32_t)0x00000001U)
  1344. #define GPIO_IDR_1 ((uint32_t)0x00000002U)
  1345. #define GPIO_IDR_2 ((uint32_t)0x00000004U)
  1346. #define GPIO_IDR_3 ((uint32_t)0x00000008U)
  1347. #define GPIO_IDR_4 ((uint32_t)0x00000010U)
  1348. #define GPIO_IDR_5 ((uint32_t)0x00000020U)
  1349. #define GPIO_IDR_6 ((uint32_t)0x00000040U)
  1350. #define GPIO_IDR_7 ((uint32_t)0x00000080U)
  1351. #define GPIO_IDR_8 ((uint32_t)0x00000100U)
  1352. #define GPIO_IDR_9 ((uint32_t)0x00000200U)
  1353. #define GPIO_IDR_10 ((uint32_t)0x00000400U)
  1354. #define GPIO_IDR_11 ((uint32_t)0x00000800U)
  1355. #define GPIO_IDR_12 ((uint32_t)0x00001000U)
  1356. #define GPIO_IDR_13 ((uint32_t)0x00002000U)
  1357. #define GPIO_IDR_14 ((uint32_t)0x00004000U)
  1358. #define GPIO_IDR_15 ((uint32_t)0x00008000U)
  1359. /****************** Bit definition for GPIO_ODR register ********************/
  1360. #define GPIO_ODR_0 ((uint32_t)0x00000001U)
  1361. #define GPIO_ODR_1 ((uint32_t)0x00000002U)
  1362. #define GPIO_ODR_2 ((uint32_t)0x00000004U)
  1363. #define GPIO_ODR_3 ((uint32_t)0x00000008U)
  1364. #define GPIO_ODR_4 ((uint32_t)0x00000010U)
  1365. #define GPIO_ODR_5 ((uint32_t)0x00000020U)
  1366. #define GPIO_ODR_6 ((uint32_t)0x00000040U)
  1367. #define GPIO_ODR_7 ((uint32_t)0x00000080U)
  1368. #define GPIO_ODR_8 ((uint32_t)0x00000100U)
  1369. #define GPIO_ODR_9 ((uint32_t)0x00000200U)
  1370. #define GPIO_ODR_10 ((uint32_t)0x00000400U)
  1371. #define GPIO_ODR_11 ((uint32_t)0x00000800U)
  1372. #define GPIO_ODR_12 ((uint32_t)0x00001000U)
  1373. #define GPIO_ODR_13 ((uint32_t)0x00002000U)
  1374. #define GPIO_ODR_14 ((uint32_t)0x00004000U)
  1375. #define GPIO_ODR_15 ((uint32_t)0x00008000U)
  1376. /****************** Bit definition for GPIO_BSRR register ********************/
  1377. #define GPIO_BSRR_BS_0 ((uint32_t)0x00000001U)
  1378. #define GPIO_BSRR_BS_1 ((uint32_t)0x00000002U)
  1379. #define GPIO_BSRR_BS_2 ((uint32_t)0x00000004U)
  1380. #define GPIO_BSRR_BS_3 ((uint32_t)0x00000008U)
  1381. #define GPIO_BSRR_BS_4 ((uint32_t)0x00000010U)
  1382. #define GPIO_BSRR_BS_5 ((uint32_t)0x00000020U)
  1383. #define GPIO_BSRR_BS_6 ((uint32_t)0x00000040U)
  1384. #define GPIO_BSRR_BS_7 ((uint32_t)0x00000080U)
  1385. #define GPIO_BSRR_BS_8 ((uint32_t)0x00000100U)
  1386. #define GPIO_BSRR_BS_9 ((uint32_t)0x00000200U)
  1387. #define GPIO_BSRR_BS_10 ((uint32_t)0x00000400U)
  1388. #define GPIO_BSRR_BS_11 ((uint32_t)0x00000800U)
  1389. #define GPIO_BSRR_BS_12 ((uint32_t)0x00001000U)
  1390. #define GPIO_BSRR_BS_13 ((uint32_t)0x00002000U)
  1391. #define GPIO_BSRR_BS_14 ((uint32_t)0x00004000U)
  1392. #define GPIO_BSRR_BS_15 ((uint32_t)0x00008000U)
  1393. #define GPIO_BSRR_BR_0 ((uint32_t)0x00010000U)
  1394. #define GPIO_BSRR_BR_1 ((uint32_t)0x00020000U)
  1395. #define GPIO_BSRR_BR_2 ((uint32_t)0x00040000U)
  1396. #define GPIO_BSRR_BR_3 ((uint32_t)0x00080000U)
  1397. #define GPIO_BSRR_BR_4 ((uint32_t)0x00100000U)
  1398. #define GPIO_BSRR_BR_5 ((uint32_t)0x00200000U)
  1399. #define GPIO_BSRR_BR_6 ((uint32_t)0x00400000U)
  1400. #define GPIO_BSRR_BR_7 ((uint32_t)0x00800000U)
  1401. #define GPIO_BSRR_BR_8 ((uint32_t)0x01000000U)
  1402. #define GPIO_BSRR_BR_9 ((uint32_t)0x02000000U)
  1403. #define GPIO_BSRR_BR_10 ((uint32_t)0x04000000U)
  1404. #define GPIO_BSRR_BR_11 ((uint32_t)0x08000000U)
  1405. #define GPIO_BSRR_BR_12 ((uint32_t)0x10000000U)
  1406. #define GPIO_BSRR_BR_13 ((uint32_t)0x20000000U)
  1407. #define GPIO_BSRR_BR_14 ((uint32_t)0x40000000U)
  1408. #define GPIO_BSRR_BR_15 ((uint32_t)0x80000000U)
  1409. /****************** Bit definition for GPIO_LCKR register ********************/
  1410. #define GPIO_LCKR_LCK0 ((uint32_t)0x00000001U)
  1411. #define GPIO_LCKR_LCK1 ((uint32_t)0x00000002U)
  1412. #define GPIO_LCKR_LCK2 ((uint32_t)0x00000004U)
  1413. #define GPIO_LCKR_LCK3 ((uint32_t)0x00000008U)
  1414. #define GPIO_LCKR_LCK4 ((uint32_t)0x00000010U)
  1415. #define GPIO_LCKR_LCK5 ((uint32_t)0x00000020U)
  1416. #define GPIO_LCKR_LCK6 ((uint32_t)0x00000040U)
  1417. #define GPIO_LCKR_LCK7 ((uint32_t)0x00000080U)
  1418. #define GPIO_LCKR_LCK8 ((uint32_t)0x00000100U)
  1419. #define GPIO_LCKR_LCK9 ((uint32_t)0x00000200U)
  1420. #define GPIO_LCKR_LCK10 ((uint32_t)0x00000400U)
  1421. #define GPIO_LCKR_LCK11 ((uint32_t)0x00000800U)
  1422. #define GPIO_LCKR_LCK12 ((uint32_t)0x00001000U)
  1423. #define GPIO_LCKR_LCK13 ((uint32_t)0x00002000U)
  1424. #define GPIO_LCKR_LCK14 ((uint32_t)0x00004000U)
  1425. #define GPIO_LCKR_LCK15 ((uint32_t)0x00008000U)
  1426. #define GPIO_LCKR_LCKK ((uint32_t)0x00010000U)
  1427. /****************** Bit definition for GPIO_AFRL register ********************/
  1428. #define GPIO_AFRL_AFRL0 ((uint32_t)0x0000000FU)
  1429. #define GPIO_AFRL_AFRL1 ((uint32_t)0x000000F0U)
  1430. #define GPIO_AFRL_AFRL2 ((uint32_t)0x00000F00U)
  1431. #define GPIO_AFRL_AFRL3 ((uint32_t)0x0000F000U)
  1432. #define GPIO_AFRL_AFRL4 ((uint32_t)0x000F0000U)
  1433. #define GPIO_AFRL_AFRL5 ((uint32_t)0x00F00000U)
  1434. #define GPIO_AFRL_AFRL6 ((uint32_t)0x0F000000U)
  1435. #define GPIO_AFRL_AFRL7 ((uint32_t)0xF0000000U)
  1436. /****************** Bit definition for GPIO_AFRH register ********************/
  1437. #define GPIO_AFRH_AFRH0 ((uint32_t)0x0000000FU)
  1438. #define GPIO_AFRH_AFRH1 ((uint32_t)0x000000F0U)
  1439. #define GPIO_AFRH_AFRH2 ((uint32_t)0x00000F00U)
  1440. #define GPIO_AFRH_AFRH3 ((uint32_t)0x0000F000U)
  1441. #define GPIO_AFRH_AFRH4 ((uint32_t)0x000F0000U)
  1442. #define GPIO_AFRH_AFRH5 ((uint32_t)0x00F00000U)
  1443. #define GPIO_AFRH_AFRH6 ((uint32_t)0x0F000000U)
  1444. #define GPIO_AFRH_AFRH7 ((uint32_t)0xF0000000U)
  1445. /****************** Bit definition for GPIO_BRR register *********************/
  1446. #define GPIO_BRR_BR_0 ((uint32_t)0x00000001U)
  1447. #define GPIO_BRR_BR_1 ((uint32_t)0x00000002U)
  1448. #define GPIO_BRR_BR_2 ((uint32_t)0x00000004U)
  1449. #define GPIO_BRR_BR_3 ((uint32_t)0x00000008U)
  1450. #define GPIO_BRR_BR_4 ((uint32_t)0x00000010U)
  1451. #define GPIO_BRR_BR_5 ((uint32_t)0x00000020U)
  1452. #define GPIO_BRR_BR_6 ((uint32_t)0x00000040U)
  1453. #define GPIO_BRR_BR_7 ((uint32_t)0x00000080U)
  1454. #define GPIO_BRR_BR_8 ((uint32_t)0x00000100U)
  1455. #define GPIO_BRR_BR_9 ((uint32_t)0x00000200U)
  1456. #define GPIO_BRR_BR_10 ((uint32_t)0x00000400U)
  1457. #define GPIO_BRR_BR_11 ((uint32_t)0x00000800U)
  1458. #define GPIO_BRR_BR_12 ((uint32_t)0x00001000U)
  1459. #define GPIO_BRR_BR_13 ((uint32_t)0x00002000U)
  1460. #define GPIO_BRR_BR_14 ((uint32_t)0x00004000U)
  1461. #define GPIO_BRR_BR_15 ((uint32_t)0x00008000U)
  1462. /******************************************************************************/
  1463. /* */
  1464. /* Inter-integrated Circuit Interface (I2C) */
  1465. /* */
  1466. /******************************************************************************/
  1467. /******************* Bit definition for I2C_CR1 register *******************/
  1468. #define I2C_CR1_PE ((uint32_t)0x00000001U) /*!< Peripheral enable */
  1469. #define I2C_CR1_TXIE ((uint32_t)0x00000002U) /*!< TX interrupt enable */
  1470. #define I2C_CR1_RXIE ((uint32_t)0x00000004U) /*!< RX interrupt enable */
  1471. #define I2C_CR1_ADDRIE ((uint32_t)0x00000008U) /*!< Address match interrupt enable */
  1472. #define I2C_CR1_NACKIE ((uint32_t)0x00000010U) /*!< NACK received interrupt enable */
  1473. #define I2C_CR1_STOPIE ((uint32_t)0x00000020U) /*!< STOP detection interrupt enable */
  1474. #define I2C_CR1_TCIE ((uint32_t)0x00000040U) /*!< Transfer complete interrupt enable */
  1475. #define I2C_CR1_ERRIE ((uint32_t)0x00000080U) /*!< Errors interrupt enable */
  1476. #define I2C_CR1_DNF ((uint32_t)0x00000F00U) /*!< Digital noise filter */
  1477. #define I2C_CR1_ANFOFF ((uint32_t)0x00001000U) /*!< Analog noise filter OFF */
  1478. #define I2C_CR1_SWRST ((uint32_t)0x00002000U) /*!< Software reset */
  1479. #define I2C_CR1_TXDMAEN ((uint32_t)0x00004000U) /*!< DMA transmission requests enable */
  1480. #define I2C_CR1_RXDMAEN ((uint32_t)0x00008000U) /*!< DMA reception requests enable */
  1481. #define I2C_CR1_SBC ((uint32_t)0x00010000U) /*!< Slave byte control */
  1482. #define I2C_CR1_NOSTRETCH ((uint32_t)0x00020000U) /*!< Clock stretching disable */
  1483. #define I2C_CR1_GCEN ((uint32_t)0x00080000U) /*!< General call enable */
  1484. #define I2C_CR1_SMBHEN ((uint32_t)0x00100000U) /*!< SMBus host address enable */
  1485. #define I2C_CR1_SMBDEN ((uint32_t)0x00200000U) /*!< SMBus device default address enable */
  1486. #define I2C_CR1_ALERTEN ((uint32_t)0x00400000U) /*!< SMBus alert enable */
  1487. #define I2C_CR1_PECEN ((uint32_t)0x00800000U) /*!< PEC enable */
  1488. /****************** Bit definition for I2C_CR2 register ********************/
  1489. #define I2C_CR2_SADD ((uint32_t)0x000003FFU) /*!< Slave address (master mode) */
  1490. #define I2C_CR2_RD_WRN ((uint32_t)0x00000400U) /*!< Transfer direction (master mode) */
  1491. #define I2C_CR2_ADD10 ((uint32_t)0x00000800U) /*!< 10-bit addressing mode (master mode) */
  1492. #define I2C_CR2_HEAD10R ((uint32_t)0x00001000U) /*!< 10-bit address header only read direction (master mode) */
  1493. #define I2C_CR2_START ((uint32_t)0x00002000U) /*!< START generation */
  1494. #define I2C_CR2_STOP ((uint32_t)0x00004000U) /*!< STOP generation (master mode) */
  1495. #define I2C_CR2_NACK ((uint32_t)0x00008000U) /*!< NACK generation (slave mode) */
  1496. #define I2C_CR2_NBYTES ((uint32_t)0x00FF0000U) /*!< Number of bytes */
  1497. #define I2C_CR2_RELOAD ((uint32_t)0x01000000U) /*!< NBYTES reload mode */
  1498. #define I2C_CR2_AUTOEND ((uint32_t)0x02000000U) /*!< Automatic end mode (master mode) */
  1499. #define I2C_CR2_PECBYTE ((uint32_t)0x04000000U) /*!< Packet error checking byte */
  1500. /******************* Bit definition for I2C_OAR1 register ******************/
  1501. #define I2C_OAR1_OA1 ((uint32_t)0x000003FFU) /*!< Interface own address 1 */
  1502. #define I2C_OAR1_OA1MODE ((uint32_t)0x00000400U) /*!< Own address 1 10-bit mode */
  1503. #define I2C_OAR1_OA1EN ((uint32_t)0x00008000U) /*!< Own address 1 enable */
  1504. /******************* Bit definition for I2C_OAR2 register ******************/
  1505. #define I2C_OAR2_OA2 ((uint32_t)0x000000FEU) /*!< Interface own address 2 */
  1506. #define I2C_OAR2_OA2MSK ((uint32_t)0x00000700U) /*!< Own address 2 masks */
  1507. #define I2C_OAR2_OA2NOMASK ((uint32_t)0x00000000U) /*!< No mask */
  1508. #define I2C_OAR2_OA2MASK01 ((uint32_t)0x00000100U) /*!< OA2[1] is masked, Only OA2[7:2] are compared */
  1509. #define I2C_OAR2_OA2MASK02 ((uint32_t)0x00000200U) /*!< OA2[2:1] is masked, Only OA2[7:3] are compared */
  1510. #define I2C_OAR2_OA2MASK03 ((uint32_t)0x00000300U) /*!< OA2[3:1] is masked, Only OA2[7:4] are compared */
  1511. #define I2C_OAR2_OA2MASK04 ((uint32_t)0x00000400U) /*!< OA2[4:1] is masked, Only OA2[7:5] are compared */
  1512. #define I2C_OAR2_OA2MASK05 ((uint32_t)0x00000500U) /*!< OA2[5:1] is masked, Only OA2[7:6] are compared */
  1513. #define I2C_OAR2_OA2MASK06 ((uint32_t)0x00000600U) /*!< OA2[6:1] is masked, Only OA2[7] are compared */
  1514. #define I2C_OAR2_OA2MASK07 ((uint32_t)0x00000700U) /*!< OA2[7:1] is masked, No comparison is done */
  1515. #define I2C_OAR2_OA2EN ((uint32_t)0x00008000U) /*!< Own address 2 enable */
  1516. /******************* Bit definition for I2C_TIMINGR register ****************/
  1517. #define I2C_TIMINGR_SCLL ((uint32_t)0x000000FFU) /*!< SCL low period (master mode) */
  1518. #define I2C_TIMINGR_SCLH ((uint32_t)0x0000FF00U) /*!< SCL high period (master mode) */
  1519. #define I2C_TIMINGR_SDADEL ((uint32_t)0x000F0000U) /*!< Data hold time */
  1520. #define I2C_TIMINGR_SCLDEL ((uint32_t)0x00F00000U) /*!< Data setup time */
  1521. #define I2C_TIMINGR_PRESC ((uint32_t)0xF0000000U) /*!< Timings prescaler */
  1522. /******************* Bit definition for I2C_TIMEOUTR register ****************/
  1523. #define I2C_TIMEOUTR_TIMEOUTA ((uint32_t)0x00000FFFU) /*!< Bus timeout A */
  1524. #define I2C_TIMEOUTR_TIDLE ((uint32_t)0x00001000U) /*!< Idle clock timeout detection */
  1525. #define I2C_TIMEOUTR_TIMOUTEN ((uint32_t)0x00008000U) /*!< Clock timeout enable */
  1526. #define I2C_TIMEOUTR_TIMEOUTB ((uint32_t)0x0FFF0000U) /*!< Bus timeout B*/
  1527. #define I2C_TIMEOUTR_TEXTEN ((uint32_t)0x80000000U) /*!< Extended clock timeout enable */
  1528. /****************** Bit definition for I2C_ISR register ********************/
  1529. #define I2C_ISR_TXE ((uint32_t)0x00000001U) /*!< Transmit data register empty */
  1530. #define I2C_ISR_TXIS ((uint32_t)0x00000002U) /*!< Transmit interrupt status */
  1531. #define I2C_ISR_RXNE ((uint32_t)0x00000004U) /*!< Receive data register not empty */
  1532. #define I2C_ISR_ADDR ((uint32_t)0x00000008U) /*!< Address matched (slave mode)*/
  1533. #define I2C_ISR_NACKF ((uint32_t)0x00000010U) /*!< NACK received flag */
  1534. #define I2C_ISR_STOPF ((uint32_t)0x00000020U) /*!< STOP detection flag */
  1535. #define I2C_ISR_TC ((uint32_t)0x00000040U) /*!< Transfer complete (master mode) */
  1536. #define I2C_ISR_TCR ((uint32_t)0x00000080U) /*!< Transfer complete reload */
  1537. #define I2C_ISR_BERR ((uint32_t)0x00000100U) /*!< Bus error */
  1538. #define I2C_ISR_ARLO ((uint32_t)0x00000200U) /*!< Arbitration lost */
  1539. #define I2C_ISR_OVR ((uint32_t)0x00000400U) /*!< Overrun/Underrun */
  1540. #define I2C_ISR_PECERR ((uint32_t)0x00000800U) /*!< PEC error in reception */
  1541. #define I2C_ISR_TIMEOUT ((uint32_t)0x00001000U) /*!< Timeout or Tlow detection flag */
  1542. #define I2C_ISR_ALERT ((uint32_t)0x00002000U) /*!< SMBus alert */
  1543. #define I2C_ISR_BUSY ((uint32_t)0x00008000U) /*!< Bus busy */
  1544. #define I2C_ISR_DIR ((uint32_t)0x00010000U) /*!< Transfer direction (slave mode) */
  1545. #define I2C_ISR_ADDCODE ((uint32_t)0x00FE0000U) /*!< Address match code (slave mode) */
  1546. /****************** Bit definition for I2C_ICR register ********************/
  1547. #define I2C_ICR_ADDRCF ((uint32_t)0x00000008U) /*!< Address matched clear flag */
  1548. #define I2C_ICR_NACKCF ((uint32_t)0x00000010U) /*!< NACK clear flag */
  1549. #define I2C_ICR_STOPCF ((uint32_t)0x00000020U) /*!< STOP detection clear flag */
  1550. #define I2C_ICR_BERRCF ((uint32_t)0x00000100U) /*!< Bus error clear flag */
  1551. #define I2C_ICR_ARLOCF ((uint32_t)0x00000200U) /*!< Arbitration lost clear flag */
  1552. #define I2C_ICR_OVRCF ((uint32_t)0x00000400U) /*!< Overrun/Underrun clear flag */
  1553. #define I2C_ICR_PECCF ((uint32_t)0x00000800U) /*!< PAC error clear flag */
  1554. #define I2C_ICR_TIMOUTCF ((uint32_t)0x00001000U) /*!< Timeout clear flag */
  1555. #define I2C_ICR_ALERTCF ((uint32_t)0x00002000U) /*!< Alert clear flag */
  1556. /****************** Bit definition for I2C_PECR register *******************/
  1557. #define I2C_PECR_PEC ((uint32_t)0x000000FFU) /*!< PEC register */
  1558. /****************** Bit definition for I2C_RXDR register *********************/
  1559. #define I2C_RXDR_RXDATA ((uint32_t)0x000000FFU) /*!< 8-bit receive data */
  1560. /****************** Bit definition for I2C_TXDR register *******************/
  1561. #define I2C_TXDR_TXDATA ((uint32_t)0x000000FFU) /*!< 8-bit transmit data */
  1562. /*****************************************************************************/
  1563. /* */
  1564. /* Independent WATCHDOG (IWDG) */
  1565. /* */
  1566. /*****************************************************************************/
  1567. /******************* Bit definition for IWDG_KR register *******************/
  1568. #define IWDG_KR_KEY ((uint32_t)0xFFFF) /*!< Key value (write only, read 0000h) */
  1569. /******************* Bit definition for IWDG_PR register *******************/
  1570. #define IWDG_PR_PR ((uint32_t)0x07) /*!< PR[2:0] (Prescaler divider) */
  1571. #define IWDG_PR_PR_0 ((uint32_t)0x01) /*!< Bit 0 */
  1572. #define IWDG_PR_PR_1 ((uint32_t)0x02) /*!< Bit 1 */
  1573. #define IWDG_PR_PR_2 ((uint32_t)0x04) /*!< Bit 2 */
  1574. /******************* Bit definition for IWDG_RLR register ******************/
  1575. #define IWDG_RLR_RL ((uint32_t)0x0FFF) /*!< Watchdog counter reload value */
  1576. /******************* Bit definition for IWDG_SR register *******************/
  1577. #define IWDG_SR_PVU ((uint32_t)0x01) /*!< Watchdog prescaler value update */
  1578. #define IWDG_SR_RVU ((uint32_t)0x02) /*!< Watchdog counter reload value update */
  1579. #define IWDG_SR_WVU ((uint32_t)0x04) /*!< Watchdog counter window value update */
  1580. /******************* Bit definition for IWDG_KR register *******************/
  1581. #define IWDG_WINR_WIN ((uint32_t)0x0FFF) /*!< Watchdog counter window value */
  1582. /*****************************************************************************/
  1583. /* */
  1584. /* Power Control (PWR) */
  1585. /* */
  1586. /*****************************************************************************/
  1587. /* Note: No specific macro feature on this device */
  1588. /******************** Bit definition for PWR_CR register *******************/
  1589. #define PWR_CR_LPDS ((uint32_t)0x00000001U) /*!< Low-power Deepsleep */
  1590. #define PWR_CR_PDDS ((uint32_t)0x00000002U) /*!< Power Down Deepsleep */
  1591. #define PWR_CR_CWUF ((uint32_t)0x00000004U) /*!< Clear Wakeup Flag */
  1592. #define PWR_CR_CSBF ((uint32_t)0x00000008U) /*!< Clear Standby Flag */
  1593. #define PWR_CR_DBP ((uint32_t)0x00000100U) /*!< Disable Backup Domain write protection */
  1594. /******************* Bit definition for PWR_CSR register *******************/
  1595. #define PWR_CSR_WUF ((uint32_t)0x00000001U) /*!< Wakeup Flag */
  1596. #define PWR_CSR_SBF ((uint32_t)0x00000002U) /*!< Standby Flag */
  1597. #define PWR_CSR_EWUP1 ((uint32_t)0x00000100U) /*!< Enable WKUP pin 1 */
  1598. #define PWR_CSR_EWUP2 ((uint32_t)0x00000200U) /*!< Enable WKUP pin 2 */
  1599. /*****************************************************************************/
  1600. /* */
  1601. /* Reset and Clock Control */
  1602. /* */
  1603. /*****************************************************************************/
  1604. /*
  1605. * @brief Specific device feature definitions (not present on all devices in the STM32F0 family)
  1606. */
  1607. /******************** Bit definition for RCC_CR register *******************/
  1608. #define RCC_CR_HSION ((uint32_t)0x00000001U) /*!< Internal High Speed clock enable */
  1609. #define RCC_CR_HSIRDY ((uint32_t)0x00000002U) /*!< Internal High Speed clock ready flag */
  1610. #define RCC_CR_HSITRIM ((uint32_t)0x000000F8U) /*!< Internal High Speed clock trimming */
  1611. #define RCC_CR_HSITRIM_0 ((uint32_t)0x00000008U) /*!<Bit 0 */
  1612. #define RCC_CR_HSITRIM_1 ((uint32_t)0x00000010U) /*!<Bit 1 */
  1613. #define RCC_CR_HSITRIM_2 ((uint32_t)0x00000020U) /*!<Bit 2 */
  1614. #define RCC_CR_HSITRIM_3 ((uint32_t)0x00000040U) /*!<Bit 3 */
  1615. #define RCC_CR_HSITRIM_4 ((uint32_t)0x00000080U) /*!<Bit 4 */
  1616. #define RCC_CR_HSICAL ((uint32_t)0x0000FF00U) /*!< Internal High Speed clock Calibration */
  1617. #define RCC_CR_HSICAL_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  1618. #define RCC_CR_HSICAL_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  1619. #define RCC_CR_HSICAL_2 ((uint32_t)0x00000400U) /*!<Bit 2 */
  1620. #define RCC_CR_HSICAL_3 ((uint32_t)0x00000800U) /*!<Bit 3 */
  1621. #define RCC_CR_HSICAL_4 ((uint32_t)0x00001000U) /*!<Bit 4 */
  1622. #define RCC_CR_HSICAL_5 ((uint32_t)0x00002000U) /*!<Bit 5 */
  1623. #define RCC_CR_HSICAL_6 ((uint32_t)0x00004000U) /*!<Bit 6 */
  1624. #define RCC_CR_HSICAL_7 ((uint32_t)0x00008000U) /*!<Bit 7 */
  1625. #define RCC_CR_HSEON ((uint32_t)0x00010000U) /*!< External High Speed clock enable */
  1626. #define RCC_CR_HSERDY ((uint32_t)0x00020000U) /*!< External High Speed clock ready flag */
  1627. #define RCC_CR_HSEBYP ((uint32_t)0x00040000U) /*!< External High Speed clock Bypass */
  1628. #define RCC_CR_CSSON ((uint32_t)0x00080000U) /*!< Clock Security System enable */
  1629. #define RCC_CR_PLLON ((uint32_t)0x01000000U) /*!< PLL enable */
  1630. #define RCC_CR_PLLRDY ((uint32_t)0x02000000U) /*!< PLL clock ready flag */
  1631. /******************** Bit definition for RCC_CFGR register *****************/
  1632. /*!< SW configuration */
  1633. #define RCC_CFGR_SW ((uint32_t)0x00000003U) /*!< SW[1:0] bits (System clock Switch) */
  1634. #define RCC_CFGR_SW_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  1635. #define RCC_CFGR_SW_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  1636. #define RCC_CFGR_SW_HSI ((uint32_t)0x00000000U) /*!< HSI selected as system clock */
  1637. #define RCC_CFGR_SW_HSE ((uint32_t)0x00000001U) /*!< HSE selected as system clock */
  1638. #define RCC_CFGR_SW_PLL ((uint32_t)0x00000002U) /*!< PLL selected as system clock */
  1639. /*!< SWS configuration */
  1640. #define RCC_CFGR_SWS ((uint32_t)0x0000000CU) /*!< SWS[1:0] bits (System Clock Switch Status) */
  1641. #define RCC_CFGR_SWS_0 ((uint32_t)0x00000004U) /*!< Bit 0 */
  1642. #define RCC_CFGR_SWS_1 ((uint32_t)0x00000008U) /*!< Bit 1 */
  1643. #define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000U) /*!< HSI oscillator used as system clock */
  1644. #define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004U) /*!< HSE oscillator used as system clock */
  1645. #define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008U) /*!< PLL used as system clock */
  1646. /*!< HPRE configuration */
  1647. #define RCC_CFGR_HPRE ((uint32_t)0x000000F0U) /*!< HPRE[3:0] bits (AHB prescaler) */
  1648. #define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010U) /*!< Bit 0 */
  1649. #define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020U) /*!< Bit 1 */
  1650. #define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040U) /*!< Bit 2 */
  1651. #define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080U) /*!< Bit 3 */
  1652. #define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000U) /*!< SYSCLK not divided */
  1653. #define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080U) /*!< SYSCLK divided by 2 */
  1654. #define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090U) /*!< SYSCLK divided by 4 */
  1655. #define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0U) /*!< SYSCLK divided by 8 */
  1656. #define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0U) /*!< SYSCLK divided by 16 */
  1657. #define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0U) /*!< SYSCLK divided by 64 */
  1658. #define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0U) /*!< SYSCLK divided by 128 */
  1659. #define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0U) /*!< SYSCLK divided by 256 */
  1660. #define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0U) /*!< SYSCLK divided by 512 */
  1661. /*!< PPRE configuration */
  1662. #define RCC_CFGR_PPRE ((uint32_t)0x00000700U) /*!< PRE[2:0] bits (APB prescaler) */
  1663. #define RCC_CFGR_PPRE_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  1664. #define RCC_CFGR_PPRE_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  1665. #define RCC_CFGR_PPRE_2 ((uint32_t)0x00000400U) /*!< Bit 2 */
  1666. #define RCC_CFGR_PPRE_DIV1 ((uint32_t)0x00000000U) /*!< HCLK not divided */
  1667. #define RCC_CFGR_PPRE_DIV2 ((uint32_t)0x00000400U) /*!< HCLK divided by 2 */
  1668. #define RCC_CFGR_PPRE_DIV4 ((uint32_t)0x00000500U) /*!< HCLK divided by 4 */
  1669. #define RCC_CFGR_PPRE_DIV8 ((uint32_t)0x00000600U) /*!< HCLK divided by 8 */
  1670. #define RCC_CFGR_PPRE_DIV16 ((uint32_t)0x00000700U) /*!< HCLK divided by 16 */
  1671. /*!< ADCPPRE configuration */
  1672. #define RCC_CFGR_ADCPRE ((uint32_t)0x00004000U) /*!< ADCPRE bit (ADC prescaler) */
  1673. #define RCC_CFGR_ADCPRE_DIV2 ((uint32_t)0x00000000U) /*!< PCLK divided by 2 */
  1674. #define RCC_CFGR_ADCPRE_DIV4 ((uint32_t)0x00004000U) /*!< PCLK divided by 4 */
  1675. #define RCC_CFGR_PLLSRC ((uint32_t)0x00010000U) /*!< PLL entry clock source */
  1676. #define RCC_CFGR_PLLSRC_HSI_DIV2 ((uint32_t)0x00000000U) /*!< HSI clock divided by 2 selected as PLL entry clock source */
  1677. #define RCC_CFGR_PLLSRC_HSE_PREDIV ((uint32_t)0x00010000U) /*!< HSE/PREDIV clock selected as PLL entry clock source */
  1678. #define RCC_CFGR_PLLXTPRE ((uint32_t)0x00020000U) /*!< HSE divider for PLL entry */
  1679. #define RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV1 ((uint32_t)0x00000000U) /*!< HSE/PREDIV clock not divided for PLL entry */
  1680. #define RCC_CFGR_PLLXTPRE_HSE_PREDIV_DIV2 ((uint32_t)0x00020000U) /*!< HSE/PREDIV clock divided by 2 for PLL entry */
  1681. /*!< PLLMUL configuration */
  1682. #define RCC_CFGR_PLLMUL ((uint32_t)0x003C0000U) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
  1683. #define RCC_CFGR_PLLMUL_0 ((uint32_t)0x00040000U) /*!< Bit 0 */
  1684. #define RCC_CFGR_PLLMUL_1 ((uint32_t)0x00080000U) /*!< Bit 1 */
  1685. #define RCC_CFGR_PLLMUL_2 ((uint32_t)0x00100000U) /*!< Bit 2 */
  1686. #define RCC_CFGR_PLLMUL_3 ((uint32_t)0x00200000U) /*!< Bit 3 */
  1687. #define RCC_CFGR_PLLMUL2 ((uint32_t)0x00000000U) /*!< PLL input clock*2 */
  1688. #define RCC_CFGR_PLLMUL3 ((uint32_t)0x00040000U) /*!< PLL input clock*3 */
  1689. #define RCC_CFGR_PLLMUL4 ((uint32_t)0x00080000U) /*!< PLL input clock*4 */
  1690. #define RCC_CFGR_PLLMUL5 ((uint32_t)0x000C0000U) /*!< PLL input clock*5 */
  1691. #define RCC_CFGR_PLLMUL6 ((uint32_t)0x00100000U) /*!< PLL input clock*6 */
  1692. #define RCC_CFGR_PLLMUL7 ((uint32_t)0x00140000U) /*!< PLL input clock*7 */
  1693. #define RCC_CFGR_PLLMUL8 ((uint32_t)0x00180000U) /*!< PLL input clock*8 */
  1694. #define RCC_CFGR_PLLMUL9 ((uint32_t)0x001C0000U) /*!< PLL input clock*9 */
  1695. #define RCC_CFGR_PLLMUL10 ((uint32_t)0x00200000U) /*!< PLL input clock10 */
  1696. #define RCC_CFGR_PLLMUL11 ((uint32_t)0x00240000U) /*!< PLL input clock*11 */
  1697. #define RCC_CFGR_PLLMUL12 ((uint32_t)0x00280000U) /*!< PLL input clock*12 */
  1698. #define RCC_CFGR_PLLMUL13 ((uint32_t)0x002C0000U) /*!< PLL input clock*13 */
  1699. #define RCC_CFGR_PLLMUL14 ((uint32_t)0x00300000U) /*!< PLL input clock*14 */
  1700. #define RCC_CFGR_PLLMUL15 ((uint32_t)0x00340000U) /*!< PLL input clock*15 */
  1701. #define RCC_CFGR_PLLMUL16 ((uint32_t)0x00380000U) /*!< PLL input clock*16 */
  1702. /*!< MCO configuration */
  1703. #define RCC_CFGR_MCO ((uint32_t)0x0F000000U) /*!< MCO[3:0] bits (Microcontroller Clock Output) */
  1704. #define RCC_CFGR_MCO_0 ((uint32_t)0x01000000U) /*!< Bit 0 */
  1705. #define RCC_CFGR_MCO_1 ((uint32_t)0x02000000U) /*!< Bit 1 */
  1706. #define RCC_CFGR_MCO_2 ((uint32_t)0x04000000U) /*!< Bit 2 */
  1707. #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000U) /*!< No clock */
  1708. #define RCC_CFGR_MCO_HSI14 ((uint32_t)0x01000000U) /*!< HSI14 clock selected as MCO source */
  1709. #define RCC_CFGR_MCO_LSI ((uint32_t)0x02000000U) /*!< LSI clock selected as MCO source */
  1710. #define RCC_CFGR_MCO_LSE ((uint32_t)0x03000000U) /*!< LSE clock selected as MCO source */
  1711. #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x04000000U) /*!< System clock selected as MCO source */
  1712. #define RCC_CFGR_MCO_HSI ((uint32_t)0x05000000U) /*!< HSI clock selected as MCO source */
  1713. #define RCC_CFGR_MCO_HSE ((uint32_t)0x06000000U) /*!< HSE clock selected as MCO source */
  1714. #define RCC_CFGR_MCO_PLL ((uint32_t)0x07000000U) /*!< PLL clock divided by 2 selected as MCO source */
  1715. /* Reference defines */
  1716. #define RCC_CFGR_MCOSEL RCC_CFGR_MCO
  1717. #define RCC_CFGR_MCOSEL_0 RCC_CFGR_MCO_0
  1718. #define RCC_CFGR_MCOSEL_1 RCC_CFGR_MCO_1
  1719. #define RCC_CFGR_MCOSEL_2 RCC_CFGR_MCO_2
  1720. #define RCC_CFGR_MCOSEL_NOCLOCK RCC_CFGR_MCO_NOCLOCK
  1721. #define RCC_CFGR_MCOSEL_HSI14 RCC_CFGR_MCO_HSI14
  1722. #define RCC_CFGR_MCOSEL_LSI RCC_CFGR_MCO_LSI
  1723. #define RCC_CFGR_MCOSEL_LSE RCC_CFGR_MCO_LSE
  1724. #define RCC_CFGR_MCOSEL_SYSCLK RCC_CFGR_MCO_SYSCLK
  1725. #define RCC_CFGR_MCOSEL_HSI RCC_CFGR_MCO_HSI
  1726. #define RCC_CFGR_MCOSEL_HSE RCC_CFGR_MCO_HSE
  1727. #define RCC_CFGR_MCOSEL_PLL_DIV2 RCC_CFGR_MCO_PLL
  1728. /*!<****************** Bit definition for RCC_CIR register *****************/
  1729. #define RCC_CIR_LSIRDYF ((uint32_t)0x00000001U) /*!< LSI Ready Interrupt flag */
  1730. #define RCC_CIR_LSERDYF ((uint32_t)0x00000002U) /*!< LSE Ready Interrupt flag */
  1731. #define RCC_CIR_HSIRDYF ((uint32_t)0x00000004U) /*!< HSI Ready Interrupt flag */
  1732. #define RCC_CIR_HSERDYF ((uint32_t)0x00000008U) /*!< HSE Ready Interrupt flag */
  1733. #define RCC_CIR_PLLRDYF ((uint32_t)0x00000010U) /*!< PLL Ready Interrupt flag */
  1734. #define RCC_CIR_HSI14RDYF ((uint32_t)0x00000020U) /*!< HSI14 Ready Interrupt flag */
  1735. #define RCC_CIR_CSSF ((uint32_t)0x00000080U) /*!< Clock Security System Interrupt flag */
  1736. #define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100U) /*!< LSI Ready Interrupt Enable */
  1737. #define RCC_CIR_LSERDYIE ((uint32_t)0x00000200U) /*!< LSE Ready Interrupt Enable */
  1738. #define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400U) /*!< HSI Ready Interrupt Enable */
  1739. #define RCC_CIR_HSERDYIE ((uint32_t)0x00000800U) /*!< HSE Ready Interrupt Enable */
  1740. #define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000U) /*!< PLL Ready Interrupt Enable */
  1741. #define RCC_CIR_HSI14RDYIE ((uint32_t)0x00002000U) /*!< HSI14 Ready Interrupt Enable */
  1742. #define RCC_CIR_LSIRDYC ((uint32_t)0x00010000U) /*!< LSI Ready Interrupt Clear */
  1743. #define RCC_CIR_LSERDYC ((uint32_t)0x00020000U) /*!< LSE Ready Interrupt Clear */
  1744. #define RCC_CIR_HSIRDYC ((uint32_t)0x00040000U) /*!< HSI Ready Interrupt Clear */
  1745. #define RCC_CIR_HSERDYC ((uint32_t)0x00080000U) /*!< HSE Ready Interrupt Clear */
  1746. #define RCC_CIR_PLLRDYC ((uint32_t)0x00100000U) /*!< PLL Ready Interrupt Clear */
  1747. #define RCC_CIR_HSI14RDYC ((uint32_t)0x00200000U) /*!< HSI14 Ready Interrupt Clear */
  1748. #define RCC_CIR_CSSC ((uint32_t)0x00800000U) /*!< Clock Security System Interrupt Clear */
  1749. /***************** Bit definition for RCC_APB2RSTR register ****************/
  1750. #define RCC_APB2RSTR_SYSCFGRST ((uint32_t)0x00000001U) /*!< SYSCFG clock reset */
  1751. #define RCC_APB2RSTR_ADCRST ((uint32_t)0x00000200U) /*!< ADC clock reset */
  1752. #define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000800U) /*!< TIM1 clock reset */
  1753. #define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000U) /*!< SPI1 clock reset */
  1754. #define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000U) /*!< USART1 clock reset */
  1755. #define RCC_APB2RSTR_TIM15RST ((uint32_t)0x00010000U) /*!< TIM15 clock reset */
  1756. #define RCC_APB2RSTR_TIM16RST ((uint32_t)0x00020000U) /*!< TIM16 clock reset */
  1757. #define RCC_APB2RSTR_TIM17RST ((uint32_t)0x00040000U) /*!< TIM17 clock reset */
  1758. #define RCC_APB2RSTR_DBGMCURST ((uint32_t)0x00400000U) /*!< DBGMCU clock reset */
  1759. /*!< Old ADC1 clock reset bit definition maintained for legacy purpose */
  1760. #define RCC_APB2RSTR_ADC1RST RCC_APB2RSTR_ADCRST
  1761. /***************** Bit definition for RCC_APB1RSTR register ****************/
  1762. #define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002U) /*!< Timer 3 clock reset */
  1763. #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010U) /*!< Timer 6 clock reset */
  1764. #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100U) /*!< Timer 14 clock reset */
  1765. #define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800U) /*!< Window Watchdog clock reset */
  1766. #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000U) /*!< SPI2 clock reset */
  1767. #define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000U) /*!< USART 2 clock reset */
  1768. #define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000U) /*!< I2C 1 clock reset */
  1769. #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000U) /*!< I2C 2 clock reset */
  1770. #define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000U) /*!< PWR clock reset */
  1771. /****************** Bit definition for RCC_AHBENR register *****************/
  1772. #define RCC_AHBENR_DMAEN ((uint32_t)0x00000001U) /*!< DMA1 clock enable */
  1773. #define RCC_AHBENR_SRAMEN ((uint32_t)0x00000004U) /*!< SRAM interface clock enable */
  1774. #define RCC_AHBENR_FLITFEN ((uint32_t)0x00000010U) /*!< FLITF clock enable */
  1775. #define RCC_AHBENR_CRCEN ((uint32_t)0x00000040U) /*!< CRC clock enable */
  1776. #define RCC_AHBENR_GPIOAEN ((uint32_t)0x00020000U) /*!< GPIOA clock enable */
  1777. #define RCC_AHBENR_GPIOBEN ((uint32_t)0x00040000U) /*!< GPIOB clock enable */
  1778. #define RCC_AHBENR_GPIOCEN ((uint32_t)0x00080000U) /*!< GPIOC clock enable */
  1779. #define RCC_AHBENR_GPIODEN ((uint32_t)0x00100000U) /*!< GPIOD clock enable */
  1780. #define RCC_AHBENR_GPIOFEN ((uint32_t)0x00400000U) /*!< GPIOF clock enable */
  1781. /* Old Bit definition maintained for legacy purpose */
  1782. #define RCC_AHBENR_DMA1EN RCC_AHBENR_DMAEN /*!< DMA1 clock enable */
  1783. #define RCC_AHBENR_TSEN RCC_AHBENR_TSCEN /*!< TS clock enable */
  1784. /***************** Bit definition for RCC_APB2ENR register *****************/
  1785. #define RCC_APB2ENR_SYSCFGCOMPEN ((uint32_t)0x00000001U) /*!< SYSCFG and comparator clock enable */
  1786. #define RCC_APB2ENR_ADCEN ((uint32_t)0x00000200U) /*!< ADC1 clock enable */
  1787. #define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000800U) /*!< TIM1 clock enable */
  1788. #define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000U) /*!< SPI1 clock enable */
  1789. #define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000U) /*!< USART1 clock enable */
  1790. #define RCC_APB2ENR_TIM15EN ((uint32_t)0x00010000U) /*!< TIM15 clock enable */
  1791. #define RCC_APB2ENR_TIM16EN ((uint32_t)0x00020000U) /*!< TIM16 clock enable */
  1792. #define RCC_APB2ENR_TIM17EN ((uint32_t)0x00040000U) /*!< TIM17 clock enable */
  1793. #define RCC_APB2ENR_DBGMCUEN ((uint32_t)0x00400000U) /*!< DBGMCU clock enable */
  1794. /* Old Bit definition maintained for legacy purpose */
  1795. #define RCC_APB2ENR_SYSCFGEN RCC_APB2ENR_SYSCFGCOMPEN /*!< SYSCFG clock enable */
  1796. #define RCC_APB2ENR_ADC1EN RCC_APB2ENR_ADCEN /*!< ADC1 clock enable */
  1797. /***************** Bit definition for RCC_APB1ENR register *****************/
  1798. #define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002U) /*!< Timer 3 clock enable */
  1799. #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010U) /*!< Timer 6 clock enable */
  1800. #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100U) /*!< Timer 14 clock enable */
  1801. #define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800U) /*!< Window Watchdog clock enable */
  1802. #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000U) /*!< SPI2 clock enable */
  1803. #define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000U) /*!< USART2 clock enable */
  1804. #define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000U) /*!< I2C1 clock enable */
  1805. #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000U) /*!< I2C2 clock enable */
  1806. #define RCC_APB1ENR_PWREN ((uint32_t)0x10000000U) /*!< PWR clock enable */
  1807. /******************* Bit definition for RCC_BDCR register ******************/
  1808. #define RCC_BDCR_LSEON ((uint32_t)0x00000001U) /*!< External Low Speed oscillator enable */
  1809. #define RCC_BDCR_LSERDY ((uint32_t)0x00000002U) /*!< External Low Speed oscillator Ready */
  1810. #define RCC_BDCR_LSEBYP ((uint32_t)0x00000004U) /*!< External Low Speed oscillator Bypass */
  1811. #define RCC_BDCR_LSEDRV ((uint32_t)0x00000018U) /*!< LSEDRV[1:0] bits (LSE Osc. drive capability) */
  1812. #define RCC_BDCR_LSEDRV_0 ((uint32_t)0x00000008U) /*!< Bit 0 */
  1813. #define RCC_BDCR_LSEDRV_1 ((uint32_t)0x00000010U) /*!< Bit 1 */
  1814. #define RCC_BDCR_RTCSEL ((uint32_t)0x00000300U) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
  1815. #define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  1816. #define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  1817. /*!< RTC configuration */
  1818. #define RCC_BDCR_RTCSEL_NOCLOCK ((uint32_t)0x00000000U) /*!< No clock */
  1819. #define RCC_BDCR_RTCSEL_LSE ((uint32_t)0x00000100U) /*!< LSE oscillator clock used as RTC clock */
  1820. #define RCC_BDCR_RTCSEL_LSI ((uint32_t)0x00000200U) /*!< LSI oscillator clock used as RTC clock */
  1821. #define RCC_BDCR_RTCSEL_HSE ((uint32_t)0x00000300U) /*!< HSE oscillator clock divided by 128 used as RTC clock */
  1822. #define RCC_BDCR_RTCEN ((uint32_t)0x00008000U) /*!< RTC clock enable */
  1823. #define RCC_BDCR_BDRST ((uint32_t)0x00010000U) /*!< Backup domain software reset */
  1824. /******************* Bit definition for RCC_CSR register *******************/
  1825. #define RCC_CSR_LSION ((uint32_t)0x00000001U) /*!< Internal Low Speed oscillator enable */
  1826. #define RCC_CSR_LSIRDY ((uint32_t)0x00000002U) /*!< Internal Low Speed oscillator Ready */
  1827. #define RCC_CSR_V18PWRRSTF ((uint32_t)0x00800000U) /*!< V1.8 power domain reset flag */
  1828. #define RCC_CSR_RMVF ((uint32_t)0x01000000U) /*!< Remove reset flag */
  1829. #define RCC_CSR_OBLRSTF ((uint32_t)0x02000000U) /*!< OBL reset flag */
  1830. #define RCC_CSR_PINRSTF ((uint32_t)0x04000000U) /*!< PIN reset flag */
  1831. #define RCC_CSR_PORRSTF ((uint32_t)0x08000000U) /*!< POR/PDR reset flag */
  1832. #define RCC_CSR_SFTRSTF ((uint32_t)0x10000000U) /*!< Software Reset flag */
  1833. #define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000U) /*!< Independent Watchdog reset flag */
  1834. #define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000U) /*!< Window watchdog reset flag */
  1835. #define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000U) /*!< Low-Power reset flag */
  1836. /* Old Bit definition maintained for legacy purpose */
  1837. #define RCC_CSR_OBL RCC_CSR_OBLRSTF /*!< OBL reset flag */
  1838. /******************* Bit definition for RCC_AHBRSTR register ***************/
  1839. #define RCC_AHBRSTR_GPIOARST ((uint32_t)0x00020000U) /*!< GPIOA clock reset */
  1840. #define RCC_AHBRSTR_GPIOBRST ((uint32_t)0x00040000U) /*!< GPIOB clock reset */
  1841. #define RCC_AHBRSTR_GPIOCRST ((uint32_t)0x00080000U) /*!< GPIOC clock reset */
  1842. #define RCC_AHBRSTR_GPIODRST ((uint32_t)0x00100000U) /*!< GPIOD clock reset */
  1843. #define RCC_AHBRSTR_GPIOFRST ((uint32_t)0x00400000U) /*!< GPIOF clock reset */
  1844. /******************* Bit definition for RCC_CFGR2 register *****************/
  1845. /*!< PREDIV configuration */
  1846. #define RCC_CFGR2_PREDIV ((uint32_t)0x0000000FU) /*!< PREDIV[3:0] bits */
  1847. #define RCC_CFGR2_PREDIV_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  1848. #define RCC_CFGR2_PREDIV_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  1849. #define RCC_CFGR2_PREDIV_2 ((uint32_t)0x00000004U) /*!< Bit 2 */
  1850. #define RCC_CFGR2_PREDIV_3 ((uint32_t)0x00000008U) /*!< Bit 3 */
  1851. #define RCC_CFGR2_PREDIV_DIV1 ((uint32_t)0x00000000U) /*!< PREDIV input clock not divided */
  1852. #define RCC_CFGR2_PREDIV_DIV2 ((uint32_t)0x00000001U) /*!< PREDIV input clock divided by 2 */
  1853. #define RCC_CFGR2_PREDIV_DIV3 ((uint32_t)0x00000002U) /*!< PREDIV input clock divided by 3 */
  1854. #define RCC_CFGR2_PREDIV_DIV4 ((uint32_t)0x00000003U) /*!< PREDIV input clock divided by 4 */
  1855. #define RCC_CFGR2_PREDIV_DIV5 ((uint32_t)0x00000004U) /*!< PREDIV input clock divided by 5 */
  1856. #define RCC_CFGR2_PREDIV_DIV6 ((uint32_t)0x00000005U) /*!< PREDIV input clock divided by 6 */
  1857. #define RCC_CFGR2_PREDIV_DIV7 ((uint32_t)0x00000006U) /*!< PREDIV input clock divided by 7 */
  1858. #define RCC_CFGR2_PREDIV_DIV8 ((uint32_t)0x00000007U) /*!< PREDIV input clock divided by 8 */
  1859. #define RCC_CFGR2_PREDIV_DIV9 ((uint32_t)0x00000008U) /*!< PREDIV input clock divided by 9 */
  1860. #define RCC_CFGR2_PREDIV_DIV10 ((uint32_t)0x00000009U) /*!< PREDIV input clock divided by 10 */
  1861. #define RCC_CFGR2_PREDIV_DIV11 ((uint32_t)0x0000000AU) /*!< PREDIV input clock divided by 11 */
  1862. #define RCC_CFGR2_PREDIV_DIV12 ((uint32_t)0x0000000BU) /*!< PREDIV input clock divided by 12 */
  1863. #define RCC_CFGR2_PREDIV_DIV13 ((uint32_t)0x0000000CU) /*!< PREDIV input clock divided by 13 */
  1864. #define RCC_CFGR2_PREDIV_DIV14 ((uint32_t)0x0000000DU) /*!< PREDIV input clock divided by 14 */
  1865. #define RCC_CFGR2_PREDIV_DIV15 ((uint32_t)0x0000000EU) /*!< PREDIV input clock divided by 15 */
  1866. #define RCC_CFGR2_PREDIV_DIV16 ((uint32_t)0x0000000FU) /*!< PREDIV input clock divided by 16 */
  1867. /******************* Bit definition for RCC_CFGR3 register *****************/
  1868. /*!< USART1 Clock source selection */
  1869. #define RCC_CFGR3_USART1SW ((uint32_t)0x00000003U) /*!< USART1SW[1:0] bits */
  1870. #define RCC_CFGR3_USART1SW_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  1871. #define RCC_CFGR3_USART1SW_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  1872. #define RCC_CFGR3_USART1SW_PCLK ((uint32_t)0x00000000U) /*!< PCLK clock used as USART1 clock source */
  1873. #define RCC_CFGR3_USART1SW_SYSCLK ((uint32_t)0x00000001U) /*!< System clock selected as USART1 clock source */
  1874. #define RCC_CFGR3_USART1SW_LSE ((uint32_t)0x00000002U) /*!< LSE oscillator clock used as USART1 clock source */
  1875. #define RCC_CFGR3_USART1SW_HSI ((uint32_t)0x00000003U) /*!< HSI oscillator clock used as USART1 clock source */
  1876. /*!< I2C1 Clock source selection */
  1877. #define RCC_CFGR3_I2C1SW ((uint32_t)0x00000010U) /*!< I2C1SW bits */
  1878. #define RCC_CFGR3_I2C1SW_HSI ((uint32_t)0x00000000U) /*!< HSI oscillator clock used as I2C1 clock source */
  1879. #define RCC_CFGR3_I2C1SW_SYSCLK ((uint32_t)0x00000010U) /*!< System clock selected as I2C1 clock source */
  1880. /******************* Bit definition for RCC_CR2 register *******************/
  1881. #define RCC_CR2_HSI14ON ((uint32_t)0x00000001U) /*!< Internal High Speed 14MHz clock enable */
  1882. #define RCC_CR2_HSI14RDY ((uint32_t)0x00000002U) /*!< Internal High Speed 14MHz clock ready flag */
  1883. #define RCC_CR2_HSI14DIS ((uint32_t)0x00000004U) /*!< Internal High Speed 14MHz clock disable */
  1884. #define RCC_CR2_HSI14TRIM ((uint32_t)0x000000F8U) /*!< Internal High Speed 14MHz clock trimming */
  1885. #define RCC_CR2_HSI14CAL ((uint32_t)0x0000FF00U) /*!< Internal High Speed 14MHz clock Calibration */
  1886. /*****************************************************************************/
  1887. /* */
  1888. /* Real-Time Clock (RTC) */
  1889. /* */
  1890. /*****************************************************************************/
  1891. /*
  1892. * @brief Specific device feature definitions (not present on all devices in the STM32F0 family)
  1893. */
  1894. #define RTC_TAMPER1_SUPPORT /*!< TAMPER 1 feature support */
  1895. /******************** Bits definition for RTC_TR register ******************/
  1896. #define RTC_TR_PM ((uint32_t)0x00400000U)
  1897. #define RTC_TR_HT ((uint32_t)0x00300000U)
  1898. #define RTC_TR_HT_0 ((uint32_t)0x00100000U)
  1899. #define RTC_TR_HT_1 ((uint32_t)0x00200000U)
  1900. #define RTC_TR_HU ((uint32_t)0x000F0000U)
  1901. #define RTC_TR_HU_0 ((uint32_t)0x00010000U)
  1902. #define RTC_TR_HU_1 ((uint32_t)0x00020000U)
  1903. #define RTC_TR_HU_2 ((uint32_t)0x00040000U)
  1904. #define RTC_TR_HU_3 ((uint32_t)0x00080000U)
  1905. #define RTC_TR_MNT ((uint32_t)0x00007000U)
  1906. #define RTC_TR_MNT_0 ((uint32_t)0x00001000U)
  1907. #define RTC_TR_MNT_1 ((uint32_t)0x00002000U)
  1908. #define RTC_TR_MNT_2 ((uint32_t)0x00004000U)
  1909. #define RTC_TR_MNU ((uint32_t)0x00000F00U)
  1910. #define RTC_TR_MNU_0 ((uint32_t)0x00000100U)
  1911. #define RTC_TR_MNU_1 ((uint32_t)0x00000200U)
  1912. #define RTC_TR_MNU_2 ((uint32_t)0x00000400U)
  1913. #define RTC_TR_MNU_3 ((uint32_t)0x00000800U)
  1914. #define RTC_TR_ST ((uint32_t)0x00000070U)
  1915. #define RTC_TR_ST_0 ((uint32_t)0x00000010U)
  1916. #define RTC_TR_ST_1 ((uint32_t)0x00000020U)
  1917. #define RTC_TR_ST_2 ((uint32_t)0x00000040U)
  1918. #define RTC_TR_SU ((uint32_t)0x0000000FU)
  1919. #define RTC_TR_SU_0 ((uint32_t)0x00000001U)
  1920. #define RTC_TR_SU_1 ((uint32_t)0x00000002U)
  1921. #define RTC_TR_SU_2 ((uint32_t)0x00000004U)
  1922. #define RTC_TR_SU_3 ((uint32_t)0x00000008U)
  1923. /******************** Bits definition for RTC_DR register ******************/
  1924. #define RTC_DR_YT ((uint32_t)0x00F00000U)
  1925. #define RTC_DR_YT_0 ((uint32_t)0x00100000U)
  1926. #define RTC_DR_YT_1 ((uint32_t)0x00200000U)
  1927. #define RTC_DR_YT_2 ((uint32_t)0x00400000U)
  1928. #define RTC_DR_YT_3 ((uint32_t)0x00800000U)
  1929. #define RTC_DR_YU ((uint32_t)0x000F0000U)
  1930. #define RTC_DR_YU_0 ((uint32_t)0x00010000U)
  1931. #define RTC_DR_YU_1 ((uint32_t)0x00020000U)
  1932. #define RTC_DR_YU_2 ((uint32_t)0x00040000U)
  1933. #define RTC_DR_YU_3 ((uint32_t)0x00080000U)
  1934. #define RTC_DR_WDU ((uint32_t)0x0000E000U)
  1935. #define RTC_DR_WDU_0 ((uint32_t)0x00002000U)
  1936. #define RTC_DR_WDU_1 ((uint32_t)0x00004000U)
  1937. #define RTC_DR_WDU_2 ((uint32_t)0x00008000U)
  1938. #define RTC_DR_MT ((uint32_t)0x00001000U)
  1939. #define RTC_DR_MU ((uint32_t)0x00000F00U)
  1940. #define RTC_DR_MU_0 ((uint32_t)0x00000100U)
  1941. #define RTC_DR_MU_1 ((uint32_t)0x00000200U)
  1942. #define RTC_DR_MU_2 ((uint32_t)0x00000400U)
  1943. #define RTC_DR_MU_3 ((uint32_t)0x00000800U)
  1944. #define RTC_DR_DT ((uint32_t)0x00000030U)
  1945. #define RTC_DR_DT_0 ((uint32_t)0x00000010U)
  1946. #define RTC_DR_DT_1 ((uint32_t)0x00000020U)
  1947. #define RTC_DR_DU ((uint32_t)0x0000000FU)
  1948. #define RTC_DR_DU_0 ((uint32_t)0x00000001U)
  1949. #define RTC_DR_DU_1 ((uint32_t)0x00000002U)
  1950. #define RTC_DR_DU_2 ((uint32_t)0x00000004U)
  1951. #define RTC_DR_DU_3 ((uint32_t)0x00000008U)
  1952. /******************** Bits definition for RTC_CR register ******************/
  1953. #define RTC_CR_COE ((uint32_t)0x00800000U)
  1954. #define RTC_CR_OSEL ((uint32_t)0x00600000U)
  1955. #define RTC_CR_OSEL_0 ((uint32_t)0x00200000U)
  1956. #define RTC_CR_OSEL_1 ((uint32_t)0x00400000U)
  1957. #define RTC_CR_POL ((uint32_t)0x00100000U)
  1958. #define RTC_CR_COSEL ((uint32_t)0x00080000U)
  1959. #define RTC_CR_BCK ((uint32_t)0x00040000U)
  1960. #define RTC_CR_SUB1H ((uint32_t)0x00020000U)
  1961. #define RTC_CR_ADD1H ((uint32_t)0x00010000U)
  1962. #define RTC_CR_TSIE ((uint32_t)0x00008000U)
  1963. #define RTC_CR_ALRAIE ((uint32_t)0x00001000U)
  1964. #define RTC_CR_TSE ((uint32_t)0x00000800U)
  1965. #define RTC_CR_ALRAE ((uint32_t)0x00000100U)
  1966. #define RTC_CR_FMT ((uint32_t)0x00000040U)
  1967. #define RTC_CR_BYPSHAD ((uint32_t)0x00000020U)
  1968. #define RTC_CR_REFCKON ((uint32_t)0x00000010U)
  1969. #define RTC_CR_TSEDGE ((uint32_t)0x00000008U)
  1970. /******************** Bits definition for RTC_ISR register *****************/
  1971. #define RTC_ISR_RECALPF ((uint32_t)0x00010000U)
  1972. #define RTC_ISR_TAMP2F ((uint32_t)0x00004000U)
  1973. #define RTC_ISR_TAMP1F ((uint32_t)0x00002000U)
  1974. #define RTC_ISR_TSOVF ((uint32_t)0x00001000U)
  1975. #define RTC_ISR_TSF ((uint32_t)0x00000800U)
  1976. #define RTC_ISR_ALRAF ((uint32_t)0x00000100U)
  1977. #define RTC_ISR_INIT ((uint32_t)0x00000080U)
  1978. #define RTC_ISR_INITF ((uint32_t)0x00000040U)
  1979. #define RTC_ISR_RSF ((uint32_t)0x00000020U)
  1980. #define RTC_ISR_INITS ((uint32_t)0x00000010U)
  1981. #define RTC_ISR_SHPF ((uint32_t)0x00000008U)
  1982. #define RTC_ISR_ALRAWF ((uint32_t)0x00000001U)
  1983. /******************** Bits definition for RTC_PRER register ****************/
  1984. #define RTC_PRER_PREDIV_A ((uint32_t)0x007F0000U)
  1985. #define RTC_PRER_PREDIV_S ((uint32_t)0x00007FFFU)
  1986. /******************** Bits definition for RTC_ALRMAR register **************/
  1987. #define RTC_ALRMAR_MSK4 ((uint32_t)0x80000000U)
  1988. #define RTC_ALRMAR_WDSEL ((uint32_t)0x40000000U)
  1989. #define RTC_ALRMAR_DT ((uint32_t)0x30000000U)
  1990. #define RTC_ALRMAR_DT_0 ((uint32_t)0x10000000U)
  1991. #define RTC_ALRMAR_DT_1 ((uint32_t)0x20000000U)
  1992. #define RTC_ALRMAR_DU ((uint32_t)0x0F000000U)
  1993. #define RTC_ALRMAR_DU_0 ((uint32_t)0x01000000U)
  1994. #define RTC_ALRMAR_DU_1 ((uint32_t)0x02000000U)
  1995. #define RTC_ALRMAR_DU_2 ((uint32_t)0x04000000U)
  1996. #define RTC_ALRMAR_DU_3 ((uint32_t)0x08000000U)
  1997. #define RTC_ALRMAR_MSK3 ((uint32_t)0x00800000U)
  1998. #define RTC_ALRMAR_PM ((uint32_t)0x00400000U)
  1999. #define RTC_ALRMAR_HT ((uint32_t)0x00300000U)
  2000. #define RTC_ALRMAR_HT_0 ((uint32_t)0x00100000U)
  2001. #define RTC_ALRMAR_HT_1 ((uint32_t)0x00200000U)
  2002. #define RTC_ALRMAR_HU ((uint32_t)0x000F0000U)
  2003. #define RTC_ALRMAR_HU_0 ((uint32_t)0x00010000U)
  2004. #define RTC_ALRMAR_HU_1 ((uint32_t)0x00020000U)
  2005. #define RTC_ALRMAR_HU_2 ((uint32_t)0x00040000U)
  2006. #define RTC_ALRMAR_HU_3 ((uint32_t)0x00080000U)
  2007. #define RTC_ALRMAR_MSK2 ((uint32_t)0x00008000U)
  2008. #define RTC_ALRMAR_MNT ((uint32_t)0x00007000U)
  2009. #define RTC_ALRMAR_MNT_0 ((uint32_t)0x00001000U)
  2010. #define RTC_ALRMAR_MNT_1 ((uint32_t)0x00002000U)
  2011. #define RTC_ALRMAR_MNT_2 ((uint32_t)0x00004000U)
  2012. #define RTC_ALRMAR_MNU ((uint32_t)0x00000F00U)
  2013. #define RTC_ALRMAR_MNU_0 ((uint32_t)0x00000100U)
  2014. #define RTC_ALRMAR_MNU_1 ((uint32_t)0x00000200U)
  2015. #define RTC_ALRMAR_MNU_2 ((uint32_t)0x00000400U)
  2016. #define RTC_ALRMAR_MNU_3 ((uint32_t)0x00000800U)
  2017. #define RTC_ALRMAR_MSK1 ((uint32_t)0x00000080U)
  2018. #define RTC_ALRMAR_ST ((uint32_t)0x00000070U)
  2019. #define RTC_ALRMAR_ST_0 ((uint32_t)0x00000010U)
  2020. #define RTC_ALRMAR_ST_1 ((uint32_t)0x00000020U)
  2021. #define RTC_ALRMAR_ST_2 ((uint32_t)0x00000040U)
  2022. #define RTC_ALRMAR_SU ((uint32_t)0x0000000FU)
  2023. #define RTC_ALRMAR_SU_0 ((uint32_t)0x00000001U)
  2024. #define RTC_ALRMAR_SU_1 ((uint32_t)0x00000002U)
  2025. #define RTC_ALRMAR_SU_2 ((uint32_t)0x00000004U)
  2026. #define RTC_ALRMAR_SU_3 ((uint32_t)0x00000008U)
  2027. /******************** Bits definition for RTC_WPR register *****************/
  2028. #define RTC_WPR_KEY ((uint32_t)0x000000FFU)
  2029. /******************** Bits definition for RTC_SSR register *****************/
  2030. #define RTC_SSR_SS ((uint32_t)0x0000FFFFU)
  2031. /******************** Bits definition for RTC_SHIFTR register **************/
  2032. #define RTC_SHIFTR_SUBFS ((uint32_t)0x00007FFFU)
  2033. #define RTC_SHIFTR_ADD1S ((uint32_t)0x80000000U)
  2034. /******************** Bits definition for RTC_TSTR register ****************/
  2035. #define RTC_TSTR_PM ((uint32_t)0x00400000U)
  2036. #define RTC_TSTR_HT ((uint32_t)0x00300000U)
  2037. #define RTC_TSTR_HT_0 ((uint32_t)0x00100000U)
  2038. #define RTC_TSTR_HT_1 ((uint32_t)0x00200000U)
  2039. #define RTC_TSTR_HU ((uint32_t)0x000F0000U)
  2040. #define RTC_TSTR_HU_0 ((uint32_t)0x00010000U)
  2041. #define RTC_TSTR_HU_1 ((uint32_t)0x00020000U)
  2042. #define RTC_TSTR_HU_2 ((uint32_t)0x00040000U)
  2043. #define RTC_TSTR_HU_3 ((uint32_t)0x00080000U)
  2044. #define RTC_TSTR_MNT ((uint32_t)0x00007000U)
  2045. #define RTC_TSTR_MNT_0 ((uint32_t)0x00001000U)
  2046. #define RTC_TSTR_MNT_1 ((uint32_t)0x00002000U)
  2047. #define RTC_TSTR_MNT_2 ((uint32_t)0x00004000U)
  2048. #define RTC_TSTR_MNU ((uint32_t)0x00000F00U)
  2049. #define RTC_TSTR_MNU_0 ((uint32_t)0x00000100U)
  2050. #define RTC_TSTR_MNU_1 ((uint32_t)0x00000200U)
  2051. #define RTC_TSTR_MNU_2 ((uint32_t)0x00000400U)
  2052. #define RTC_TSTR_MNU_3 ((uint32_t)0x00000800U)
  2053. #define RTC_TSTR_ST ((uint32_t)0x00000070U)
  2054. #define RTC_TSTR_ST_0 ((uint32_t)0x00000010U)
  2055. #define RTC_TSTR_ST_1 ((uint32_t)0x00000020U)
  2056. #define RTC_TSTR_ST_2 ((uint32_t)0x00000040U)
  2057. #define RTC_TSTR_SU ((uint32_t)0x0000000FU)
  2058. #define RTC_TSTR_SU_0 ((uint32_t)0x00000001U)
  2059. #define RTC_TSTR_SU_1 ((uint32_t)0x00000002U)
  2060. #define RTC_TSTR_SU_2 ((uint32_t)0x00000004U)
  2061. #define RTC_TSTR_SU_3 ((uint32_t)0x00000008U)
  2062. /******************** Bits definition for RTC_TSDR register ****************/
  2063. #define RTC_TSDR_WDU ((uint32_t)0x0000E000U)
  2064. #define RTC_TSDR_WDU_0 ((uint32_t)0x00002000U)
  2065. #define RTC_TSDR_WDU_1 ((uint32_t)0x00004000U)
  2066. #define RTC_TSDR_WDU_2 ((uint32_t)0x00008000U)
  2067. #define RTC_TSDR_MT ((uint32_t)0x00001000U)
  2068. #define RTC_TSDR_MU ((uint32_t)0x00000F00U)
  2069. #define RTC_TSDR_MU_0 ((uint32_t)0x00000100U)
  2070. #define RTC_TSDR_MU_1 ((uint32_t)0x00000200U)
  2071. #define RTC_TSDR_MU_2 ((uint32_t)0x00000400U)
  2072. #define RTC_TSDR_MU_3 ((uint32_t)0x00000800U)
  2073. #define RTC_TSDR_DT ((uint32_t)0x00000030U)
  2074. #define RTC_TSDR_DT_0 ((uint32_t)0x00000010U)
  2075. #define RTC_TSDR_DT_1 ((uint32_t)0x00000020U)
  2076. #define RTC_TSDR_DU ((uint32_t)0x0000000FU)
  2077. #define RTC_TSDR_DU_0 ((uint32_t)0x00000001U)
  2078. #define RTC_TSDR_DU_1 ((uint32_t)0x00000002U)
  2079. #define RTC_TSDR_DU_2 ((uint32_t)0x00000004U)
  2080. #define RTC_TSDR_DU_3 ((uint32_t)0x00000008U)
  2081. /******************** Bits definition for RTC_TSSSR register ***************/
  2082. #define RTC_TSSSR_SS ((uint32_t)0x0000FFFFU)
  2083. /******************** Bits definition for RTC_CALR register ****************/
  2084. #define RTC_CALR_CALP ((uint32_t)0x00008000U)
  2085. #define RTC_CALR_CALW8 ((uint32_t)0x00004000U)
  2086. #define RTC_CALR_CALW16 ((uint32_t)0x00002000U)
  2087. #define RTC_CALR_CALM ((uint32_t)0x000001FFU)
  2088. #define RTC_CALR_CALM_0 ((uint32_t)0x00000001U)
  2089. #define RTC_CALR_CALM_1 ((uint32_t)0x00000002U)
  2090. #define RTC_CALR_CALM_2 ((uint32_t)0x00000004U)
  2091. #define RTC_CALR_CALM_3 ((uint32_t)0x00000008U)
  2092. #define RTC_CALR_CALM_4 ((uint32_t)0x00000010U)
  2093. #define RTC_CALR_CALM_5 ((uint32_t)0x00000020U)
  2094. #define RTC_CALR_CALM_6 ((uint32_t)0x00000040U)
  2095. #define RTC_CALR_CALM_7 ((uint32_t)0x00000080U)
  2096. #define RTC_CALR_CALM_8 ((uint32_t)0x00000100U)
  2097. /******************** Bits definition for RTC_TAFCR register ***************/
  2098. #define RTC_TAFCR_PC15MODE ((uint32_t)0x00800000U)
  2099. #define RTC_TAFCR_PC15VALUE ((uint32_t)0x00400000U)
  2100. #define RTC_TAFCR_PC14MODE ((uint32_t)0x00200000U)
  2101. #define RTC_TAFCR_PC14VALUE ((uint32_t)0x00100000U)
  2102. #define RTC_TAFCR_PC13MODE ((uint32_t)0x00080000U)
  2103. #define RTC_TAFCR_PC13VALUE ((uint32_t)0x00040000U)
  2104. #define RTC_TAFCR_TAMPPUDIS ((uint32_t)0x00008000U)
  2105. #define RTC_TAFCR_TAMPPRCH ((uint32_t)0x00006000U)
  2106. #define RTC_TAFCR_TAMPPRCH_0 ((uint32_t)0x00002000U)
  2107. #define RTC_TAFCR_TAMPPRCH_1 ((uint32_t)0x00004000U)
  2108. #define RTC_TAFCR_TAMPFLT ((uint32_t)0x00001800U)
  2109. #define RTC_TAFCR_TAMPFLT_0 ((uint32_t)0x00000800U)
  2110. #define RTC_TAFCR_TAMPFLT_1 ((uint32_t)0x00001000U)
  2111. #define RTC_TAFCR_TAMPFREQ ((uint32_t)0x00000700U)
  2112. #define RTC_TAFCR_TAMPFREQ_0 ((uint32_t)0x00000100U)
  2113. #define RTC_TAFCR_TAMPFREQ_1 ((uint32_t)0x00000200U)
  2114. #define RTC_TAFCR_TAMPFREQ_2 ((uint32_t)0x00000400U)
  2115. #define RTC_TAFCR_TAMPTS ((uint32_t)0x00000080U)
  2116. #define RTC_TAFCR_TAMP2TRG ((uint32_t)0x00000010U)
  2117. #define RTC_TAFCR_TAMP2E ((uint32_t)0x00000008U)
  2118. #define RTC_TAFCR_TAMPIE ((uint32_t)0x00000004U)
  2119. #define RTC_TAFCR_TAMP1TRG ((uint32_t)0x00000002U)
  2120. #define RTC_TAFCR_TAMP1E ((uint32_t)0x00000001U)
  2121. /* Reference defines */
  2122. #define RTC_TAFCR_ALARMOUTTYPE RTC_TAFCR_PC13VALUE
  2123. /******************** Bits definition for RTC_ALRMASSR register ************/
  2124. #define RTC_ALRMASSR_MASKSS ((uint32_t)0x0F000000U)
  2125. #define RTC_ALRMASSR_MASKSS_0 ((uint32_t)0x01000000U)
  2126. #define RTC_ALRMASSR_MASKSS_1 ((uint32_t)0x02000000U)
  2127. #define RTC_ALRMASSR_MASKSS_2 ((uint32_t)0x04000000U)
  2128. #define RTC_ALRMASSR_MASKSS_3 ((uint32_t)0x08000000U)
  2129. #define RTC_ALRMASSR_SS ((uint32_t)0x00007FFFU)
  2130. /*****************************************************************************/
  2131. /* */
  2132. /* Serial Peripheral Interface (SPI) */
  2133. /* */
  2134. /*****************************************************************************/
  2135. /******************* Bit definition for SPI_CR1 register *******************/
  2136. #define SPI_CR1_CPHA ((uint32_t)0x00000001U) /*!< Clock Phase */
  2137. #define SPI_CR1_CPOL ((uint32_t)0x00000002U) /*!< Clock Polarity */
  2138. #define SPI_CR1_MSTR ((uint32_t)0x00000004U) /*!< Master Selection */
  2139. #define SPI_CR1_BR ((uint32_t)0x00000038U) /*!< BR[2:0] bits (Baud Rate Control) */
  2140. #define SPI_CR1_BR_0 ((uint32_t)0x00000008U) /*!< Bit 0 */
  2141. #define SPI_CR1_BR_1 ((uint32_t)0x00000010U) /*!< Bit 1 */
  2142. #define SPI_CR1_BR_2 ((uint32_t)0x00000020U) /*!< Bit 2 */
  2143. #define SPI_CR1_SPE ((uint32_t)0x00000040U) /*!< SPI Enable */
  2144. #define SPI_CR1_LSBFIRST ((uint32_t)0x00000080U) /*!< Frame Format */
  2145. #define SPI_CR1_SSI ((uint32_t)0x00000100U) /*!< Internal slave select */
  2146. #define SPI_CR1_SSM ((uint32_t)0x00000200U) /*!< Software slave management */
  2147. #define SPI_CR1_RXONLY ((uint32_t)0x00000400U) /*!< Receive only */
  2148. #define SPI_CR1_CRCL ((uint32_t)0x00000800U) /*!< CRC Length */
  2149. #define SPI_CR1_CRCNEXT ((uint32_t)0x00001000U) /*!< Transmit CRC next */
  2150. #define SPI_CR1_CRCEN ((uint32_t)0x00002000U) /*!< Hardware CRC calculation enable */
  2151. #define SPI_CR1_BIDIOE ((uint32_t)0x00004000U) /*!< Output enable in bidirectional mode */
  2152. #define SPI_CR1_BIDIMODE ((uint32_t)0x00008000U) /*!< Bidirectional data mode enable */
  2153. /******************* Bit definition for SPI_CR2 register *******************/
  2154. #define SPI_CR2_RXDMAEN ((uint32_t)0x00000001U) /*!< Rx Buffer DMA Enable */
  2155. #define SPI_CR2_TXDMAEN ((uint32_t)0x00000002U) /*!< Tx Buffer DMA Enable */
  2156. #define SPI_CR2_SSOE ((uint32_t)0x00000004U) /*!< SS Output Enable */
  2157. #define SPI_CR2_NSSP ((uint32_t)0x00000008U) /*!< NSS pulse management Enable */
  2158. #define SPI_CR2_FRF ((uint32_t)0x00000010U) /*!< Frame Format Enable */
  2159. #define SPI_CR2_ERRIE ((uint32_t)0x00000020U) /*!< Error Interrupt Enable */
  2160. #define SPI_CR2_RXNEIE ((uint32_t)0x00000040U) /*!< RX buffer Not Empty Interrupt Enable */
  2161. #define SPI_CR2_TXEIE ((uint32_t)0x00000080U) /*!< Tx buffer Empty Interrupt Enable */
  2162. #define SPI_CR2_DS ((uint32_t)0x00000F00U) /*!< DS[3:0] Data Size */
  2163. #define SPI_CR2_DS_0 ((uint32_t)0x00000100U) /*!< Bit 0 */
  2164. #define SPI_CR2_DS_1 ((uint32_t)0x00000200U) /*!< Bit 1 */
  2165. #define SPI_CR2_DS_2 ((uint32_t)0x00000400U) /*!< Bit 2 */
  2166. #define SPI_CR2_DS_3 ((uint32_t)0x00000800U) /*!< Bit 3 */
  2167. #define SPI_CR2_FRXTH ((uint32_t)0x00001000U) /*!< FIFO reception Threshold */
  2168. #define SPI_CR2_LDMARX ((uint32_t)0x00002000U) /*!< Last DMA transfer for reception */
  2169. #define SPI_CR2_LDMATX ((uint32_t)0x00004000U) /*!< Last DMA transfer for transmission */
  2170. /******************** Bit definition for SPI_SR register *******************/
  2171. #define SPI_SR_RXNE ((uint32_t)0x00000001U) /*!< Receive buffer Not Empty */
  2172. #define SPI_SR_TXE ((uint32_t)0x00000002U) /*!< Transmit buffer Empty */
  2173. #define SPI_SR_CRCERR ((uint32_t)0x00000010U) /*!< CRC Error flag */
  2174. #define SPI_SR_MODF ((uint32_t)0x00000020U) /*!< Mode fault */
  2175. #define SPI_SR_OVR ((uint32_t)0x00000040U) /*!< Overrun flag */
  2176. #define SPI_SR_BSY ((uint32_t)0x00000080U) /*!< Busy flag */
  2177. #define SPI_SR_FRE ((uint32_t)0x00000100U) /*!< TI frame format error */
  2178. #define SPI_SR_FRLVL ((uint32_t)0x00000600U) /*!< FIFO Reception Level */
  2179. #define SPI_SR_FRLVL_0 ((uint32_t)0x00000200U) /*!< Bit 0 */
  2180. #define SPI_SR_FRLVL_1 ((uint32_t)0x00000400U) /*!< Bit 1 */
  2181. #define SPI_SR_FTLVL ((uint32_t)0x00001800U) /*!< FIFO Transmission Level */
  2182. #define SPI_SR_FTLVL_0 ((uint32_t)0x00000800U) /*!< Bit 0 */
  2183. #define SPI_SR_FTLVL_1 ((uint32_t)0x00001000U) /*!< Bit 1 */
  2184. /******************** Bit definition for SPI_DR register *******************/
  2185. #define SPI_DR_DR ((uint32_t)0xFFFFFFFFU) /*!< Data Register */
  2186. /******************* Bit definition for SPI_CRCPR register *****************/
  2187. #define SPI_CRCPR_CRCPOLY ((uint32_t)0xFFFFFFFFU) /*!< CRC polynomial register */
  2188. /****************** Bit definition for SPI_RXCRCR register *****************/
  2189. #define SPI_RXCRCR_RXCRC ((uint32_t)0xFFFFFFFFU) /*!< Rx CRC Register */
  2190. /****************** Bit definition for SPI_TXCRCR register *****************/
  2191. #define SPI_TXCRCR_TXCRC ((uint32_t)0xFFFFFFFFU) /*!< Tx CRC Register */
  2192. /****************** Bit definition for SPI_I2SCFGR register ****************/
  2193. #define SPI_I2SCFGR_CHLEN ((uint32_t)0x00000001U) /*!<Channel length (number of bits per audio channel) */
  2194. #define SPI_I2SCFGR_DATLEN ((uint32_t)0x00000006U) /*!<DATLEN[1:0] bits (Data length to be transferred) */
  2195. #define SPI_I2SCFGR_DATLEN_0 ((uint32_t)0x00000002U) /*!<Bit 0 */
  2196. #define SPI_I2SCFGR_DATLEN_1 ((uint32_t)0x00000004U) /*!<Bit 1 */
  2197. #define SPI_I2SCFGR_CKPOL ((uint32_t)0x00000008U) /*!<steady state clock polarity */
  2198. #define SPI_I2SCFGR_I2SSTD ((uint32_t)0x00000030U) /*!<I2SSTD[1:0] bits (I2S standard selection) */
  2199. #define SPI_I2SCFGR_I2SSTD_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  2200. #define SPI_I2SCFGR_I2SSTD_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  2201. #define SPI_I2SCFGR_PCMSYNC ((uint32_t)0x00000080U) /*!<PCM frame synchronization */
  2202. #define SPI_I2SCFGR_I2SCFG ((uint32_t)0x00000300U) /*!<I2SCFG[1:0] bits (I2S configuration mode) */
  2203. #define SPI_I2SCFGR_I2SCFG_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  2204. #define SPI_I2SCFGR_I2SCFG_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  2205. #define SPI_I2SCFGR_I2SE ((uint32_t)0x00000400U) /*!<I2S Enable */
  2206. #define SPI_I2SCFGR_I2SMOD ((uint32_t)0x00000800U) /*!<I2S mode selection */
  2207. /****************** Bit definition for SPI_I2SPR register ******************/
  2208. #define SPI_I2SPR_I2SDIV ((uint32_t)0x000000FFU) /*!<I2S Linear prescaler */
  2209. #define SPI_I2SPR_ODD ((uint32_t)0x00000100U) /*!<Odd factor for the prescaler */
  2210. #define SPI_I2SPR_MCKOE ((uint32_t)0x00000200U) /*!<Master Clock Output Enable */
  2211. /*****************************************************************************/
  2212. /* */
  2213. /* System Configuration (SYSCFG) */
  2214. /* */
  2215. /*****************************************************************************/
  2216. /***************** Bit definition for SYSCFG_CFGR1 register ****************/
  2217. #define SYSCFG_CFGR1_MEM_MODE ((uint32_t)0x00000003U) /*!< SYSCFG_Memory Remap Config */
  2218. #define SYSCFG_CFGR1_MEM_MODE_0 ((uint32_t)0x00000001U) /*!< SYSCFG_Memory Remap Config Bit 0 */
  2219. #define SYSCFG_CFGR1_MEM_MODE_1 ((uint32_t)0x00000002U) /*!< SYSCFG_Memory Remap Config Bit 1 */
  2220. #define SYSCFG_CFGR1_DMA_RMP ((uint32_t)0x00001F00U) /*!< DMA remap mask */
  2221. #define SYSCFG_CFGR1_ADC_DMA_RMP ((uint32_t)0x00000100U) /*!< ADC DMA remap */
  2222. #define SYSCFG_CFGR1_USART1TX_DMA_RMP ((uint32_t)0x00000200U) /*!< USART1 TX DMA remap */
  2223. #define SYSCFG_CFGR1_USART1RX_DMA_RMP ((uint32_t)0x00000400U) /*!< USART1 RX DMA remap */
  2224. #define SYSCFG_CFGR1_TIM16_DMA_RMP ((uint32_t)0x00000800U) /*!< Timer 16 DMA remap */
  2225. #define SYSCFG_CFGR1_TIM17_DMA_RMP ((uint32_t)0x00001000U) /*!< Timer 17 DMA remap */
  2226. #define SYSCFG_CFGR1_I2C_FMP_PB6 ((uint32_t)0x00010000U) /*!< I2C PB6 Fast mode plus */
  2227. #define SYSCFG_CFGR1_I2C_FMP_PB7 ((uint32_t)0x00020000U) /*!< I2C PB7 Fast mode plus */
  2228. #define SYSCFG_CFGR1_I2C_FMP_PB8 ((uint32_t)0x00040000U) /*!< I2C PB8 Fast mode plus */
  2229. #define SYSCFG_CFGR1_I2C_FMP_PB9 ((uint32_t)0x00080000U) /*!< I2C PB9 Fast mode plus */
  2230. /***************** Bit definition for SYSCFG_EXTICR1 register **************/
  2231. #define SYSCFG_EXTICR1_EXTI0 ((uint32_t)0x0000000FU) /*!< EXTI 0 configuration */
  2232. #define SYSCFG_EXTICR1_EXTI1 ((uint32_t)0x000000F0U) /*!< EXTI 1 configuration */
  2233. #define SYSCFG_EXTICR1_EXTI2 ((uint32_t)0x00000F00U) /*!< EXTI 2 configuration */
  2234. #define SYSCFG_EXTICR1_EXTI3 ((uint32_t)0x0000F000U) /*!< EXTI 3 configuration */
  2235. /**
  2236. * @brief EXTI0 configuration
  2237. */
  2238. #define SYSCFG_EXTICR1_EXTI0_PA ((uint32_t)0x00000000U) /*!< PA[0] pin */
  2239. #define SYSCFG_EXTICR1_EXTI0_PB ((uint32_t)0x00000001U) /*!< PB[0] pin */
  2240. #define SYSCFG_EXTICR1_EXTI0_PC ((uint32_t)0x00000002U) /*!< PC[0] pin */
  2241. #define SYSCFG_EXTICR1_EXTI0_PD ((uint32_t)0x00000003U) /*!< PD[0] pin */
  2242. #define SYSCFG_EXTICR1_EXTI0_PF ((uint32_t)0x00000005U) /*!< PF[0] pin */
  2243. /**
  2244. * @brief EXTI1 configuration
  2245. */
  2246. #define SYSCFG_EXTICR1_EXTI1_PA ((uint32_t)0x00000000U) /*!< PA[1] pin */
  2247. #define SYSCFG_EXTICR1_EXTI1_PB ((uint32_t)0x00000010U) /*!< PB[1] pin */
  2248. #define SYSCFG_EXTICR1_EXTI1_PC ((uint32_t)0x00000020U) /*!< PC[1] pin */
  2249. #define SYSCFG_EXTICR1_EXTI1_PD ((uint32_t)0x00000030U) /*!< PD[1] pin */
  2250. #define SYSCFG_EXTICR1_EXTI1_PF ((uint32_t)0x00000050U) /*!< PF[1] pin */
  2251. /**
  2252. * @brief EXTI2 configuration
  2253. */
  2254. #define SYSCFG_EXTICR1_EXTI2_PA ((uint32_t)0x00000000U) /*!< PA[2] pin */
  2255. #define SYSCFG_EXTICR1_EXTI2_PB ((uint32_t)0x00000100U) /*!< PB[2] pin */
  2256. #define SYSCFG_EXTICR1_EXTI2_PC ((uint32_t)0x00000200U) /*!< PC[2] pin */
  2257. #define SYSCFG_EXTICR1_EXTI2_PD ((uint32_t)0x00000300U) /*!< PD[2] pin */
  2258. #define SYSCFG_EXTICR1_EXTI2_PF ((uint32_t)0x00000500U) /*!< PF[2] pin */
  2259. /**
  2260. * @brief EXTI3 configuration
  2261. */
  2262. #define SYSCFG_EXTICR1_EXTI3_PA ((uint32_t)0x00000000U) /*!< PA[3] pin */
  2263. #define SYSCFG_EXTICR1_EXTI3_PB ((uint32_t)0x00001000U) /*!< PB[3] pin */
  2264. #define SYSCFG_EXTICR1_EXTI3_PC ((uint32_t)0x00002000U) /*!< PC[3] pin */
  2265. #define SYSCFG_EXTICR1_EXTI3_PD ((uint32_t)0x00003000U) /*!< PD[3] pin */
  2266. #define SYSCFG_EXTICR1_EXTI3_PF ((uint32_t)0x00005000U) /*!< PF[3] pin */
  2267. /***************** Bit definition for SYSCFG_EXTICR2 register **************/
  2268. #define SYSCFG_EXTICR2_EXTI4 ((uint32_t)0x0000000FU) /*!< EXTI 4 configuration */
  2269. #define SYSCFG_EXTICR2_EXTI5 ((uint32_t)0x000000F0U) /*!< EXTI 5 configuration */
  2270. #define SYSCFG_EXTICR2_EXTI6 ((uint32_t)0x00000F00U) /*!< EXTI 6 configuration */
  2271. #define SYSCFG_EXTICR2_EXTI7 ((uint32_t)0x0000F000U) /*!< EXTI 7 configuration */
  2272. /**
  2273. * @brief EXTI4 configuration
  2274. */
  2275. #define SYSCFG_EXTICR2_EXTI4_PA ((uint32_t)0x00000000U) /*!< PA[4] pin */
  2276. #define SYSCFG_EXTICR2_EXTI4_PB ((uint32_t)0x00000001U) /*!< PB[4] pin */
  2277. #define SYSCFG_EXTICR2_EXTI4_PC ((uint32_t)0x00000002U) /*!< PC[4] pin */
  2278. #define SYSCFG_EXTICR2_EXTI4_PD ((uint32_t)0x00000003U) /*!< PD[4] pin */
  2279. #define SYSCFG_EXTICR2_EXTI4_PF ((uint32_t)0x00000005U) /*!< PF[4] pin */
  2280. /**
  2281. * @brief EXTI5 configuration
  2282. */
  2283. #define SYSCFG_EXTICR2_EXTI5_PA ((uint32_t)0x00000000U) /*!< PA[5] pin */
  2284. #define SYSCFG_EXTICR2_EXTI5_PB ((uint32_t)0x00000010U) /*!< PB[5] pin */
  2285. #define SYSCFG_EXTICR2_EXTI5_PC ((uint32_t)0x00000020U) /*!< PC[5] pin */
  2286. #define SYSCFG_EXTICR2_EXTI5_PD ((uint32_t)0x00000030U) /*!< PD[5] pin */
  2287. #define SYSCFG_EXTICR2_EXTI5_PF ((uint32_t)0x00000050U) /*!< PF[5] pin */
  2288. /**
  2289. * @brief EXTI6 configuration
  2290. */
  2291. #define SYSCFG_EXTICR2_EXTI6_PA ((uint32_t)0x00000000U) /*!< PA[6] pin */
  2292. #define SYSCFG_EXTICR2_EXTI6_PB ((uint32_t)0x00000100U) /*!< PB[6] pin */
  2293. #define SYSCFG_EXTICR2_EXTI6_PC ((uint32_t)0x00000200U) /*!< PC[6] pin */
  2294. #define SYSCFG_EXTICR2_EXTI6_PD ((uint32_t)0x00000300U) /*!< PD[6] pin */
  2295. #define SYSCFG_EXTICR2_EXTI6_PF ((uint32_t)0x00000500U) /*!< PF[6] pin */
  2296. /**
  2297. * @brief EXTI7 configuration
  2298. */
  2299. #define SYSCFG_EXTICR2_EXTI7_PA ((uint32_t)0x00000000U) /*!< PA[7] pin */
  2300. #define SYSCFG_EXTICR2_EXTI7_PB ((uint32_t)0x00001000U) /*!< PB[7] pin */
  2301. #define SYSCFG_EXTICR2_EXTI7_PC ((uint32_t)0x00002000U) /*!< PC[7] pin */
  2302. #define SYSCFG_EXTICR2_EXTI7_PD ((uint32_t)0x00003000U) /*!< PD[7] pin */
  2303. #define SYSCFG_EXTICR2_EXTI7_PF ((uint32_t)0x00005000U) /*!< PF[7] pin */
  2304. /***************** Bit definition for SYSCFG_EXTICR3 register **************/
  2305. #define SYSCFG_EXTICR3_EXTI8 ((uint32_t)0x0000000FU) /*!< EXTI 8 configuration */
  2306. #define SYSCFG_EXTICR3_EXTI9 ((uint32_t)0x000000F0U) /*!< EXTI 9 configuration */
  2307. #define SYSCFG_EXTICR3_EXTI10 ((uint32_t)0x00000F00U) /*!< EXTI 10 configuration */
  2308. #define SYSCFG_EXTICR3_EXTI11 ((uint32_t)0x0000F000U) /*!< EXTI 11 configuration */
  2309. /**
  2310. * @brief EXTI8 configuration
  2311. */
  2312. #define SYSCFG_EXTICR3_EXTI8_PA ((uint32_t)0x00000000U) /*!< PA[8] pin */
  2313. #define SYSCFG_EXTICR3_EXTI8_PB ((uint32_t)0x00000001U) /*!< PB[8] pin */
  2314. #define SYSCFG_EXTICR3_EXTI8_PC ((uint32_t)0x00000002U) /*!< PC[8] pin */
  2315. #define SYSCFG_EXTICR3_EXTI8_PD ((uint32_t)0x00000003U) /*!< PD[8] pin */
  2316. #define SYSCFG_EXTICR3_EXTI8_PF ((uint32_t)0x00000005U) /*!< PF[8] pin */
  2317. /**
  2318. * @brief EXTI9 configuration
  2319. */
  2320. #define SYSCFG_EXTICR3_EXTI9_PA ((uint32_t)0x00000000U) /*!< PA[9] pin */
  2321. #define SYSCFG_EXTICR3_EXTI9_PB ((uint32_t)0x00000010U) /*!< PB[9] pin */
  2322. #define SYSCFG_EXTICR3_EXTI9_PC ((uint32_t)0x00000020U) /*!< PC[9] pin */
  2323. #define SYSCFG_EXTICR3_EXTI9_PD ((uint32_t)0x00000030U) /*!< PD[9] pin */
  2324. #define SYSCFG_EXTICR3_EXTI9_PF ((uint32_t)0x00000050U) /*!< PF[9] pin */
  2325. /**
  2326. * @brief EXTI10 configuration
  2327. */
  2328. #define SYSCFG_EXTICR3_EXTI10_PA ((uint32_t)0x00000000U) /*!< PA[10] pin */
  2329. #define SYSCFG_EXTICR3_EXTI10_PB ((uint32_t)0x00000100U) /*!< PB[10] pin */
  2330. #define SYSCFG_EXTICR3_EXTI10_PC ((uint32_t)0x00000200U) /*!< PC[10] pin */
  2331. #define SYSCFG_EXTICR3_EXTI10_PD ((uint32_t)0x00000300U) /*!< PD[10] pin */
  2332. #define SYSCFG_EXTICR3_EXTI10_PF ((uint32_t)0x00000500U) /*!< PF[10] pin */
  2333. /**
  2334. * @brief EXTI11 configuration
  2335. */
  2336. #define SYSCFG_EXTICR3_EXTI11_PA ((uint32_t)0x00000000U) /*!< PA[11] pin */
  2337. #define SYSCFG_EXTICR3_EXTI11_PB ((uint32_t)0x00001000U) /*!< PB[11] pin */
  2338. #define SYSCFG_EXTICR3_EXTI11_PC ((uint32_t)0x00002000U) /*!< PC[11] pin */
  2339. #define SYSCFG_EXTICR3_EXTI11_PD ((uint32_t)0x00003000U) /*!< PD[11] pin */
  2340. #define SYSCFG_EXTICR3_EXTI11_PF ((uint32_t)0x00005000U) /*!< PF[11] pin */
  2341. /***************** Bit definition for SYSCFG_EXTICR4 register **************/
  2342. #define SYSCFG_EXTICR4_EXTI12 ((uint32_t)0x0000000FU) /*!< EXTI 12 configuration */
  2343. #define SYSCFG_EXTICR4_EXTI13 ((uint32_t)0x000000F0U) /*!< EXTI 13 configuration */
  2344. #define SYSCFG_EXTICR4_EXTI14 ((uint32_t)0x00000F00U) /*!< EXTI 14 configuration */
  2345. #define SYSCFG_EXTICR4_EXTI15 ((uint32_t)0x0000F000U) /*!< EXTI 15 configuration */
  2346. /**
  2347. * @brief EXTI12 configuration
  2348. */
  2349. #define SYSCFG_EXTICR4_EXTI12_PA ((uint32_t)0x00000000U) /*!< PA[12] pin */
  2350. #define SYSCFG_EXTICR4_EXTI12_PB ((uint32_t)0x00000001U) /*!< PB[12] pin */
  2351. #define SYSCFG_EXTICR4_EXTI12_PC ((uint32_t)0x00000002U) /*!< PC[12] pin */
  2352. #define SYSCFG_EXTICR4_EXTI12_PD ((uint32_t)0x00000003U) /*!< PD[12] pin */
  2353. #define SYSCFG_EXTICR4_EXTI12_PF ((uint32_t)0x00000005U) /*!< PF[12] pin */
  2354. /**
  2355. * @brief EXTI13 configuration
  2356. */
  2357. #define SYSCFG_EXTICR4_EXTI13_PA ((uint32_t)0x00000000U) /*!< PA[13] pin */
  2358. #define SYSCFG_EXTICR4_EXTI13_PB ((uint32_t)0x00000010U) /*!< PB[13] pin */
  2359. #define SYSCFG_EXTICR4_EXTI13_PC ((uint32_t)0x00000020U) /*!< PC[13] pin */
  2360. #define SYSCFG_EXTICR4_EXTI13_PD ((uint32_t)0x00000030U) /*!< PD[13] pin */
  2361. #define SYSCFG_EXTICR4_EXTI13_PF ((uint32_t)0x00000050U) /*!< PF[13] pin */
  2362. /**
  2363. * @brief EXTI14 configuration
  2364. */
  2365. #define SYSCFG_EXTICR4_EXTI14_PA ((uint32_t)0x00000000U) /*!< PA[14] pin */
  2366. #define SYSCFG_EXTICR4_EXTI14_PB ((uint32_t)0x00000100U) /*!< PB[14] pin */
  2367. #define SYSCFG_EXTICR4_EXTI14_PC ((uint32_t)0x00000200U) /*!< PC[14] pin */
  2368. #define SYSCFG_EXTICR4_EXTI14_PD ((uint32_t)0x00000300U) /*!< PD[14] pin */
  2369. #define SYSCFG_EXTICR4_EXTI14_PF ((uint32_t)0x00000500U) /*!< PF[14] pin */
  2370. /**
  2371. * @brief EXTI15 configuration
  2372. */
  2373. #define SYSCFG_EXTICR4_EXTI15_PA ((uint32_t)0x00000000U) /*!< PA[15] pin */
  2374. #define SYSCFG_EXTICR4_EXTI15_PB ((uint32_t)0x00001000U) /*!< PB[15] pin */
  2375. #define SYSCFG_EXTICR4_EXTI15_PC ((uint32_t)0x00002000U) /*!< PC[15] pin */
  2376. #define SYSCFG_EXTICR4_EXTI15_PD ((uint32_t)0x00003000U) /*!< PD[15] pin */
  2377. #define SYSCFG_EXTICR4_EXTI15_PF ((uint32_t)0x00005000U) /*!< PF[15] pin */
  2378. /***************** Bit definition for SYSCFG_CFGR2 register ****************/
  2379. #define SYSCFG_CFGR2_LOCKUP_LOCK ((uint32_t)0x00000001U) /*!< Enables and locks the LOCKUP (Hardfault) output of CortexM0 with Break Input of TIMER1 */
  2380. #define SYSCFG_CFGR2_SRAM_PARITY_LOCK ((uint32_t)0x00000002U) /*!< Enables and locks the SRAM_PARITY error signal with Break Input of TIMER1 */
  2381. #define SYSCFG_CFGR2_SRAM_PEF ((uint32_t)0x00000100U) /*!< SRAM Parity error flag */
  2382. #define SYSCFG_CFGR2_SRAM_PE SYSCFG_CFGR2_SRAM_PEF /*!< SRAM Parity error flag (define maintained for legacy purpose) */
  2383. /*****************************************************************************/
  2384. /* */
  2385. /* Timers (TIM) */
  2386. /* */
  2387. /*****************************************************************************/
  2388. /******************* Bit definition for TIM_CR1 register *******************/
  2389. #define TIM_CR1_CEN ((uint32_t)0x00000001U) /*!<Counter enable */
  2390. #define TIM_CR1_UDIS ((uint32_t)0x00000002U) /*!<Update disable */
  2391. #define TIM_CR1_URS ((uint32_t)0x00000004U) /*!<Update request source */
  2392. #define TIM_CR1_OPM ((uint32_t)0x00000008U) /*!<One pulse mode */
  2393. #define TIM_CR1_DIR ((uint32_t)0x00000010U) /*!<Direction */
  2394. #define TIM_CR1_CMS ((uint32_t)0x00000060U) /*!<CMS[1:0] bits (Center-aligned mode selection) */
  2395. #define TIM_CR1_CMS_0 ((uint32_t)0x00000020U) /*!<Bit 0 */
  2396. #define TIM_CR1_CMS_1 ((uint32_t)0x00000040U) /*!<Bit 1 */
  2397. #define TIM_CR1_ARPE ((uint32_t)0x00000080U) /*!<Auto-reload preload enable */
  2398. #define TIM_CR1_CKD ((uint32_t)0x00000300U) /*!<CKD[1:0] bits (clock division) */
  2399. #define TIM_CR1_CKD_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  2400. #define TIM_CR1_CKD_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  2401. /******************* Bit definition for TIM_CR2 register *******************/
  2402. #define TIM_CR2_CCPC ((uint32_t)0x00000001U) /*!<Capture/Compare Preloaded Control */
  2403. #define TIM_CR2_CCUS ((uint32_t)0x00000004U) /*!<Capture/Compare Control Update Selection */
  2404. #define TIM_CR2_CCDS ((uint32_t)0x00000008U) /*!<Capture/Compare DMA Selection */
  2405. #define TIM_CR2_MMS ((uint32_t)0x00000070U) /*!<MMS[2:0] bits (Master Mode Selection) */
  2406. #define TIM_CR2_MMS_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  2407. #define TIM_CR2_MMS_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  2408. #define TIM_CR2_MMS_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  2409. #define TIM_CR2_TI1S ((uint32_t)0x00000080U) /*!<TI1 Selection */
  2410. #define TIM_CR2_OIS1 ((uint32_t)0x00000100U) /*!<Output Idle state 1 (OC1 output) */
  2411. #define TIM_CR2_OIS1N ((uint32_t)0x00000200U) /*!<Output Idle state 1 (OC1N output) */
  2412. #define TIM_CR2_OIS2 ((uint32_t)0x00000400U) /*!<Output Idle state 2 (OC2 output) */
  2413. #define TIM_CR2_OIS2N ((uint32_t)0x00000800U) /*!<Output Idle state 2 (OC2N output) */
  2414. #define TIM_CR2_OIS3 ((uint32_t)0x00001000U) /*!<Output Idle state 3 (OC3 output) */
  2415. #define TIM_CR2_OIS3N ((uint32_t)0x00002000U) /*!<Output Idle state 3 (OC3N output) */
  2416. #define TIM_CR2_OIS4 ((uint32_t)0x00004000U) /*!<Output Idle state 4 (OC4 output) */
  2417. /******************* Bit definition for TIM_SMCR register ******************/
  2418. #define TIM_SMCR_SMS ((uint32_t)0x00000007U) /*!<SMS[2:0] bits (Slave mode selection) */
  2419. #define TIM_SMCR_SMS_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  2420. #define TIM_SMCR_SMS_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  2421. #define TIM_SMCR_SMS_2 ((uint32_t)0x00000004U) /*!<Bit 2 */
  2422. #define TIM_SMCR_OCCS ((uint32_t)0x00000008U) /*!< OCREF clear selection */
  2423. #define TIM_SMCR_TS ((uint32_t)0x00000070U) /*!<TS[2:0] bits (Trigger selection) */
  2424. #define TIM_SMCR_TS_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  2425. #define TIM_SMCR_TS_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  2426. #define TIM_SMCR_TS_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  2427. #define TIM_SMCR_MSM ((uint32_t)0x00000080U) /*!<Master/slave mode */
  2428. #define TIM_SMCR_ETF ((uint32_t)0x00000F00U) /*!<ETF[3:0] bits (External trigger filter) */
  2429. #define TIM_SMCR_ETF_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  2430. #define TIM_SMCR_ETF_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  2431. #define TIM_SMCR_ETF_2 ((uint32_t)0x00000400U) /*!<Bit 2 */
  2432. #define TIM_SMCR_ETF_3 ((uint32_t)0x00000800U) /*!<Bit 3 */
  2433. #define TIM_SMCR_ETPS ((uint32_t)0x00003000U) /*!<ETPS[1:0] bits (External trigger prescaler) */
  2434. #define TIM_SMCR_ETPS_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  2435. #define TIM_SMCR_ETPS_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  2436. #define TIM_SMCR_ECE ((uint32_t)0x00004000U) /*!<External clock enable */
  2437. #define TIM_SMCR_ETP ((uint32_t)0x00008000U) /*!<External trigger polarity */
  2438. /******************* Bit definition for TIM_DIER register ******************/
  2439. #define TIM_DIER_UIE ((uint32_t)0x00000001U) /*!<Update interrupt enable */
  2440. #define TIM_DIER_CC1IE ((uint32_t)0x00000002U) /*!<Capture/Compare 1 interrupt enable */
  2441. #define TIM_DIER_CC2IE ((uint32_t)0x00000004U) /*!<Capture/Compare 2 interrupt enable */
  2442. #define TIM_DIER_CC3IE ((uint32_t)0x00000008U) /*!<Capture/Compare 3 interrupt enable */
  2443. #define TIM_DIER_CC4IE ((uint32_t)0x00000010U) /*!<Capture/Compare 4 interrupt enable */
  2444. #define TIM_DIER_COMIE ((uint32_t)0x00000020U) /*!<COM interrupt enable */
  2445. #define TIM_DIER_TIE ((uint32_t)0x00000040U) /*!<Trigger interrupt enable */
  2446. #define TIM_DIER_BIE ((uint32_t)0x00000080U) /*!<Break interrupt enable */
  2447. #define TIM_DIER_UDE ((uint32_t)0x00000100U) /*!<Update DMA request enable */
  2448. #define TIM_DIER_CC1DE ((uint32_t)0x00000200U) /*!<Capture/Compare 1 DMA request enable */
  2449. #define TIM_DIER_CC2DE ((uint32_t)0x00000400U) /*!<Capture/Compare 2 DMA request enable */
  2450. #define TIM_DIER_CC3DE ((uint32_t)0x00000800U) /*!<Capture/Compare 3 DMA request enable */
  2451. #define TIM_DIER_CC4DE ((uint32_t)0x00001000U) /*!<Capture/Compare 4 DMA request enable */
  2452. #define TIM_DIER_COMDE ((uint32_t)0x00002000U) /*!<COM DMA request enable */
  2453. #define TIM_DIER_TDE ((uint32_t)0x00004000U) /*!<Trigger DMA request enable */
  2454. /******************** Bit definition for TIM_SR register *******************/
  2455. #define TIM_SR_UIF ((uint32_t)0x00000001U) /*!<Update interrupt Flag */
  2456. #define TIM_SR_CC1IF ((uint32_t)0x00000002U) /*!<Capture/Compare 1 interrupt Flag */
  2457. #define TIM_SR_CC2IF ((uint32_t)0x00000004U) /*!<Capture/Compare 2 interrupt Flag */
  2458. #define TIM_SR_CC3IF ((uint32_t)0x00000008U) /*!<Capture/Compare 3 interrupt Flag */
  2459. #define TIM_SR_CC4IF ((uint32_t)0x00000010U) /*!<Capture/Compare 4 interrupt Flag */
  2460. #define TIM_SR_COMIF ((uint32_t)0x00000020U) /*!<COM interrupt Flag */
  2461. #define TIM_SR_TIF ((uint32_t)0x00000040U) /*!<Trigger interrupt Flag */
  2462. #define TIM_SR_BIF ((uint32_t)0x00000080U) /*!<Break interrupt Flag */
  2463. #define TIM_SR_CC1OF ((uint32_t)0x00000200U) /*!<Capture/Compare 1 Overcapture Flag */
  2464. #define TIM_SR_CC2OF ((uint32_t)0x00000400U) /*!<Capture/Compare 2 Overcapture Flag */
  2465. #define TIM_SR_CC3OF ((uint32_t)0x00000800U) /*!<Capture/Compare 3 Overcapture Flag */
  2466. #define TIM_SR_CC4OF ((uint32_t)0x00001000U) /*!<Capture/Compare 4 Overcapture Flag */
  2467. /******************* Bit definition for TIM_EGR register *******************/
  2468. #define TIM_EGR_UG ((uint32_t)0x00000001U) /*!<Update Generation */
  2469. #define TIM_EGR_CC1G ((uint32_t)0x00000002U) /*!<Capture/Compare 1 Generation */
  2470. #define TIM_EGR_CC2G ((uint32_t)0x00000004U) /*!<Capture/Compare 2 Generation */
  2471. #define TIM_EGR_CC3G ((uint32_t)0x00000008U) /*!<Capture/Compare 3 Generation */
  2472. #define TIM_EGR_CC4G ((uint32_t)0x00000010U) /*!<Capture/Compare 4 Generation */
  2473. #define TIM_EGR_COMG ((uint32_t)0x00000020U) /*!<Capture/Compare Control Update Generation */
  2474. #define TIM_EGR_TG ((uint32_t)0x00000040U) /*!<Trigger Generation */
  2475. #define TIM_EGR_BG ((uint32_t)0x00000080U) /*!<Break Generation */
  2476. /****************** Bit definition for TIM_CCMR1 register ******************/
  2477. #define TIM_CCMR1_CC1S ((uint32_t)0x00000003U) /*!<CC1S[1:0] bits (Capture/Compare 1 Selection) */
  2478. #define TIM_CCMR1_CC1S_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  2479. #define TIM_CCMR1_CC1S_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  2480. #define TIM_CCMR1_OC1FE ((uint32_t)0x00000004U) /*!<Output Compare 1 Fast enable */
  2481. #define TIM_CCMR1_OC1PE ((uint32_t)0x00000008U) /*!<Output Compare 1 Preload enable */
  2482. #define TIM_CCMR1_OC1M ((uint32_t)0x00000070U) /*!<OC1M[2:0] bits (Output Compare 1 Mode) */
  2483. #define TIM_CCMR1_OC1M_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  2484. #define TIM_CCMR1_OC1M_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  2485. #define TIM_CCMR1_OC1M_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  2486. #define TIM_CCMR1_OC1CE ((uint32_t)0x00000080U) /*!<Output Compare 1Clear Enable */
  2487. #define TIM_CCMR1_CC2S ((uint32_t)0x00000300U) /*!<CC2S[1:0] bits (Capture/Compare 2 Selection) */
  2488. #define TIM_CCMR1_CC2S_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  2489. #define TIM_CCMR1_CC2S_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  2490. #define TIM_CCMR1_OC2FE ((uint32_t)0x00000400U) /*!<Output Compare 2 Fast enable */
  2491. #define TIM_CCMR1_OC2PE ((uint32_t)0x00000800U) /*!<Output Compare 2 Preload enable */
  2492. #define TIM_CCMR1_OC2M ((uint32_t)0x00007000U) /*!<OC2M[2:0] bits (Output Compare 2 Mode) */
  2493. #define TIM_CCMR1_OC2M_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  2494. #define TIM_CCMR1_OC2M_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  2495. #define TIM_CCMR1_OC2M_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  2496. #define TIM_CCMR1_OC2CE ((uint32_t)0x00008000U) /*!<Output Compare 2 Clear Enable */
  2497. /*---------------------------------------------------------------------------*/
  2498. #define TIM_CCMR1_IC1PSC ((uint32_t)0x0000000CU) /*!<IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
  2499. #define TIM_CCMR1_IC1PSC_0 ((uint32_t)0x00000004U) /*!<Bit 0 */
  2500. #define TIM_CCMR1_IC1PSC_1 ((uint32_t)0x00000008U) /*!<Bit 1 */
  2501. #define TIM_CCMR1_IC1F ((uint32_t)0x000000F0U) /*!<IC1F[3:0] bits (Input Capture 1 Filter) */
  2502. #define TIM_CCMR1_IC1F_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  2503. #define TIM_CCMR1_IC1F_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  2504. #define TIM_CCMR1_IC1F_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  2505. #define TIM_CCMR1_IC1F_3 ((uint32_t)0x00000080U) /*!<Bit 3 */
  2506. #define TIM_CCMR1_IC2PSC ((uint32_t)0x00000C00U) /*!<IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
  2507. #define TIM_CCMR1_IC2PSC_0 ((uint32_t)0x00000400U) /*!<Bit 0 */
  2508. #define TIM_CCMR1_IC2PSC_1 ((uint32_t)0x00000800U) /*!<Bit 1 */
  2509. #define TIM_CCMR1_IC2F ((uint32_t)0x0000F000U) /*!<IC2F[3:0] bits (Input Capture 2 Filter) */
  2510. #define TIM_CCMR1_IC2F_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  2511. #define TIM_CCMR1_IC2F_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  2512. #define TIM_CCMR1_IC2F_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  2513. #define TIM_CCMR1_IC2F_3 ((uint32_t)0x00008000U) /*!<Bit 3 */
  2514. /****************** Bit definition for TIM_CCMR2 register ******************/
  2515. #define TIM_CCMR2_CC3S ((uint32_t)0x00000003U) /*!<CC3S[1:0] bits (Capture/Compare 3 Selection) */
  2516. #define TIM_CCMR2_CC3S_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  2517. #define TIM_CCMR2_CC3S_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  2518. #define TIM_CCMR2_OC3FE ((uint32_t)0x00000004U) /*!<Output Compare 3 Fast enable */
  2519. #define TIM_CCMR2_OC3PE ((uint32_t)0x00000008U) /*!<Output Compare 3 Preload enable */
  2520. #define TIM_CCMR2_OC3M ((uint32_t)0x00000070U) /*!<OC3M[2:0] bits (Output Compare 3 Mode) */
  2521. #define TIM_CCMR2_OC3M_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  2522. #define TIM_CCMR2_OC3M_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  2523. #define TIM_CCMR2_OC3M_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  2524. #define TIM_CCMR2_OC3CE ((uint32_t)0x00000080U) /*!<Output Compare 3 Clear Enable */
  2525. #define TIM_CCMR2_CC4S ((uint32_t)0x00000300U) /*!<CC4S[1:0] bits (Capture/Compare 4 Selection) */
  2526. #define TIM_CCMR2_CC4S_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  2527. #define TIM_CCMR2_CC4S_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  2528. #define TIM_CCMR2_OC4FE ((uint32_t)0x00000400U) /*!<Output Compare 4 Fast enable */
  2529. #define TIM_CCMR2_OC4PE ((uint32_t)0x00000800U) /*!<Output Compare 4 Preload enable */
  2530. #define TIM_CCMR2_OC4M ((uint32_t)0x00007000U) /*!<OC4M[2:0] bits (Output Compare 4 Mode) */
  2531. #define TIM_CCMR2_OC4M_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  2532. #define TIM_CCMR2_OC4M_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  2533. #define TIM_CCMR2_OC4M_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  2534. #define TIM_CCMR2_OC4CE ((uint32_t)0x00008000U) /*!<Output Compare 4 Clear Enable */
  2535. /*---------------------------------------------------------------------------*/
  2536. #define TIM_CCMR2_IC3PSC ((uint32_t)0x0000000CU) /*!<IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
  2537. #define TIM_CCMR2_IC3PSC_0 ((uint32_t)0x00000004U) /*!<Bit 0 */
  2538. #define TIM_CCMR2_IC3PSC_1 ((uint32_t)0x00000008U) /*!<Bit 1 */
  2539. #define TIM_CCMR2_IC3F ((uint32_t)0x000000F0U) /*!<IC3F[3:0] bits (Input Capture 3 Filter) */
  2540. #define TIM_CCMR2_IC3F_0 ((uint32_t)0x00000010U) /*!<Bit 0 */
  2541. #define TIM_CCMR2_IC3F_1 ((uint32_t)0x00000020U) /*!<Bit 1 */
  2542. #define TIM_CCMR2_IC3F_2 ((uint32_t)0x00000040U) /*!<Bit 2 */
  2543. #define TIM_CCMR2_IC3F_3 ((uint32_t)0x00000080U) /*!<Bit 3 */
  2544. #define TIM_CCMR2_IC4PSC ((uint32_t)0x00000C00U) /*!<IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
  2545. #define TIM_CCMR2_IC4PSC_0 ((uint32_t)0x00000400U) /*!<Bit 0 */
  2546. #define TIM_CCMR2_IC4PSC_1 ((uint32_t)0x00000800U) /*!<Bit 1 */
  2547. #define TIM_CCMR2_IC4F ((uint32_t)0x0000F000U) /*!<IC4F[3:0] bits (Input Capture 4 Filter) */
  2548. #define TIM_CCMR2_IC4F_0 ((uint32_t)0x00001000U) /*!<Bit 0 */
  2549. #define TIM_CCMR2_IC4F_1 ((uint32_t)0x00002000U) /*!<Bit 1 */
  2550. #define TIM_CCMR2_IC4F_2 ((uint32_t)0x00004000U) /*!<Bit 2 */
  2551. #define TIM_CCMR2_IC4F_3 ((uint32_t)0x00008000U) /*!<Bit 3 */
  2552. /******************* Bit definition for TIM_CCER register ******************/
  2553. #define TIM_CCER_CC1E ((uint32_t)0x00000001U) /*!<Capture/Compare 1 output enable */
  2554. #define TIM_CCER_CC1P ((uint32_t)0x00000002U) /*!<Capture/Compare 1 output Polarity */
  2555. #define TIM_CCER_CC1NE ((uint32_t)0x00000004U) /*!<Capture/Compare 1 Complementary output enable */
  2556. #define TIM_CCER_CC1NP ((uint32_t)0x00000008U) /*!<Capture/Compare 1 Complementary output Polarity */
  2557. #define TIM_CCER_CC2E ((uint32_t)0x00000010U) /*!<Capture/Compare 2 output enable */
  2558. #define TIM_CCER_CC2P ((uint32_t)0x00000020U) /*!<Capture/Compare 2 output Polarity */
  2559. #define TIM_CCER_CC2NE ((uint32_t)0x00000040U) /*!<Capture/Compare 2 Complementary output enable */
  2560. #define TIM_CCER_CC2NP ((uint32_t)0x00000080U) /*!<Capture/Compare 2 Complementary output Polarity */
  2561. #define TIM_CCER_CC3E ((uint32_t)0x00000100U) /*!<Capture/Compare 3 output enable */
  2562. #define TIM_CCER_CC3P ((uint32_t)0x00000200U) /*!<Capture/Compare 3 output Polarity */
  2563. #define TIM_CCER_CC3NE ((uint32_t)0x00000400U) /*!<Capture/Compare 3 Complementary output enable */
  2564. #define TIM_CCER_CC3NP ((uint32_t)0x00000800U) /*!<Capture/Compare 3 Complementary output Polarity */
  2565. #define TIM_CCER_CC4E ((uint32_t)0x00001000U) /*!<Capture/Compare 4 output enable */
  2566. #define TIM_CCER_CC4P ((uint32_t)0x00002000U) /*!<Capture/Compare 4 output Polarity */
  2567. #define TIM_CCER_CC4NP ((uint32_t)0x00008000U) /*!<Capture/Compare 4 Complementary output Polarity */
  2568. /******************* Bit definition for TIM_CNT register *******************/
  2569. #define TIM_CNT_CNT ((uint32_t)0xFFFFFFFFU) /*!<Counter Value */
  2570. /******************* Bit definition for TIM_PSC register *******************/
  2571. #define TIM_PSC_PSC ((uint32_t)0x0000FFFFU) /*!<Prescaler Value */
  2572. /******************* Bit definition for TIM_ARR register *******************/
  2573. #define TIM_ARR_ARR ((uint32_t)0xFFFFFFFFU) /*!<actual auto-reload Value */
  2574. /******************* Bit definition for TIM_RCR register *******************/
  2575. #define TIM_RCR_REP ((uint32_t)0x000000FFU) /*!<Repetition Counter Value */
  2576. /******************* Bit definition for TIM_CCR1 register ******************/
  2577. #define TIM_CCR1_CCR1 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 1 Value */
  2578. /******************* Bit definition for TIM_CCR2 register ******************/
  2579. #define TIM_CCR2_CCR2 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 2 Value */
  2580. /******************* Bit definition for TIM_CCR3 register ******************/
  2581. #define TIM_CCR3_CCR3 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 3 Value */
  2582. /******************* Bit definition for TIM_CCR4 register ******************/
  2583. #define TIM_CCR4_CCR4 ((uint32_t)0x0000FFFFU) /*!<Capture/Compare 4 Value */
  2584. /******************* Bit definition for TIM_BDTR register ******************/
  2585. #define TIM_BDTR_DTG ((uint32_t)0x000000FFU) /*!<DTG[0:7] bits (Dead-Time Generator set-up) */
  2586. #define TIM_BDTR_DTG_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  2587. #define TIM_BDTR_DTG_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  2588. #define TIM_BDTR_DTG_2 ((uint32_t)0x00000004U) /*!<Bit 2 */
  2589. #define TIM_BDTR_DTG_3 ((uint32_t)0x00000008U) /*!<Bit 3 */
  2590. #define TIM_BDTR_DTG_4 ((uint32_t)0x00000010U) /*!<Bit 4 */
  2591. #define TIM_BDTR_DTG_5 ((uint32_t)0x00000020U) /*!<Bit 5 */
  2592. #define TIM_BDTR_DTG_6 ((uint32_t)0x00000040U) /*!<Bit 6 */
  2593. #define TIM_BDTR_DTG_7 ((uint32_t)0x00000080U) /*!<Bit 7 */
  2594. #define TIM_BDTR_LOCK ((uint32_t)0x00000300U) /*!<LOCK[1:0] bits (Lock Configuration) */
  2595. #define TIM_BDTR_LOCK_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  2596. #define TIM_BDTR_LOCK_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  2597. #define TIM_BDTR_OSSI ((uint32_t)0x00000400U) /*!<Off-State Selection for Idle mode */
  2598. #define TIM_BDTR_OSSR ((uint32_t)0x00000800U) /*!<Off-State Selection for Run mode */
  2599. #define TIM_BDTR_BKE ((uint32_t)0x00001000U) /*!<Break enable */
  2600. #define TIM_BDTR_BKP ((uint32_t)0x00002000U) /*!<Break Polarity */
  2601. #define TIM_BDTR_AOE ((uint32_t)0x00004000U) /*!<Automatic Output enable */
  2602. #define TIM_BDTR_MOE ((uint32_t)0x00008000U) /*!<Main Output enable */
  2603. /******************* Bit definition for TIM_DCR register *******************/
  2604. #define TIM_DCR_DBA ((uint32_t)0x0000001FU) /*!<DBA[4:0] bits (DMA Base Address) */
  2605. #define TIM_DCR_DBA_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  2606. #define TIM_DCR_DBA_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  2607. #define TIM_DCR_DBA_2 ((uint32_t)0x00000004U) /*!<Bit 2 */
  2608. #define TIM_DCR_DBA_3 ((uint32_t)0x00000008U) /*!<Bit 3 */
  2609. #define TIM_DCR_DBA_4 ((uint32_t)0x00000010U) /*!<Bit 4 */
  2610. #define TIM_DCR_DBL ((uint32_t)0x00001F00U) /*!<DBL[4:0] bits (DMA Burst Length) */
  2611. #define TIM_DCR_DBL_0 ((uint32_t)0x00000100U) /*!<Bit 0 */
  2612. #define TIM_DCR_DBL_1 ((uint32_t)0x00000200U) /*!<Bit 1 */
  2613. #define TIM_DCR_DBL_2 ((uint32_t)0x00000400U) /*!<Bit 2 */
  2614. #define TIM_DCR_DBL_3 ((uint32_t)0x00000800U) /*!<Bit 3 */
  2615. #define TIM_DCR_DBL_4 ((uint32_t)0x00001000U) /*!<Bit 4 */
  2616. /******************* Bit definition for TIM_DMAR register ******************/
  2617. #define TIM_DMAR_DMAB ((uint32_t)0x0000FFFFU) /*!<DMA register for burst accesses */
  2618. /******************* Bit definition for TIM14_OR register ********************/
  2619. #define TIM14_OR_TI1_RMP ((uint32_t)0x00000003U) /*!<TI1_RMP[1:0] bits (TIM14 Input 4 remap) */
  2620. #define TIM14_OR_TI1_RMP_0 ((uint32_t)0x00000001U) /*!<Bit 0 */
  2621. #define TIM14_OR_TI1_RMP_1 ((uint32_t)0x00000002U) /*!<Bit 1 */
  2622. /******************************************************************************/
  2623. /* */
  2624. /* Universal Synchronous Asynchronous Receiver Transmitter (USART) */
  2625. /* */
  2626. /******************************************************************************/
  2627. /****************** Bit definition for USART_CR1 register *******************/
  2628. #define USART_CR1_UE ((uint32_t)0x00000001U) /*!< USART Enable */
  2629. #define USART_CR1_RE ((uint32_t)0x00000004U) /*!< Receiver Enable */
  2630. #define USART_CR1_TE ((uint32_t)0x00000008U) /*!< Transmitter Enable */
  2631. #define USART_CR1_IDLEIE ((uint32_t)0x00000010U) /*!< IDLE Interrupt Enable */
  2632. #define USART_CR1_RXNEIE ((uint32_t)0x00000020U) /*!< RXNE Interrupt Enable */
  2633. #define USART_CR1_TCIE ((uint32_t)0x00000040U) /*!< Transmission Complete Interrupt Enable */
  2634. #define USART_CR1_TXEIE ((uint32_t)0x00000080U) /*!< TXE Interrupt Enable */
  2635. #define USART_CR1_PEIE ((uint32_t)0x00000100U) /*!< PE Interrupt Enable */
  2636. #define USART_CR1_PS ((uint32_t)0x00000200U) /*!< Parity Selection */
  2637. #define USART_CR1_PCE ((uint32_t)0x00000400U) /*!< Parity Control Enable */
  2638. #define USART_CR1_WAKE ((uint32_t)0x00000800U) /*!< Receiver Wakeup method */
  2639. #define USART_CR1_M ((uint32_t)0x00001000U) /*!< Word Length */
  2640. #define USART_CR1_MME ((uint32_t)0x00002000U) /*!< Mute Mode Enable */
  2641. #define USART_CR1_CMIE ((uint32_t)0x00004000U) /*!< Character match interrupt enable */
  2642. #define USART_CR1_OVER8 ((uint32_t)0x00008000U) /*!< Oversampling by 8-bit or 16-bit mode */
  2643. #define USART_CR1_DEDT ((uint32_t)0x001F0000U) /*!< DEDT[4:0] bits (Driver Enable Deassertion Time) */
  2644. #define USART_CR1_DEDT_0 ((uint32_t)0x00010000U) /*!< Bit 0 */
  2645. #define USART_CR1_DEDT_1 ((uint32_t)0x00020000U) /*!< Bit 1 */
  2646. #define USART_CR1_DEDT_2 ((uint32_t)0x00040000U) /*!< Bit 2 */
  2647. #define USART_CR1_DEDT_3 ((uint32_t)0x00080000U) /*!< Bit 3 */
  2648. #define USART_CR1_DEDT_4 ((uint32_t)0x00100000U) /*!< Bit 4 */
  2649. #define USART_CR1_DEAT ((uint32_t)0x03E00000U) /*!< DEAT[4:0] bits (Driver Enable Assertion Time) */
  2650. #define USART_CR1_DEAT_0 ((uint32_t)0x00200000U) /*!< Bit 0 */
  2651. #define USART_CR1_DEAT_1 ((uint32_t)0x00400000U) /*!< Bit 1 */
  2652. #define USART_CR1_DEAT_2 ((uint32_t)0x00800000U) /*!< Bit 2 */
  2653. #define USART_CR1_DEAT_3 ((uint32_t)0x01000000U) /*!< Bit 3 */
  2654. #define USART_CR1_DEAT_4 ((uint32_t)0x02000000U) /*!< Bit 4 */
  2655. #define USART_CR1_RTOIE ((uint32_t)0x04000000U) /*!< Receive Time Out interrupt enable */
  2656. #define USART_CR1_EOBIE ((uint32_t)0x08000000U) /*!< End of Block interrupt enable */
  2657. /****************** Bit definition for USART_CR2 register *******************/
  2658. #define USART_CR2_ADDM7 ((uint32_t)0x00000010U) /*!< 7-bit or 4-bit Address Detection */
  2659. #define USART_CR2_LBCL ((uint32_t)0x00000100U) /*!< Last Bit Clock pulse */
  2660. #define USART_CR2_CPHA ((uint32_t)0x00000200U) /*!< Clock Phase */
  2661. #define USART_CR2_CPOL ((uint32_t)0x00000400U) /*!< Clock Polarity */
  2662. #define USART_CR2_CLKEN ((uint32_t)0x00000800U) /*!< Clock Enable */
  2663. #define USART_CR2_STOP ((uint32_t)0x00003000U) /*!< STOP[1:0] bits (STOP bits) */
  2664. #define USART_CR2_STOP_0 ((uint32_t)0x00001000U) /*!< Bit 0 */
  2665. #define USART_CR2_STOP_1 ((uint32_t)0x00002000U) /*!< Bit 1 */
  2666. #define USART_CR2_SWAP ((uint32_t)0x00008000U) /*!< SWAP TX/RX pins */
  2667. #define USART_CR2_RXINV ((uint32_t)0x00010000U) /*!< RX pin active level inversion */
  2668. #define USART_CR2_TXINV ((uint32_t)0x00020000U) /*!< TX pin active level inversion */
  2669. #define USART_CR2_DATAINV ((uint32_t)0x00040000U) /*!< Binary data inversion */
  2670. #define USART_CR2_MSBFIRST ((uint32_t)0x00080000U) /*!< Most Significant Bit First */
  2671. #define USART_CR2_ABREN ((uint32_t)0x00100000U) /*!< Auto Baud-Rate Enable*/
  2672. #define USART_CR2_ABRMODE ((uint32_t)0x00600000U) /*!< ABRMOD[1:0] bits (Auto Baud-Rate Mode) */
  2673. #define USART_CR2_ABRMODE_0 ((uint32_t)0x00200000U) /*!< Bit 0 */
  2674. #define USART_CR2_ABRMODE_1 ((uint32_t)0x00400000U) /*!< Bit 1 */
  2675. #define USART_CR2_RTOEN ((uint32_t)0x00800000U) /*!< Receiver Time-Out enable */
  2676. #define USART_CR2_ADD ((uint32_t)0xFF000000U) /*!< Address of the USART node */
  2677. /****************** Bit definition for USART_CR3 register *******************/
  2678. #define USART_CR3_EIE ((uint32_t)0x00000001U) /*!< Error Interrupt Enable */
  2679. #define USART_CR3_HDSEL ((uint32_t)0x00000008U) /*!< Half-Duplex Selection */
  2680. #define USART_CR3_DMAR ((uint32_t)0x00000040U) /*!< DMA Enable Receiver */
  2681. #define USART_CR3_DMAT ((uint32_t)0x00000080U) /*!< DMA Enable Transmitter */
  2682. #define USART_CR3_RTSE ((uint32_t)0x00000100U) /*!< RTS Enable */
  2683. #define USART_CR3_CTSE ((uint32_t)0x00000200U) /*!< CTS Enable */
  2684. #define USART_CR3_CTSIE ((uint32_t)0x00000400U) /*!< CTS Interrupt Enable */
  2685. #define USART_CR3_ONEBIT ((uint32_t)0x00000800U) /*!< One sample bit method enable */
  2686. #define USART_CR3_OVRDIS ((uint32_t)0x00001000U) /*!< Overrun Disable */
  2687. #define USART_CR3_DDRE ((uint32_t)0x00002000U) /*!< DMA Disable on Reception Error */
  2688. #define USART_CR3_DEM ((uint32_t)0x00004000U) /*!< Driver Enable Mode */
  2689. #define USART_CR3_DEP ((uint32_t)0x00008000U) /*!< Driver Enable Polarity Selection */
  2690. /****************** Bit definition for USART_BRR register *******************/
  2691. #define USART_BRR_DIV_FRACTION ((uint32_t)0x0000000FU) /*!< Fraction of USARTDIV */
  2692. #define USART_BRR_DIV_MANTISSA ((uint32_t)0x0000FFF0U) /*!< Mantissa of USARTDIV */
  2693. /****************** Bit definition for USART_GTPR register ******************/
  2694. #define USART_GTPR_PSC ((uint32_t)0x000000FFU) /*!< PSC[7:0] bits (Prescaler value) */
  2695. #define USART_GTPR_GT ((uint32_t)0x0000FF00U) /*!< GT[7:0] bits (Guard time value) */
  2696. /******************* Bit definition for USART_RTOR register *****************/
  2697. #define USART_RTOR_RTO ((uint32_t)0x00FFFFFFU) /*!< Receiver Time Out Value */
  2698. #define USART_RTOR_BLEN ((uint32_t)0xFF000000U) /*!< Block Length */
  2699. /******************* Bit definition for USART_RQR register ******************/
  2700. #define USART_RQR_ABRRQ ((uint32_t)0x00000001U) /*!< Auto-Baud Rate Request */
  2701. #define USART_RQR_SBKRQ ((uint32_t)0x00000002U) /*!< Send Break Request */
  2702. #define USART_RQR_MMRQ ((uint32_t)0x00000004U) /*!< Mute Mode Request */
  2703. #define USART_RQR_RXFRQ ((uint32_t)0x00000008U) /*!< Receive Data flush Request */
  2704. /******************* Bit definition for USART_ISR register ******************/
  2705. #define USART_ISR_PE ((uint32_t)0x00000001U) /*!< Parity Error */
  2706. #define USART_ISR_FE ((uint32_t)0x00000002U) /*!< Framing Error */
  2707. #define USART_ISR_NE ((uint32_t)0x00000004U) /*!< Noise detected Flag */
  2708. #define USART_ISR_ORE ((uint32_t)0x00000008U) /*!< OverRun Error */
  2709. #define USART_ISR_IDLE ((uint32_t)0x00000010U) /*!< IDLE line detected */
  2710. #define USART_ISR_RXNE ((uint32_t)0x00000020U) /*!< Read Data Register Not Empty */
  2711. #define USART_ISR_TC ((uint32_t)0x00000040U) /*!< Transmission Complete */
  2712. #define USART_ISR_TXE ((uint32_t)0x00000080U) /*!< Transmit Data Register Empty */
  2713. #define USART_ISR_CTSIF ((uint32_t)0x00000200U) /*!< CTS interrupt flag */
  2714. #define USART_ISR_CTS ((uint32_t)0x00000400U) /*!< CTS flag */
  2715. #define USART_ISR_RTOF ((uint32_t)0x00000800U) /*!< Receiver Time Out */
  2716. #define USART_ISR_ABRE ((uint32_t)0x00004000U) /*!< Auto-Baud Rate Error */
  2717. #define USART_ISR_ABRF ((uint32_t)0x00008000U) /*!< Auto-Baud Rate Flag */
  2718. #define USART_ISR_BUSY ((uint32_t)0x00010000U) /*!< Busy Flag */
  2719. #define USART_ISR_CMF ((uint32_t)0x00020000U) /*!< Character Match Flag */
  2720. #define USART_ISR_SBKF ((uint32_t)0x00040000U) /*!< Send Break Flag */
  2721. #define USART_ISR_TEACK ((uint32_t)0x00200000U) /*!< Transmit Enable Acknowledge Flag */
  2722. #define USART_ISR_REACK ((uint32_t)0x00400000U) /*!< Receive Enable Acknowledge Flag */
  2723. /******************* Bit definition for USART_ICR register ******************/
  2724. #define USART_ICR_PECF ((uint32_t)0x00000001U) /*!< Parity Error Clear Flag */
  2725. #define USART_ICR_FECF ((uint32_t)0x00000002U) /*!< Framing Error Clear Flag */
  2726. #define USART_ICR_NCF ((uint32_t)0x00000004U) /*!< Noise detected Clear Flag */
  2727. #define USART_ICR_ORECF ((uint32_t)0x00000008U) /*!< OverRun Error Clear Flag */
  2728. #define USART_ICR_IDLECF ((uint32_t)0x00000010U) /*!< IDLE line detected Clear Flag */
  2729. #define USART_ICR_TCCF ((uint32_t)0x00000040U) /*!< Transmission Complete Clear Flag */
  2730. #define USART_ICR_CTSCF ((uint32_t)0x00000200U) /*!< CTS Interrupt Clear Flag */
  2731. #define USART_ICR_RTOCF ((uint32_t)0x00000800U) /*!< Receiver Time Out Clear Flag */
  2732. #define USART_ICR_CMCF ((uint32_t)0x00020000U) /*!< Character Match Clear Flag */
  2733. /******************* Bit definition for USART_RDR register ******************/
  2734. #define USART_RDR_RDR ((uint16_t)0x01FFU) /*!< RDR[8:0] bits (Receive Data value) */
  2735. /******************* Bit definition for USART_TDR register ******************/
  2736. #define USART_TDR_TDR ((uint16_t)0x01FFU) /*!< TDR[8:0] bits (Transmit Data value) */
  2737. /******************************************************************************/
  2738. /* */
  2739. /* Window WATCHDOG (WWDG) */
  2740. /* */
  2741. /******************************************************************************/
  2742. /******************* Bit definition for WWDG_CR register ********************/
  2743. #define WWDG_CR_T ((uint32_t)0x0000007FU) /*!< T[6:0] bits (7-Bit counter (MSB to LSB)) */
  2744. #define WWDG_CR_T_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  2745. #define WWDG_CR_T_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  2746. #define WWDG_CR_T_2 ((uint32_t)0x00000004U) /*!< Bit 2 */
  2747. #define WWDG_CR_T_3 ((uint32_t)0x00000008U) /*!< Bit 3 */
  2748. #define WWDG_CR_T_4 ((uint32_t)0x00000010U) /*!< Bit 4 */
  2749. #define WWDG_CR_T_5 ((uint32_t)0x00000020U) /*!< Bit 5 */
  2750. #define WWDG_CR_T_6 ((uint32_t)0x00000040U) /*!< Bit 6 */
  2751. /* Legacy defines */
  2752. #define WWDG_CR_T0 WWDG_CR_T_0
  2753. #define WWDG_CR_T1 WWDG_CR_T_1
  2754. #define WWDG_CR_T2 WWDG_CR_T_2
  2755. #define WWDG_CR_T3 WWDG_CR_T_3
  2756. #define WWDG_CR_T4 WWDG_CR_T_4
  2757. #define WWDG_CR_T5 WWDG_CR_T_5
  2758. #define WWDG_CR_T6 WWDG_CR_T_6
  2759. #define WWDG_CR_WDGA ((uint32_t)0x00000080U) /*!< Activation bit */
  2760. /******************* Bit definition for WWDG_CFR register *******************/
  2761. #define WWDG_CFR_W ((uint32_t)0x0000007FU) /*!< W[6:0] bits (7-bit window value) */
  2762. #define WWDG_CFR_W_0 ((uint32_t)0x00000001U) /*!< Bit 0 */
  2763. #define WWDG_CFR_W_1 ((uint32_t)0x00000002U) /*!< Bit 1 */
  2764. #define WWDG_CFR_W_2 ((uint32_t)0x00000004U) /*!< Bit 2 */
  2765. #define WWDG_CFR_W_3 ((uint32_t)0x00000008U) /*!< Bit 3 */
  2766. #define WWDG_CFR_W_4 ((uint32_t)0x00000010U) /*!< Bit 4 */
  2767. #define WWDG_CFR_W_5 ((uint32_t)0x00000020U) /*!< Bit 5 */
  2768. #define WWDG_CFR_W_6 ((uint32_t)0x00000040U) /*!< Bit 6 */
  2769. /* Legacy defines */
  2770. #define WWDG_CFR_W0 WWDG_CFR_W_0
  2771. #define WWDG_CFR_W1 WWDG_CFR_W_1
  2772. #define WWDG_CFR_W2 WWDG_CFR_W_2
  2773. #define WWDG_CFR_W3 WWDG_CFR_W_3
  2774. #define WWDG_CFR_W4 WWDG_CFR_W_4
  2775. #define WWDG_CFR_W5 WWDG_CFR_W_5
  2776. #define WWDG_CFR_W6 WWDG_CFR_W_6
  2777. #define WWDG_CFR_WDGTB ((uint32_t)0x00000180U) /*!< WDGTB[1:0] bits (Timer Base) */
  2778. #define WWDG_CFR_WDGTB_0 ((uint32_t)0x00000080U) /*!< Bit 0 */
  2779. #define WWDG_CFR_WDGTB_1 ((uint32_t)0x00000100U) /*!< Bit 1 */
  2780. /* Legacy defines */
  2781. #define WWDG_CFR_WDGTB0 WWDG_CFR_WDGTB_0
  2782. #define WWDG_CFR_WDGTB1 WWDG_CFR_WDGTB_1
  2783. #define WWDG_CFR_EWI ((uint32_t)0x00000200U) /*!< Early Wakeup Interrupt */
  2784. /******************* Bit definition for WWDG_SR register ********************/
  2785. #define WWDG_SR_EWIF ((uint32_t)0x00000001U) /*!< Early Wakeup Interrupt Flag */
  2786. /**
  2787. * @}
  2788. */
  2789. /**
  2790. * @}
  2791. */
  2792. /** @addtogroup Exported_macro
  2793. * @{
  2794. */
  2795. /****************************** ADC Instances *********************************/
  2796. #define IS_ADC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == ADC1)
  2797. #define IS_ADC_COMMON_INSTANCE(INSTANCE) ((INSTANCE) == ADC)
  2798. /****************************** CRC Instances *********************************/
  2799. #define IS_CRC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == CRC)
  2800. /******************************* DMA Instances ********************************/
  2801. #define IS_DMA_ALL_INSTANCE(INSTANCE) (((INSTANCE) == DMA1_Channel1) || \
  2802. ((INSTANCE) == DMA1_Channel2) || \
  2803. ((INSTANCE) == DMA1_Channel3) || \
  2804. ((INSTANCE) == DMA1_Channel4) || \
  2805. ((INSTANCE) == DMA1_Channel5))
  2806. /****************************** GPIO Instances ********************************/
  2807. #define IS_GPIO_ALL_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  2808. ((INSTANCE) == GPIOB) || \
  2809. ((INSTANCE) == GPIOC) || \
  2810. ((INSTANCE) == GPIOD) || \
  2811. ((INSTANCE) == GPIOF))
  2812. /**************************** GPIO Alternate Function Instances ***************/
  2813. #define IS_GPIO_AF_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  2814. ((INSTANCE) == GPIOB))
  2815. /****************************** GPIO Lock Instances ***************************/
  2816. #define IS_GPIO_LOCK_INSTANCE(INSTANCE) (((INSTANCE) == GPIOA) || \
  2817. ((INSTANCE) == GPIOB))
  2818. /****************************** I2C Instances *********************************/
  2819. #define IS_I2C_ALL_INSTANCE(INSTANCE) (((INSTANCE) == I2C1) || \
  2820. ((INSTANCE) == I2C2))
  2821. /****************************** IWDG Instances ********************************/
  2822. #define IS_IWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == IWDG)
  2823. /****************************** RTC Instances *********************************/
  2824. #define IS_RTC_ALL_INSTANCE(INSTANCE) ((INSTANCE) == RTC)
  2825. /****************************** SMBUS Instances *********************************/
  2826. #define IS_SMBUS_ALL_INSTANCE(INSTANCE) ((INSTANCE) == I2C1)
  2827. /****************************** SPI Instances *********************************/
  2828. #define IS_SPI_ALL_INSTANCE(INSTANCE) (((INSTANCE) == SPI1) || \
  2829. ((INSTANCE) == SPI2))
  2830. /****************************** TIM Instances *********************************/
  2831. #define IS_TIM_INSTANCE(INSTANCE)\
  2832. (((INSTANCE) == TIM1) || \
  2833. ((INSTANCE) == TIM3) || \
  2834. ((INSTANCE) == TIM6) || \
  2835. ((INSTANCE) == TIM14) || \
  2836. ((INSTANCE) == TIM15) || \
  2837. ((INSTANCE) == TIM16) || \
  2838. ((INSTANCE) == TIM17))
  2839. #define IS_TIM_CC1_INSTANCE(INSTANCE)\
  2840. (((INSTANCE) == TIM1) || \
  2841. ((INSTANCE) == TIM3) || \
  2842. ((INSTANCE) == TIM14) || \
  2843. ((INSTANCE) == TIM15) || \
  2844. ((INSTANCE) == TIM16) || \
  2845. ((INSTANCE) == TIM17))
  2846. #define IS_TIM_CC2_INSTANCE(INSTANCE)\
  2847. (((INSTANCE) == TIM1) || \
  2848. ((INSTANCE) == TIM3) || \
  2849. ((INSTANCE) == TIM15))
  2850. #define IS_TIM_CC3_INSTANCE(INSTANCE)\
  2851. (((INSTANCE) == TIM1) || \
  2852. ((INSTANCE) == TIM3))
  2853. #define IS_TIM_CC4_INSTANCE(INSTANCE)\
  2854. (((INSTANCE) == TIM1) || \
  2855. ((INSTANCE) == TIM3))
  2856. #define IS_TIM_CLOCKSOURCE_ETRMODE1_INSTANCE(INSTANCE)\
  2857. (((INSTANCE) == TIM1) || \
  2858. ((INSTANCE) == TIM3))
  2859. #define IS_TIM_CLOCKSOURCE_ETRMODE2_INSTANCE(INSTANCE)\
  2860. (((INSTANCE) == TIM1) || \
  2861. ((INSTANCE) == TIM3))
  2862. #define IS_TIM_CLOCKSOURCE_TIX_INSTANCE(INSTANCE)\
  2863. (((INSTANCE) == TIM1) || \
  2864. ((INSTANCE) == TIM3) || \
  2865. ((INSTANCE) == TIM15))
  2866. #define IS_TIM_CLOCKSOURCE_ITRX_INSTANCE(INSTANCE)\
  2867. (((INSTANCE) == TIM1) || \
  2868. ((INSTANCE) == TIM3) || \
  2869. ((INSTANCE) == TIM15))
  2870. #define IS_TIM_OCXREF_CLEAR_INSTANCE(INSTANCE)\
  2871. (((INSTANCE) == TIM1) || \
  2872. ((INSTANCE) == TIM3))
  2873. #define IS_TIM_ENCODER_INTERFACE_INSTANCE(INSTANCE)\
  2874. (((INSTANCE) == TIM1) || \
  2875. ((INSTANCE) == TIM3))
  2876. #define IS_TIM_HALL_INTERFACE_INSTANCE(INSTANCE)\
  2877. (((INSTANCE) == TIM1))
  2878. #define IS_TIM_XOR_INSTANCE(INSTANCE)\
  2879. (((INSTANCE) == TIM1) || \
  2880. ((INSTANCE) == TIM3))
  2881. #define IS_TIM_MASTER_INSTANCE(INSTANCE)\
  2882. (((INSTANCE) == TIM1) || \
  2883. ((INSTANCE) == TIM3) || \
  2884. ((INSTANCE) == TIM15))
  2885. #define IS_TIM_SLAVE_INSTANCE(INSTANCE)\
  2886. (((INSTANCE) == TIM1) || \
  2887. ((INSTANCE) == TIM3) || \
  2888. ((INSTANCE) == TIM15))
  2889. #define IS_TIM_32B_COUNTER_INSTANCE(INSTANCE) (0)
  2890. #define IS_TIM_DMABURST_INSTANCE(INSTANCE)\
  2891. (((INSTANCE) == TIM1) || \
  2892. ((INSTANCE) == TIM3) || \
  2893. ((INSTANCE) == TIM15) || \
  2894. ((INSTANCE) == TIM16) || \
  2895. ((INSTANCE) == TIM17))
  2896. #define IS_TIM_BREAK_INSTANCE(INSTANCE)\
  2897. (((INSTANCE) == TIM1) || \
  2898. ((INSTANCE) == TIM15) || \
  2899. ((INSTANCE) == TIM16) || \
  2900. ((INSTANCE) == TIM17))
  2901. #define IS_TIM_CCX_INSTANCE(INSTANCE, CHANNEL) \
  2902. ((((INSTANCE) == TIM1) && \
  2903. (((CHANNEL) == TIM_CHANNEL_1) || \
  2904. ((CHANNEL) == TIM_CHANNEL_2) || \
  2905. ((CHANNEL) == TIM_CHANNEL_3) || \
  2906. ((CHANNEL) == TIM_CHANNEL_4))) \
  2907. || \
  2908. (((INSTANCE) == TIM3) && \
  2909. (((CHANNEL) == TIM_CHANNEL_1) || \
  2910. ((CHANNEL) == TIM_CHANNEL_2) || \
  2911. ((CHANNEL) == TIM_CHANNEL_3) || \
  2912. ((CHANNEL) == TIM_CHANNEL_4))) \
  2913. || \
  2914. (((INSTANCE) == TIM14) && \
  2915. (((CHANNEL) == TIM_CHANNEL_1))) \
  2916. || \
  2917. (((INSTANCE) == TIM15) && \
  2918. (((CHANNEL) == TIM_CHANNEL_1) || \
  2919. ((CHANNEL) == TIM_CHANNEL_2))) \
  2920. || \
  2921. (((INSTANCE) == TIM16) && \
  2922. (((CHANNEL) == TIM_CHANNEL_1))) \
  2923. || \
  2924. (((INSTANCE) == TIM17) && \
  2925. (((CHANNEL) == TIM_CHANNEL_1))))
  2926. #define IS_TIM_CCXN_INSTANCE(INSTANCE, CHANNEL) \
  2927. ((((INSTANCE) == TIM1) && \
  2928. (((CHANNEL) == TIM_CHANNEL_1) || \
  2929. ((CHANNEL) == TIM_CHANNEL_2) || \
  2930. ((CHANNEL) == TIM_CHANNEL_3))) \
  2931. || \
  2932. (((INSTANCE) == TIM15) && \
  2933. ((CHANNEL) == TIM_CHANNEL_1)) \
  2934. || \
  2935. (((INSTANCE) == TIM16) && \
  2936. ((CHANNEL) == TIM_CHANNEL_1)) \
  2937. || \
  2938. (((INSTANCE) == TIM17) && \
  2939. ((CHANNEL) == TIM_CHANNEL_1)))
  2940. #define IS_TIM_COUNTER_MODE_SELECT_INSTANCE(INSTANCE)\
  2941. (((INSTANCE) == TIM1) || \
  2942. ((INSTANCE) == TIM3))
  2943. #define IS_TIM_REPETITION_COUNTER_INSTANCE(INSTANCE)\
  2944. (((INSTANCE) == TIM1) || \
  2945. ((INSTANCE) == TIM15) || \
  2946. ((INSTANCE) == TIM16) || \
  2947. ((INSTANCE) == TIM17))
  2948. #define IS_TIM_CLOCK_DIVISION_INSTANCE(INSTANCE)\
  2949. (((INSTANCE) == TIM1) || \
  2950. ((INSTANCE) == TIM3) || \
  2951. ((INSTANCE) == TIM14) || \
  2952. ((INSTANCE) == TIM15) || \
  2953. ((INSTANCE) == TIM16) || \
  2954. ((INSTANCE) == TIM17))
  2955. #define IS_TIM_DMA_INSTANCE(INSTANCE)\
  2956. (((INSTANCE) == TIM1) || \
  2957. ((INSTANCE) == TIM3) || \
  2958. ((INSTANCE) == TIM6) || \
  2959. ((INSTANCE) == TIM15) || \
  2960. ((INSTANCE) == TIM16) || \
  2961. ((INSTANCE) == TIM17))
  2962. #define IS_TIM_DMA_CC_INSTANCE(INSTANCE)\
  2963. (((INSTANCE) == TIM1) || \
  2964. ((INSTANCE) == TIM3) || \
  2965. ((INSTANCE) == TIM15) || \
  2966. ((INSTANCE) == TIM16) || \
  2967. ((INSTANCE) == TIM17))
  2968. #define IS_TIM_COMMUTATION_EVENT_INSTANCE(INSTANCE)\
  2969. (((INSTANCE) == TIM1) || \
  2970. ((INSTANCE) == TIM15) || \
  2971. ((INSTANCE) == TIM16) || \
  2972. ((INSTANCE) == TIM17))
  2973. #define IS_TIM_REMAP_INSTANCE(INSTANCE)\
  2974. ((INSTANCE) == TIM14)
  2975. /******************** USART Instances : Synchronous mode **********************/
  2976. #define IS_USART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  2977. ((INSTANCE) == USART2))
  2978. /******************** USART Instances : auto Baud rate detection **************/
  2979. #define IS_USART_AUTOBAUDRATE_DETECTION_INSTANCE(INSTANCE) ((INSTANCE) == USART1)
  2980. /******************** UART Instances : Asynchronous mode **********************/
  2981. #define IS_UART_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  2982. ((INSTANCE) == USART2))
  2983. /******************** UART Instances : Half-Duplex mode **********************/
  2984. #define IS_UART_HALFDUPLEX_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  2985. ((INSTANCE) == USART2))
  2986. /****************** UART Instances : Hardware Flow control ********************/
  2987. #define IS_UART_HWFLOW_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  2988. ((INSTANCE) == USART2))
  2989. /****************** UART Instances : Driver enable detection ********************/
  2990. #define IS_UART_DRIVER_ENABLE_INSTANCE(INSTANCE) (((INSTANCE) == USART1) || \
  2991. ((INSTANCE) == USART2))
  2992. /****************************** WWDG Instances ********************************/
  2993. #define IS_WWDG_ALL_INSTANCE(INSTANCE) ((INSTANCE) == WWDG)
  2994. /**
  2995. * @}
  2996. */
  2997. /******************************************************************************/
  2998. /* For a painless codes migration between the STM32F0xx device product */
  2999. /* lines, the aliases defined below are put in place to overcome the */
  3000. /* differences in the interrupt handlers and IRQn definitions. */
  3001. /* No need to update developed interrupt code when moving across */
  3002. /* product lines within the same STM32F0 Family */
  3003. /******************************************************************************/
  3004. /* Aliases for __IRQn */
  3005. #define ADC1_COMP_IRQn ADC1_IRQn
  3006. #define DMA1_Ch1_IRQn DMA1_Channel1_IRQn
  3007. #define DMA1_Ch2_3_DMA2_Ch1_2_IRQn DMA1_Channel2_3_IRQn
  3008. #define DMA1_Channel4_5_6_7_IRQn DMA1_Channel4_5_IRQn
  3009. #define DMA1_Ch4_7_DMA2_Ch3_5_IRQn DMA1_Channel4_5_IRQn
  3010. #define RCC_CRS_IRQn RCC_IRQn
  3011. #define TIM6_DAC_IRQn TIM6_IRQn
  3012. /* Aliases for __IRQHandler */
  3013. #define ADC1_COMP_IRQHandler ADC1_IRQHandler
  3014. #define DMA1_Ch1_IRQHandler DMA1_Channel1_IRQHandler
  3015. #define DMA1_Ch2_3_DMA2_Ch1_2_IRQHandler DMA1_Channel2_3_IRQHandler
  3016. #define DMA1_Channel4_5_6_7_IRQHandler DMA1_Channel4_5_IRQHandler
  3017. #define DMA1_Ch4_7_DMA2_Ch3_5_IRQHandler DMA1_Channel4_5_IRQHandler
  3018. #define RCC_CRS_IRQHandler RCC_IRQHandler
  3019. #define TIM6_DAC_IRQHandler TIM6_IRQHandler
  3020. #ifdef __cplusplus
  3021. }
  3022. #endif /* __cplusplus */
  3023. #endif /* __STM32F030x8_H */
  3024. /**
  3025. * @}
  3026. */
  3027. /**
  3028. * @}
  3029. */
  3030. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/