stm32f3xx_hal_opamp.h 22 KB

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