@@ -50,7 +50,8 @@ typedef struct
50
50
51
51
uint32_t WindowMode ; /*!< Set window mode of a pair of comparators instances
52
52
(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.
54
55
This parameter can be a value of @ref COMP_WindowMode */
55
56
56
57
uint32_t Mode ; /*!< Set comparator operating mode to adjust power and speed.
@@ -151,15 +152,25 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
151
152
* @}
152
153
*/
153
154
155
+
154
156
/** @defgroup COMP_WindowMode COMP Window Mode
155
157
* @{
156
158
*/
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
+ */
159
168
/**
160
169
* @}
161
170
*/
162
171
172
+
173
+
163
174
/** @defgroup COMP_PowerMode COMP power mode
164
175
* @{
165
176
*/
@@ -302,14 +313,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
302
313
* @param __HANDLE__ COMP handle
303
314
* @retval None
304
315
*/
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)
306
317
307
318
/**
308
319
* @brief Disable the specified comparator.
309
320
* @param __HANDLE__ COMP handle
310
321
* @retval None
311
322
*/
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)
313
324
314
325
/**
315
326
* @brief Lock the specified comparator configuration.
@@ -320,14 +331,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
320
331
* @param __HANDLE__ COMP handle
321
332
* @retval None
322
333
*/
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)
324
335
325
336
/**
326
337
* @brief Check whether the specified comparator is locked.
327
338
* @param __HANDLE__ COMP handle
328
339
* @retval Value 0 if COMP instance is not locked, value 1 if COMP instance is locked
329
340
*/
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)
331
342
332
343
/**
333
344
* @}
@@ -336,7 +347,6 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
336
347
/** @defgroup COMP_Exti_Management COMP external interrupt line management
337
348
* @{
338
349
*/
339
-
340
350
/**
341
351
* @brief Enable the COMP1 EXTI line rising edge trigger.
342
352
* @retval None
@@ -365,19 +375,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
365
375
* @brief Enable the COMP1 EXTI line rising & falling edge trigger.
366
376
* @retval None
367
377
*/
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)
372
382
373
383
/**
374
384
* @brief Disable the COMP1 EXTI line rising & falling edge trigger.
375
385
* @retval None
376
386
*/
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)
381
391
382
392
/**
383
393
* @brief Enable the COMP1 EXTI line in interrupt mode.
@@ -461,19 +471,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
461
471
* @brief Enable the COMP2 EXTI line rising & falling edge trigger.
462
472
* @retval None
463
473
*/
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)
468
478
469
479
/**
470
480
* @brief Disable the COMP2 EXTI line rising & falling edge trigger.
471
481
* @retval None
472
482
*/
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)
477
487
478
488
/**
479
489
* @brief Enable the COMP2 EXTI line in interrupt mode.
@@ -609,7 +619,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
609
619
/* Note: On this STM32 series, comparator input minus parameters are */
610
620
/* the same on all COMP instances. */
611
621
/* However, comparator instance kept as macro parameter for */
612
- /* compatibility with other STM32 families. */
622
+ /* compatibility with other STM32 series. */
613
623
#define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
614
624
((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
615
625
((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
@@ -628,7 +638,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
628
638
((__POL__) == COMP_OUTPUTPOL_INVERTED))
629
639
630
640
#define IS_COMP_BLANKINGSRCE (__OUTPUT_BLANKING_SOURCE__ ) \
631
- ( ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \
641
+ (((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \
632
642
|| ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) \
633
643
|| ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) \
634
644
|| ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM3_OC3_COMP1) \
@@ -638,17 +648,17 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
638
648
)
639
649
640
650
#define IS_COMP_BLANKINGSRC_INSTANCE (__INSTANCE__ , __OUTPUT_BLANKING_SOURCE__ ) \
641
- ((((__INSTANCE__) == COMP1) && \
651
+ ((((__INSTANCE__) == COMP1) && \
642
652
(((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) || \
643
653
((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5_COMP1) || \
644
654
((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3_COMP1) || \
645
655
((__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))))
652
662
653
663
654
664
#define IS_COMP_TRIGGERMODE (__MODE__ ) (((__MODE__) == COMP_TRIGGERMODE_NONE) || \
0 commit comments