]> git.donarmstrong.com Git - qmk_firmware.git/blob - tool/mbed/mbed-sdk/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_STM32L0/stm32l0xx_hal_comp.c
Squashed 'tmk_core/' changes from 7967731..b9e0ea0
[qmk_firmware.git] / tool / mbed / mbed-sdk / libraries / mbed / targets / cmsis / TARGET_STM / TARGET_STM32L0 / stm32l0xx_hal_comp.c
1 /**
2   ******************************************************************************
3   * @file    stm32l0xx_hal_comp.c
4   * @author  MCD Application Team
5   * @version V1.2.0
6   * @date    06-February-2015
7   * @brief   COMP HAL module driver.
8   *    
9   *          This file provides firmware functions to manage the following 
10   *          functionalities of the COMP peripheral:
11   *           + Initialization/de-initialization functions
12   *           + I/O operation functions
13   *           + Peripheral Control functions 
14   *           + Peripheral State functions
15   *         
16   @verbatim
17 ================================================================================
18           ##### COMP Peripheral features #####
19 ================================================================================
20            
21   [..]       
22       The STM32L0xx device family integrates  2 analog comparators COMP1 and COMP2:
23       (#) The non inverting input and inverting input can be set to GPIO pins
24           as shown in table1. COMP Inputs below.
25   
26       (#) The COMP output is available using HAL_COMP_GetOutputLevel()
27           and can be set on GPIO pins. Refer to table 2. COMP Outputs below.
28   
29       (#) The COMP output can be redirected to embedded timers (TIM2, TIM21, TIM22...) and LPTIM
30           Refer to TIM and LPTIM drivers.
31   
32       (#) The comparators COMP1 and COMP2 can be combined in window mode and only COMP2 non inverting input can be used as non-inverting input.
33   
34       (#) The 2 comparators have interrupt capability with wake-up
35           from Sleep and Stop modes (through the EXTI controller):
36           (++) COMP1 is internally connected to EXTI Line 21
37           (++) COMP2 is internally connected to EXTI Line 22
38
39           From the corresponding IRQ handler, the right interrupt source can be retrieved with the 
40           macro __HAL_COMP_EXTI_GET_FLAG(). Possible values are:
41           (++) COMP_EXTI_LINE_COMP1
42           (++) COMP_EXTI_LINE_COMP2
43
44
45 [..] Table 1. COMP Inputs for the STM32L0xx devices
46  +--------------------------------------------------+     
47  |                 |                | COMP1 | COMP2 | 
48  |-----------------|----------------|---------------|
49  |                 | 1/4 VREFINT    |  --   |  OK   |  
50  |                 | 1/2 VREFINT    |  --   |  OK   |
51  |                 | 3/4 VREFINT    |  --   |  OK   |
52  | Inverting Input | VREFINT        |  OK   |  OK   | 
53  |                 | DAC OUT (PA4)  |  OK   |  OK   |  
54  |                 | IO1            |  PA0  |  PA2  |  
55  |                 | IO2            |  PA5  |  PA5  |  
56  |                 | IO3            |  ---  |  PB3  |  
57  |-----------------|----------------|-------|-------|
58  |  Non Inverting  | IO1            |  PA1  |  PA3  |  
59  |    Input        | IO2            |  ---  |  PB4  |
60  |                 | IO3            |  ---  |  PB5  |  
61  |                 | IO4            |  ---  |  PB6  |  
62  |                 | IO5            |  ---  |  PB7  |  
63  +--------------------------------------------------+  
64   
65  [..] Table 2. COMP Outputs for the STM32L0xx devices
66  +---------------+     
67  | COMP1 | COMP2 | 
68  |-------|-------|
69  |  PA0  |  PA2  | 
70  |  PA6  |  PA7  |  
71  |  PA11 |  PA12 | 
72  +---------------+
73
74     
75             ##### How to use this driver #####
76 ================================================================================
77   [..]
78       This driver provides functions to configure and program the Comparators of all STM32L0xx devices.
79
80       To use the comparator, perform the following steps:
81   
82       (#)  Initialize the COMP low level resources by implementing the HAL_COMP_MspInit().
83       (++) Configure the comparator input in analog mode using HAL_GPIO_Init().
84       (++) Configure the comparator output in alternate function mode using HAL_GPIO_Init() to map the comparator 
85            output to the GPIO pin.
86       (++) If required enable the VREFINT reference using HAL_VREFINT_Cmd() and HAL_COMP_EnableBuffer_Cmd().
87       (++) If required enable the COMP interrupt by configuring and enabling EXTI line in Interrupt mode and 
88            selecting the desired sensitivity level using HAL_GPIO_Init() function. After that enable the comparator
89            interrupt vector using HAL_NVIC_EnableIRQ() function.
90   
91       (#) Configure the comparator using HAL_COMP_Init() function:
92       (++) Select the inverting input
93       (++) Select the non-inverting input
94       (++) Select the output polarity  
95       (++) Select the power mode
96       (++) Select the window mode
97   
98       (#) Enable the comparator using HAL_COMP_Start() function
99     
100   @endverbatim
101   ******************************************************************************
102   * @attention
103   *
104   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
105   *
106   * Redistribution and use in source and binary forms, with or without modification,
107   * are permitted provided that the following conditions are met:
108   *   1. Redistributions of source code must retain the above copyright notice,
109   *      this list of conditions and the following disclaimer.
110   *   2. Redistributions in binary form must reproduce the above copyright notice,
111   *      this list of conditions and the following disclaimer in the documentation
112   *      and/or other materials provided with the distribution.
113   *   3. Neither the name of STMicroelectronics nor the names of its contributors
114   *      may be used to endorse or promote products derived from this software
115   *      without specific prior written permission.
116   *
117   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
118   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
119   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
120   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
121   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
122   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
123   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
124   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
125   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
126   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
127   *
128   ******************************************************************************  
129   */
130
131 /* Includes ------------------------------------------------------------------*/
132 #include "stm32l0xx_hal.h"
133
134 /** @addtogroup STM32L0xx_HAL_Driver
135   * @{
136   */
137
138 /** @addtogroup COMP
139   * @brief COMP HAL module driver
140   * @{
141   */
142
143 #ifdef HAL_COMP_MODULE_ENABLED
144
145 /* Private typedef -----------------------------------------------------------*/
146 /* Private define ------------------------------------------------------------*/
147 /* CSR register reset value */ 
148 #define COMP_CSR_RESET_VALUE             ((uint32_t)0x00000000)
149
150
151 /** @addtogroup COMP_Exported_Functions
152   * @{
153   */
154
155 /** @addtogroup COMP_Exported_Functions_Group1
156  *  @brief    Initialization and Configuration functions 
157  *
158 @verbatim    
159  ===============================================================================
160               ##### Initialization/de-initialization functions #####
161  ===============================================================================
162     [..]  This section provides functions to initialize and de-initialize comparators 
163
164 @endverbatim
165   * @{
166   */
167
168 /**
169   * @brief  Initializes the COMP according to the specified
170   *         parameters in the COMP_InitTypeDef and create the associated handle.
171   * @note   If the selected comparator is locked, initialization can't be performed.
172   *         To unlock the configuration, perform a system reset.
173   * @note   When the LPTIM connection is enabled, the following pins LPTIM_IN1(PB5, PC0)
174             and LPTIM_IN2(PB7, PC2) should not be configured in AF. 
175   * @param  hcomp: COMP handle
176   * @retval HAL status
177   */
178 HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp)
179 {
180  HAL_StatusTypeDef status = HAL_OK;
181   
182   /* Check the COMP handle allocation and lock status */
183   if((hcomp == NULL) || ((hcomp->State & COMP_STATE_BIT_LOCK) != 0x00))
184   {
185     status = HAL_ERROR;
186   }
187   else
188   {
189     /* Check the parameter */
190     assert_param(IS_COMP_ALL_INSTANCE(hcomp->Instance));
191     assert_param(IS_COMP_INVERTINGINPUT(hcomp->Init.InvertingInput));
192     assert_param(IS_COMP_NONINVERTINGINPUT(hcomp->Init.NonInvertingInput));
193     assert_param(IS_COMP_LPTIMCONNECTION(hcomp->Init.LPTIMConnection));
194     assert_param(IS_COMP_OUTPUTPOL(hcomp->Init.OutputPol));
195     assert_param(IS_COMP_MODE(hcomp->Init.Mode));
196     
197     if(hcomp->Init.WindowMode != COMP_WINDOWMODE_DISABLE)
198     {
199       assert_param(IS_COMP_WINDOWMODE_INSTANCE(hcomp->Instance));
200       assert_param(IS_COMP_WINDOWMODE(hcomp->Init.WindowMode));
201     }
202     
203     if(hcomp->State == HAL_COMP_STATE_RESET)
204     {
205       /* Init SYSCFG and the low level hardware to access comparators */
206      __HAL_RCC_SYSCFG_CLK_ENABLE();
207       /* Init the low level hardware : SYSCFG to access comparators */
208       HAL_COMP_MspInit(hcomp);
209     }
210     
211     /* Change COMP peripheral state */
212     hcomp->State = HAL_COMP_STATE_BUSY;
213   
214     /* Set COMP parameters */
215       /*     Set COMPxINSEL bits according to hcomp->Init.InvertingInput value        */
216       /*     Set COMPxNONINSEL bits according to hcomp->Init.NonInvertingInput value  */
217       /*     Set COMPxPOL bit according to hcomp->Init.OutputPol value                */
218       /*     Set COMPxMODE bits according to hcomp->Init.Mode value                   */
219       /*     Set COMP1WM bit according to hcomp->Init.WindowMode value                */
220     MODIFY_REG(hcomp->Instance->CSR, COMP_CSR_UPDATE_PARAMETERS_MASK, \
221                                      hcomp->Init.InvertingInput    |  \
222                                      hcomp->Init.NonInvertingInput |  \
223                                      hcomp->Init.LPTIMConnection   |  \
224                                      hcomp->Init.OutputPol         |  \
225                                      hcomp->Init.Mode              |  \
226                                      hcomp->Init.WindowMode);
227
228
229     /* Initialize the COMP state*/
230     hcomp->State = HAL_COMP_STATE_READY;
231
232   }
233   
234   return status;
235 }
236
237 /**
238   * @brief  DeInitializes the COMP peripheral 
239   * @note   Deinitialization can't be performed if the COMP configuration is locked.
240   *         To unlock the configuration, perform a system reset.
241   * @param  hcomp: COMP handle
242   * @retval HAL status
243   */
244 HAL_StatusTypeDef HAL_COMP_DeInit(COMP_HandleTypeDef *hcomp)
245 {
246   HAL_StatusTypeDef status = HAL_OK;
247
248   /* Check the COMP handle allocation and lock status */
249   if((hcomp == NULL) || ((hcomp->State & COMP_STATE_BIT_LOCK) != 0x00))
250   {
251     status = HAL_ERROR;
252   }
253   else
254   {
255     /* Check the parameter */
256     assert_param(IS_COMP_ALL_INSTANCE(hcomp->Instance));
257
258     /* Set COMP_CSR register to reset value */
259     WRITE_REG(hcomp->Instance->CSR, COMP_CSR_RESET_VALUE);
260
261     /* DeInit the low level hardware: SYSCFG, GPIO, CLOCK and NVIC */
262     HAL_COMP_MspDeInit(hcomp);
263
264     hcomp->State = HAL_COMP_STATE_RESET;
265     
266     /* Release Lock */
267     __HAL_UNLOCK(hcomp);
268   }
269   
270   return status;
271 }
272
273 /**
274   * @brief  Initializes the COMP MSP.
275   * @param  hcomp: COMP handle
276   * @retval None
277   */
278 __weak void HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp)
279 {
280   /* NOTE : This function Should not be modified, when the callback is needed,
281             the HAL_COMP_MspInit could be implenetd in the user file
282    */
283 }
284
285 /**
286   * @brief  DeInitializes COMP MSP.
287   * @param  hcomp: COMP handle
288   * @retval None
289   */
290 __weak void HAL_COMP_MspDeInit(COMP_HandleTypeDef *hcomp)
291 {
292   /* NOTE : This function Should not be modified, when the callback is needed,
293             the HAL_COMP_MspDeInit could be implenetd in the user file
294    */
295 }
296
297 /**
298   * @}
299   */
300
301 /** @addtogroup COMP_Exported_Functions_Group2
302  *  @brief   Data transfers functions 
303  *
304 @verbatim   
305  ===============================================================================
306                       ##### IO operation functions #####
307  ===============================================================================  
308     [..]
309     This subsection provides a set of functions allowing to manage the COMP data 
310     transfers.
311
312 @endverbatim
313   * @{
314   */
315
316 /**
317   * @brief  Start the comparator 
318   * @param  hcomp: COMP handle
319   * @retval HAL status
320   */
321 HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp)
322
323   HAL_StatusTypeDef status = HAL_OK;
324   
325   /* Check the COMP handle allocation and lock status */
326   if((hcomp == NULL) || ((hcomp->State & COMP_STATE_BIT_LOCK) != 0x00))
327   {
328     status = HAL_ERROR;
329   }
330   else
331   {
332     /* Check the parameter */
333     assert_param(IS_COMP_ALL_INSTANCE(hcomp->Instance));
334
335     if(hcomp->State == HAL_COMP_STATE_READY)
336     {
337       /* Enable the selected comparator */
338       __HAL_COMP_ENABLE(hcomp);
339
340       hcomp->State = HAL_COMP_STATE_BUSY;      
341     }
342     else
343     {
344       status = HAL_ERROR;
345     }
346   }
347
348   return status;
349 }
350
351 /**
352   * @brief  Stop the comparator 
353   * @param  hcomp: COMP handle
354   * @retval HAL status
355   */
356 HAL_StatusTypeDef HAL_COMP_Stop(COMP_HandleTypeDef *hcomp)
357
358   HAL_StatusTypeDef status = HAL_OK;
359   
360   /* Check the COMP handle allocation and lock status */
361   if((hcomp == NULL) || ((hcomp->State & COMP_STATE_BIT_LOCK) != 0x00))
362   {
363     status = HAL_ERROR;
364   }
365   else
366   {
367     /* Check the parameter */
368     assert_param(IS_COMP_ALL_INSTANCE(hcomp->Instance));
369
370     if(hcomp->State == HAL_COMP_STATE_BUSY)
371     {
372       /* Disable the selected comparator */
373       __HAL_COMP_DISABLE(hcomp);
374
375       hcomp->State = HAL_COMP_STATE_READY;
376     }
377     else
378     {
379       status = HAL_ERROR;
380     }
381   }
382   
383   return status;
384 }
385
386 /**
387   * @brief  Enables the interrupt and starts the comparator
388   * @param  hcomp: COMP handle
389   * @retval HAL status.
390   */
391 HAL_StatusTypeDef HAL_COMP_Start_IT(COMP_HandleTypeDef *hcomp)
392
393   HAL_StatusTypeDef status = HAL_OK;
394   uint32_t extiline = 0;
395   
396   status = HAL_COMP_Start(hcomp);
397   if(status == HAL_OK)
398   {
399     /* Check the Exti Line output configuration */
400     extiline = COMP_GET_EXTI_LINE(hcomp->Instance);
401     
402     /* Configure the rising edge */
403     if((hcomp->Init.TriggerMode & COMP_TRIGGERMODE_IT_RISING) != 0x00)
404     {
405       if (extiline == COMP_EXTI_LINE_COMP1)
406       {
407         __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE();
408       }
409       else
410       {
411        __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE();
412       }
413     }
414     else
415     {
416       if (extiline == COMP_EXTI_LINE_COMP1)
417       {
418         __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE();
419       }
420       else
421       {
422         __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE();
423       }      
424     }
425     
426     /* Configure the falling edge */
427     if((hcomp->Init.TriggerMode & COMP_TRIGGERMODE_IT_FALLING) != 0x00)
428     {
429       if (extiline == COMP_EXTI_LINE_COMP1)
430       {
431         __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE();
432       }
433       else
434       {
435        __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE();
436       }
437     }
438     else
439     {
440       if (extiline == COMP_EXTI_LINE_COMP1)
441       {
442         __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE();
443       }
444       else
445       {
446         __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE();
447       }      
448     }
449     
450     if (extiline == COMP_EXTI_LINE_COMP1)
451     {
452       /* Clear COMP Exti pending bit */
453       __HAL_COMP_COMP1_EXTI_CLEAR_FLAG();
454       /* Enable Exti interrupt mode */
455       __HAL_COMP_COMP1_EXTI_ENABLE_IT();
456     } else
457     {
458       /* Clear COMP Exti pending bit */
459       __HAL_COMP_COMP2_EXTI_CLEAR_FLAG();
460       /* Enable Exti interrupt mode */
461       __HAL_COMP_COMP2_EXTI_ENABLE_IT();
462     }
463   }
464
465   return status;
466 }
467
468 /**
469   * @brief  Disable the interrupt and Stop the comparator 
470   * @param  hcomp: COMP handle
471   * @retval HAL status
472   */
473 HAL_StatusTypeDef HAL_COMP_Stop_IT(COMP_HandleTypeDef *hcomp)
474 {  
475   HAL_StatusTypeDef status = HAL_OK;
476   
477   if (COMP_GET_EXTI_LINE(hcomp->Instance) == COMP_EXTI_LINE_COMP1)
478   {
479     __HAL_COMP_COMP1_EXTI_DISABLE_IT();
480   }
481   if (COMP_GET_EXTI_LINE(hcomp->Instance) == COMP_EXTI_LINE_COMP2)
482   {
483     __HAL_COMP_COMP2_EXTI_DISABLE_IT();
484   }
485   
486   status = HAL_COMP_Stop(hcomp);
487   
488   return status;
489 }
490
491 /**
492   * @brief  Comparator IRQ Handler 
493   * @param  hcomp: COMP handle
494   * @retval HAL status
495   */
496 void HAL_COMP_IRQHandler(COMP_HandleTypeDef *hcomp)
497 {
498
499   /* Check COMP Exti flag */
500
501   if(__HAL_COMP_COMP1_EXTI_GET_FLAG() != RESET)
502   {    
503     /* Clear COMP Exti pending bit */
504     __HAL_COMP_COMP1_EXTI_CLEAR_FLAG();
505   } 
506   if(__HAL_COMP_COMP2_EXTI_GET_FLAG() != RESET)
507   {    
508     /* Clear COMP Exti pending bit */
509     __HAL_COMP_COMP2_EXTI_CLEAR_FLAG();
510   }  
511   
512   /* COMP trigger user callback */
513   HAL_COMP_TriggerCallback(hcomp);
514 }
515
516 /**
517   * @}
518   */
519
520 /** @addtogroup COMP_Exported_Functions_Group3
521  *  @brief   management functions 
522  *
523 @verbatim   
524  ===============================================================================
525                       ##### Peripheral Control functions #####
526  ===============================================================================  
527     [..]
528     This subsection provides a set of functions allowing to control the COMP data 
529     transfers.
530
531 @endverbatim
532   * @{
533   */
534
535 /**
536   * @brief  Lock the selected comparator configuration. 
537   * @param  hcomp: COMP handle
538   * @retval HAL status
539   */
540 HAL_StatusTypeDef HAL_COMP_Lock(COMP_HandleTypeDef *hcomp)
541 {
542   HAL_StatusTypeDef status = HAL_OK;
543
544   /* Check the COMP handle allocation and lock status */
545   if((hcomp == NULL) || ((hcomp->State & COMP_STATE_BIT_LOCK) != 0x00))
546   {
547     status = HAL_ERROR;
548   }
549   else
550   {
551         /* Check the parameter */
552     assert_param(IS_COMP_ALL_INSTANCE(hcomp->Instance));
553
554     /* Set lock flag on state */
555     switch(hcomp->State)
556     {
557     case HAL_COMP_STATE_BUSY:
558       hcomp->State = HAL_COMP_STATE_BUSY_LOCKED;
559       break;
560     case HAL_COMP_STATE_READY:
561       hcomp->State = HAL_COMP_STATE_READY_LOCKED;
562       break;
563     default:
564       /* unexpected state */
565       status = HAL_ERROR;
566       break;
567     }
568   }
569   
570   if(status == HAL_OK)
571   {
572     /* Set the lock bit corresponding to selected comparator */
573     __HAL_COMP_LOCK(hcomp);
574   }
575   
576   return status; 
577 }
578
579 /**
580   * @brief  Return the output level (high or low) of the selected comparator. 
581   *         The output level depends on the selected polarity.
582   *         If the polarity is not inverted:
583   *           - Comparator output is low when the non-inverting input is at a lower
584   *             voltage than the inverting input
585   *           - Comparator output is high when the non-inverting input is at a higher
586   *             voltage than the inverting input
587   *         If the polarity is inverted:
588   *           - Comparator output is high when the non-inverting input is at a lower
589   *             voltage than the inverting input
590   *           - Comparator output is low when the non-inverting input is at a higher
591   *             voltage than the inverting input
592   * @param  hcomp: COMP handle
593   * @retval Returns the selected comparator output level: COMP_OUTPUTLEVEL_LOW or COMP_OUTPUTLEVEL_HIGH.
594   *       
595   */
596 uint32_t HAL_COMP_GetOutputLevel(COMP_HandleTypeDef *hcomp)
597 {
598   /* Check the parameter */
599   assert_param(IS_COMP_ALL_INSTANCE(hcomp->Instance));
600   
601   return((uint32_t)(hcomp->Instance->CSR & COMP_OUTPUTLEVEL_HIGH));
602 }
603
604 /**
605   * @brief  Comparator callback.
606   * @param  hcomp: COMP handle
607   * @retval None
608   */
609 __weak void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp)
610 {
611   /* NOTE : This function should not be modified, when the callback is needed,
612             the HAL_COMP_TriggerCallback should be implemented in the user file
613    */
614 }
615
616
617 /**
618   * @}
619   */
620
621 /** @addtogroup COMP_Exported_Functions_Group4
622  *  @brief   Peripheral State functions 
623  *
624 @verbatim   
625  ===============================================================================
626                       ##### Peripheral State functions #####
627  ===============================================================================  
628     [..]
629     This subsection permit to get in run-time the status of the peripheral 
630     and the data flow.
631
632 @endverbatim
633   * @{
634   */
635
636 /**
637   * @brief  Return the COMP state
638   * @param  hcomp : COMP handle
639   * @retval HAL state
640   */
641 HAL_COMP_StateTypeDef HAL_COMP_GetState(COMP_HandleTypeDef *hcomp)
642 {
643   /* Check the COMP handle allocation */
644   if(hcomp == NULL)
645   {
646     return HAL_COMP_STATE_RESET;
647   }
648
649   /* Check the parameter */
650   assert_param(IS_COMP_ALL_INSTANCE(hcomp->Instance));
651
652   return hcomp->State;
653 }
654
655 /**
656   * @}
657   */
658
659
660 /**
661   * @}
662   */
663
664 #endif /* HAL_COMP_MODULE_ENABLED */
665 /**
666   * @}
667   */
668
669 /**
670   * @}
671   */
672
673 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
674