1 /**
2   ******************************************************************************
3   * @file    stm32l1xx_hal_opamp.h
4   * @author  MCD Application Team
5   * @brief   Header file of OPAMP HAL module.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2017 STMicroelectronics.
10   * All rights reserved.
11   *
12   * This software is licensed under terms that can be found in the LICENSE file
13   * in the root directory of this software component.
14   * If no LICENSE file comes with this software, it is provided AS-IS.
15   *
16   ******************************************************************************
17   */
18 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32L1xx_HAL_OPAMP_H
21 #define STM32L1xx_HAL_OPAMP_H
22 
23 #ifdef __cplusplus
24  extern "C" {
25 #endif
26 
27 #if defined (STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L151xE) || defined (STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX) || defined (STM32L162xC) || defined (STM32L152xC) || defined (STM32L151xC)
28 
29 /* Includes ------------------------------------------------------------------*/
30 #include "stm32l1xx_hal_def.h"
31 
32 /** @addtogroup STM32L1xx_HAL_Driver
33   * @{
34   */
35 
36 /** @addtogroup OPAMP
37   * @{
38   */
39 
40 /* Exported types ------------------------------------------------------------*/
41 
42 /** @defgroup OPAMP_Exported_Types OPAMP Exported Types
43   * @{
44   */
45 
46 /**
47   * @brief  OPAMP Init structure definition
48   */
49 
50 typedef struct
51 {
52   uint32_t PowerSupplyRange;            /*!< Specifies the power supply range: above or under 2.4V.
53                                              This parameter must be a value of @ref OPAMP_PowerSupplyRange
54                                              Caution: This parameter is common to all OPAMP instances: a modification of this parameter for the selected OPAMP impacts the other OPAMP instances. */
55 
56   uint32_t PowerMode;                   /*!< Specifies the power mode Normal or Low-Power.
57                                              This parameter must be a value of @ref OPAMP_PowerMode */
58 
59   uint32_t Mode;                        /*!< Specifies the OPAMP mode
60                                              This parameter must be a value of @ref OPAMP_Mode
61                                              mode is either Standalone or Follower */
62 
63   uint32_t InvertingInput;              /*!< Specifies the inverting input in Standalone mode
64                                                - In Standalone mode:   i.e when mode is OPAMP_STANDALONE_MODE
65                                                  This parameter must be a value of @ref OPAMP_InvertingInput
66                                                  InvertingInput is either VM0 or VM1
67                                                - In Follower mode:     i.e when mode is OPAMP_FOLLOWER_MODE
68                                                  This parameter is Not Applicable */
69 
70   uint32_t NonInvertingInput;           /*!< Specifies the non inverting input of the opamp:
71                                              This parameter must be a value of @ref OPAMP_NonInvertingInput
72                                              Note: Non-inverting input availability depends on OPAMP instance:
73                                                    OPAMP1: Non-inverting input is either IO0, DAC_Channel1
74                                                    OPAMP2: Non-inverting input is either IO0, DAC_Channel1, DAC_Channel2
75                                                    OPAMP3: Non-inverting input is either IO0, DAC_Channel2 (OPAMP3 availability depends on STM32L1 devices) */
76 
77   uint32_t UserTrimming;                /*!< Specifies the trimming mode
78                                              This parameter must be a value of @ref OPAMP_UserTrimming
79                                              UserTrimming is either factory or user trimming.
80                                              Caution: This parameter is common to all OPAMP instances: a modification of this parameter for the selected OPAMP impacts the other OPAMP instances. */
81 
82   uint32_t TrimmingValueP;              /*!< Specifies the offset trimming value (PMOS)
83                                              i.e. when UserTrimming is OPAMP_TRIMMING_USER.
84                                              This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden)
85                                              16 is typical default value */
86 
87   uint32_t TrimmingValueN;              /*!< Specifies the offset trimming value (NMOS)
88                                              i.e. when UserTrimming is OPAMP_TRIMMING_USER.
89                                              This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden)
90                                              16 is typical default value */
91 
92   uint32_t TrimmingValuePLowPower;      /*!< Specifies the offset trimming value (PMOS)
93                                              i.e. when UserTrimming is OPAMP_TRIMMING_USER.
94                                              This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden)
95                                              16 is typical default value */
96 
97   uint32_t TrimmingValueNLowPower;      /*!< Specifies the offset trimming value (NMOS)
98                                              i.e. when UserTrimming is OPAMP_TRIMMING_USER.
99                                              This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden)
100                                              16 is typical default value */
101 
102 }OPAMP_InitTypeDef;
103 
104 /**
105   * @brief  HAL State structures definition
106   */
107 
108 typedef enum
109 {
110   HAL_OPAMP_STATE_RESET               = 0x00000000, /*!< OPAMP is not yet Initialized          */
111 
112   HAL_OPAMP_STATE_READY               = 0x00000001, /*!< OPAMP is initialized and ready for use */
113   HAL_OPAMP_STATE_CALIBBUSY           = 0x00000002, /*!< OPAMP is enabled in auto calibration mode */
114 
115   HAL_OPAMP_STATE_BUSY                = 0x00000004, /*!< OPAMP is enabled and running in normal mode */
116   HAL_OPAMP_STATE_BUSYLOCKED          = 0x00000005  /*!< OPAMP is locked
117                                                          only system reset allows reconfiguring the opamp. */
118 
119 }HAL_OPAMP_StateTypeDef;
120 
121 /**
122   * @brief OPAMP Handle Structure definition
123   */
124 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
125 typedef struct __OPAMP_HandleTypeDef
126 #else
127 typedef struct
128 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */
129 {
130   OPAMP_TypeDef       *Instance;                    /*!< OPAMP instance's registers base address   */
131   OPAMP_InitTypeDef   Init;                         /*!< OPAMP required parameters */
132   HAL_StatusTypeDef Status;                         /*!< OPAMP peripheral status   */
133   HAL_LockTypeDef   Lock;                           /*!< Locking object          */
134   __IO HAL_OPAMP_StateTypeDef  State;               /*!< OPAMP communication state */
135 
136 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
137 void (* MspInitCallback)                (struct __OPAMP_HandleTypeDef *hopamp);
138 void (* MspDeInitCallback)              (struct __OPAMP_HandleTypeDef *hopamp);
139 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */
140 
141 } OPAMP_HandleTypeDef;
142 
143 /**
144   * @brief HAl_OPAMP_TrimmingValueTypeDef definition
145   */
146 
147 typedef  uint32_t HAL_OPAMP_TrimmingValueTypeDef;
148 
149 /**
150   * @}
151   */
152 
153 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
154 /**
155   * @brief  HAL OPAMP Callback ID enumeration definition
156   */
157 typedef enum
158 {
159   HAL_OPAMP_MSPINIT_CB_ID                     = 0x01U,  /*!< OPAMP MspInit Callback ID           */
160   HAL_OPAMP_MSPDEINIT_CB_ID                   = 0x02U,  /*!< OPAMP MspDeInit Callback ID         */
161   HAL_OPAMP_ALL_CB_ID                         = 0x03U   /*!< OPAMP All ID                        */
162 }HAL_OPAMP_CallbackIDTypeDef;
163 
164 /**
165   * @brief  HAL OPAMP Callback pointer definition
166   */
167 typedef void (*pOPAMP_CallbackTypeDef)(OPAMP_HandleTypeDef *hopamp);
168 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */
169 
170 
171 /* Exported constants --------------------------------------------------------*/
172 
173 /** @defgroup OPAMP_Exported_Constants OPAMP Exported Constants
174   * @{
175   */
176 
177 /**
178   * OTR register Mask
179   */
180 #define OPAMP_TRIM_VALUE_MASK   OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LOW
181 
182 /**
183   * CSR register Mask
184   */
185 #define OPAMP_CSR_INSTANCE_OFFSET   ( 8U) /* Offset of each OPAMP instance into register CSR */
186 #define OPAMP_OTR_INSTANCE_OFFSET   (10U) /* Offset of each OPAMP instance into register OTR */
187 
188 
189 /** @defgroup OPAMP_Mode OPAMP Mode
190   * @{
191   */
192 #define OPAMP_STANDALONE_MODE            0x00000000U  /*!< OPAMP standalone mode */
193 #define OPAMP_FOLLOWER_MODE              0x00000001U  /*!< OPAMP follower mode */
194 
195 /**
196   * @}
197   */
198 
199 /** @defgroup OPAMP_NonInvertingInput OPAMP NonInvertingInput
200   * @{
201   */
202 #define OPAMP_NONINVERTINGINPUT_IO0       0x00000000U   /*!< Comparator non-inverting input connected to dedicated IO pin low-leakage */
203 #define OPAMP_NONINVERTINGINPUT_DAC_CH1   0x00000001U   /*!< Comparator non-inverting input connected internally to DAC channel 1. Available only on OPAMP1 and OPAMP2. */
204 #define OPAMP_NONINVERTINGINPUT_DAC_CH2   0x00000002U   /*!< Comparator non-inverting input connected internally to DAC channel 2. Available only on OPAMP2 and OPAMP3 (OPAMP3 availability depends on STM32L1 devices). */
205 
206 /**
207   * @}
208   */
209 
210 /** @defgroup OPAMP_InvertingInput OPAMP InvertingInput
211   * @{
212   */
213 /* Note: Literal "OPAMP_SEC_INVERTINGINPUT_IO1" is a legacy naming of "OPAMP_INVERTINGINPUT_IO1". It is equivalent and must be replaced by "OPAMP_INVERTINGINPUT_IO1". */
214 #define OPAMP_INVERTINGINPUT_IO0         0x00000000U   /*!< Comparator inverting input connected to dedicated IO pin low-leakage */
215 #define OPAMP_INVERTINGINPUT_IO1         0x00000001U   /*!< Comparator inverting input connected to alternative IO pin available on some device packages */
216 
217 /**
218   * @}
219   */
220 
221 /** @defgroup OPAMP_PowerMode OPAMP PowerMode
222   * @{
223   */
224 #define OPAMP_POWERMODE_NORMAL        0x00000000U
225 #define OPAMP_POWERMODE_LOWPOWER      0x00000001U
226 
227 /**
228   * @}
229   */
230 
231 /** @defgroup OPAMP_PowerSupplyRange OPAMP PowerSupplyRange
232   * @{
233   */
234 #define OPAMP_POWERSUPPLY_LOW          0x00000000U             /*!< Power supply range low (VDDA lower than 2.4V) */
235 #define OPAMP_POWERSUPPLY_HIGH         OPAMP_CSR_AOP_RANGE     /*!< Power supply range high (VDDA higher than 2.4V) */
236 
237 /**
238   * @}
239   */
240 
241 /** @defgroup OPAMP_UserTrimming OPAMP User Trimming
242   * @{
243   */
244 #define OPAMP_TRIMMING_FACTORY         0x00000000U                           /*!< Factory trimming */
245 #define OPAMP_TRIMMING_USER           OPAMP_OTR_OT_USER                      /*!< User trimming */
246 
247 /**
248   * @}
249   */
250 
251 /** @defgroup OPAMP_FactoryTrimming OPAMP FactoryTrimming
252   * @{
253   */
254 #define OPAMP_FACTORYTRIMMING_DUMMY    0xFFFFFFFFU                                      /*!< Dummy value if trimming value could not be retrieved */
255 
256 #define OPAMP_FACTORYTRIMMING_P        0U                                               /*!< Offset trimming P */
257 #define OPAMP_FACTORYTRIMMING_N        POSITION_VAL(OPAMP_OTR_AO1_OPT_OFFSET_TRIM_HIGH) /*!< Offset trimming N */
258 
259 /**
260   * @}
261   */
262 
263 /**
264   * @}
265   */
266 
267 /* Private constants ---------------------------------------------------------*/
268 /** @defgroup OPAMP_Private_Constants OPAMP Private Constants
269   * @{
270   */
271 
272 /* Offset trimming time: during calibration, minimum time needed between two  */
273 /* steps to have 1 mV accuracy.                                               */
274 /* Refer to datasheet, electrical characteristics: parameter tOFFTRIM Typ=1ms.*/
275 /* Unit: ms.                                                                  */
276 #define OPAMP_TRIMMING_DELAY               ((uint32_t) 1)
277 
278 /**
279   * @}
280   */
281 
282 /* Exported macros -----------------------------------------------------------*/
283 
284 /** @defgroup OPAMP_Private_Macro OPAMP Private Macro
285   * @{
286   */
287 
288 /** @brief Reset OPAMP handle state
289   * @param  __HANDLE__ OPAMP handle.
290   * @retval None
291   */
292 #define __HAL_OPAMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_OPAMP_STATE_RESET)
293 
294 /**
295   * @}
296   */
297 
298 /* Private macro -------------------------------------------------------------*/
299 
300 /** @defgroup OPAMP_Private_Macro OPAMP Private Macro
301   * @{
302   */
303 
304 /**
305   * @brief Select the OPAMP bit OPAxPD (power-down) corresponding to the
306   * selected OPAMP instance.
307   * @param __HANDLE__: OPAMP handle
308   * @retval None
309   */
310 #define OPAMP_CSR_OPAXPD(__HANDLE__)                                           \
311   (OPAMP_CSR_OPA1PD << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))
312 
313 /**
314   * @brief Select the OPAMP bit S3SELx (switch 3) corresponding to the
315   * selected OPAMP instance.
316   * @param __HANDLE__: OPAMP handle
317   * @retval None
318   */
319 #define OPAMP_CSR_S3SELX(__HANDLE__)                                           \
320   (OPAMP_CSR_S3SEL1 << ((OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET) & 0x1fU))
321 
322 /**
323   * @brief Select the OPAMP bit S4SELx (switch 4) corresponding to the
324   * selected OPAMP instance.
325   * @param __HANDLE__: OPAMP handle
326   * @retval None
327   */
328 #define OPAMP_CSR_S4SELX(__HANDLE__)                                           \
329   (OPAMP_CSR_S4SEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))
330 
331 /**
332   * @brief Select the OPAMP bit S5SELx (switch 5) corresponding to the
333   * selected OPAMP instance.
334   * @param __HANDLE__: OPAMP handle
335   * @retval None
336   */
337 #define OPAMP_CSR_S5SELX(__HANDLE__)                                           \
338   (OPAMP_CSR_S5SEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))
339 
340 /**
341   * @brief Select the OPAMP bit S3SELx (switch 6) corresponding to the
342   * selected OPAMP instance.
343   * @param __HANDLE__: OPAMP handle
344   * @retval None
345   */
346 #define OPAMP_CSR_S6SELX(__HANDLE__)                                           \
347   (OPAMP_CSR_S6SEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))
348 
349 /**
350   * @brief Select the OPAMP bit OPAxCAL_L (offset calibration for differential
351   * pair P) corresponding to the selected OPAMP instance.
352   * @param __HANDLE__: OPAMP handle
353   * @retval None
354   */
355 #define OPAMP_CSR_OPAXCAL_L(__HANDLE__)                                        \
356   (OPAMP_CSR_OPA1CAL_L << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))
357 
358 /**
359   * @brief Select the OPAMP bit OPAxCAL_H (offset calibration for differential
360   * pair N) corresponding to the selected OPAMP instance.
361   * @param __HANDLE__: OPAMP handle
362   * @retval None
363   */
364 #define OPAMP_CSR_OPAXCAL_H(__HANDLE__)                                        \
365   (OPAMP_CSR_OPA1CAL_H << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))
366 
367 /**
368   * @brief Select the OPAMP bit OPAxLPM (low power mode) corresponding to the
369   * selected OPAMP instance.
370   * @param __HANDLE__: OPAMP handle
371   * @retval None
372   */
373 #define OPAMP_CSR_OPAXLPM(__HANDLE__)                                          \
374   (OPAMP_CSR_OPA1LPM << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))
375 
376 /**
377   * @brief Select the OPAMP bits of all switches corresponding to the
378   * selected OPAMP instance.
379   * @param __HANDLE__: OPAMP handle
380   * @retval None
381   */
382 #define OPAMP_CSR_ALL_SWITCHES(__HANDLE__)                                     \
383   ( ( ((__HANDLE__)->Instance != OPAMP2)                                       \
384     )?                                                                         \
385      (                                                                         \
386        ((OPAMP_CSR_S3SEL1 | OPAMP_CSR_S4SEL1 | OPAMP_CSR_S5SEL1 | OPAMP_CSR_S6SEL1) << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))  \
387        |                                                                       \
388        (OPAMP_CSR_ANAWSEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__)))        \
389      )                                                                         \
390     :                                                                          \
391      (                                                                         \
392        ((OPAMP_CSR_S3SEL1 | OPAMP_CSR_S4SEL1 | OPAMP_CSR_S5SEL1 | OPAMP_CSR_S6SEL1) << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET))  \
393        |                                                                       \
394        (OPAMP_CSR_ANAWSEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__)))        \
395        |                                                                       \
396        (OPAMP_CSR_S7SEL2)                                                      \
397      )                                                                         \
398   )
399 
400 /**
401   * @brief Select the OPAMP bit ANAWSELx (switch SanA) corresponding to the
402   * selected OPAMP instance.
403   * @param __HANDLE__: OPAMP handle
404   * @retval None
405   */
406 #define OPAMP_CSR_ANAWSELX(__HANDLE__)                                         \
407   (OPAMP_CSR_ANAWSEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__)))
408 
409 /**
410   * @brief Select the OPAMP bit OPAxCALOUT in function of the selected
411   * OPAMP instance.
412   * @param __HANDLE__: OPAMP handle
413   * @retval None
414   */
415 #define OPAMP_CSR_OPAXCALOUT(__HANDLE__)                                       \
416   (OPAMP_CSR_OPA1CALOUT << (OPAMP_INSTANCE_DECIMAL(__HANDLE__)))
417 
418 /**
419   * @brief Select the OPAMP trimming bits position value (position of LSB)
420   * in register OPAMP_OTR or register OPAMP_LPOTR in function of the selected
421   * OPAMP instance and the transistors differential pair high (PMOS) or
422   * low (NMOS).
423   * @param __HANDLE__: OPAMP handle
424   * @param __TRIM_HIGH_LOW__: transistors differential pair high or low.
425   * Must be a value of @ref OPAMP_FactoryTrimming.
426   * @retval None
427   */
428 #define OPAMP_OFFSET_TRIM_BITSPOSITION(__HANDLE__, __TRIM_HIGH_LOW__)          \
429   ((OPAMP_INSTANCE_DECIMAL((__HANDLE__)) * OPAMP_OTR_INSTANCE_OFFSET) + (__TRIM_HIGH_LOW__))
430 
431 /**
432   * @brief Shift the OPAMP trimming bits to register OPAMP_OTR or register
433   * OPAMP_LPOTR in function of the selected OPAMP instance and the transistors
434   * differential pair high (PMOS) or low (NMOS).
435   * @param __HANDLE__: OPAMP handle
436   * @param __TRIM_HIGH_LOW__: transistors differential pair high or low.
437   * Must be a value of @ref OPAMP_FactoryTrimming.
438   * @param __TRIMMING_VALUE__: Trimming value
439   * @retval None
440   */
441 #define OPAMP_OFFSET_TRIM_SET(__HANDLE__, __TRIM_HIGH_LOW__, __TRIMMING_VALUE__) \
442   ((__TRIMMING_VALUE__) << (OPAMP_OFFSET_TRIM_BITSPOSITION((__HANDLE__), (__TRIM_HIGH_LOW__))))
443 
444 /**
445   * @brief Check that trimming value is within correct range
446   * @param TRIMMINGVALUE: OPAMP trimming value
447   * @retval None
448   */
449 #define IS_OPAMP_TRIMMINGVALUE(TRIMMINGVALUE) ((TRIMMINGVALUE) <= 30U)
450 
451 #define IS_OPAMP_FUNCTIONAL_NORMALMODE(INPUT) (((INPUT) == OPAMP_STANDALONE_MODE) || \
452                                                ((INPUT) == OPAMP_FOLLOWER_MODE))
453 
454 #define IS_OPAMP_INVERTING_INPUT(INPUT) (((INPUT) == OPAMP_INVERTINGINPUT_IO0) || \
455                                          ((INPUT) == OPAMP_INVERTINGINPUT_IO1)   )
456 
457 #define IS_OPAMP_POWERMODE(TRIMMING) (((TRIMMING) == OPAMP_POWERMODE_NORMAL) || \
458                                       ((TRIMMING) == OPAMP_POWERMODE_LOWPOWER) )
459 
460 #define IS_OPAMP_POWER_SUPPLY_RANGE(RANGE) (((RANGE) == OPAMP_POWERSUPPLY_LOW) || \
461                                             ((RANGE) == OPAMP_POWERSUPPLY_HIGH)  )
462 
463 #define IS_OPAMP_TRIMMING(TRIMMING) (((TRIMMING) == OPAMP_TRIMMING_FACTORY) || \
464                                      ((TRIMMING) == OPAMP_TRIMMING_USER))
465 
466 #define IS_OPAMP_FACTORYTRIMMING(TRIMMING) (((TRIMMING) == OPAMP_FACTORYTRIMMING_N) || \
467                                             ((TRIMMING) == OPAMP_FACTORYTRIMMING_P)   )
468 
469 /**
470   * @}
471   */
472 
473 
474 /* Include OPAMP HAL Extension module */
475 #include "stm32l1xx_hal_opamp_ex.h"
476 
477 /* Exported functions --------------------------------------------------------*/
478 /** @addtogroup OPAMP_Exported_Functions
479   * @{
480   */
481 
482 /** @addtogroup OPAMP_Exported_Functions_Group1
483   * @{
484   */
485 /* Initialization/de-initialization functions  **********************************/
486 HAL_StatusTypeDef HAL_OPAMP_Init(OPAMP_HandleTypeDef *hopamp);
487 HAL_StatusTypeDef HAL_OPAMP_DeInit (OPAMP_HandleTypeDef *hopamp);
488 void HAL_OPAMP_MspInit(OPAMP_HandleTypeDef *hopamp);
489 void HAL_OPAMP_MspDeInit(OPAMP_HandleTypeDef *hopamp);
490 /**
491   * @}
492   */
493 
494 /** @addtogroup OPAMP_Exported_Functions_Group2
495   * @{
496   */
497 
498 /* I/O operation functions  *****************************************************/
499 HAL_StatusTypeDef HAL_OPAMP_Start(OPAMP_HandleTypeDef *hopamp);
500 HAL_StatusTypeDef HAL_OPAMP_Stop(OPAMP_HandleTypeDef *hopamp);
501 HAL_StatusTypeDef HAL_OPAMP_SelfCalibrate(OPAMP_HandleTypeDef *hopamp);
502 
503 /**
504   * @}
505   */
506 
507 /** @addtogroup OPAMP_Exported_Functions_Group3
508   * @{
509   */
510 
511 /* Peripheral Control functions  ************************************************/
512 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
513 /* OPAMP callback registering/unregistering */
514 HAL_StatusTypeDef HAL_OPAMP_RegisterCallback (OPAMP_HandleTypeDef *hopamp, HAL_OPAMP_CallbackIDTypeDef CallbackID, pOPAMP_CallbackTypeDef pCallback);
515 HAL_StatusTypeDef HAL_OPAMP_UnRegisterCallback (OPAMP_HandleTypeDef *hopamp, HAL_OPAMP_CallbackIDTypeDef CallbackID);
516 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */
517 
518 HAL_StatusTypeDef HAL_OPAMP_Lock(OPAMP_HandleTypeDef *hopamp);
519 HAL_OPAMP_TrimmingValueTypeDef HAL_OPAMP_GetTrimOffset (OPAMP_HandleTypeDef *hopamp, uint32_t trimmingoffset);
520 
521 /**
522   * @}
523   */
524 
525 /** @addtogroup OPAMP_Exported_Functions_Group4
526   * @{
527   */
528 
529 /* Peripheral State functions  **************************************************/
530 HAL_OPAMP_StateTypeDef HAL_OPAMP_GetState(OPAMP_HandleTypeDef *hopamp);
531 
532 /**
533   * @}
534   */
535 
536 /**
537   * @}
538   */
539 
540 /**
541   * @}
542   */
543 
544 /**
545   * @}
546   */
547 
548 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX || STM32L162xC || STM32L152xC || STM32L151xC */
549 #ifdef __cplusplus
550 }
551 #endif
552 
553 #endif /* STM32L1xx_HAL_OPAMP_H */
554 
555