20#ifndef __STM32H7xx_LL_COMP_H
21#define __STM32H7xx_LL_COMP_H
34#if defined (COMP1) || defined (COMP2)
50#define LL_COMP_OUTPUT_LEVEL_BITOFFSET_POS (30U)
65#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
91 uint32_t InputHysteresis;
96 uint32_t OutputPolarity;
101 uint32_t OutputBlankingSource;
106} LL_COMP_InitTypeDef;
123#define LL_COMP_WINDOWMODE_DISABLE (0x00000000UL)
124#define LL_COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON (COMP_CFGRx_WINMODE)
133#define LL_COMP_POWERMODE_HIGHSPEED (0x00000000UL)
134#define LL_COMP_POWERMODE_MEDIUMSPEED (COMP_CFGRx_PWRMODE_0)
135#define LL_COMP_POWERMODE_ULTRALOWPOWER (COMP_CFGRx_PWRMODE_1 | COMP_CFGRx_PWRMODE_0)
144#define LL_COMP_INPUT_PLUS_IO1 (0x00000000UL)
145#define LL_COMP_INPUT_PLUS_IO2 (COMP_CFGRx_INPSEL)
146#if defined (COMP_CFGRx_INP2SEL)
147#define LL_COMP_INPUT_PLUS_DAC2_CH1 (COMP_CFGRx_INP2SEL)
157#define LL_COMP_INPUT_MINUS_1_4VREFINT ( COMP_CFGRx_SCALEN | COMP_CFGRx_BRGEN)
158#define LL_COMP_INPUT_MINUS_1_2VREFINT ( COMP_CFGRx_INMSEL_0 | COMP_CFGRx_SCALEN | COMP_CFGRx_BRGEN)
159#define LL_COMP_INPUT_MINUS_3_4VREFINT ( COMP_CFGRx_INMSEL_1 | COMP_CFGRx_SCALEN | COMP_CFGRx_BRGEN)
160#define LL_COMP_INPUT_MINUS_VREFINT ( COMP_CFGRx_INMSEL_1 | COMP_CFGRx_INMSEL_0 | COMP_CFGRx_SCALEN )
161#define LL_COMP_INPUT_MINUS_DAC1_CH1 ( COMP_CFGRx_INMSEL_2 )
162#define LL_COMP_INPUT_MINUS_DAC1_CH2 ( COMP_CFGRx_INMSEL_2 | COMP_CFGRx_INMSEL_0 )
163#define LL_COMP_INPUT_MINUS_IO1 ( COMP_CFGRx_INMSEL_2 | COMP_CFGRx_INMSEL_1 )
164#define LL_COMP_INPUT_MINUS_IO2 ( COMP_CFGRx_INMSEL_2 | COMP_CFGRx_INMSEL_1 | COMP_CFGRx_INMSEL_0 )
165#if defined (COMP_CFGRx_INMSEL_3)
166#define LL_COMP_INPUT_MINUS_TPSENS_DAC2CH1 (COMP_CFGRx_INMSEL_3 )
167#define LL_COMP_INPUT_MINUS_VBAT_VDDAP (COMP_CFGRx_INMSEL_3 | COMP_CFGRx_INMSEL_0 )
177#define LL_COMP_HYSTERESIS_NONE (0x00000000UL)
178#define LL_COMP_HYSTERESIS_LOW ( COMP_CFGRx_HYST_0)
179#define LL_COMP_HYSTERESIS_MEDIUM (COMP_CFGRx_HYST_1 )
180#define LL_COMP_HYSTERESIS_HIGH (COMP_CFGRx_HYST_1 | COMP_CFGRx_HYST_0)
189#define LL_COMP_OUTPUTPOL_NONINVERTED (0x00000000UL)
190#define LL_COMP_OUTPUTPOL_INVERTED (COMP_CFGRx_POLARITY)
199#define LL_COMP_BLANKINGSRC_NONE (0x00000000UL)
200#define LL_COMP_BLANKINGSRC_TIM1_OC5 (COMP_CFGRx_BLANKING_0)
201#define LL_COMP_BLANKINGSRC_TIM2_OC3 (COMP_CFGRx_BLANKING_1)
202#define LL_COMP_BLANKINGSRC_TIM3_OC3 (COMP_CFGRx_BLANKING_0 |COMP_CFGRx_BLANKING_1)
203#define LL_COMP_BLANKINGSRC_TIM3_OC4 (COMP_CFGRx_BLANKING_2)
204#define LL_COMP_BLANKINGSRC_TIM8_OC5 (COMP_CFGRx_BLANKING_2|COMP_CFGRx_BLANKING_0)
205#define LL_COMP_BLANKINGSRC_TIM15_OC1 (COMP_CFGRx_BLANKING_2|COMP_CFGRx_BLANKING_1)
214#define LL_COMP_OUTPUT_LEVEL_LOW (0x00000000UL)
215#define LL_COMP_OUTPUT_LEVEL_HIGH (0x00000001UL)
223#define LL_COMP_AF_PA6 COMP_OR_AFOPA6
224#define LL_COMP_AF_PA8 COMP_OR_AFOPA8
225#define LL_COMP_AF_PB12 COMP_OR_AFOPB12
226#define LL_COMP_AF_PE6 COMP_OR_AFOPE6
227#define LL_COMP_AF_PE15 COMP_OR_AFOPE15
228#define LL_COMP_AF_PG2 COMP_OR_AFOPG2
229#define LL_COMP_AF_PG3 COMP_OR_AFOPG3
230#define LL_COMP_AF_PG4 COMP_OR_AFOPG4
231#define LL_COMP_AF_PI1 COMP_OR_AFOPI1
232#define LL_COMP_AF_PI4 COMP_OR_AFOPI4
233#define LL_COMP_AF_PK2 COMP_OR_AFOPK2
252#define LL_COMP_DELAY_STARTUP_US ( 80UL)
260#define LL_COMP_DELAY_VOLTAGE_SCALER_STAB_US ( 200UL)
287#define LL_COMP_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
295#define LL_COMP_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
314#define __LL_COMP_COMMON_INSTANCE(__COMPx__) \
347__STATIC_INLINE
void LL_COMP_SetCommonWindowMode(
COMP_Common_TypeDef *COMPxy_COMMON, uint32_t WindowMode)
388__STATIC_INLINE
void LL_COMP_SetPowerMode(
COMP_TypeDef *COMPx, uint32_t PowerMode)
402__STATIC_INLINE uint32_t LL_COMP_GetPowerMode(
COMP_TypeDef *COMPx)
455__STATIC_INLINE
void LL_COMP_ConfigInputs(
COMP_TypeDef *COMPx, uint32_t InputMinus, uint32_t InputPlus)
457#if defined (COMP_CFGRx_INP2SEL)
458 MODIFY_REG(COMPx->
CFGR,
462 InputMinus | InputPlus);
464 MODIFY_REG(COMPx->
CFGR,
467 InputMinus | InputPlus);
484__STATIC_INLINE
void LL_COMP_SetInputPlus(
COMP_TypeDef *COMPx, uint32_t InputPlus)
486#if defined (COMP_CFGRx_INP2SEL)
505__STATIC_INLINE uint32_t LL_COMP_GetInputPlus(
COMP_TypeDef *COMPx)
507#if defined (COMP_CFGRx_INP2SEL)
548__STATIC_INLINE
void LL_COMP_SetInputMinus(
COMP_TypeDef *COMPx, uint32_t InputMinus)
574__STATIC_INLINE uint32_t LL_COMP_GetInputMinus(
COMP_TypeDef *COMPx)
590__STATIC_INLINE
void LL_COMP_SetInputHysteresis(
COMP_TypeDef *COMPx, uint32_t InputHysteresis)
605__STATIC_INLINE uint32_t LL_COMP_GetInputHysteresis(
COMP_TypeDef *COMPx)
628__STATIC_INLINE
void LL_COMP_SetOutputPolarity(
COMP_TypeDef *COMPx, uint32_t OutputPolarity)
641__STATIC_INLINE uint32_t LL_COMP_GetOutputPolarity(
COMP_TypeDef *COMPx)
664__STATIC_INLINE
void LL_COMP_SetOutputBlankingSource(
COMP_TypeDef *COMPx, uint32_t BlankingSource)
686__STATIC_INLINE uint32_t LL_COMP_GetOutputBlankingSource(
COMP_TypeDef *COMPx)
711__STATIC_INLINE
void LL_COMP_SetOutputAlternateFunction(
COMP_TypeDef *COMPx, uint32_t CompAFx)
713 MODIFY_REG(COMP12->OR, 0x7FFUL, (COMPx == COMP1) ? ((~CompAFx) & 0x7FFUL) : CompAFx);
732__STATIC_INLINE uint32_t LL_COMP_GetOutputAlternateFunction(
COMP_TypeDef *COMPx )
734 return (uint32_t) ((COMPx == COMP1) ? ((~COMP12->OR) & 0x7FFUL) : (COMP12->OR & 0x7FFUL));
766__STATIC_INLINE
void LL_COMP_Disable(
COMP_TypeDef *COMPx)
778__STATIC_INLINE uint32_t LL_COMP_IsEnabled(
COMP_TypeDef *COMPx)
805__STATIC_INLINE uint32_t LL_COMP_IsLocked(
COMP_TypeDef *COMPx)
830__STATIC_INLINE uint32_t LL_COMP_ReadOutputLevel(
COMP_TypeDef *COMPx)
834 return (uint32_t)(READ_BIT(COMP12->SR, COMP_SR_C1VAL));
838 return (uint32_t)((READ_BIT(COMP12->SR, COMP_SR_C2VAL))>> 1);
857__STATIC_INLINE uint32_t LL_COMP_IsActiveFlag_OutputTrig(
COMP_TypeDef *COMPx)
861 return ((READ_BIT(COMP12->SR, COMP_SR_C1IF) == (COMP_SR_C1IF)) ? 1UL : 0UL);
865 return ((READ_BIT(COMP12->SR, COMP_SR_C2IF) == (COMP_SR_C2IF)) ? 1UL : 0UL);
875__STATIC_INLINE
void LL_COMP_ClearFlag_OutputTrig(
COMP_TypeDef *COMPx)
879 SET_BIT(COMP12->ICFR, COMP_ICFR_C1IF);
883 SET_BIT(COMP12->ICFR, COMP_ICFR_C2IF);
902__STATIC_INLINE
void LL_COMP_EnableIT_OutputTrig(
COMP_TypeDef *COMPx)
913__STATIC_INLINE
void LL_COMP_DisableIT_OutputTrig(
COMP_TypeDef *COMPx)
924__STATIC_INLINE uint32_t LL_COMP_IsEnabledIT_OutputTrig(
COMP_TypeDef *COMPx)
933#if defined(USE_FULL_LL_DRIVER) || defined(__rtems__)
940ErrorStatus LL_COMP_Init(
COMP_TypeDef *COMPx, LL_COMP_InitTypeDef *COMP_InitStruct);
941void LL_COMP_StructInit(LL_COMP_InitTypeDef *COMP_InitStruct);
#define COMP_CFGRx_PWRMODE
Definition: stm32h723xx.h:20876
#define COMP_CFGRx_INPSEL
Definition: stm32h723xx.h:20887
#define COMP_CFGRx_SCALEN
Definition: stm32h723xx.h:20859
#define COMP_CFGRx_INP2SEL
Definition: stm32h7a3xx.h:19210
#define COMP_CFGRx_INMSEL
Definition: stm32h723xx.h:20881
#define COMP_CFGRx_WINMODE
Definition: stm32h723xx.h:20865
#define COMP_CFGRx_LOCK
Definition: stm32h723xx.h:20896
#define COMP_CFGRx_BLANKING
Definition: stm32h723xx.h:20890
#define COMP_CFGRx_EN
Definition: stm32h723xx.h:20853
#define COMP_CFGRx_BRGEN
Definition: stm32h723xx.h:20856
#define COMP_CFGRx_POLARITY
Definition: stm32h723xx.h:20862
#define COMP_CFGRx_ITEN
Definition: stm32h723xx.h:20868
#define COMP_CFGRx_HYST
Definition: stm32h723xx.h:20871
CMSIS STM32H7xx Device Peripheral Access Layer Header File.
Definition: stm32h723xx.h:1588
__IO uint32_t CFGR
Definition: stm32h723xx.h:1589
Definition: stm32h723xx.h:1583
__IO uint32_t CFGR
Definition: stm32h723xx.h:1584