stm32f030x6.h 220 KB

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