@@ -50,7 +50,8 @@ typedef struct
5050
5151 uint32_t WindowMode ; /*!< Set window mode of a pair of comparators instances
5252 (2 consecutive instances odd and even COMP<x> and COMP<x+1>).
53- Note: HAL COMP driver allows to set window mode from any COMP instance of the pair of COMP instances composing window mode.
53+ Note: HAL COMP driver allows to set window mode from any COMP
54+ instance of the pair of COMP instances composing window mode.
5455 This parameter can be a value of @ref COMP_WindowMode */
5556
5657 uint32_t Mode ; /*!< Set comparator operating mode to adjust power and speed.
@@ -151,15 +152,25 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
151152 * @}
152153 */
153154
155+
154156/** @defgroup COMP_WindowMode COMP Window Mode
155157 * @{
156158 */
157- #define COMP_WINDOWMODE_DISABLE (0x00000000UL) /*!< Window mode disable: Comparators instances pair COMP1 and COMP2 are independent */
158- #define COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON (COMP_CSR_WINMODE) /*!< Window mode enable: Comparators instances pair COMP1 and COMP2 have their input plus connected together. The common input is COMP1 input plus (COMP2 input plus is no more accessible). */
159+ #define COMP_WINDOWMODE_DISABLE (0x00000000UL) /*!< Window mode disable: Comparators
160+ instances pair COMP1 and COMP2 are
161+ independent */
162+ #define COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON (COMP_CSR_WINMODE) /*!< Window mode enable: Comparators instances
163+ pair COMP1 and COMP2 have their input
164+ plus connected together.
165+ The common input is COMP1 input plus
166+ (COMP2 input plus is no more accessible).
167+ */
159168/**
160169 * @}
161170 */
162171
172+
173+
163174/** @defgroup COMP_PowerMode COMP power mode
164175 * @{
165176 */
@@ -302,14 +313,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
302313 * @param __HANDLE__ COMP handle
303314 * @retval None
304315 */
305- #define __HAL_COMP_ENABLE (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
316+ #define __HAL_COMP_ENABLE (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
306317
307318/**
308319 * @brief Disable the specified comparator.
309320 * @param __HANDLE__ COMP handle
310321 * @retval None
311322 */
312- #define __HAL_COMP_DISABLE (__HANDLE__ ) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
323+ #define __HAL_COMP_DISABLE (__HANDLE__ ) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
313324
314325/**
315326 * @brief Lock the specified comparator configuration.
@@ -320,14 +331,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
320331 * @param __HANDLE__ COMP handle
321332 * @retval None
322333 */
323- #define __HAL_COMP_LOCK (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK)
334+ #define __HAL_COMP_LOCK (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK)
324335
325336/**
326337 * @brief Check whether the specified comparator is locked.
327338 * @param __HANDLE__ COMP handle
328339 * @retval Value 0 if COMP instance is not locked, value 1 if COMP instance is locked
329340 */
330- #define __HAL_COMP_IS_LOCKED (__HANDLE__ ) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK)
341+ #define __HAL_COMP_IS_LOCKED (__HANDLE__ ) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK)
331342
332343/**
333344 * @}
@@ -336,7 +347,6 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
336347/** @defgroup COMP_Exti_Management COMP external interrupt line management
337348 * @{
338349 */
339-
340350/**
341351 * @brief Enable the COMP1 EXTI line rising edge trigger.
342352 * @retval None
@@ -365,19 +375,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
365375 * @brief Enable the COMP1 EXTI line rising & falling edge trigger.
366376 * @retval None
367377 */
368- #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
369- LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
370- LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \
371- } while(0)
378+ #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
379+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
380+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \
381+ } while(0)
372382
373383/**
374384 * @brief Disable the COMP1 EXTI line rising & falling edge trigger.
375385 * @retval None
376386 */
377- #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
378- LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
379- LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \
380- } while(0)
387+ #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
388+ LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
389+ LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1);\
390+ } while(0)
381391
382392/**
383393 * @brief Enable the COMP1 EXTI line in interrupt mode.
@@ -461,19 +471,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
461471 * @brief Enable the COMP2 EXTI line rising & falling edge trigger.
462472 * @retval None
463473 */
464- #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
465- LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
466- LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
467- } while(0)
474+ #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
475+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
476+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
477+ } while(0)
468478
469479/**
470480 * @brief Disable the COMP2 EXTI line rising & falling edge trigger.
471481 * @retval None
472482 */
473- #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
474- LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
475- LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
476- } while(0)
483+ #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
484+ LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
485+ LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2);\
486+ } while(0)
477487
478488/**
479489 * @brief Enable the COMP2 EXTI line in interrupt mode.
@@ -609,7 +619,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
609619/* Note: On this STM32 series, comparator input minus parameters are */
610620/* the same on all COMP instances. */
611621/* However, comparator instance kept as macro parameter for */
612- /* compatibility with other STM32 families. */
622+ /* compatibility with other STM32 series. */
613623#define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
614624 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
615625 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
@@ -628,7 +638,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
628638 ((__POL__) == COMP_OUTPUTPOL_INVERTED))
629639
630640#define IS_COMP_BLANKINGSRCE (__OUTPUT_BLANKING_SOURCE__ ) \
631- ( ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \
641+ (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \
632642 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) \
633643 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) \
634644 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1) \
@@ -638,17 +648,17 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
638648 )
639649
640650#define IS_COMP_BLANKINGSRC_INSTANCE (__INSTANCE__ , __OUTPUT_BLANKING_SOURCE__ ) \
641- ((((__INSTANCE__) == COMP1) && \
651+ ((((__INSTANCE__) == COMP1) && \
642652 (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \
643653 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
644654 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
645655 ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1))) \
646- || \
647- (((__INSTANCE__) == COMP2) && \
648- (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \
649- ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) || \
650- ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM8_OC5_COMP2) || \
651- ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))))
656+ || \
657+ (((__INSTANCE__) == COMP2) && \
658+ (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \
659+ ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC4_COMP2) || \
660+ ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM8_OC5_COMP2) || \
661+ ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM15_OC1_COMP2))))
652662
653663
654664#define IS_COMP_TRIGGERMODE (__MODE__ ) (((__MODE__) == COMP_TRIGGERMODE_NONE) || \
0 commit comments