@@ -51,7 +51,8 @@ typedef struct
51
51
#if defined(COMP2 )
52
52
uint32_t WindowMode ; /*!< Set window mode of a pair of comparators instances
53
53
(2 consecutive instances odd and even COMP<x> and COMP<x+1>).
54
- Note: HAL COMP driver allows to set window mode from any COMP instance of the pair of COMP instances composing window mode.
54
+ Note: HAL COMP driver allows to set window mode from any COMP
55
+ instance of the pair of COMP instances composing window mode.
55
56
This parameter can be a value of @ref COMP_WindowMode */
56
57
#endif /* COMP2 */
57
58
@@ -153,17 +154,25 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
153
154
* @}
154
155
*/
155
156
157
+
156
158
#if defined(COMP2 )
157
159
/** @defgroup COMP_WindowMode COMP Window Mode
158
160
* @{
159
161
*/
160
- #define COMP_WINDOWMODE_DISABLE (0x00000000UL) /*!< Window mode disable: Comparators instances pair COMP1 and COMP2 are independent */
161
- #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). */
162
+ #define COMP_WINDOWMODE_DISABLE (0x00000000UL) /*!< Window mode disable: Comparators instances
163
+ pair COMP1 and COMP2 are independent */
164
+ #define COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON (COMP_CSR_WINMODE) /*!< Window mode enable: Comparators instances
165
+ pair COMP1 and COMP2 have their input plus
166
+ connected together. The common input is
167
+ COMP1 input plus
168
+ (COMP2 input plus is no more accessible). */
162
169
/**
163
170
* @}
164
171
*/
165
172
#endif /* COMP2 */
166
173
174
+
175
+
167
176
/** @defgroup COMP_PowerMode COMP power mode
168
177
* @{
169
178
*/
@@ -198,7 +207,7 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
198
207
#define COMP_INPUT_MINUS_1_2VREFINT ( COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 1/2 VrefInt */
199
208
#define COMP_INPUT_MINUS_3_4VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_SCALEN | COMP_CSR_BRGEN) /*!< Comparator input minus connected to 3/4 VrefInt */
200
209
#define COMP_INPUT_MINUS_VREFINT ( COMP_CSR_INMSEL_1 | COMP_CSR_INMSEL_0 | COMP_CSR_SCALEN ) /*!< Comparator input minus connected to VrefInt */
201
- #define COMP_INPUT_MINUS_IO1 (COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_1 ) /*!< Comparator input minus connected to IO1 (pin PB1 for COMP1, pin PB3 for COMP2) */
210
+ #define COMP_INPUT_MINUS_IO1 (COMP_CSR_INMSEL_2 | COMP_CSR_INMSEL_1 ) /*!< Comparator input minus connected to IO1 (pin PB1 for COMP1, pin PB3 for COMP2) */
202
211
#if defined(STM32WB15xx ) || defined(STM32WB10xx ) || defined(STM32WB1Mxx )
203
212
/* COMP_INPUT_MINUS_IO2 not available on this device */
204
213
#else
@@ -312,14 +321,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
312
321
* @param __HANDLE__ COMP handle
313
322
* @retval None
314
323
*/
315
- #define __HAL_COMP_ENABLE (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
324
+ #define __HAL_COMP_ENABLE (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
316
325
317
326
/**
318
327
* @brief Disable the specified comparator.
319
328
* @param __HANDLE__ COMP handle
320
329
* @retval None
321
330
*/
322
- #define __HAL_COMP_DISABLE (__HANDLE__ ) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
331
+ #define __HAL_COMP_DISABLE (__HANDLE__ ) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_EN)
323
332
324
333
/**
325
334
* @brief Lock the specified comparator configuration.
@@ -330,14 +339,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
330
339
* @param __HANDLE__ COMP handle
331
340
* @retval None
332
341
*/
333
- #define __HAL_COMP_LOCK (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK)
342
+ #define __HAL_COMP_LOCK (__HANDLE__ ) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK)
334
343
335
344
/**
336
345
* @brief Check whether the specified comparator is locked.
337
346
* @param __HANDLE__ COMP handle
338
347
* @retval Value 0 if COMP instance is not locked, value 1 if COMP instance is locked
339
348
*/
340
- #define __HAL_COMP_IS_LOCKED (__HANDLE__ ) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK)
349
+ #define __HAL_COMP_IS_LOCKED (__HANDLE__ ) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_LOCK) == COMP_CSR_LOCK)
341
350
342
351
/**
343
352
* @}
@@ -346,7 +355,6 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
346
355
/** @defgroup COMP_Exti_Management COMP external interrupt line management
347
356
* @{
348
357
*/
349
-
350
358
/**
351
359
* @brief Enable the COMP1 EXTI line rising edge trigger.
352
360
* @retval None
@@ -375,19 +383,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
375
383
* @brief Enable the COMP1 EXTI line rising & falling edge trigger.
376
384
* @retval None
377
385
*/
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)
386
+ #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
387
+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
388
+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP1);\
389
+ } while(0)
382
390
383
391
/**
384
392
* @brief Disable the COMP1 EXTI line rising & falling edge trigger.
385
393
* @retval None
386
394
*/
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)
395
+ #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
396
+ LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP1); \
397
+ LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP1);\
398
+ } while(0)
391
399
392
400
/**
393
401
* @brief Enable the COMP1 EXTI line in interrupt mode.
@@ -460,19 +468,19 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
460
468
* @brief Enable the COMP2 EXTI line rising & falling edge trigger.
461
469
* @retval None
462
470
*/
463
- #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
464
- LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
465
- LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
466
- } while(0)
471
+ #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE () do { \
472
+ LL_EXTI_EnableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
473
+ LL_EXTI_EnableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
474
+ } while(0)
467
475
468
476
/**
469
477
* @brief Disable the COMP2 EXTI line rising & falling edge trigger.
470
478
* @retval None
471
- */
472
- #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
473
- LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
474
- LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2); \
475
- } while(0)
479
+ */
480
+ #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE () do { \
481
+ LL_EXTI_DisableRisingTrig_0_31(COMP_EXTI_LINE_COMP2); \
482
+ LL_EXTI_DisableFallingTrig_0_31(COMP_EXTI_LINE_COMP2);\
483
+ } while(0)
476
484
477
485
/**
478
486
* @brief Enable the COMP2 EXTI line in interrupt mode.
@@ -607,23 +615,23 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
607
615
/* However, comparator instance kept as macro parameter for */
608
616
/* compatibility with other STM32 families. */
609
617
#if defined(COMP_INPUT_MINUS_IO2 )
610
- #define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
611
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
612
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
613
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \
614
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \
615
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2) || \
616
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) || \
617
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) || \
618
+ #define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) ||\
619
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) ||\
620
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) ||\
621
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) ||\
622
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) ||\
623
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2) ||\
624
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) ||\
625
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) ||\
618
626
((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO5))
619
627
#else
620
- #define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) || \
621
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) || \
622
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) || \
623
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) || \
624
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) || \
625
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) || \
626
- ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) || \
628
+ #define IS_COMP_INPUT_MINUS (__COMP_INSTANCE__ , __INPUT_MINUS__ ) (((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) ||\
629
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) ||\
630
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) ||\
631
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) ||\
632
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) ||\
633
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO3) ||\
634
+ ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO4) ||\
627
635
((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO5))
628
636
#endif
629
637
@@ -637,14 +645,14 @@ typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer
637
645
638
646
#define IS_COMP_BLANKINGSRCE (__OUTPUT_BLANKING_SOURCE__ ) \
639
647
( ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_NONE) \
640
- || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5) \
641
- || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3) \
648
+ || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM1_OC5) \
649
+ || ((__OUTPUT_BLANKING_SOURCE__) == COMP_BLANKINGSRC_TIM2_OC3) \
642
650
)
643
651
644
652
/* Note: Output blanking source common to all COMP instances */
645
653
/* Macro kept for compatibility with other STM32 series */
646
654
#define IS_COMP_BLANKINGSRC_INSTANCE (__INSTANCE__ , __OUTPUT_BLANKING_SOURCE__ ) \
647
- (IS_COMP_BLANKINGSRCE(__OUTPUT_BLANKING_SOURCE__))
655
+ (IS_COMP_BLANKINGSRCE(__OUTPUT_BLANKING_SOURCE__))
648
656
649
657
650
658
#define IS_COMP_TRIGGERMODE (__MODE__ ) (((__MODE__) == COMP_TRIGGERMODE_NONE) || \
0 commit comments