@@ -228,8 +228,10 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
228228/* Note: For the characteristics of comparator power modes */
229229/* (propagation delay and power consumption), */
230230/* refer to device datasheet. */
231- #define COMP_POWERMODE_HIGHSPEED (0x00000000UL) /*!< High Speed */
232- #define COMP_POWERMODE_MEDIUMSPEED (COMP_CSR_PWRMODE_0) /*!< Medium Speed */
231+ #define COMP_POWERMODE_HIGHSPEED (0x00000000UL) /*!< High speed */
232+ #define COMP_POWERMODE_INTERMSPEED (COMP_CSR_PWRMODE_0) /*!< Intermediate speed */
233+ #define COMP_POWERMODE_MEDIUMSPEED (COMP_CSR_PWRMODE_1) /*!< Medium speed */
234+ #define COMP_POWERMODE_ULTRALOWPOWER (COMP_CSR_PWRMODE_1 | COMP_CSR_PWRMODE_0) /*!< Ultra-low power */
233235/**
234236 * @}
235237 */
@@ -418,16 +420,16 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
418420 * @brief Enable the COMP1 EXTI line rising & falling edge trigger.
419421 * @retval None
420422 */
421- #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
422- LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
423- LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1);\
423+ #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
424+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
425+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \
424426 } while(0)
425427
426428/**
427429 * @brief Disable the COMP1 EXTI line rising & falling edge trigger.
428430 * @retval None
429431 */
430- #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
432+ #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
431433 LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
432434 LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1);\
433435 } while(0)
@@ -514,17 +516,17 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
514516 * @brief Enable the COMP2 EXTI line rising & falling edge trigger.
515517 * @retval None
516518 */
517- #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
518- LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2);\
519- LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2);\
519+ #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
520+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
521+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
520522 } while(0)
521523
522524/**
523525 * @brief Disable the COMP2 EXTI line rising & falling edge trigger.
524526 * @retval None
525527 */
526- #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
527- LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2);\
528+ #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
529+ LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
528530 LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2);\
529531 } while(0)
530532
@@ -662,18 +664,20 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
662664 ((__WINDOWOUTPUT__) == COMP_WINDOWOUTPUT_BOTH) )
663665
664666#define IS_COMP_POWERMODE (__POWERMODE__ ) (((__POWERMODE__) == COMP_POWERMODE_HIGHSPEED) || \
665- ((__POWERMODE__) == COMP_POWERMODE_MEDIUMSPEED) )
667+ ((__POWERMODE__) == COMP_POWERMODE_INTERMSPEED) || \
668+ ((__POWERMODE__) == COMP_POWERMODE_MEDIUMSPEED) || \
669+ ((__POWERMODE__) == COMP_POWERMODE_ULTRALOWPOWER) )
666670
667671#define IS_COMP_INPUT_PLUS (__COMP_INSTANCE__ , __INPUT_PLUS__ ) ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1)
668672
669673/* Note: On this STM32 series, comparator input minus parameters are */
670674/* the same on all COMP instances. */
671675/* However, comparator instance kept as macro parameter for */
672- /* compatibility with other STM32 families. */
673- #define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) ||\
674- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) ||\
675- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) ||\
676- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) ||\
676+ /* compatibility with other STM32 series. */
677+ #define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
678+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
679+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
680+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \
677681 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1))
678682
679683#define IS_COMP_HYSTERESIS (__HYSTERESIS__ ) (((__HYSTERESIS__) == COMP_HYSTERESIS_NONE) || \
@@ -685,14 +689,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
685689 ((__POL__) == COMP_OUTPUTPOL_INVERTED))
686690
687691#define IS_COMP_BLANKINGSRC_INSTANCE (__INSTANCE__ , __OUTPUT_BLANKING_SOURCE__ ) \
688- ((((__INSTANCE__) == COMP1) && \
692+ ((((__INSTANCE__) == COMP1) && \
689693 (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \
690694 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
691695 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
692696 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1))) \
693- || \
694- (((__INSTANCE__) == COMP2) && \
695- (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \
697+ || \
698+ (((__INSTANCE__) == COMP2) && \
699+ (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \
696700 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2))))
697701
698702
0 commit comments