@@ -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 */
@@ -300,14 +311,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
300311 * @param __HANDLE__ COMP handle
301312 * @retval None
302313 */
303- #define __HAL_COMP_ENABLE (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
314+ #define __HAL_COMP_ENABLE (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
304315
305316/**
306317 * @brief Disable the specified comparator.
307318 * @param __HANDLE__ COMP handle
308319 * @retval None
309320 */
310- #define __HAL_COMP_DISABLE (__HANDLE__ ) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
321+ #define __HAL_COMP_DISABLE (__HANDLE__ ) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
311322
312323/**
313324 * @brief Lock the specified comparator configuration.
@@ -318,14 +329,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
318329 * @param __HANDLE__ COMP handle
319330 * @retval None
320331 */
321- #define __HAL_COMP_LOCK (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK)
332+ #define __HAL_COMP_LOCK (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK)
322333
323334/**
324335 * @brief Check whether the specified comparator is locked.
325336 * @param __HANDLE__ COMP handle
326337 * @retval Value 0 if COMP instance is not locked, value 1 if COMP instance is locked
327338 */
328- #define __HAL_COMP_IS_LOCKED (__HANDLE__ ) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK)
339+ #define __HAL_COMP_IS_LOCKED (__HANDLE__ ) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK)
329340
330341/**
331342 * @}
@@ -334,7 +345,6 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
334345/** @defgroup COMP_Exti_Management COMP external interrupt line management
335346 * @{
336347 */
337-
338348/**
339349 * @brief Enable the COMP1 EXTI line rising edge trigger.
340350 * @retval None
@@ -363,19 +373,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
363373 * @brief Enable the COMP1 EXTI line rising & falling edge trigger.
364374 * @retval None
365375 */
366- #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
367- LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
368- LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \
369- } while(0)
376+ #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
377+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
378+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \
379+ } while(0)
370380
371381/**
372382 * @brief Disable the COMP1 EXTI line rising & falling edge trigger.
373383 * @retval None
374384 */
375- #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
376- LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
377- LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1); \
378- } while(0)
385+ #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
386+ LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
387+ LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1);\
388+ } while(0)
379389
380390/**
381391 * @brief Enable the COMP1 EXTI line in interrupt mode.
@@ -463,19 +473,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
463473 * @brief Enable the COMP2 EXTI line rising & falling edge trigger.
464474 * @retval None
465475 */
466- #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
467- LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
468- LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
469- } while(0)
476+ #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
477+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
478+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
479+ } while(0)
470480
471481/**
472482 * @brief Disable the COMP2 EXTI line rising & falling edge trigger.
473483 * @retval None
474484 */
475- #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
476- LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
477- LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
478- } while(0)
485+ #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
486+ LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
487+ LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2);\
488+ } while(0)
479489
480490/**
481491 * @brief Enable the COMP2 EXTI line in interrupt mode.
@@ -599,7 +609,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
599609/* Note: On this STM32 series, comparator input minus parameters are */
600610/* the same on all COMP instances. */
601611/* However, comparator instance kept as macro parameter for */
602- /* compatibility with other STM32 families. */
612+ /* compatibility with other STM32 series. */
603613#define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
604614 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
605615 ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
@@ -619,15 +629,15 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
619629 ((__POL__) == COMP_OUTPUTPOL_INVERTED))
620630
621631#define IS_COMP_BLANKINGSRCE (__OUTPUT_BLANKING_SOURCE__ ) \
622- ( ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \
632+ (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \
623633 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5) \
624634 || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3) \
625635 )
626636
627637/* Note: Output blanking source common to all COMP instances */
628638/* Macro kept for compatibility with other STM32 series */
629639#define IS_COMP_BLANKINGSRC_INSTANCE (__INSTANCE__ , __OUTPUT_BLANKING_SOURCE__ ) \
630- (IS_COMP_BLANKINGSRCE(__OUTPUT_BLANKING_SOURCE__))
640+ (IS_COMP_BLANKINGSRCE(__OUTPUT_BLANKING_SOURCE__))
631641
632642
633643#define IS_COMP_TRIGGERMODE (__MODE__ ) (((__MODE__) == COMP_TRIGGERMODE_NONE) || \
0 commit comments