1 /** 2 ****************************************************************************** 3 * @file stm32f3xx_hal_opamp.h 4 * @author MCD Application Team 5 * @brief Header file of OPAMP HAL module. 6 ****************************************************************************** 7 * @attention 8 * 9 * Copyright (c) 2016 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 STM32F3xx_HAL_OPAMP_H 21 #define STM32F3xx_HAL_OPAMP_H 22 23 #ifdef __cplusplus 24 extern "C" { 25 #endif 26 27 #if defined (OPAMP1) || defined (OPAMP2) || defined (OPAMP3) || defined (OPAMP4) 28 29 /* Includes ------------------------------------------------------------------*/ 30 #include "stm32f3xx_hal_def.h" 31 32 /** @addtogroup STM32F3xx_HAL_Driver 33 * @{ 34 */ 35 36 /** @addtogroup OPAMP 37 * @{ 38 */ 39 40 /* Exported types ------------------------------------------------------------*/ 41 /** @defgroup OPAMP_Exported_Types OPAMP Exported Types 42 * @{ 43 */ 44 45 /** 46 * @brief OPAMP Init structure definition 47 */ 48 49 typedef struct 50 { 51 uint32_t Mode; /*!< Specifies the OPAMP mode 52 This parameter must be a value of @ref OPAMP_Mode 53 mode is either Standalone, - Follower or PGA */ 54 55 uint32_t InvertingInput; /*!< Specifies the inverting input in Standalone & Pga modes 56 - In Standalone mode: i.e when mode is OPAMP_STANDALONE_MODE 57 This parameter must be a value of @ref OPAMP_InvertingInput 58 InvertingInput is either VM0 or VM1 59 - In PGA mode: i.e when mode is OPAMP_PGA_MODE 60 & in Follower mode i.e when mode is OPAMP_FOLLOWER_MODE 61 This parameter is Not Applicable */ 62 63 uint32_t NonInvertingInput; /*!< Specifies the non inverting input of the opamp: 64 This parameter must be a value of @ref OPAMP_NonInvertingInput 65 NonInvertingInput is either VP0, VP1, VP2 or VP3 */ 66 67 uint32_t TimerControlledMuxmode; /*!< Specifies if the Timer controlled Mux mode is enabled or disabled 68 This parameter must be a value of @ref OPAMP_TimerControlledMuxmode */ 69 70 uint32_t InvertingInputSecondary; /*!< Specifies the inverting input (secondary) of the opamp when 71 TimerControlledMuxmode is enabled 72 i.e. when TimerControlledMuxmode is OPAMP_TIMERCONTROLLEDMUXMODE_ENABLE 73 - In Standalone mode: i.e when mode is OPAMP_STANDALONE_MODE 74 This parameter must be a value of @ref OPAMP_InvertingInputSecondary 75 InvertingInputSecondary is either VM0 or VM1 76 - In PGA mode: i.e when mode is OPAMP_PGA_MODE 77 & in Follower mode i.e when mode is OPAMP_FOLLOWER_MODE 78 This parameter is Not Applicable */ 79 80 uint32_t NonInvertingInputSecondary; /*!< Specifies the non inverting input (secondary) of the opamp when 81 TimerControlledMuxmode is enabled 82 i.e. when TimerControlledMuxmode is OPAMP_TIMERCONTROLLEDMUXMODE_ENABLE 83 This parameter must be a value of @ref OPAMP_NonInvertingInputSecondary 84 NonInvertingInput is either VP0, VP1, VP2 or VP3 */ 85 86 uint32_t PgaConnect; /*!< Specifies the inverting pin in PGA mode 87 i.e. when mode is OPAMP_PGA_MODE 88 This parameter must be a value of @ref OPAMP_PgaConnect 89 Either: not connected, connected to VM0, connected to VM1 90 (VM0 or VM1 are typically used for external filtering) */ 91 92 uint32_t PgaGain; /*!< Specifies the gain in PGA mode 93 i.e. when mode is OPAMP_PGA_MODE. 94 This parameter must be a value of @ref OPAMP_PgaGain (2U, 4U, 8 or 16U ) */ 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 100 uint32_t TrimmingValueP; /*!< Specifies the offset trimming value (PMOS) 101 i.e. when UserTrimming is OPAMP_TRIMMING_USER. 102 This parameter must be a number between Min_Data = 1 and Max_Data = 31U */ 103 104 uint32_t TrimmingValueN; /*!< Specifies the offset trimming value (NMOS) 105 i.e. when UserTrimming is OPAMP_TRIMMING_USER. 106 This parameter must be a number between Min_Data = 1 and Max_Data = 31U */ 107 108 } OPAMP_InitTypeDef; 109 110 /** 111 * @brief HAL State structures definition 112 */ 113 114 typedef enum 115 { 116 HAL_OPAMP_STATE_RESET = 0x00000000U, /*!< OPMAP is not yet Initialized */ 117 118 HAL_OPAMP_STATE_READY = 0x00000001U, /*!< OPAMP is initialized and ready for use */ 119 HAL_OPAMP_STATE_CALIBBUSY = 0x00000002U, /*!< OPAMP is enabled in auto calibration mode */ 120 121 HAL_OPAMP_STATE_BUSY = 0x00000004U, /*!< OPAMP is enabled and running in normal mode */ 122 HAL_OPAMP_STATE_BUSYLOCKED = 0x00000005U, /*!< OPAMP is locked 123 only system reset allows reconfiguring the opamp. */ 124 125 }HAL_OPAMP_StateTypeDef; 126 127 /** 128 * @brief OPAMP Handle Structure definition to @brief OPAMP Handle Structure definition 129 */ 130 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1) 131 typedef struct __OPAMP_HandleTypeDef 132 #else 133 typedef struct 134 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */ 135 { 136 OPAMP_TypeDef *Instance; /*!< OPAMP instance's registers base address */ 137 OPAMP_InitTypeDef Init; /*!< OPAMP required parameters */ 138 HAL_StatusTypeDef Status; /*!< OPAMP peripheral status */ 139 HAL_LockTypeDef Lock; /*!< Locking object */ 140 __IO HAL_OPAMP_StateTypeDef State; /*!< OPAMP communication state */ 141 142 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1) 143 void (* MspInitCallback) (struct __OPAMP_HandleTypeDef *hopamp); 144 void (* MspDeInitCallback) (struct __OPAMP_HandleTypeDef *hopamp); 145 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */ 146 147 } OPAMP_HandleTypeDef; 148 149 /** 150 * @brief OPAMP_TrimmingValueTypeDef @brief definition 151 */ 152 153 typedef uint32_t OPAMP_TrimmingValueTypeDef; 154 /** 155 * @} 156 */ 157 158 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1) 159 /** 160 * @brief HAL OPAMP Callback ID enumeration definition 161 */ 162 typedef enum 163 { 164 HAL_OPAMP_MSP_INIT_CB_ID = 0x01U, /*!< OPAMP MspInit Callback ID */ 165 HAL_OPAMP_MSP_DEINIT_CB_ID = 0x02U, /*!< OPAMP MspDeInit Callback ID */ 166 HAL_OPAMP_ALL_CB_ID = 0x03U /*!< OPAMP All ID */ 167 } HAL_OPAMP_CallbackIDTypeDef; 168 169 /** 170 * @brief HAL OPAMP Callback pointer definition 171 */ 172 typedef void (*pOPAMP_CallbackTypeDef)(OPAMP_HandleTypeDef *hopamp); 173 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */ 174 175 /* Exported constants --------------------------------------------------------*/ 176 /** @defgroup OPAMP_Exported_Constants OPAMP Exported Constants 177 * @{ 178 */ 179 180 /** @defgroup OPAMP_CSR_INIT OPAMP CSR init register Mask 181 * @{ 182 */ 183 /* Used for Init phase */ 184 #define OPAMP_CSR_UPDATE_PARAMETERS_INIT_MASK (OPAMP_CSR_TRIMOFFSETN | OPAMP_CSR_TRIMOFFSETP \ 185 | OPAMP_CSR_USERTRIM | OPAMP_CSR_PGGAIN | OPAMP_CSR_VPSSEL \ 186 | OPAMP_CSR_VMSSEL | OPAMP_CSR_TCMEN | OPAMP_CSR_VPSEL \ 187 | OPAMP_CSR_VMSEL | OPAMP_CSR_FORCEVP) 188 189 /** 190 * @} 191 */ 192 193 /** @defgroup OPAMP_Mode OPAMP Mode 194 * @{ 195 */ 196 #define OPAMP_STANDALONE_MODE (0x00000000U) /*!< standalone mode */ 197 #define OPAMP_PGA_MODE OPAMP_CSR_VMSEL_1 /*!< PGA mode */ 198 #define OPAMP_FOLLOWER_MODE OPAMP_CSR_VMSEL /*!< follower mode */ 199 200 201 #define IS_OPAMP_FUNCTIONAL_NORMALMODE(INPUT) (((INPUT) == OPAMP_STANDALONE_MODE) || \ 202 ((INPUT) == OPAMP_PGA_MODE) || \ 203 ((INPUT) == OPAMP_FOLLOWER_MODE)) 204 205 /** 206 * @} 207 */ 208 209 /** @defgroup OPAMP_NonInvertingInput OPAMP Non Inverting Input 210 * @{ 211 */ 212 213 #define OPAMP_NONINVERTINGINPUT_IO0 OPAMP_CSR_VPSEL /*!< VP0 (PA1 for OPAMP1, VP0 PA7 for OPAMP2, VP0 PB0 for OPAMP3, VP0 PB13 for OPAMP4) 214 connected to OPAMPx non inverting input */ 215 #define OPAMP_NONINVERTINGINPUT_IO1 (0x00000000U) /*!< VP1 (PA7 for OPAMP1, VP3 PD14 for OPAMP2, VP1 PB13 for OPAMP3, VP1 PD11 for OPAMP4) 216 connected to OPAMPx non inverting input */ 217 #define OPAMP_NONINVERTINGINPUT_IO2 OPAMP_CSR_VPSEL_1 /*!< VP2 (PA3 for OPAMP1, VP2 PB0 for OPAMP2, VP2 PA1 for OPAMP3, VP3 PA4 for OPAMP4) 218 connected to OPAMPx non inverting input */ 219 #define OPAMP_NONINVERTINGINPUT_IO3 OPAMP_CSR_VPSEL_0 /*!< VP3 (PA5 for OPAMP1, VP1 PB14 for OPAMP2, VP3 PA5 for OPAMP3, VP2 PB11 for OPAMP4) 220 connected to OPAMPx non inverting input */ 221 222 #define IS_OPAMP_NONINVERTING_INPUT(INPUT) (((INPUT) == OPAMP_NONINVERTINGINPUT_IO0) || \ 223 ((INPUT) == OPAMP_NONINVERTINGINPUT_IO1) || \ 224 ((INPUT) == OPAMP_NONINVERTINGINPUT_IO2) || \ 225 ((INPUT) == OPAMP_NONINVERTINGINPUT_IO3)) 226 227 /** 228 * @} 229 */ 230 231 /** @defgroup OPAMP_InvertingInput OPAMP Inverting Input 232 * @{ 233 */ 234 235 #define OPAMP_INVERTINGINPUT_IO0 (0x00000000U) /*!< inverting input connected to VM0 */ 236 #define OPAMP_INVERTINGINPUT_IO1 OPAMP_CSR_VMSEL_0 /*!< inverting input connected to VM1 */ 237 238 #define IS_OPAMP_INVERTING_INPUT(INPUT) (((INPUT) == OPAMP_INVERTINGINPUT_IO0) || \ 239 ((INPUT) == OPAMP_INVERTINGINPUT_IO1)) 240 241 /** 242 * @} 243 */ 244 245 /** @defgroup OPAMP_TimerControlledMuxmode OPAMP Timer Controlled Mux mode 246 * @{ 247 */ 248 #define OPAMP_TIMERCONTROLLEDMUXMODE_DISABLE (0x00000000U) /*!< Timer controlled Mux mode disabled */ 249 #define OPAMP_TIMERCONTROLLEDMUXMODE_ENABLE OPAMP_CSR_TCMEN /*!< Timer controlled Mux mode enabled */ 250 251 #define IS_OPAMP_TIMERCONTROLLED_MUXMODE(MUXMODE) (((MUXMODE) == OPAMP_TIMERCONTROLLEDMUXMODE_DISABLE) || \ 252 ((MUXMODE) == OPAMP_TIMERCONTROLLEDMUXMODE_ENABLE)) 253 /** 254 * @} 255 */ 256 257 /** @defgroup OPAMP_NonInvertingInputSecondary OPAMP Non Inverting Input Secondary 258 * @{ 259 */ 260 261 #define OPAMP_SEC_NONINVERTINGINPUT_IO0 OPAMP_CSR_VPSSEL /*!< VP0 (PA1 for OPAMP1, PA7 for OPAMP2, PB0 for OPAMP3, PB13 for OPAMP4) 262 connected to OPAMPx non inverting input */ 263 #define OPAMP_SEC_NONINVERTINGINPUT_IO1 (0x00000000U) /*!< VP1 (PA7 for OPAMP1, PD14 for OPAMP2, PB13 for OPAMP3, PD11 for OPAMP4) 264 connected to OPAMPx non inverting input */ 265 #define OPAMP_SEC_NONINVERTINGINPUT_IO2 OPAMP_CSR_VPSSEL_1 /*!< VP2 (PA3 for OPAMP1, PB0 for OPAMP2, PA1 for OPAMP3, PA4 for OPAMP4) 266 connected to OPAMPx non inverting input */ 267 #define OPAMP_SEC_NONINVERTINGINPUT_IO3 OPAMP_CSR_VPSSEL_0 /*!< VP3 (PA5 for OPAMP1, PB14 for OPAMP2, PA5 for OPAMP3, PB11 for OPAMP4) 268 connected to OPAMPx non inverting input */ 269 270 #define IS_OPAMP_SEC_NONINVERTINGINPUT(INPUT) (((INPUT) == OPAMP_SEC_NONINVERTINGINPUT_IO0) || \ 271 ((INPUT) == OPAMP_SEC_NONINVERTINGINPUT_IO1) || \ 272 ((INPUT) == OPAMP_SEC_NONINVERTINGINPUT_IO2) || \ 273 ((INPUT) == OPAMP_SEC_NONINVERTINGINPUT_IO3)) 274 275 /** 276 * @} 277 */ 278 279 /** @defgroup OPAMP_InvertingInputSecondary OPAMP Inverting Input Secondary 280 * @{ 281 */ 282 283 #define OPAMP_SEC_INVERTINGINPUT_IO0 (0x00000000U) /*!< VM0 (PC5 for OPAMP1 and OPAMP2, PB10 for OPAMP3 and OPAMP4) 284 connected to OPAMPx inverting input */ 285 #define OPAMP_SEC_INVERTINGINPUT_IO1 OPAMP_CSR_VMSSEL /*!< VM1 (PA3 for OPAMP1, PA5 for OPAMP2, PB2 for OPAMP3, PD8 for OPAMP4) 286 connected to OPAMPx inverting input */ 287 288 #define IS_OPAMP_SEC_INVERTINGINPUT(INPUT) (((INPUT) == OPAMP_SEC_INVERTINGINPUT_IO0) || \ 289 ((INPUT) == OPAMP_SEC_INVERTINGINPUT_IO1)) 290 291 /** 292 * @} 293 */ 294 295 /** @defgroup OPAMP_PgaConnect OPAMP Pga Connect 296 * @{ 297 */ 298 299 #define OPAMP_PGA_CONNECT_INVERTINGINPUT_NO (0x00000000U) /*!< In PGA mode, the non inverting input is not connected */ 300 #define OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 OPAMP_CSR_PGGAIN_3 /*!< In PGA mode, the non inverting input is connected to VM0 */ 301 #define OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1 (OPAMP_CSR_PGGAIN_2 | OPAMP_CSR_PGGAIN_3) /*!< In PGA mode, the non inverting input is connected to VM1 */ 302 303 #define IS_OPAMP_PGACONNECT(CONNECT) (((CONNECT) == OPAMP_PGA_CONNECT_INVERTINGINPUT_NO) || \ 304 ((CONNECT) == OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0) || \ 305 ((CONNECT) == OPAMP_PGA_CONNECT_INVERTINGINPUT_IO1)) 306 /** 307 * @} 308 */ 309 310 311 /** @defgroup OPAMP_PgaGain OPAMP Pga Gain 312 * @{ 313 */ 314 315 #define OPAMP_PGA_GAIN_2 (0x00000000U) /*!< PGA gain = 2 */ 316 #define OPAMP_PGA_GAIN_4 OPAMP_CSR_PGGAIN_0 /*!< PGA gain = 4 */ 317 #define OPAMP_PGA_GAIN_8 OPAMP_CSR_PGGAIN_1 /*!< PGA gain = 8 */ 318 #define OPAMP_PGA_GAIN_16 (OPAMP_CSR_PGGAIN_0 | OPAMP_CSR_PGGAIN_1) /*!< PGA gain = 16 */ 319 320 #define IS_OPAMP_PGA_GAIN(GAIN) (((GAIN) == OPAMP_PGA_GAIN_2) || \ 321 ((GAIN) == OPAMP_PGA_GAIN_4) || \ 322 ((GAIN) == OPAMP_PGA_GAIN_8) || \ 323 ((GAIN) == OPAMP_PGA_GAIN_16)) 324 /** 325 * @} 326 */ 327 328 /** @defgroup OPAMP_UserTrimming OPAMP User Trimming 329 * @{ 330 */ 331 332 #define OPAMP_TRIMMING_FACTORY (0x00000000U) /*!< Factory trimming */ 333 #define OPAMP_TRIMMING_USER OPAMP_CSR_USERTRIM /*!< User trimming */ 334 335 #define IS_OPAMP_TRIMMING(TRIMMING) (((TRIMMING) == OPAMP_TRIMMING_FACTORY) || \ 336 ((TRIMMING) == OPAMP_TRIMMING_USER)) 337 338 /** @defgroup OPAMP_FactoryTrimming OPAMP Factory Trimming 339 * @{ 340 */ 341 342 #define OPAMP_FACTORYTRIMMING_DUMMY (0xFFFFFFFFU) /*!< Dummy trimming value */ 343 344 #define OPAMP_FACTORYTRIMMING_N (0x00000000U) /*!< Offset trimming N */ 345 #define OPAMP_FACTORYTRIMMING_P (0x00000001U) /*!< Offset trimming P */ 346 347 #define IS_OPAMP_FACTORYTRIMMING(TRIMMING) (((TRIMMING) == OPAMP_FACTORYTRIMMING_N) || \ 348 ((TRIMMING) == OPAMP_FACTORYTRIMMING_P)) 349 350 /** 351 * @} 352 */ 353 354 355 /** @defgroup OPAMP_TrimmingValue OPAMP Trimming Value 356 * @{ 357 */ 358 359 #define IS_OPAMP_TRIMMINGVALUE(TRIMMINGVALUE) ((TRIMMINGVALUE) <= 0x1FU) 360 361 362 /** 363 * @} 364 */ 365 366 367 /** @defgroup OPAMP_Input OPAMP Input 368 * @{ 369 */ 370 371 #define OPAMP_INPUT_INVERTING (24U) /*!< Inverting input */ 372 #define OPAMP_INPUT_NONINVERTING (19U) /*!< Non inverting input */ 373 374 #define IS_OPAMP_INPUT(INPUT) (((INPUT) == OPAMP_INPUT_INVERTING) || \ 375 ((INPUT) == OPAMP_INPUT_NONINVERTING)) 376 /** 377 * @} 378 */ 379 380 381 /** @defgroup OPAMP_VREF OPAMP VREF 382 * @{ 383 */ 384 385 #define OPAMP_VREF_3VDDA (0x00000000U) /*!< OPMAP Vref = 3.3U% VDDA */ 386 #define OPAMP_VREF_10VDDA OPAMP_CSR_CALSEL_0 /*!< OPMAP Vref = 10U% VDDA */ 387 #define OPAMP_VREF_50VDDA OPAMP_CSR_CALSEL_1 /*!< OPMAP Vref = 50U% VDDA */ 388 #define OPAMP_VREF_90VDDA OPAMP_CSR_CALSEL /*!< OPMAP Vref = 90U% VDDA */ 389 390 #define IS_OPAMP_VREF(VREF) (((VREF) == OPAMP_VREF_3VDDA) || \ 391 ((VREF) == OPAMP_VREF_10VDDA) || \ 392 ((VREF) == OPAMP_VREF_50VDDA) || \ 393 ((VREF) == OPAMP_VREF_90VDDA)) 394 395 /** 396 * @} 397 */ 398 399 /** @defgroup OPAMP_Vref2ADCforCalib OPAMP Vref2ADCforCalib 400 * @{ 401 */ 402 403 #define OPAMP_VREF_NOTCONNECTEDTO_ADC (0x00000000U) /*!< VREF not connected to ADC */ 404 #define OPAMP_VREF_CONNECTEDTO_ADC (0x00000001U) /*!< VREF not connected to ADC */ 405 406 #define IS_OPAMP_ALLOPAMPVREF_CONNECT(CONNECT) (((CONNECT) == OPAMP_VREF_NOTCONNECTEDTO_ADC) || \ 407 ((CONNECT) == OPAMP_VREF_CONNECTEDTO_ADC)) 408 409 410 /** 411 * @} 412 */ 413 414 /** 415 * @} 416 */ 417 418 /* Exported macros -----------------------------------------------------------*/ 419 /** @defgroup OPAMP_Exported_Macros OPAMP Exported Macros 420 * @{ 421 */ 422 423 /** @brief Reset OPAMP handle state 424 * @param __HANDLE__ OPAMP handle. 425 * @retval None 426 */ 427 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1) 428 #define __HAL_OPAMP_RESET_HANDLE_STATE(__HANDLE__) do { \ 429 (__HANDLE__)->State = HAL_OPAMP_STATE_RESET; \ 430 (__HANDLE__)->MspInitCallback = NULL; \ 431 (__HANDLE__)->MspDeInitCallback = NULL; \ 432 } while(0) 433 #else 434 #define __HAL_OPAMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_OPAMP_STATE_RESET) 435 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */ 436 437 /** 438 * @} 439 */ 440 441 /* Include OPAMP HAL Extended module */ 442 #include "stm32f3xx_hal_opamp_ex.h" 443 444 /* Exported functions --------------------------------------------------------*/ 445 /** @defgroup OPAMP_Exported_Functions OPAMP Exported Functions 446 * @{ 447 */ 448 449 /** @defgroup OPAMP_Exported_Functions_Group1 Initialization and de-initialization functions 450 * @{ 451 */ 452 453 /* Initialization/de-initialization functions **********************************/ 454 HAL_StatusTypeDef HAL_OPAMP_Init(OPAMP_HandleTypeDef *hopamp); 455 HAL_StatusTypeDef HAL_OPAMP_DeInit(OPAMP_HandleTypeDef *hopamp); 456 void HAL_OPAMP_MspInit(OPAMP_HandleTypeDef *hopamp); 457 void HAL_OPAMP_MspDeInit(OPAMP_HandleTypeDef *hopamp); 458 /** 459 * @} 460 */ 461 462 463 /** @defgroup OPAMP_Exported_Functions_Group2 Input and Output operation functions 464 * @{ 465 */ 466 467 /* I/O operation functions *****************************************************/ 468 HAL_StatusTypeDef HAL_OPAMP_Start(OPAMP_HandleTypeDef *hopamp); 469 HAL_StatusTypeDef HAL_OPAMP_Stop(OPAMP_HandleTypeDef *hopamp); 470 HAL_StatusTypeDef HAL_OPAMP_SelfCalibrate(OPAMP_HandleTypeDef *hopamp); 471 472 /** 473 * @} 474 */ 475 476 /** @defgroup OPAMP_Exported_Functions_Group3 Peripheral Control functions 477 * @{ 478 */ 479 480 /* Peripheral Control functions ************************************************/ 481 #if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1) 482 /* OPAMP callback registering/unregistering */ 483 HAL_StatusTypeDef HAL_OPAMP_RegisterCallback(OPAMP_HandleTypeDef *hopamp, HAL_OPAMP_CallbackIDTypeDef CallbackId, pOPAMP_CallbackTypeDef pCallback); 484 HAL_StatusTypeDef HAL_OPAMP_UnRegisterCallback(OPAMP_HandleTypeDef *hopamp, HAL_OPAMP_CallbackIDTypeDef CallbackId); 485 #endif /* USE_HAL_OPAMP_REGISTER_CALLBACKS */ 486 487 HAL_StatusTypeDef HAL_OPAMP_Lock(OPAMP_HandleTypeDef *hopamp); 488 489 /** 490 * @} 491 */ 492 493 /** @defgroup OPAMP_Exported_Functions_Group4 Peripheral State functions 494 * @{ 495 */ 496 497 /* Peripheral State functions **************************************************/ 498 HAL_OPAMP_StateTypeDef HAL_OPAMP_GetState(OPAMP_HandleTypeDef *hopamp); 499 OPAMP_TrimmingValueTypeDef HAL_OPAMP_GetTrimOffset(OPAMP_HandleTypeDef *hopamp, uint32_t trimmingoffset); 500 501 /** 502 * @} 503 */ 504 505 /** 506 * @} 507 */ 508 509 /** 510 * @} 511 */ 512 513 /** 514 * @} 515 */ 516 517 #endif /* OPAMP1 || OPAMP2 || OPAMP3 || OPAMP4 */ 518 519 #ifdef __cplusplus 520 } 521 #endif 522 523 #endif /* STM32F3xx_HAL_OPAMP_H */ 524 525