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