| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788 |
- /**
- ******************************************************************************
- * @file stm32f3xx_hal_comp_ex.h
- * @author MCD Application Team
- * @brief Header file of COMP HAL Extended module.
- ******************************************************************************
- * @attention
- *
- * Copyright (c) 2016 STMicroelectronics.
- * All rights reserved.
- *
- * This software is licensed under terms that can be found in the LICENSE file
- * in the root directory of this software component.
- * If no LICENSE file comes with this software, it is provided AS-IS.
- *
- ******************************************************************************
- */
- /* Define to prevent recursive inclusion -------------------------------------*/
- #ifndef __STM32F3xx_HAL_COMP_EX_H
- #define __STM32F3xx_HAL_COMP_EX_H
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* Includes ------------------------------------------------------------------*/
- #include "stm32f3xx_hal_def.h"
- /** @addtogroup STM32F3xx_HAL_Driver
- * @{
- */
- /** @defgroup COMPEx COMPEx
- * @{
- */
- /* Exported types ------------------------------------------------------------*/
- /* Exported constants --------------------------------------------------------*/
- /** @defgroup COMPEx_Exported_Constants COMP Extended Exported Constants
- * @{
- */
- #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
- /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F302xE/STM32F303xE/STM32F398xx/STM32F302xC/STM32F303xC/STM32F358xx Product devices)
- * @{
- */
- #define COMP_INVERTINGINPUT_1_4VREFINT (0x00000000U) /*!< 1U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_1_2VREFINT COMP_CSR_COMPxINSEL_0 /*!< 1U/2 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_3_4VREFINT COMP_CSR_COMPxINSEL_1 /*!< 3U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_VREFINT (COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0) /*!< VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC1_CH1 COMP_CSR_COMPxINSEL_2 /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC1_CH2 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_0) /*!< DAC1_CH2_OUT (PA5) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_IO1 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1) /*!< IO1 (PA0 for COMP1, PA2 for COMP2, PD15 for COMP3,
- PE8 for COMP4, PD13 for COMP5, PD10 for COMP6,
- PC0 for COMP7) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_IO2 COMP_CSR_COMPxINSEL /*!< IO2 (PB12 for COMP3, PB2 for COMP4, PB10 for COMP5,
- PB15 for COMP6) connected to comparator inverting input */
- /* Aliases for compatibility */
- #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
- #define COMP_INVERTINGINPUT_DAC2 COMP_INVERTINGINPUT_DAC1_CH2
- /**
- * @}
- */
- #elif defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
- /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F301x8/STM32F302x8/STM32F318xx Product devices)
- * @{
- */
- #define COMP_INVERTINGINPUT_1_4VREFINT (0x00000000U) /*!< 1U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_1_2VREFINT COMP_CSR_COMPxINSEL_0 /*!< 1U/2 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_3_4VREFINT COMP_CSR_COMPxINSEL_1 /*!< 3U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_VREFINT (COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0) /*!< VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC1_CH1 COMP_CSR_COMPxINSEL_2 /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_IO1 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1) /*!< IO1 (PA2 for COMP2),
- connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_IO2 COMP_CSR_COMPxINSEL /*!< IO2 (PB2 for COMP4, PB15 for COMP6)
- connected to comparator inverting input */
- /* Aliases for compatibility */
- #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
- /**
- * @}
- */
- #elif defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F303x8/STM32F334x8/STM32F328xx Product devices)
- * @{
- */
- /* Note: On these STM32 devices, there is only 1 comparator inverting input */
- /* connected to a GPIO. */
- /* It must be chosen among the 2 literals COMP_INVERTINGINPUT_IOx */
- /* depending on comparator instance COMPx. */
- #define COMP_INVERTINGINPUT_1_4VREFINT (0x00000000U) /*!< 1U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_1_2VREFINT COMP_CSR_COMPxINSEL_0 /*!< 1U/2 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_3_4VREFINT COMP_CSR_COMPxINSEL_1 /*!< 3U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_VREFINT (COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0) /*!< VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC1_CH1 COMP_CSR_COMPxINSEL_2 /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC1_CH2 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_0) /*!< DAC1_CH2_OUT (PA5) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_IO1 (COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1) /*!< IO1 (PA2 for COMP2),
- connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_IO2 COMP_CSR_COMPxINSEL /*!< IO2 (PB2 for COMP4, PB15 for COMP6)
- connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC2_CH1 COMP_CSR_COMPxINSEL_3 /*!< DAC2_CH1_OUT connected to comparator inverting input */
- /* Aliases for compatibility */
- #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
- #define COMP_INVERTINGINPUT_DAC2 COMP_INVERTINGINPUT_DAC1_CH2
- /**
- * @}
- */
- #elif defined(STM32F373xC) || defined(STM32F378xx)
- /** @defgroup COMPEx_InvertingInput COMP Extended InvertingInput (STM32F373xC/STM32F378xx Product devices)
- * @{
- */
- #define COMP_INVERTINGINPUT_1_4VREFINT (0x00000000U) /*!< 1U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_1_2VREFINT ((uint32_t)COMP_CSR_COMPxINSEL_0) /*!< 1U/2 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_3_4VREFINT ((uint32_t)COMP_CSR_COMPxINSEL_1) /*!< 3U/4 VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_VREFINT ((uint32_t)(COMP_CSR_COMPxINSEL_1|COMP_CSR_COMPxINSEL_0)) /*!< VREFINT connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC1_CH1 ((uint32_t)COMP_CSR_COMPxINSEL_2) /*!< DAC1_CH1_OUT (PA4) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC1_CH2 ((uint32_t)(COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_0)) /*!< DAC1_CH2_OUT (PA5) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_IO1 ((uint32_t)(COMP_CSR_COMPxINSEL_2|COMP_CSR_COMPxINSEL_1)) /*!< IO1 (PA0 for COMP1, PA2 for COMP2) connected to comparator inverting input */
- #define COMP_INVERTINGINPUT_DAC2_CH1 ((uint32_t)COMP_CSR_COMPxINSEL) /*!< DAC2_CH1_OUT connected to comparator inverting input */
- /* Aliases for compatibility */
- #define COMP_INVERTINGINPUT_DAC1 COMP_INVERTINGINPUT_DAC1_CH1
- #define COMP_INVERTINGINPUT_DAC2 COMP_INVERTINGINPUT_DAC1_CH2
- /**
- * @}
- */
- #endif /* STM32F302xE || STM32F303xE || STM32F398xx || */
- /* STM32F302xC || STM32F303xC || STM32F358xx */
- #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
- /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F302xC/STM32F303xC/STM32F358xx Product devices)
- * @{
- */
- #define COMP_NONINVERTINGINPUT_IO1 (0x00000000U) /*!< IO1 (PA1 for COMP1, PA7 for COMP2, PB14 for COMP3,
- PB0 for COMP4, PD12 for COMP5, PD11 for COMP6,
- PA0 for COMP7) connected to comparator non inverting input */
- #define COMP_NONINVERTINGINPUT_IO2 COMP_CSR_COMPxNONINSEL /*!< IO2 (PA3 for COMP2, PD14 for COMP3, PE7 for COMP4, PB13 for COMP5,
- PB11 for COMP6, PC1 for COMP7) connected to comparator non inverting input */
- #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP1_CSR_COMP1SW1 /*!< DAC output connected to comparator COMP1 non inverting input */
- /**
- * @}
- */
- #elif defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
- /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F301x8/STM32F302x8/STM32F318xx Product devices)
- * @{
- */
- #define COMP_NONINVERTINGINPUT_IO1 (0x00000000U) /*!< IO1 (PA7 for COMP2, PB0 for COMP4, PB11 for COMP6)
- connected to comparator non inverting input */
- #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP2_CSR_COMP2INPDAC /*!< DAC output connected to comparator COMP2 non inverting input */
- /**
- * @}
- */
- #elif defined(STM32F373xC) || defined(STM32F378xx)
- /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F373xC/STM32F378xx Product devices)
- * @{
- */
- #define COMP_NONINVERTINGINPUT_IO1 (0x00000000U) /*!< IO1 (PA1 for COMP1, PA3 for COMP2)
- connected to comparator non inverting input */
- #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP_CSR_COMP1SW1 /*!< DAC output connected to comparator COMP1 non inverting input */
- /**
- * @}
- */
- #elif defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
- /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (STM32F302xE/STM32F303xE/STM32F398xx Product devices)
- * @{
- */
- #define COMP_NONINVERTINGINPUT_IO1 (0x00000000U) /*!< IO1 (PA1 for COMP1, PA7 for COMP2, PB14 for COMP3,
- PB0 for COMP4, PD12 for COMP5, PD11 for COMP6,
- PA0 for COMP7) connected to comparator non inverting input */
- #define COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED COMP1_CSR_COMP1SW1 /*!< DAC output connected to comparator COMP1 non inverting input */
- /**
- * @}
- */
- #else
- /** @defgroup COMPEx_NonInvertingInput COMP Extended NonInvertingInput (Other Product devices)
- * @{
- */
- #define COMP_NONINVERTINGINPUT_IO1 (0x00000000U) /*!< IO1 (PA7 for COMP2, PB0 for COMP4, PB11 for COMP6)
- connected to comparator non inverting input */
- /**
- * @}
- */
- #endif /* STM32F302xC || STM32F303xC || STM32F358xx */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
- /** @defgroup COMPEx_Output COMP Extended Output (STM32F301x8/STM32F302x8/STM32F318xx Product devices)
- * Elements value convention on 16 LSB: 00XXXX0000YYYYYYb
- * - YYYYYY : Applicable comparator instance number (bitmap format: 000010 for COMP2, 100000 for COMP6)
- * - XXXX : COMPxOUTSEL value
- * @{
- */
- /* Output Redirection values common to all comparators COMP2, COMP4 and COMP6 */
- #define COMP_OUTPUT_NONE (0x0000002AU) /*!< COMP2, COMP4 or COMP6 output isn't connected to other peripherals */
- #define COMP_OUTPUT_TIM1BKIN (0x0000042AU) /*!< COMP2, COMP4 or COMP6 output connected to TIM1 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM1BKIN2_BRK2 (0x0000082AU) /*!< COMP2, COMP4 or COMP6 output connected to TIM1 Break Input 2 (BRK2) */
- #define COMP_OUTPUT_TIM1BKIN2 (0x0000142AU) /*!< COMP2, COMP4 or COMP6 output connected to TIM1 Break Input 2 (BKIN2) */
- /* Output Redirection specific to COMP2 */
- #define COMP_OUTPUT_TIM1OCREFCLR (0x00001802U) /*!< COMP2 output connected to TIM1 OCREF Clear */
- #define COMP_OUTPUT_TIM1IC1 (0x00001C02U) /*!< COMP2 output connected to TIM1 Input Capture 1U */
- #define COMP_OUTPUT_TIM2IC4 (0x00002002U) /*!< COMP2 output connected to TIM2 Input Capture 4U */
- #define COMP_OUTPUT_TIM2OCREFCLR (0x00002402U) /*!< COMP2 output connected to TIM2 OCREF Clear */
- /* Output Redirection specific to COMP4 */
- #define COMP_OUTPUT_TIM15IC2 (0x00002008U) /*!< COMP4 output connected to TIM15 Input Capture 2U */
- #define COMP_OUTPUT_TIM15OCREFCLR (0x00002808U) /*!< COMP4 output connected to TIM15 OCREF Clear */
- /* Output Redirection specific to COMP6 */
- #define COMP_OUTPUT_TIM2IC2 (0x00001820U) /*!< COMP6 output connected to TIM2 Input Capture 2U */
- #define COMP_OUTPUT_COMP6_TIM2OCREFCLR (0x00002020U) /*!< COMP6 output connected to TIM2 OCREF Clear */
- #define COMP_OUTPUT_TIM16OCREFCLR (0x00002420U) /*!< COMP6 output connected to TIM16 OCREF Clear */
- #define COMP_OUTPUT_TIM16IC1 (0x00002820U) /*!< COMP6 output connected to TIM16 Input Capture 1U */
- /**
- * @}
- */
- #elif defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- /** @defgroup COMPEx_Output COMP Extended Output (STM32F303x8/STM32F334x8/STM32F328xx Product devices)
- * Elements value convention on 16 LSB: 00XXXX0000YYYYYYb
- * - YYYYYY : Applicable comparator instance number (bitmap format: 000010 for COMP2, 100000 for COMP6)
- * - XXXX : COMPxOUTSEL value
- * @{
- */
- /* Output Redirection values common to all comparators COMP2, COMP4 and COMP6 */
- #define COMP_OUTPUT_NONE (0x0000002AU) /*!< COMP2, COMP4 or COMP6 output isn't connected to other peripherals */
- #define COMP_OUTPUT_TIM1BKIN (0x0000042AU) /*!< COMP2, COMP4 or COMP6 output connected to TIM1 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM1BKIN2 (0x0000082AU) /*!< COMP2, COMP4 or COMP6 output connected to TIM1 Break Input 2 (BKIN2) */
- /* Output Redirection common to COMP2 and COMP4 */
- #define COMP_OUTPUT_TIM3OCREFCLR (0x00002C0AU) /*!< COMP2 or COMP4 output connected to TIM3 OCREF Clear */
- /* Output Redirection specific to COMP2 */
- #define COMP_OUTPUT_TIM1OCREFCLR (0x00001802U) /*!< COMP2 output connected to TIM1 OCREF Clear */
- #define COMP_OUTPUT_TIM1IC1 (0x00001C02U) /*!< COMP2 output connected to TIM1 Input Capture 1U */
- #define COMP_OUTPUT_TIM2IC4 (0x00002002U) /*!< COMP2 output connected to TIM2 Input Capture 4U */
- #define COMP_OUTPUT_TIM2OCREFCLR (0x00002402U) /*!< COMP2 output connected to TIM2 OCREF Clear */
- #define COMP_OUTPUT_TIM3IC1 (0x00002802U) /*!< COMP2 output connected to TIM3 Input Capture 1U */
- /* Output Redirection specific to COMP4 */
- #define COMP_OUTPUT_TIM3IC3 (0x00001808U) /*!< COMP4 output connected to TIM3 Input Capture 3U */
- #define COMP_OUTPUT_TIM15IC2 (0x00002008U) /*!< COMP4 output connected to TIM15 Input Capture 2U */
- #define COMP_OUTPUT_TIM15OCREFCLR (0x00002808U) /*!< COMP4 output connected to TIM15 OCREF Clear */
- /* Output Redirection specific to COMP6 */
- #define COMP_OUTPUT_TIM2IC2 (0x00001820U) /*!< COMP6 output connected to TIM2 Input Capture 2U */
- #define COMP_OUTPUT_COMP6_TIM2OCREFCLR (0x00002020U) /*!< COMP6 output connected to TIM2 OCREF Clear */
- #define COMP_OUTPUT_TIM16OCREFCLR (0x00002420U) /*!< COMP6 output connected to TIM16 OCREF Clear */
- #define COMP_OUTPUT_TIM16IC1 (0x00002820U) /*!< COMP6 output connected to TIM16 Input Capture 1U */
- /**
- * @}
- */
- #elif defined(STM32F302xC) || defined(STM32F302xE)
- /** @defgroup COMPEx_Output COMP Extended Output (STM32F302xC/STM32F302xE Product devices)
- * Elements value convention on 16 LSB: 00XXXX0000YYYYYYb
- * - YYYYYY : Applicable comparator instance number (bitmap format: 000001 for COMP1, 100000 for COMP6)
- * - XXXX : COMPxOUTSEL value
- * @{
- */
- /* Output Redirection values common to all comparators COMP1, COMP2, COMP4, COMP6 */
- #define COMP_OUTPUT_NONE (0x0000002BU) /*!< COMP1, COMP2, COMP4 or COMP6 output isn't connected to other peripherals */
- #define COMP_OUTPUT_TIM1BKIN (0x0000042BU) /*!< COMP1, COMP2, COMP4 or COMP6 output connected to TIM1 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM1BKIN2_BRK2 (0x0000082BU) /*!< COMP1, COMP2, COMP4 or COMP6 output connected to TIM1 Break Input 2 (BRK2) */
- #define COMP_OUTPUT_TIM1BKIN2 (0x0000142BU) /*!< COMP1, COMP2, COMP4 or COMP6 output connected to TIM1 Break Input 2 (BKIN2) */
- /* Output Redirection common to COMP1 and COMP2 */
- #define COMP_OUTPUT_TIM1OCREFCLR (0x00001803U) /*!< COMP1 or COMP2 output connected to TIM1 OCREF Clear */
- #define COMP_OUTPUT_TIM1IC1 (0x00001C03U) /*!< COMP1 or COMP2 output connected to TIM1 Input Capture 1U */
- #define COMP_OUTPUT_TIM2IC4 (0x00002003U) /*!< COMP1 or COMP2 output connected to TIM2 Input Capture 4U */
- #define COMP_OUTPUT_TIM2OCREFCLR (0x00002403U) /*!< COMP1 or COMP2 output connected to TIM2 OCREF Clear */
- #define COMP_OUTPUT_TIM3IC1 (0x00002803U) /*!< COMP1 or COMP2 output connected to TIM3 Input Capture 1U */
- /* Output Redirection common to COMP1,COMP2 and COMP4 */
- #define COMP_OUTPUT_TIM3OCREFCLR (0x00002C0BU) /*!< COMP1, COMP2 or COMP4 output connected to TIM3 OCREF Clear */
- /* Output Redirection specific to COMP4 */
- #define COMP_OUTPUT_TIM3IC3 (0x00001808U) /*!< COMP4 output connected to TIM3 Input Capture 3U */
- #define COMP_OUTPUT_TIM15IC2 (0x00002008U) /*!< COMP4 output connected to TIM15 Input Capture 2U */
- #define COMP_OUTPUT_TIM4IC2 (0x00002408U) /*!< COMP4 output connected to TIM4 Input Capture 2U */
- #define COMP_OUTPUT_TIM15OCREFCLR (0x00002808U) /*!< COMP4 output connected to TIM15 OCREF Clear */
- /* Output Redirection specific to COMP6 */
- #define COMP_OUTPUT_TIM2IC2 (0x00001820U) /*!< COMP6 output connected to TIM2 Input Capture 2U */
- #define COMP_OUTPUT_COMP6_TIM2OCREFCLR (0x00002020U) /*!< COMP6 output connected to TIM2 OCREF Clear */
- #define COMP_OUTPUT_TIM16OCREFCLR (0x00002420U) /*!< COMP6 output connected to TIM16 OCREF Clear */
- #define COMP_OUTPUT_TIM16IC1 (0x00002820U) /*!< COMP6 output connected to TIM16 Input Capture 1U */
- #define COMP_OUTPUT_TIM4IC4 (0x00002C20U) /*!< COMP6 output connected to TIM4 Input Capture 4U */
- /**
- * @}
- */
- #elif defined(STM32F303xC) || defined(STM32F358xx)
- /** @defgroup COMPEx_Output COMP Extended Output (STM32F303xC/STM32F358xx Product devices)
- * Elements value convention on 16 LSB: 00XXXX000YYYYYYYb
- * - YYYYYYY : Applicable comparator instance number (bitmap format: 0000001 for COMP1, 1000000 for COMP7)
- * - XXXX : COMPxOUTSEL value
- * @{
- */
- /* Output Redirection values common to all comparators COMP1...COMP7 */
- #define COMP_OUTPUT_NONE (0x0000007FU) /*!< COMP1, COMP2... or COMP7 output isn't connected to other peripherals */
- #define COMP_OUTPUT_TIM1BKIN (0x0000047FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM1 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM1BKIN2 (0x0000087FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM1 Break Input 2 (BKIN2) */
- #define COMP_OUTPUT_TIM8BKIN (0x00000C7FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM8 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM8BKIN2 (0x0000107FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM8 Break Input 2 (BKIN2) */
- #define COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2 (0x0000147FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM1 Break Input 2 and TIM8 Break Input 2U */
- /* Output Redirection common to COMP1, COMP2, COMP3 and COMP7 */
- #define COMP_OUTPUT_TIM1OCREFCLR (0x00001847U) /*!< COMP1, COMP2, COMP3 or COMP7 output connected to TIM1 OCREF Clear */
- /* Output Redirection common to COMP1, COMP2 and COMP3 */
- #define COMP_OUTPUT_TIM2OCREFCLR (0x00002407U) /*!< COMP1, COMP2 or COMP3 output connected to TIM2 OCREF Clear */
- /* Output Redirection common to COMP1, COMP2, COMP4 and COMP5 */
- #define COMP_OUTPUT_TIM3OCREFCLR (0x00002C1BU) /*!< COMP1, COMP2, COMP4 or COMP5 output connected to TIM3 OCREF Clear */
- /* Output Redirection common to COMP4, COMP5, COMP6 and COMP7 */
- #define COMP_OUTPUT_TIM8OCREFCLR (0x00001C78U) /*!< COMP4, COMP5, COMP6 or COMP7 output connected to TIM8 OCREF Clear */
- /* Output Redirection common to COMP1 and COMP2 */
- #define COMP_OUTPUT_TIM1IC1 (0x00001C03U) /*!< COMP1 or COMP2 output connected to TIM1 Input Capture 1U */
- #define COMP_OUTPUT_TIM2IC4 (0x00002003U) /*!< COMP1 or COMP2 output connected to TIM2 Input Capture 4U */
- #define COMP_OUTPUT_TIM3IC1 (0x00002803U) /*!< COMP1 or COMP2 output connected to TIM3 Input Capture 1U */
- /* Output Redirection specific to COMP3 */
- #define COMP_OUTPUT_TIM4IC1 (0x00001C04U) /*!< COMP3 output connected to TIM4 Input Capture 1U */
- #define COMP_OUTPUT_TIM3IC2 (0x00002004U) /*!< COMP3 output connected to TIM3 Input Capture 2U */
- #define COMP_OUTPUT_TIM15IC1 (0x00002804U) /*!< COMP3 output connected to TIM15 Input Capture 1U */
- #define COMP_OUTPUT_TIM15BKIN (0x00002C04U) /*!< COMP3 output connected to TIM15 Break Input (BKIN) */
- /* Output Redirection specific to COMP4 */
- #define COMP_OUTPUT_TIM3IC3 (0x00001808U) /*!< COMP4 output connected to TIM3 Input Capture 3U */
- #define COMP_OUTPUT_TIM15IC2 (0x00002008U) /*!< COMP4 output connected to TIM15 Input Capture 2U */
- #define COMP_OUTPUT_TIM4IC2 (0x00002408U) /*!< COMP4 output connected to TIM4 Input Capture 2U */
- #define COMP_OUTPUT_TIM15OCREFCLR (0x00002808U) /*!< COMP4 output connected to TIM15 OCREF Clear */
- /* Output Redirection specific to COMP5 */
- #define COMP_OUTPUT_TIM2IC1 (0x00001810U) /*!< COMP5 output connected to TIM2 Input Capture 1U */
- #define COMP_OUTPUT_TIM17IC1 (0x00002010U) /*!< COMP5 output connected to TIM17 Input Capture 1U */
- #define COMP_OUTPUT_TIM4IC3 (0x00002410U) /*!< COMP5 output connected to TIM4 Input Capture 3U */
- #define COMP_OUTPUT_TIM16BKIN (0x00002810U) /*!< COMP5 output connected to TIM16 Break Input (BKIN) */
- /* Output Redirection specific to COMP6 */
- #define COMP_OUTPUT_TIM2IC2 (0x00001820U) /*!< COMP6 output connected to TIM2 Input Capture 2U */
- #define COMP_OUTPUT_COMP6_TIM2OCREFCLR (0x00002020U) /*!< COMP6 output connected to TIM2 OCREF Clear */
- #define COMP_OUTPUT_TIM16OCREFCLR (0x00002420U) /*!< COMP6 output connected to TIM16 OCREF Clear */
- #define COMP_OUTPUT_TIM16IC1 (0x00002820U) /*!< COMP6 output connected to TIM16 Input Capture 1U */
- #define COMP_OUTPUT_TIM4IC4 (0x00002C20U) /*!< COMP6 output connected to TIM4 Input Capture 4U */
- /* Output Redirection specific to COMP7 */
- #define COMP_OUTPUT_TIM2IC3 (0x00002040U) /*!< COMP7 output connected to TIM2 Input Capture 3U */
- #define COMP_OUTPUT_TIM1IC2 (0x00002440U) /*!< COMP7 output connected to TIM1 Input Capture 2U */
- #define COMP_OUTPUT_TIM17OCREFCLR (0x00002840U) /*!< COMP7 output connected to TIM17 OCREF Clear */
- #define COMP_OUTPUT_TIM17BKIN (0x00002C40U) /*!< COMP7 output connected to TIM17 Break Input (BKIN) */
- /**
- * @}
- */
- #elif defined(STM32F303xE) || defined(STM32F398xx)
- /** @defgroup COMPEx_Output COMP Extended Output (STM32F303xE/STM32F398xx Product devices)
- * Elements value convention on 16 LSB: 00XXXX000YYYYYYYb
- * - YYYYYYY : Applicable comparator instance number (bitmap format: 0000001 for COMP1, 1000000 for COMP7)
- * - XXXX : COMPxOUTSEL value
- * @{
- */
- /* Output Redirection values common to all comparators COMP1...COMP7 */
- #define COMP_OUTPUT_NONE (0x0000007FU) /*!< COMP1, COMP2... or COMP7 output isn't connected to other peripherals */
- #define COMP_OUTPUT_TIM1BKIN (0x0000047FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM1 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM1BKIN2 (0x0000087FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM1 Break Input 2 (BKIN2) */
- #define COMP_OUTPUT_TIM8BKIN (0x00000C7FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM8 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM8BKIN2 (0x0000107FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM8 Break Input 2 (BKIN2) */
- #define COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2 (0x0000147FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM1 Break Input 2 and TIM8 Break Input 2U */
- #define COMP_OUTPUT_TIM20BKIN (0x0000307FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM20 Break Input (BKIN) */
- #define COMP_OUTPUT_TIM20BKIN2 (0x0000347FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM20 Break Input 2 (BKIN2) */
- #define COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2 (0x0000387FU) /*!< COMP1, COMP2... or COMP7 output connected to TIM1 Break Input 2U, TIM8 Break Input 2 and TIM20 Break Input 2 */
- /* Output Redirection common to COMP1, COMP2, COMP3 and COMP7 */
- #define COMP_OUTPUT_TIM1OCREFCLR (0x00001847U) /*!< COMP1, COMP2, COMP3 or COMP7 output connected to TIM1 OCREF Clear */
- /* Output Redirection common to COMP1, COMP2 and COMP3 */
- #define COMP_OUTPUT_TIM2OCREFCLR (0x00002407U) /*!< COMP1, COMP2 or COMP3 output connected to TIM2 OCREF Clear */
- /* Output Redirection common to COMP1, COMP2, COMP4 and COMP5 */
- #define COMP_OUTPUT_TIM3OCREFCLR (0x00002C1BU) /*!< COMP1, COMP2, COMP4 or COMP5 output connected to TIM3 OCREF Clear */
- /* Output Redirection common to COMP4, COMP5, COMP6 and COMP7 */
- #define COMP_OUTPUT_TIM8OCREFCLR (0x00001C78U) /*!< COMP4, COMP5, COMP6 or COMP7 output connected to TIM8 OCREF Clear */
- /* Output Redirection common to COMP1 and COMP2 */
- #define COMP_OUTPUT_TIM1IC1 (0x00001C03U) /*!< COMP1 or COMP2 output connected to TIM1 Input Capture 1U */
- #define COMP_OUTPUT_TIM2IC4 (0x00002003U) /*!< COMP1 or COMP2 output connected to TIM2 Input Capture 4U */
- #define COMP_OUTPUT_TIM3IC1 (0x00002803U) /*!< COMP1 or COMP2 output connected to TIM3 Input Capture 1U */
- /* Output Redirection specific to COMP2 */
- #define COMP_OUTPUT_TIM20OCREFCLR (0x00003C04U) /*!< COMP2 output connected to TIM20 OCREF Clear */
- /* Output Redirection specific to COMP3 */
- #define COMP_OUTPUT_TIM4IC1 (0x00001C04U) /*!< COMP3 output connected to TIM4 Input Capture 1U */
- #define COMP_OUTPUT_TIM3IC2 (0x00002004U) /*!< COMP3 output connected to TIM3 Input Capture 2U */
- #define COMP_OUTPUT_TIM15IC1 (0x00002804U) /*!< COMP3 output connected to TIM15 Input Capture 1U */
- #define COMP_OUTPUT_TIM15BKIN (0x00002C04U) /*!< COMP3 output connected to TIM15 Break Input (BKIN) */
- /* Output Redirection specific to COMP4 */
- #define COMP_OUTPUT_TIM3IC3 (0x00001808U) /*!< COMP4 output connected to TIM3 Input Capture 3U */
- #define COMP_OUTPUT_TIM15IC2 (0x00002008U) /*!< COMP4 output connected to TIM15 Input Capture 2U */
- #define COMP_OUTPUT_TIM4IC2 (0x00002408U) /*!< COMP4 output connected to TIM4 Input Capture 2U */
- #define COMP_OUTPUT_TIM15OCREFCLR (0x00002808U) /*!< COMP4 output connected to TIM15 OCREF Clear */
- /* Output Redirection specific to COMP5 */
- #define COMP_OUTPUT_TIM2IC1 (0x00001810U) /*!< COMP5 output connected to TIM2 Input Capture 1U */
- #define COMP_OUTPUT_TIM17IC1 (0x00002010U) /*!< COMP5 output connected to TIM17 Input Capture 1U */
- #define COMP_OUTPUT_TIM4IC3 (0x00002410U) /*!< COMP5 output connected to TIM4 Input Capture 3U */
- #define COMP_OUTPUT_TIM16BKIN (0x00002810U) /*!< COMP5 output connected to TIM16 Break Input (BKIN) */
- /* Output Redirection specific to COMP6 */
- #define COMP_OUTPUT_TIM2IC2 (0x00001820U) /*!< COMP6 output connected to TIM2 Input Capture 2U */
- #define COMP_OUTPUT_COMP6_TIM2OCREFCLR (0x00002020U) /*!< COMP6 output connected to TIM2 OCREF Clear */
- #define COMP_OUTPUT_TIM16OCREFCLR (0x00002420U) /*!< COMP6 output connected to TIM16 OCREF Clear */
- #define COMP_OUTPUT_TIM16IC1 (0x00002820U) /*!< COMP6 output connected to TIM16 Input Capture 1U */
- #define COMP_OUTPUT_TIM4IC4 (0x00002C20U) /*!< COMP6 output connected to TIM4 Input Capture 4U */
- /* Output Redirection specific to COMP7 */
- #define COMP_OUTPUT_TIM2IC3 (0x00002040U) /*!< COMP7 output connected to TIM2 Input Capture 3U */
- #define COMP_OUTPUT_TIM1IC2 (0x00002440U) /*!< COMP7 output connected to TIM1 Input Capture 2U */
- #define COMP_OUTPUT_TIM17OCREFCLR (0x00002840U) /*!< COMP7 output connected to TIM17 OCREF Clear */
- #define COMP_OUTPUT_TIM17BKIN (0x00002C40U) /*!< COMP7 output connected to TIM17 Break Input (BKIN) */
- /**
- * @}
- */
- #elif defined(STM32F373xC) || defined(STM32F378xx)
- /** @defgroup COMPEx_Output COMP Extended Output (STM32F373xC/STM32F378xx Product devices)
- * Elements value convention: 00000XXX000000YYb
- * - YY : Applicable comparator instance number (bitmap format: 01 for COMP1, 10 for COMP2)
- * - XXX : COMPxOUTSEL value
- * @{
- */
- /* Output Redirection values common to all comparators COMP1 and COMP2 */
- #define COMP_OUTPUT_NONE (0x0003U) /*!< COMP1 or COMP2 output isn't connected to other peripherals */
- #define COMP_OUTPUT_TIM2IC4 (0x0403U) /*!< COMP1 or COMP2 output connected to TIM2 Input Capture 4U */
- #define COMP_OUTPUT_TIM2OCREFCLR (0x0503U) /*!< COMP1 or COMP2 output connected to TIM2 OCREF Clear */
- /* Output Redirection specific to COMP1 */
- #define COMP_OUTPUT_TIM15BKIN (0x0101U) /*!< COMP1 output connected to TIM15 Break Input */
- #define COMP_OUTPUT_COMP1_TIM3IC1 (0x0201U) /*!< COMP1 output connected to TIM3 Input Capture 1U */
- #define COMP_OUTPUT_COMP1_TIM3OCREFCLR (0x0301U) /*!< COMP1 output connected to TIM3 OCREF Clear */
- #define COMP_OUTPUT_TIM5IC4 (0x0601U) /*!< COMP1 output connected to TIM5 Input Capture 4U */
- #define COMP_OUTPUT_TIM5OCREFCLR (0x0701U) /*!< COMP1 output connected to TIM5 OCREF Clear */
- /* Output Redirection specific to COMP2 */
- #define COMP_OUTPUT_TIM16BKIN (0x0102U) /*!< COMP2 output connected to TIM16 Break Input */
- #define COMP_OUTPUT_TIM4IC1 (0x0202U) /*!< COMP2 output connected to TIM4 Input Capture 1U */
- #define COMP_OUTPUT_TIM4OCREFCLR (0x0302U) /*!< COMP2 output connected to TIM4 OCREF Clear */
- #define COMP_OUTPUT_COMP2_TIM3IC1 (0x0602U) /*!< COMP2 output connected to TIM3 Input Capture 1U */
- #define COMP_OUTPUT_COMP2_TIM3OCREFCLR (0x0702U) /*!< COMP2 output connected to TIM3 OCREF Clear */
- /**
- * @}
- */
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */
- #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
- /** @defgroup COMPEx_WindowMode COMP Extended WindowMode (STM32F302xC/STM32F303xC/STM32F358xx Product devices)
- * @{
- */
- #define COMP_WINDOWMODE_DISABLE (0x00000000U) /*!< Window mode disabled */
- #define COMP_WINDOWMODE_ENABLE COMP_CSR_COMPxWNDWEN /*!< Window mode enabled: non inverting input of comparator X (x=2U,4,6U)
- is connected to the non inverting input of comparator X-1U */
- /**
- * @}
- */
- #elif defined(STM32F373xC) || defined(STM32F378xx)
- /** @defgroup COMPEx_WindowMode COMP Extended WindowMode (STM32F373xC/STM32F378xx Product devices)
- * @{
- */
- #define COMP_WINDOWMODE_DISABLE (0x00000000U) /*!< Window mode disabled */
- #define COMP_WINDOWMODE_ENABLE ((uint32_t)COMP_CSR_COMPxWNDWEN) /*!< Window mode enabled: non inverting input of comparator 2
- is connected to the non inverting input of comparator 1 (PA1) */
- /**
- * @}
- */
- #else
- /** @defgroup COMPEx_WindowMode COMP Extended WindowMode (Other Product devices)
- * @{
- */
- #define COMP_WINDOWMODE_DISABLE (0x00000000U) /*!< Window mode disabled (not available) */
- /**
- * @}
- */
- #endif /* STM32F302xC || STM32F303xC || STM32F358xx */
- /** @defgroup COMPEx_Mode COMP Extended Mode
- * @{
- */
- #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
- defined(STM32F373xC) || defined(STM32F378xx)
- /* Please refer to the electrical characteristics in the device datasheet for
- the power consumption values */
- #define COMP_MODE_HIGHSPEED (0x00000000U) /*!< High Speed */
- #define COMP_MODE_MEDIUMSPEED COMP_CSR_COMPxMODE_0 /*!< Medium Speed */
- #define COMP_MODE_LOWPOWER COMP_CSR_COMPxMODE_1 /*!< Low power mode */
- #define COMP_MODE_ULTRALOWPOWER COMP_CSR_COMPxMODE /*!< Ultra-low power mode */
- #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
- /* STM32F373xC || STM32F378xx */
- /**
- * @}
- */
- /** @defgroup COMPEx_Hysteresis COMP Extended Hysteresis
- * @{
- */
- #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
- defined(STM32F373xC) || defined(STM32F378xx)
- #define COMP_HYSTERESIS_NONE (0x00000000U) /*!< No hysteresis */
- #define COMP_HYSTERESIS_LOW COMP_CSR_COMPxHYST_0 /*!< Hysteresis level low */
- #define COMP_HYSTERESIS_MEDIUM COMP_CSR_COMPxHYST_1 /*!< Hysteresis level medium */
- #define COMP_HYSTERESIS_HIGH COMP_CSR_COMPxHYST /*!< Hysteresis level high */
- #else
- #define COMP_HYSTERESIS_NONE (0x00000000U) /*!< No hysteresis */
- #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
- /* STM32F373xC || STM32F378xx */
- /**
- * @}
- */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
- defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F301x8/STM32F302x8/STM32F303x8/STM32F334x8/STM32F318xx/STM32F328xx Product devices)
- * @{
- */
- /* No blanking source can be selected for all comparators */
- #define COMP_BLANKINGSRCE_NONE (0x00000000U) /*!< No blanking source */
- /* Blanking source for COMP2 */
- #define COMP_BLANKINGSRCE_TIM1OC5 COMP_CSR_COMPxBLANKING_0 /*!< TIM1 OC5 selected as blanking source for COMP2 */
- #define COMP_BLANKINGSRCE_TIM2OC3 COMP_CSR_COMPxBLANKING_1 /*!< TIM2 OC3 selected as blanking source for COMP2 */
- #define COMP_BLANKINGSRCE_TIM3OC3 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM3 OC3 selected as blanking source for COMP2 */
- /* Blanking source for COMP4 */
- #define COMP_BLANKINGSRCE_TIM3OC4 COMP_CSR_COMPxBLANKING_0 /*!< TIM3 OC4 selected as blanking source for COMP4 */
- #define COMP_BLANKINGSRCE_TIM15OC1 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM15 OC1 selected as blanking source for COMP4 */
- /* Blanking source for COMP6 */
- #define COMP_BLANKINGSRCE_TIM2OC4 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC4 selected as blanking source for COMP6 */
- #define COMP_BLANKINGSRCE_TIM15OC2 COMP_CSR_COMPxBLANKING_2 /*!< TIM15 OC2 selected as blanking source for COMP6 */
- /**
- * @}
- */
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
- /* STM32F303x8 || STM32F334x8 || STM32F328xx */
- #if defined(STM32F302xE) ||\
- defined(STM32F302xC)
- /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F302xE/STM32F302xC Product devices)
- * @{
- */
- /* No blanking source can be selected for all comparators */
- #define COMP_BLANKINGSRCE_NONE (0x00000000U) /*!< No blanking source */
- /* Blanking source common for COMP1 and COMP2 */
- #define COMP_BLANKINGSRCE_TIM1OC5 COMP_CSR_COMPxBLANKING_0 /*!< TIM1 OC5 selected as blanking source for COMP1 and COMP2 */
- /* Blanking source common for COMP1 and COMP2 */
- #define COMP_BLANKINGSRCE_TIM2OC3 COMP_CSR_COMPxBLANKING_1 /*!< TIM2 OC3 selected as blanking source for COMP1 and COMP2 */
- /* Blanking source common for COMP1 and COMP2 */
- #define COMP_BLANKINGSRCE_TIM3OC3 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM3 OC3 selected as blanking source for COMP1 and COMP2 */
- /* Blanking source for COMP4 */
- #define COMP_BLANKINGSRCE_TIM3OC4 COMP_CSR_COMPxBLANKING_0 /*!< TIM3 OC4 selected as blanking source for COMP4 */
- #define COMP_BLANKINGSRCE_TIM15OC1 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM15 OC1 selected as blanking source for COMP4 */
- /* Blanking source for COMP6 */
- #define COMP_BLANKINGSRCE_TIM2OC4 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC4 selected as blanking source for COMP6 */
- #define COMP_BLANKINGSRCE_TIM15OC2 COMP_CSR_COMPxBLANKING_2 /*!< TIM15 OC2 selected as blanking source for COMP6 */
- /**
- * @}
- */
- #endif /* STM32F302xE || */
- /* STM32F302xC */
- #if defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303xC) || defined(STM32F358xx)
- /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F303xE/STM32F398xx/STM32F303xC/STM32F358xx Product devices)
- * @{
- */
- /* No blanking source can be selected for all comparators */
- #define COMP_BLANKINGSRCE_NONE (0x00000000U) /*!< No blanking source */
- /* Blanking source common for COMP1, COMP2, COMP3 and COMP7 */
- #define COMP_BLANKINGSRCE_TIM1OC5 COMP_CSR_COMPxBLANKING_0 /*!< TIM1 OC5 selected as blanking source for COMP1, COMP2, COMP3 and COMP7 */
- /* Blanking source common for COMP1 and COMP2 */
- #define COMP_BLANKINGSRCE_TIM2OC3 COMP_CSR_COMPxBLANKING_1 /*!< TIM2 OC5 selected as blanking source for COMP1 and COMP2 */
- /* Blanking source common for COMP1, COMP2 and COMP5 */
- #define COMP_BLANKINGSRCE_TIM3OC3 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC3 selected as blanking source for COMP1, COMP2 and COMP5 */
- /* Blanking source common for COMP3 and COMP6 */
- #define COMP_BLANKINGSRCE_TIM2OC4 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM2 OC4 selected as blanking source for COMP3 and COMP6 */
- /* Blanking source common for COMP4, COMP5, COMP6 and COMP7 */
- #define COMP_BLANKINGSRCE_TIM8OC5 COMP_CSR_COMPxBLANKING_1 /*!< TIM8 OC5 selected as blanking source for COMP4, COMP5, COMP6 and COMP7 */
- /* Blanking source for COMP4 */
- #define COMP_BLANKINGSRCE_TIM3OC4 COMP_CSR_COMPxBLANKING_0 /*!< TIM3 OC4 selected as blanking source for COMP4 */
- #define COMP_BLANKINGSRCE_TIM15OC1 (COMP_CSR_COMPxBLANKING_0|COMP_CSR_COMPxBLANKING_1) /*!< TIM15 OC1 selected as blanking source for COMP4 */
- /* Blanking source common for COMP6 and COMP7 */
- #define COMP_BLANKINGSRCE_TIM15OC2 COMP_CSR_COMPxBLANKING_2 /*!< TIM15 OC2 selected as blanking source for COMP6 and COMP7 */
- /**
- * @}
- */
- #endif /* STM32F303xE || STM32F398xx || */
- /* STM32F303xC || STM32F358xx */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- /** @defgroup COMPEx_BlankingSrce COMP Extended Blanking Source (STM32F373xC/STM32F378xx Product devices)
- * @{
- */
- /* No blanking source can be selected for all comparators */
- #define COMP_BLANKINGSRCE_NONE (0x00000000U) /*!< No blanking source */
- /**
- * @}
- */
- #endif /* STM32F373xC || STM32F378xx */
- /** @defgroup COMP_Flag COMP Flag
- * @{
- */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- #define COMP_FLAG_LOCK COMP_CSR_COMP1LOCK /*!< Lock flag */
- #else
- #define COMP_FLAG_LOCK COMP_CSR_LOCK /*!< Lock flag */
- #endif /* STM32F373xC || STM32F378xx */
- /**
- * @}
- */
- /**
- * @}
- */
- /* Exported macro ------------------------------------------------------------*/
- /** @defgroup COMPEx_Exported_Macros COMP Extended Exported Macros
- * @{
- */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- /**
- * @brief Enable the specified comparator.
- * @param __HANDLE__ COMP handle.
- * @retval None
- */
- #define __HAL_COMP_ENABLE(__HANDLE__) \
- do { \
- uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
- \
- if((__HANDLE__)->Instance == COMP2) \
- { \
- regshift = COMP_CSR_COMP2_SHIFT; \
- } \
- SET_BIT(COMP->CSR, (uint32_t)COMP_CSR_COMPxEN << regshift); \
- } while(0U)
- /**
- * @brief Disable the specified comparator.
- * @param __HANDLE__ COMP handle.
- * @retval None
- */
- #define __HAL_COMP_DISABLE(__HANDLE__) \
- do { \
- uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
- \
- if((__HANDLE__)->Instance == COMP2) \
- { \
- regshift = COMP_CSR_COMP2_SHIFT; \
- } \
- CLEAR_BIT(COMP->CSR, (uint32_t)COMP_CSR_COMPxEN << regshift); \
- } while(0U)
- /**
- * @brief Lock a comparator instance
- * @param __HANDLE__ COMP handle
- * @retval None.
- */
- #define __HAL_COMP_LOCK(__HANDLE__) \
- do { \
- uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
- \
- if((__HANDLE__)->Instance == COMP2) \
- { \
- regshift = COMP_CSR_COMP2_SHIFT; \
- } \
- SET_BIT(COMP->CSR, (uint32_t)COMP_CSR_COMPxLOCK << regshift); \
- } while(0U)
- /** @brief Check whether the specified COMP flag is set or not.
- * @param __HANDLE__ COMP Handle.
- * @param __FLAG__ flag to check.
- * This parameter can be one of the following values:
- * @arg @ref COMP_FLAG_LOCK lock flag
- * @retval The new state of __FLAG__ (TRUE or FALSE).
- */
- #define __HAL_COMP_GET_FLAG(__HANDLE__, __FLAG__) \
- (((__HANDLE__)->Instance == COMP1) ? (((__HANDLE__)->Instance->CSR & (__FLAG__)) == (__FLAG__)) \
- (((__HANDLE__)->Instance->CSR & (uint32_t)((__FLAG__) << COMP_CSR_COMP2_SHIFT) == (__FLAG__))))
- #else
- /**
- * @brief Enable the specified comparator.
- * @param __HANDLE__ COMP handle.
- * @retval None
- */
- #define __HAL_COMP_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxEN)
- /**
- * @brief Disable the specified comparator.
- * @param __HANDLE__ COMP handle.
- * @retval None
- */
- #define __HAL_COMP_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxEN)
- /**
- * @brief Lock a comparator instance
- * @param __HANDLE__ COMP handle
- * @retval None.
- */
- #define __HAL_COMP_LOCK(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxLOCK)
- /** @brief Check whether the specified COMP flag is set or not.
- * @param __HANDLE__ COMP Handle.
- * @param __FLAG__ flag to check.
- * This parameter can be one of the following values:
- * @arg @ref COMP_FLAG_LOCK lock flag
- * @retval The new state of __FLAG__ (TRUE or FALSE).
- */
- #define __HAL_COMP_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->CSR & (__FLAG__)) == (__FLAG__))
- #endif /* STM32F373xC || STM32F378xx */
- #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
- defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F373xC) || defined(STM32F378xx)
- /**
- * @brief Enable the COMP1 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Disable the COMP1 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Enable the COMP1 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Disable the COMP1 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Enable the COMP1 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE(); \
- __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Disable the COMP1 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE(); \
- __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Enable the COMP1 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Disable the COMP1 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Generate a software interrupt on the COMP1 EXTI line.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Enable the COMP1 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Disable the COMP1 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Check whether the COMP1 EXTI line flag is set or not.
- * @retval RESET or SET
- */
- #define __HAL_COMP_COMP1_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP1)
- /**
- * @brief Clear the COMP1 EXTI flag.
- * @retval None
- */
- #define __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP1)
- #endif /* STM32F302xC || STM32F303xC || STM32F358xx || */
- /* STM32F302xE || STM32F303xE || STM32F398xx || */
- /* STM32F373xC || STM32F378xx */
- /**
- * @brief Enable the COMP2 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Disable the COMP2 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Enable the COMP2 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Disable the COMP2 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Enable the COMP2 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE(); \
- __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Disable the COMP2 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE(); \
- __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Enable the COMP2 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Disable the COMP2 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Generate a software interrupt on the COMP2 EXTI line.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Enable the COMP2 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Disable the COMP2 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Check whether the COMP2 EXTI line flag is set or not.
- * @retval RESET or SET
- */
- #define __HAL_COMP_COMP2_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP2)
- /**
- * @brief Clear the COMP2 EXTI flag.
- * @retval None
- */
- #define __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP2)
- #if defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303xC) || defined(STM32F358xx)
- /**
- * @brief Enable the COMP3 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Disable the COMP3 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Enable the COMP3 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Disable the COMP3 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Enable the COMP3 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP3_EXTI_ENABLE_RISING_EDGE(); \
- __HAL_COMP_COMP3_EXTI_ENABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Disable the COMP3 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP3_EXTI_DISABLE_RISING_EDGE(); \
- __HAL_COMP_COMP3_EXTI_DISABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Enable the COMP3 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Disable the COMP3 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Generate a software interrupt on the COMP3 EXTI line.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Enable the COMP3 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Disable the COMP3 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Check whether the COMP3 EXTI line flag is set or not.
- * @retval RESET or SET
- */
- #define __HAL_COMP_COMP3_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP3)
- /**
- * @brief Clear the COMP3 EXTI flag.
- * @retval None
- */
- #define __HAL_COMP_COMP3_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP3)
- #endif /* STM32F303xE || STM32F398xx || */
- /* STM32F303xC || STM32F358xx */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
- defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
- defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- /**
- * @brief Enable the COMP4 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Disable the COMP4 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Enable the COMP4 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Disable the COMP4 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Enable the COMP4 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP4_EXTI_ENABLE_RISING_EDGE(); \
- __HAL_COMP_COMP4_EXTI_ENABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Disable the COMP4 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP4_EXTI_DISABLE_RISING_EDGE(); \
- __HAL_COMP_COMP4_EXTI_DISABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Enable the COMP4 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Disable the COMP4 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Generate a software interrupt on the COMP4 EXTI line.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Enable the COMP4 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Disable the COMP4 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Check whether the COMP4 EXTI line flag is set or not.
- * @retval RESET or SET
- */
- #define __HAL_COMP_COMP4_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP4)
- /**
- * @brief Clear the COMP4 EXTI flag.
- * @retval None
- */
- #define __HAL_COMP_COMP4_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP4)
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
- /* STM32F302xC || STM32F303xC || STM32F358xx || */
- /* STM32F302xE || STM32F303xE || STM32F398xx || */
- /* STM32F303x8 || STM32F334x8 || STM32F328xx */
- #if defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303xC) || defined(STM32F358xx)
- /**
- * @brief Enable the COMP5 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Disable the COMP5 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Enable the COMP5 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Disable the COMP5 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Enable the COMP5 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP5_EXTI_ENABLE_RISING_EDGE(); \
- __HAL_COMP_COMP5_EXTI_ENABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Disable the COMP5 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP5_EXTI_DISABLE_RISING_EDGE(); \
- __HAL_COMP_COMP5_EXTI_DISABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Enable the COMP5 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Disable the COMP5 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Generate a software interrupt on the COMP5 EXTI line.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Enable the COMP5 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Disable the COMP5 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Check whether the COMP5 EXTI line flag is set or not.
- * @retval RESET or SET
- */
- #define __HAL_COMP_COMP5_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP5)
- /**
- * @brief Clear the COMP5 EXTI flag.
- * @retval None
- */
- #define __HAL_COMP_COMP5_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP5)
- #endif /* STM32F303xE || STM32F398xx || */
- /* STM32F303xC || STM32F358xx */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
- defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx) || \
- defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- /**
- * @brief Enable the COMP6 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Disable the COMP6 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Enable the COMP6 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Disable the COMP6 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Enable the COMP6 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP6_EXTI_ENABLE_RISING_EDGE(); \
- __HAL_COMP_COMP6_EXTI_ENABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Disable the COMP6 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP6_EXTI_DISABLE_RISING_EDGE(); \
- __HAL_COMP_COMP6_EXTI_DISABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Enable the COMP6 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Disable the COMP6 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Generate a software interrupt on the COMP6 EXTI line.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Enable the COMP6 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Disable the COMP6 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Check whether the COMP6 EXTI line flag is set or not.
- * @retval RESET or SET
- */
- #define __HAL_COMP_COMP6_EXTI_GET_FLAG() READ_BIT(EXTI->PR2, COMP_EXTI_LINE_COMP6)
- /**
- * @brief Clear the COMP6 EXTI flag.
- * @retval None
- */
- #define __HAL_COMP_COMP6_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR2, COMP_EXTI_LINE_COMP6)
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
- /* STM32F302xC || STM32F303xC || STM32F358xx || */
- /* STM32F302xE || STM32F303xE || STM32F398xx || */
- /* STM32F303x8 || STM32F334x8 || STM32F328xx */
- #if defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303xC) || defined(STM32F358xx)
- /**
- * @brief Enable the COMP7 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Disable the COMP7 EXTI line rising edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Enable the COMP7 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Disable the COMP7 EXTI line falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Enable the COMP7 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP7_EXTI_ENABLE_RISING_EDGE(); \
- __HAL_COMP_COMP7_EXTI_ENABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Disable the COMP7 EXTI line rising & falling edge trigger.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
- __HAL_COMP_COMP7_EXTI_DISABLE_RISING_EDGE(); \
- __HAL_COMP_COMP7_EXTI_DISABLE_FALLING_EDGE(); \
- } while(0U)
- /**
- * @brief Enable the COMP7 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Disable the COMP7 EXTI line in interrupt mode.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Generate a software interrupt on the COMP7 EXTI line.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Enable the COMP7 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Disable the COMP7 EXTI line in event mode.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Check whether the COMP7 EXTI line flag is set or not.
- * @retval RESET or SET
- */
- #define __HAL_COMP_COMP7_EXTI_GET_FLAG() READ_BIT(EXTI->PR2, COMP_EXTI_LINE_COMP7)
- /**
- * @brief Clear the COMP7 EXTI flag.
- * @retval None
- */
- #define __HAL_COMP_COMP7_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR2, COMP_EXTI_LINE_COMP7)
- #endif /* STM32F303xE || STM32F398xx || */
- /* STM32F303xC || STM32F358xx */
- /**
- * @}
- */
- /* Private types -------------------------------------------------------------*/
- /* Private constants ---------------------------------------------------------*/
- /** @defgroup COMPEx_Private_Constants COMP Extended Private Constants
- * @{
- */
- /** @defgroup COMPEx_ExtiLineEvent COMP Extended EXTI lines
- * @{
- */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
- defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- #define COMP_EXTI_LINE_COMP2 EXTI_IMR_MR22 /*!< External interrupt line 22 connected to COMP2 */
- #define COMP_EXTI_LINE_COMP4 EXTI_IMR_MR30 /*!< External interrupt line 30 connected to COMP4 */
- #define COMP_EXTI_LINE_COMP6 EXTI_IMR2_MR32 /*!< External interrupt line 32 connected to COMP6 */
- #define COMP_EXTI_LINE_REG2_MASK EXTI_IMR2_MR32 /*!< Mask for External interrupt line control in register xxx2 */
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
- /* STM32F303x8 || STM32F334x8 || STM32F328xx */
- #if defined(STM32F302xE) || \
- defined(STM32F302xC)
- #define COMP_EXTI_LINE_COMP1 EXTI_IMR_MR21 /*!< External interrupt line 21 connected to COMP1 */
- #define COMP_EXTI_LINE_COMP2 EXTI_IMR_MR22 /*!< External interrupt line 22 connected to COMP2 */
- #define COMP_EXTI_LINE_COMP4 EXTI_IMR_MR30 /*!< External interrupt line 30 connected to COMP4 */
- #define COMP_EXTI_LINE_COMP6 EXTI_IMR2_MR32 /*!< External interrupt line 32 connected to COMP6 */
- #define COMP_EXTI_LINE_REG2_MASK EXTI_IMR2_MR32 /*!< Mask for External interrupt line control in register xxx2 */
- #endif /* STM32F302xE || */
- /* STM32F302xC */
- #if defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303xC) || defined(STM32F358xx)
- #define COMP_EXTI_LINE_COMP1 EXTI_IMR_MR21 /*!< External interrupt line 21 connected to COMP1 */
- #define COMP_EXTI_LINE_COMP2 EXTI_IMR_MR22 /*!< External interrupt line 22 connected to COMP2 */
- #define COMP_EXTI_LINE_COMP3 EXTI_IMR_MR29 /*!< External interrupt line 29 connected to COMP3 */
- #define COMP_EXTI_LINE_COMP4 EXTI_IMR_MR30 /*!< External interrupt line 30 connected to COMP4 */
- #define COMP_EXTI_LINE_COMP5 EXTI_IMR_MR31 /*!< External interrupt line 31 connected to COMP5 */
- #define COMP_EXTI_LINE_COMP6 EXTI_IMR2_MR32 /*!< External interrupt line 32 connected to COMP6 */
- #define COMP_EXTI_LINE_COMP7 EXTI_IMR2_MR33 /*!< External interrupt line 33 connected to COMP7 */
- #define COMP_EXTI_LINE_REG2_MASK (EXTI_IMR2_MR33 | EXTI_IMR2_MR32) /*!< Mask for External interrupt line control in register xxx2 */
- #endif /* STM32F303xE || STM32F398xx || */
- /* STM32F303xC || STM32F358xx */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- #define COMP_EXTI_LINE_COMP1 EXTI_IMR_MR21 /*!< External interrupt line 21 connected to COMP1 */
- #define COMP_EXTI_LINE_COMP2 EXTI_IMR_MR22 /*!< External interrupt line 22 connected to COMP2 */
- #endif /* STM32F373xC || STM32F378xx */
- /**
- * @}
- */
- /** @defgroup COMPEx_Misc COMP Extended miscellaneous defines
- * @{
- */
- /* CSR masks redefinition for internal use */
- #define COMP_CSR_COMPxINSEL_MASK COMP_CSR_COMPxINSEL /*!< COMP_CSR_COMPxINSEL Mask */
- #define COMP_CSR_COMPxOUTSEL_MASK COMP_CSR_COMPxOUTSEL /*!< COMP_CSR_COMPxOUTSEL Mask */
- #define COMP_CSR_COMPxPOL_MASK COMP_CSR_COMPxPOL /*!< COMP_CSR_COMPxPOL Mask */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- /* CSR register reset value */
- #define COMP_CSR_RESET_VALUE (0x00000000U)
- #define COMP_CSR_RESET_PARAMETERS_MASK (0x00003FFFU)
- #define COMP_CSR_UPDATE_PARAMETERS_MASK (0x00003FFEU)
- /* CSR COMP1/COMP2 shift */
- #define COMP_CSR_COMP1_SHIFT 0U
- #define COMP_CSR_COMP2_SHIFT 16U
- #else
- /* CSR register reset value */
- #define COMP_CSR_RESET_VALUE (0x00000000U)
- #endif /* STM32F373xC || STM32F378xx */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
- #define COMP_CSR_COMPxNONINSEL_MASK (COMP2_CSR_COMP2INPDAC) /*!< COMP_CSR_COMPxNONINSEL mask */
- #define COMP_CSR_COMPxWNDWEN_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxMODE_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxHYST_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxBLANKING_MASK COMP_CSR_COMPxBLANKING /*!< COMP_CSR_COMPxBLANKING mask */
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */
- #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- #define COMP_CSR_COMPxNONINSEL_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxWNDWEN_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxMODE_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxHYST_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxBLANKING_MASK COMP_CSR_COMPxBLANKING /*!< COMP_CSR_COMPxBLANKING mask */
- #endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */
- #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
- #define COMP_CSR_COMPxNONINSEL_MASK (COMP_CSR_COMPxNONINSEL | COMP1_CSR_COMP1SW1) /*!< COMP_CSR_COMPxNONINSEL mask */
- #define COMP_CSR_COMPxWNDWEN_MASK COMP_CSR_COMPxWNDWEN /*!< COMP_CSR_COMPxWNDWEN mask */
- #define COMP_CSR_COMPxMODE_MASK COMP_CSR_COMPxMODE /*!< COMP_CSR_COMPxMODE Mask */
- #define COMP_CSR_COMPxHYST_MASK COMP_CSR_COMPxHYST /*!< COMP_CSR_COMPxHYST Mask */
- #define COMP_CSR_COMPxBLANKING_MASK COMP_CSR_COMPxBLANKING /*!< COMP_CSR_COMPxBLANKING mask */
- #endif /* STM32F302xC || STM32F303xC || STM32F358xx */
- #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
- #define COMP_CSR_COMPxNONINSEL_MASK (COMP1_CSR_COMP1SW1) /*!< COMP_CSR_COMPxNONINSEL mask */
- #define COMP_CSR_COMPxWNDWEN_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxMODE_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxHYST_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #define COMP_CSR_COMPxBLANKING_MASK COMP_CSR_COMPxBLANKING /*!< COMP_CSR_COMPxBLANKING mask */
- #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- #define COMP_CSR_COMPxNONINSEL_MASK (COMP_CSR_COMP1SW1) /*!< COMP_CSR_COMPxNONINSEL mask */
- #define COMP_CSR_COMPxWNDWEN_MASK COMP_CSR_COMPxWNDWEN /*!< COMP_CSR_COMPxWNDWEN mask */
- #define COMP_CSR_COMPxMODE_MASK COMP_CSR_COMPxMODE /*!< COMP_CSR_COMPxMODE Mask */
- #define COMP_CSR_COMPxHYST_MASK COMP_CSR_COMPxHYST /*!< COMP_CSR_COMPxHYST Mask */
- #define COMP_CSR_COMPxBLANKING_MASK (0x00000000U) /*!< Mask empty: feature not available */
- #endif /* STM32F373xC || STM32F378xx */
- /**
- * @}
- */
- /**
- * @}
- */
- /* Private macros ------------------------------------------------------------*/
- /** @defgroup COMPEx_Private_Macros COMP Extended Private Macros
- * @{
- */
- /** @defgroup COMP_GET_EXTI_LINE COMP Extended Private macro to get the EXTI line associated with a comparator handle
- * @{
- */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx) || \
- defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- /**
- * @brief Get the specified EXTI line for a comparator instance
- * @param __INSTANCE__ specifies the COMP instance.
- * @retval value of @ref COMPEx_ExtiLineEvent
- */
- #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP2) ? COMP_EXTI_LINE_COMP2 : \
- ((__INSTANCE__) == COMP4) ? COMP_EXTI_LINE_COMP4 : \
- COMP_EXTI_LINE_COMP6)
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx || */
- /* STM32F303x8 || STM32F334x8 || STM32F328xx */
- #if defined(STM32F302xE) || \
- defined(STM32F302xC)
- /**
- * @brief Get the specified EXTI line for a comparator instance
- * @param __INSTANCE__ specifies the COMP instance.
- * @retval value of @ref COMPEx_ExtiLineEvent
- */
- #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1 : \
- ((__INSTANCE__) == COMP2) ? COMP_EXTI_LINE_COMP2 : \
- ((__INSTANCE__) == COMP4) ? COMP_EXTI_LINE_COMP4 : \
- COMP_EXTI_LINE_COMP6)
- #endif /* STM32F302xE || */
- /* STM32F302xC */
- #if defined(STM32F303xE) || defined(STM32F398xx) || \
- defined(STM32F303xC) || defined(STM32F358xx)
- /**
- * @brief Get the specified EXTI line for a comparator instance
- * @param __INSTANCE__ specifies the COMP instance.
- * @retval value of @ref COMPEx_ExtiLineEvent
- */
- #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1 : \
- ((__INSTANCE__) == COMP2) ? COMP_EXTI_LINE_COMP2 : \
- ((__INSTANCE__) == COMP3) ? COMP_EXTI_LINE_COMP3 : \
- ((__INSTANCE__) == COMP4) ? COMP_EXTI_LINE_COMP4 : \
- ((__INSTANCE__) == COMP5) ? COMP_EXTI_LINE_COMP5 : \
- ((__INSTANCE__) == COMP6) ? COMP_EXTI_LINE_COMP6 : \
- COMP_EXTI_LINE_COMP7)
- #endif /* STM32F303xE || STM32F398xx || */
- /* STM32F303xC || STM32F358xx */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- /**
- * @brief Get the specified EXTI line for a comparator instance
- * @param __INSTANCE__ specifies the COMP instance.
- * @retval value of @ref COMPEx_ExtiLineEvent
- */
- #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1 : \
- COMP_EXTI_LINE_COMP2)
- #endif /* STM32F373xC || STM32F378xx */
- /**
- * @}
- */
- /** @defgroup COMPEx_Private_Macros_Misc COMP Extended miscellaneous private macros
- * @{
- */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- /**
- * @brief Init a comparator instance
- * @param __HANDLE__ COMP handle
- * @note The common output selection is checked versus the COMP instance to set the right output configuration
- * @retval None.
- */
- #define COMP_INIT(__HANDLE__) \
- do { \
- uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
- uint32_t compoutput = (__HANDLE__)->Init.Output & COMP_CSR_COMPxOUTSEL_MASK; \
- \
- if((__HANDLE__)->Instance == COMP2) \
- { \
- regshift = COMP_CSR_COMP2_SHIFT; \
- } \
- \
- MODIFY_REG(COMP->CSR, \
- (COMP_CSR_COMPxINSEL | COMP_CSR_COMPxNONINSEL_MASK | \
- COMP_CSR_COMPxOUTSEL | COMP_CSR_COMPxPOL | \
- COMP_CSR_COMPxHYST | COMP_CSR_COMPxMODE) << regshift, \
- ((__HANDLE__)->Init.InvertingInput | \
- (__HANDLE__)->Init.NonInvertingInput | \
- compoutput | \
- (__HANDLE__)->Init.OutputPol | \
- (__HANDLE__)->Init.Hysteresis | \
- (__HANDLE__)->Init.Mode) << regshift); \
- \
- if((__HANDLE__)->Init.WindowMode != COMP_WINDOWMODE_DISABLE) \
- { \
- COMP->CSR |= COMP_CSR_WNDWEN; \
- } \
- } while(0U)
- /**
- * @brief DeInit a comparator instance
- * @param __HANDLE__ COMP handle
- * @retval None.
- */
- #define COMP_DEINIT(__HANDLE__) \
- do { \
- uint32_t regshift = COMP_CSR_COMP1_SHIFT; \
- \
- if((__HANDLE__)->Instance == COMP2) \
- { \
- regshift = COMP_CSR_COMP2_SHIFT; \
- } \
- MODIFY_REG(COMP->CSR, \
- COMP_CSR_RESET_PARAMETERS_MASK << regshift, \
- COMP_CSR_RESET_VALUE << regshift); \
- } while(0U)
- /**
- * @brief Enable the Exti Line rising edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_RISING_ENABLE(__EXTILINE__) SET_BIT(EXTI->RTSR, (__EXTILINE__))
- /**
- * @brief Disable the Exti Line rising edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_RISING_DISABLE(__EXTILINE__) CLEAR_BIT(EXTI->RTSR, (__EXTILINE__))
- /**
- * @brief Enable the Exti Line falling edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_FALLING_ENABLE(__EXTILINE__) SET_BIT(EXTI->FTSR, (__EXTILINE__))
- /**
- * @brief Disable the Exti Line falling edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_FALLING_DISABLE(__EXTILINE__) CLEAR_BIT(EXTI->FTSR, (__EXTILINE__))
- /**
- * @brief Enable the COMP Exti Line interrupt generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_ENABLE_IT(__EXTILINE__) SET_BIT(EXTI->IMR, (__EXTILINE__))
- /**
- * @brief Disable the COMP Exti Line interrupt generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_DISABLE_IT(__EXTILINE__) CLEAR_BIT(EXTI->IMR, (__EXTILINE__))
- /**
- * @brief Enable the COMP Exti Line event generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_ENABLE_EVENT(__EXTILINE__) SET_BIT(EXTI->EMR, (__EXTILINE__))
- /**
- * @brief Disable the COMP Exti Line event generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_DISABLE_EVENT(__EXTILINE__) CLEAR_BIT(EXTI->EMR, (__EXTILINE__))
- /**
- * @brief Check whether the specified EXTI line flag is set or not.
- * @param __FLAG__ specifies the COMP Exti sources to be checked.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval The state of __FLAG__ (SET or RESET).
- */
- #define COMP_EXTI_GET_FLAG(__FLAG__) READ_BIT(EXTI->PR, (__FLAG__))
- /**
- * @brief Clear the COMP Exti flags.
- * @param __FLAG__ specifies the COMP Exti sources to be cleared.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_CLEAR_FLAG(__FLAG__) WRITE_REG(EXTI->PR, (__FLAG__))
- #else /* STM32F30x, STM32F32xx, STM32F35x, STM32F39x, STM32F33x */
- /**
- * @brief Init a comparator instance
- * @param __HANDLE__ COMP handle
- * @retval None.
- */
- #define COMP_INIT(__HANDLE__) \
- do { \
- __IO uint32_t csrreg = 0U; \
- \
- csrreg = READ_REG((__HANDLE__)->Instance->CSR); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxINSEL_MASK, (__HANDLE__)->Init.InvertingInput); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxNONINSEL_MASK, (__HANDLE__)->Init.NonInvertingInput); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxBLANKING_MASK, (__HANDLE__)->Init.BlankingSrce); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxOUTSEL_MASK, (__HANDLE__)->Init.Output & COMP_CSR_COMPxOUTSEL_MASK); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxPOL_MASK, (__HANDLE__)->Init.OutputPol); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxHYST_MASK, (__HANDLE__)->Init.Hysteresis); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxMODE_MASK, (__HANDLE__)->Init.Mode); \
- MODIFY_REG(csrreg, COMP_CSR_COMPxWNDWEN_MASK, (__HANDLE__)->Init.WindowMode); \
- WRITE_REG((__HANDLE__)->Instance->CSR, csrreg); \
- } while(0U)
- /**
- * @brief DeInit a comparator instance
- * @param __HANDLE__ COMP handle
- * @retval None.
- */
- #define COMP_DEINIT(__HANDLE__) WRITE_REG((__HANDLE__)->Instance->CSR, COMP_CSR_RESET_VALUE)
- /**
- * @brief Enable the Exti Line rising edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_RISING_ENABLE(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? SET_BIT(EXTI->RTSR2, (__EXTILINE__)) : SET_BIT(EXTI->RTSR, (__EXTILINE__)))
- /**
- * @brief Disable the Exti Line rising edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_RISING_DISABLE(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? CLEAR_BIT(EXTI->RTSR2, (__EXTILINE__)) : CLEAR_BIT(EXTI->RTSR, (__EXTILINE__)))
- /**
- * @brief Enable the Exti Line falling edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_FALLING_ENABLE(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? SET_BIT(EXTI->FTSR2, (__EXTILINE__)) : SET_BIT(EXTI->FTSR, (__EXTILINE__)))
- /**
- * @brief Disable the Exti Line falling edge trigger.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_FALLING_DISABLE(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? CLEAR_BIT(EXTI->FTSR2, (__EXTILINE__)) : CLEAR_BIT(EXTI->FTSR, (__EXTILINE__)))
- /**
- * @brief Enable the COMP Exti Line interrupt generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_ENABLE_IT(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? SET_BIT(EXTI->IMR2, (__EXTILINE__)) : SET_BIT(EXTI->IMR, (__EXTILINE__)))
- /**
- * @brief Disable the COMP Exti Line interrupt generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_DISABLE_IT(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? CLEAR_BIT(EXTI->IMR2, (__EXTILINE__)) : CLEAR_BIT(EXTI->IMR, (__EXTILINE__)))
- /**
- * @brief Enable the COMP Exti Line event generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be enabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_ENABLE_EVENT(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? SET_BIT(EXTI->EMR2, (__EXTILINE__)) : SET_BIT(EXTI->EMR, (__EXTILINE__)))
- /**
- * @brief Disable the COMP Exti Line event generation.
- * @param __EXTILINE__ specifies the COMP Exti sources to be disabled.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_DISABLE_EVENT(__EXTILINE__) ((((__EXTILINE__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? CLEAR_BIT(EXTI->EMR2, (__EXTILINE__)) : CLEAR_BIT(EXTI->EMR, (__EXTILINE__)))
- /**
- * @brief Check whether the specified EXTI line flag is set or not.
- * @param __FLAG__ specifies the COMP Exti sources to be checked.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval The state of __FLAG__ (SET or RESET).
- */
- #define COMP_EXTI_GET_FLAG(__FLAG__) ((((__FLAG__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? READ_BIT(EXTI->PR2, (__FLAG__)) : READ_BIT(EXTI->PR, (__FLAG__)))
- /**
- * @brief Clear the COMP Exti flags.
- * @param __FLAG__ specifies the COMP Exti sources to be cleared.
- * This parameter can be a value of @ref COMPEx_ExtiLineEvent
- * @retval None.
- */
- #define COMP_EXTI_CLEAR_FLAG(__FLAG__) ((((__FLAG__) & COMP_EXTI_LINE_REG2_MASK) != RESET) ? WRITE_REG(EXTI->PR2, (__FLAG__)) : WRITE_REG(EXTI->PR, (__FLAG__)))
- #endif /* STM32F373xC || STM32F378xx */
- /**
- * @brief Manage inverting input comparator inverting input connected to a GPIO
- * for STM32F302x, STM32F32xx, STM32F33x.
- * - On devices STM32F302x, STM32F32xx, STM32F33x, there is
- * only 1 comparator inverting input connected to a GPIO.
- * Legacy definition of literal COMP_INVERTINGINPUT_IO1
- * was initially the only selection, but depending on
- * comparator instance it corresponds to COMP_INVERTINGINPUT_IO2
- * (for instances COMP4, COMP6).
- * Since, COMP_INVERTINGINPUT_IO2 has been created and this macro
- * selects the correct literal COMP_INVERTINGINPUT_IOx in function
- * of comparator instance.
- * - On other STM32F3 devices, this macro performs no action.
- * @param __COMP_INSTANCE__ COMP instance
- * @param __INVERTINGINPUT__ COMP inverting input
- * @retval None.
- */
- #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- #define COMP_INVERTINGINPUT_SELECTION(__COMP_INSTANCE__, __INVERTINGINPUT__) \
- (((__INVERTINGINPUT__) != COMP_INVERTINGINPUT_IO1) \
- ? ( \
- (__INVERTINGINPUT__) \
- ) \
- : \
- (((__COMP_INSTANCE__) == COMP2) \
- ? ( \
- (COMP_INVERTINGINPUT_IO1) \
- ) \
- : \
- ( \
- (COMP_INVERTINGINPUT_IO2) \
- ) \
- ) \
- )
- #else
- #define COMP_INVERTINGINPUT_SELECTION(__COMP_INSTANCE__, __INVERTINGINPUT__) \
- (__INVERTINGINPUT__)
- #endif
- /**
- * @}
- */
- /** @defgroup COMPEx_IS_COMP_Definitions COMP Extended Private macros to check input parameters
- * @{
- */
- #if defined(STM32F301x8) || defined(STM32F302x8) || defined(STM32F318xx)
- #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO1))
- #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
- /* STM32F301x6/x8, STM32F302x6/x8, STM32F318xx devices comparator instances non inverting source values */
- #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
- ((((INSTANCE) == COMP2) && \
- (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
- || \
- (((INPUT) == COMP_NONINVERTINGINPUT_IO1)))
- #define IS_COMP_WINDOWMODE(WINDOWMODE) ((WINDOWMODE) == (WINDOWMODE)) /*!< Not available: check always true */
- #define IS_COMP_MODE(MODE) ((MODE) == (MODE)) /*!< Not available: check always true */
- #define IS_COMP_HYSTERESIS(HYSTERESIS) ((HYSTERESIS) == (HYSTERESIS)) /*!< Not available: check always true */
- #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))
- #define IS_COMP_OUTPUT_INSTANCE(INSTANCE, OUTPUT) \
- ((((INSTANCE) == COMP2) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))))
- #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
- /* STM32F301x6/x8, STM32F302x6/x8, STM32F303x6/x8, STM32F334x4/6U/8U, STM32F318xx/STM32F328xx devices comparator instances blanking source values */
- #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
- ((((INSTANCE) == COMP2) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
- #endif /* STM32F301x8 || STM32F302x8 || STM32F318xx */
- #if defined(STM32F303x8) || defined(STM32F334x8) || defined(STM32F328xx)
- #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH2) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO2) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC2_CH1))
- /*!< Non inverting input not available */
- #define IS_COMP_NONINVERTINGINPUT(INPUT) ((INPUT) == (INPUT)) /*!< Multiple selection not available: check always true */
- #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) ((INPUT) == (INPUT)) /*!< Multiple selection not available: check always true */
- #define IS_COMP_WINDOWMODE(WINDOWMODE) ((WINDOWMODE) == (WINDOWMODE)) /*!< Not available: check always true */
- #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))
- #define IS_COMP_OUTPUT_INSTANCE(INSTANCE, OUTPUT) \
- ((((INSTANCE) == COMP2) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))))
- #define IS_COMP_MODE(MODE) ((MODE) == (MODE)) /*!< Not available: check always true */
- #define IS_COMP_HYSTERESIS(HYSTERESIS) ((HYSTERESIS) == (HYSTERESIS)) /*!< Not available: check always true */
- #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
- /* STM32F301x6/x8, STM32F302x6/x8, STM32F303x6/x8, STM32F334x4/6U/8U, STM32F318xx/STM32F328xx devices comparator instances blanking source values */
- #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
- ((((INSTANCE) == COMP2) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
- #endif /* STM32F303x8 || STM32F334x8 || STM32F328xx */
- #if defined(STM32F302xC) || defined(STM32F303xC) || defined(STM32F358xx)
- #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH2) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO2))
- #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_IO2) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
- /* STM32F302xB/xC, STM32F303xB/xC, STM32F358xx devices comparator instances non inverting source values */
- #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
- ((((INSTANCE) == COMP1) && \
- (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_IO2) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
- || \
- ((((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_IO2))))
- #define IS_COMP_WINDOWMODE(WINDOWMODE) (((WINDOWMODE) == COMP_WINDOWMODE_DISABLE) || \
- ((WINDOWMODE) == COMP_WINDOWMODE_ENABLE))
- #define IS_COMP_MODE(MODE) (((MODE) == COMP_MODE_HIGHSPEED) || \
- ((MODE) == COMP_MODE_MEDIUMSPEED) || \
- ((MODE) == COMP_MODE_LOWPOWER) || \
- ((MODE) == COMP_MODE_ULTRALOWPOWER))
- #define IS_COMP_HYSTERESIS(HYSTERESIS) (((HYSTERESIS) == COMP_HYSTERESIS_NONE) || \
- ((HYSTERESIS) == COMP_HYSTERESIS_LOW) || \
- ((HYSTERESIS) == COMP_HYSTERESIS_MEDIUM) || \
- ((HYSTERESIS) == COMP_HYSTERESIS_HIGH))
- #if defined(STM32F302xC)
- #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4))
- #define IS_COMP_OUTPUT_INSTANCE(INSTANCE, OUTPUT) \
- ((((INSTANCE) == COMP1) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP2) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))))
- #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
- /* STM32F302xB/STM32F302xC/STM32F302xE devices comparator instances blanking source values */
- #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
- (((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
- #endif /* STM32F302xC */
- #if defined(STM32F303xC) || defined(STM32F358xx)
- #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17OCREFCLR))
- #define IS_COMP_OUTPUT_INSTANCE(INSTANCE, OUTPUT) \
- ((((INSTANCE) == COMP1) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP2) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP3) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15BKIN))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR))) \
- || \
- (((INSTANCE) == COMP5) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17IC1))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))) \
- || \
- (((INSTANCE) == COMP7) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17OCREFCLR))))
- #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
- /* STM32F303xE/STM32F398xx/STM32F303xB/STM32F303xC/STM32F358xx devices comparator instances blanking source values */
- #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
- (((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP3) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
- || \
- (((INSTANCE) == COMP5) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))) \
- || \
- (((INSTANCE) == COMP7) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
-
- #endif /* STM32F303xC || STM32F358xx */
- #endif /* STM32F302xC || STM32F303xC || STM32F358xx */
- #if defined(STM32F302xE) || defined(STM32F303xE) || defined(STM32F398xx)
- #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH2) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO2))
- #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
- /* STM32F302xE/STM32F303xE/STM32F398xx devices comparator instances non inverting source values */
- #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
- ((((INSTANCE) == COMP1) && \
- (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
- || \
- (((INPUT) == COMP_NONINVERTINGINPUT_IO1)))
- #define IS_COMP_WINDOWMODE(WINDOWMODE) ((WINDOWMODE) == (WINDOWMODE)) /*!< Not available: check always true */
- #define IS_COMP_MODE(MODE) ((MODE) == (MODE)) /*!< Not available: check always true */
- #define IS_COMP_HYSTERESIS(HYSTERESIS) ((HYSTERESIS) == (HYSTERESIS)) /*!< Not available: check always true */
- #if defined(STM32F302xE)
- #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4))
- #define IS_COMP_OUTPUT_INSTANCE(INSTANCE, OUTPUT) \
- ((((INSTANCE) == COMP1) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP2) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_BRK2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))))
- #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
- /* STM32F302xB/STM32F302xC/STM32F302xE devices comparator instances blanking source values */
- #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
- (((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
- #endif /* STM32F302xE */
- #if defined(STM32F303xE) || defined(STM32F398xx)
- #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17OCREFCLR))
- #define IS_COMP_OUTPUT_INSTANCE(INSTANCE, OUTPUT) \
- ((((INSTANCE) == COMP1) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR))) \
- || \
- (((INSTANCE) == COMP2) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20OCREFCLR))) \
- || \
- (((INSTANCE) == COMP3) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15BKIN))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15OCREFCLR))) \
- || \
- (((INSTANCE) == COMP5) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17IC1))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP6_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16OCREFCLR))) \
- || \
- (((INSTANCE) == COMP7) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM8OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1BKIN2_TIM8BKIN2_TIM20BKIN2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM1IC2) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC3) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM17OCREFCLR))))
- #define IS_COMP_BLANKINGSRCE(SOURCE) (((SOURCE) == COMP_BLANKINGSRCE_NONE) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC3) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC1) || \
- ((SOURCE) == COMP_BLANKINGSRCE_TIM15OC2))
- /* STM32F303xE/STM32F398xx/STM32F303xB/STM32F303xC/STM32F358xx devices comparator instances blanking source values */
- #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
- (((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC3) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP3) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4))) \
- || \
- (((INSTANCE) == COMP4) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC1))) \
- || \
- (((INSTANCE) == COMP5) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM3OC3))) \
- || \
- (((INSTANCE) == COMP6) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM2OC4) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))) \
- || \
- (((INSTANCE) == COMP7) && \
- (((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM1OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM8OC5) || \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_TIM15OC2))))
-
- #endif /* STM32F303xE || STM32F398xx */
- #endif /* STM32F302xE || STM32F303xE || STM32F398xx */
- #if defined(STM32F373xC) || defined(STM32F378xx)
- #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH1) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC1_CH2) || \
- ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_INVERTINGINPUT_DAC2_CH1))
- #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))
- /* STM32F373xB/xC, STM32F378xx devices comparator instances non inverting source values */
- #define IS_COMP_NONINVERTINGINPUT_INSTANCE(INSTANCE, INPUT) \
- ((((INSTANCE) == COMP1) && \
- (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
- ((INPUT) == COMP_NONINVERTINGINPUT_DAC1SWITCHCLOSED))) \
- || \
- (((INPUT) == COMP_NONINVERTINGINPUT_IO1)))
- #define IS_COMP_WINDOWMODE(WINDOWMODE) (((WINDOWMODE) == COMP_WINDOWMODE_DISABLE) || \
- ((WINDOWMODE) == COMP_WINDOWMODE_ENABLE))
- #define IS_COMP_MODE(MODE) (((MODE) == COMP_MODE_HIGHSPEED) || \
- ((MODE) == COMP_MODE_MEDIUMSPEED) || \
- ((MODE) == COMP_MODE_LOWPOWER) || \
- ((MODE) == COMP_MODE_ULTRALOWPOWER))
- #define IS_COMP_HYSTERESIS(HYSTERESIS) (((HYSTERESIS) == COMP_HYSTERESIS_NONE) || \
- ((HYSTERESIS) == COMP_HYSTERESIS_LOW) || \
- ((HYSTERESIS) == COMP_HYSTERESIS_MEDIUM) || \
- ((HYSTERESIS) == COMP_HYSTERESIS_HIGH))
- #define IS_COMP_OUTPUT(OUTPUT) (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP1_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_COMP1_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP2_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_COMP2_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM5IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM5OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15BKIN) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16BKIN))
- #define IS_COMP_OUTPUT_INSTANCE(INSTANCE, OUTPUT) \
- ((((INSTANCE) == COMP1) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP1_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_COMP1_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM5IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM5OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM15BKIN))) \
- || \
- (((INSTANCE) == COMP2) && \
- (((OUTPUT) == COMP_OUTPUT_NONE) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2IC4) || \
- ((OUTPUT) == COMP_OUTPUT_TIM2OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_COMP2_TIM3IC1) || \
- ((OUTPUT) == COMP_OUTPUT_COMP2_TIM3OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4IC1) || \
- ((OUTPUT) == COMP_OUTPUT_TIM4OCREFCLR) || \
- ((OUTPUT) == COMP_OUTPUT_TIM16BKIN))))
- #define IS_COMP_BLANKINGSRCE(SOURCE) ((SOURCE) == (SOURCE)) /*!< Not available: check always true */
- /* STM32F373xB/STM32F373xC/STM32F378xx devices comparator instances blanking source values */
- #define IS_COMP_BLANKINGSRCE_INSTANCE(INSTANCE, BLANKINGSRCE) \
- ((((INSTANCE) == COMP1) || ((INSTANCE) == COMP2)) && \
- ((BLANKINGSRCE) == COMP_BLANKINGSRCE_NONE))
- #endif /* STM32F373xC || STM32F378xx */
- /**
- * @}
- */
- /**
- * @}
- */
- /**
- * @}
- */
- /**
- * @}
- */
- #ifdef __cplusplus
- }
- #endif
- #endif /* __STM32F3xx_HAL_COMP_EX_H */
|