20#ifndef STM32H7xx_HAL_OPAMP_H
21#define STM32H7xx_HAL_OPAMP_H
125#if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
126typedef struct __OPAMP_HandleTypeDef
137#if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
138void (* MspInitCallback) (
struct __OPAMP_HandleTypeDef *hopamp);
139void (* MspDeInitCallback) (
struct __OPAMP_HandleTypeDef *hopamp);
149#if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
155 HAL_OPAMP_MSPINIT_CB_ID = 0x01U,
156 HAL_OPAMP_MSPDEINIT_CB_ID = 0x02U,
157 HAL_OPAMP_ALL_CB_ID = 0x03U
158}HAL_OPAMP_CallbackIDTypeDef;
179#define OPAMP_STANDALONE_MODE 0x00000000U
180#define OPAMP_PGA_MODE OPAMP_CSR_VMSEL_1
181#define OPAMP_FOLLOWER_MODE (OPAMP_CSR_VMSEL_1 | OPAMP_CSR_VMSEL_0)
192#define OPAMP_NONINVERTINGINPUT_IO0 0x00000000U
193#define OPAMP_NONINVERTINGINPUT_DAC_CH OPAMP_CSR_VPSEL_0
195#define OPAMP_NONINVERTINGINPUT_DAC2_CH OPAMP_CSR_VPSEL_1
207#define OPAMP_INVERTINGINPUT_IO0 0x00000000U
208#define OPAMP_INVERTINGINPUT_IO1 OPAMP_CSR_VMSEL_0
219#define OPAMP_PGA_CONNECT_INVERTINGINPUT_NO 0x00000000U
220#define OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0 OPAMP_CSR_PGGAIN_2
221#define OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0_BIAS OPAMP_CSR_PGGAIN_3
222#define OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0_IO1_BIAS (OPAMP_CSR_PGGAIN_2 | OPAMP_CSR_PGGAIN_3)
234#define OPAMP_PGA_GAIN_2_OR_MINUS_1 0x00000000U
235#define OPAMP_PGA_GAIN_4_OR_MINUS_3 OPAMP_CSR_PGGAIN_0
236#define OPAMP_PGA_GAIN_8_OR_MINUS_7 OPAMP_CSR_PGGAIN_1
237#define OPAMP_PGA_GAIN_16_OR_MINUS_15 (OPAMP_CSR_PGGAIN_0 | OPAMP_CSR_PGGAIN_1)
247#define OPAMP_POWERMODE_NORMAL 0x00000000U
248#define OPAMP_POWERMODE_HIGHSPEED OPAMP_CSR_OPAHSM
260#define OPAMP_VREF_3VDDA 0x00000000U
261#define OPAMP_VREF_10VDDA OPAMP_CSR_CALSEL_0
262#define OPAMP_VREF_50VDDA OPAMP_CSR_CALSEL_1
263#define OPAMP_VREF_90VDDA OPAMP_CSR_CALSEL
273#define OPAMP_TRIMMING_FACTORY 0x00000000U
274#define OPAMP_TRIMMING_USER OPAMP_CSR_USERTRIM
285#define OPAMP_FACTORYTRIMMING_DUMMY 0xFFFFFFFFU
287#define OPAMP_FACTORYTRIMMING_N 0x00000000U
288#define OPAMP_FACTORYTRIMMING_P 0x00000001U
306#define OPAMP_INPUT_NONINVERTING (8U)
312#define OPAMP_TRIMMING_DELAY (2U)
328#define __HAL_OPAMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_OPAMP_STATE_RESET)
341#define IS_OPAMP_FUNCTIONAL_NORMALMODE(INPUT) (((INPUT) == OPAMP_STANDALONE_MODE) || \
342 ((INPUT) == OPAMP_PGA_MODE) || \
343 ((INPUT) == OPAMP_FOLLOWER_MODE))
345#define IS_OPAMP_INVERTING_INPUT_STANDALONE(INPUT) (((INPUT) == OPAMP_INVERTINGINPUT_IO0) || \
346 ((INPUT) == OPAMP_INVERTINGINPUT_IO1))
349#define IS_OPAMP_NONINVERTING_INPUT(INPUT) (((INPUT) == OPAMP_NONINVERTINGINPUT_IO0) || \
350 ((INPUT) == OPAMP_NONINVERTINGINPUT_DAC_CH) || \
351 ((INPUT) == OPAMP_NONINVERTINGINPUT_DAC2_CH))
353#define IS_OPAMP_NONINVERTING_INPUT(INPUT) (((INPUT) == OPAMP_NONINVERTINGINPUT_IO0) || \
354 ((INPUT) == OPAMP_NONINVERTINGINPUT_DAC_CH))
357#define IS_OPAMP_PGACONNECT(CONNECT) (((CONNECT) == OPAMP_PGA_CONNECT_INVERTINGINPUT_NO) || \
358 ((CONNECT) == OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0) || \
359 ((CONNECT) == OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0_BIAS) || \
360 ((CONNECT) == OPAMP_PGA_CONNECT_INVERTINGINPUT_IO0_IO1_BIAS))
362#define IS_OPAMP_PGA_GAIN(GAIN) (((GAIN) == OPAMP_PGA_GAIN_2_OR_MINUS_1) || \
363 ((GAIN) == OPAMP_PGA_GAIN_4_OR_MINUS_3) || \
364 ((GAIN) == OPAMP_PGA_GAIN_8_OR_MINUS_7) || \
365 ((GAIN) == OPAMP_PGA_GAIN_16_OR_MINUS_15))
368#define IS_OPAMP_VREF(VREF) (((VREF) == OPAMP_VREF_3VDDA) || \
369 ((VREF) == OPAMP_VREF_10VDDA) || \
370 ((VREF) == OPAMP_VREF_50VDDA) || \
371 ((VREF) == OPAMP_VREF_90VDDA))
373#define IS_OPAMP_POWERMODE(TRIMMING) (((TRIMMING) == OPAMP_POWERMODE_NORMAL) || \
374 ((TRIMMING) == OPAMP_POWERMODE_HIGHSPEED) )
377#define IS_OPAMP_TRIMMING(TRIMMING) (((TRIMMING) == OPAMP_TRIMMING_FACTORY) || \
378 ((TRIMMING) == OPAMP_TRIMMING_USER))
381#define IS_OPAMP_TRIMMINGVALUE(TRIMMINGVALUE) ((TRIMMINGVALUE) <= 0x1FU)
383#define IS_OPAMP_FACTORYTRIMMING(TRIMMING) (((TRIMMING) == OPAMP_FACTORYTRIMMING_N) || \
384 ((TRIMMING) == OPAMP_FACTORYTRIMMING_P))
428#if (USE_HAL_OPAMP_REGISTER_CALLBACKS == 1)
#define __IO
Definition: core_cm4.h:239
uint32_t HAL_OPAMP_TrimmingValueTypeDef
HAl_OPAMP_TrimmingValueTypeDef definition.
Definition: stm32h7xx_hal_opamp.h:147
HAL_OPAMP_StateTypeDef
HAL State structures definition
Definition: stm32h7xx_hal_opamp.h:110
@ HAL_OPAMP_STATE_BUSYLOCKED
Definition: stm32h7xx_hal_opamp.h:117
@ HAL_OPAMP_STATE_CALIBBUSY
Definition: stm32h7xx_hal_opamp.h:114
@ HAL_OPAMP_STATE_RESET
Definition: stm32h7xx_hal_opamp.h:111
@ HAL_OPAMP_STATE_BUSY
Definition: stm32h7xx_hal_opamp.h:116
@ HAL_OPAMP_STATE_READY
Definition: stm32h7xx_hal_opamp.h:113
This file contains HAL common defines, enumeration, macros and structures definitions.
HAL_StatusTypeDef
HAL Status structures definition.
Definition: stm32h7xx_hal_def.h:47
HAL_LockTypeDef
HAL Lock structures definition.
Definition: stm32h7xx_hal_def.h:58
Header file of OPAMP HAL Extended module.
OPAMP Handle Structure definition.
Definition: stm32h7xx_hal_opamp.h:130
OPAMP_TypeDef * Instance
Definition: stm32h7xx_hal_opamp.h:131
HAL_StatusTypeDef Status
Definition: stm32h7xx_hal_opamp.h:133
HAL_LockTypeDef Lock
Definition: stm32h7xx_hal_opamp.h:134
OPAMP_InitTypeDef Init
Definition: stm32h7xx_hal_opamp.h:132
__IO HAL_OPAMP_StateTypeDef State
Definition: stm32h7xx_hal_opamp.h:135
OPAMP Init structure definition
Definition: stm32h7xx_hal_opamp.h:50
uint32_t Mode
Definition: stm32h7xx_hal_opamp.h:55
uint32_t NonInvertingInput
Definition: stm32h7xx_hal_opamp.h:66
uint32_t UserTrimming
Definition: stm32h7xx_hal_opamp.h:79
uint32_t InvertingInput
Definition: stm32h7xx_hal_opamp.h:59
uint32_t PowerMode
Definition: stm32h7xx_hal_opamp.h:52
uint32_t TrimmingValueN
Definition: stm32h7xx_hal_opamp.h:88
uint32_t TrimmingValueP
Definition: stm32h7xx_hal_opamp.h:83
uint32_t TrimmingValuePHighSpeed
Definition: stm32h7xx_hal_opamp.h:93
uint32_t TrimmingValueNHighSpeed
Definition: stm32h7xx_hal_opamp.h:98
uint32_t PgaConnect
Definition: stm32h7xx_hal_opamp.h:73
uint32_t PgaGain
Definition: stm32h7xx_hal_opamp.h:69
Operational Amplifier (OPAMP)
Definition: stm32h723xx.h:1083