stm32f30x_opamp.h
Go to the documentation of this file.
1 
29 /* Define to prevent recursive inclusion -------------------------------------*/
30 #ifndef __STM32F30x_OPAMP_H
31 #define __STM32F30x_OPAMP_H
32 
33 #ifdef __cplusplus
34  extern "C" {
35 #endif
36 
37 /* Includes ------------------------------------------------------------------*/
38 #include "stm32f30x.h"
39 
48 /* Exported types ------------------------------------------------------------*/
49 
54 typedef struct
55 {
56 
64 
65 /* Exported constants --------------------------------------------------------*/
66 
75 #define OPAMP_Selection_OPAMP1 ((uint32_t)0x00000000)
76 #define OPAMP_Selection_OPAMP2 ((uint32_t)0x00000004)
77 #define OPAMP_Selection_OPAMP3 ((uint32_t)0x00000008)
78 #define OPAMP_Selection_OPAMP4 ((uint32_t)0x0000000C)
80 #define IS_OPAMP_ALL_PERIPH(PERIPH) (((PERIPH) == OPAMP_Selection_OPAMP1) || \
81  ((PERIPH) == OPAMP_Selection_OPAMP2) || \
82  ((PERIPH) == OPAMP_Selection_OPAMP3) || \
83  ((PERIPH) == OPAMP_Selection_OPAMP4))
84 
93 #define OPAMP_InvertingInput_IO1 ((uint32_t)0x00000000)
95 #define OPAMP_InvertingInput_IO2 OPAMP_CSR_VMSEL_0
97 #define OPAMP_InvertingInput_PGA OPAMP_CSR_VMSEL_1
98 #define OPAMP_InvertingInput_Vout OPAMP_CSR_VMSEL
100 #define IS_OPAMP_INVERTING_INPUT(INPUT) (((INPUT) == OPAMP_InvertingInput_IO1) || \
101  ((INPUT) == OPAMP_InvertingInput_IO2) || \
102  ((INPUT) == OPAMP_InvertingInput_PGA) || \
103  ((INPUT) == OPAMP_InvertingInput_Vout))
104 
112 #define OPAMP_NonInvertingInput_IO1 ((uint32_t)0x00000000)
114 #define OPAMP_NonInvertingInput_IO2 OPAMP_CSR_VPSEL_0
116 #define OPAMP_NonInvertingInput_IO3 OPAMP_CSR_VPSEL_1
118 #define OPAMP_NonInvertingInput_IO4 OPAMP_CSR_VPSEL
121 #define IS_OPAMP_NONINVERTING_INPUT(INPUT) (((INPUT) == OPAMP_NonInvertingInput_IO1) || \
122  ((INPUT) == OPAMP_NonInvertingInput_IO2) || \
123  ((INPUT) == OPAMP_NonInvertingInput_IO3) || \
124  ((INPUT) == OPAMP_NonInvertingInput_IO4))
125 
133 #define OPAMP_OPAMP_PGAGain_2 ((uint32_t)0x00000000)
134 #define OPAMP_OPAMP_PGAGain_4 OPAMP_CSR_PGGAIN_0
135 #define OPAMP_OPAMP_PGAGain_8 OPAMP_CSR_PGGAIN_1
136 #define OPAMP_OPAMP_PGAGain_16 ((uint32_t)0x0000C000)
137 
138 #define IS_OPAMP_PGAGAIN(GAIN) (((GAIN) == OPAMP_OPAMP_PGAGain_2) || \
139  ((GAIN) == OPAMP_OPAMP_PGAGain_4) || \
140  ((GAIN) == OPAMP_OPAMP_PGAGain_8) || \
141  ((GAIN) == OPAMP_OPAMP_PGAGain_16))
150 #define OPAMP_PGAConnect_No ((uint32_t)0x00000000)
151 #define OPAMP_PGAConnect_IO1 OPAMP_CSR_PGGAIN_3
152 #define OPAMP_PGAConnect_IO2 ((uint32_t)0x00030000)
153 
154 #define IS_OPAMP_PGACONNECT(CONNECT) (((CONNECT) == OPAMP_PGAConnect_No) || \
155  ((CONNECT) == OPAMP_PGAConnect_IO1) || \
156  ((CONNECT) == OPAMP_PGAConnect_IO2))
165 #define IS_OPAMP_SECONDARY_INVINPUT(INVINPUT) (((INVINPUT) == OPAMP_InvertingInput_IO1) || \
166  ((INVINPUT) == OPAMP_InvertingInput_IO2))
167 
175 #define OPAMP_Input_Inverting ((uint32_t)0x00000018)
176 #define OPAMP_Input_NonInverting ((uint32_t)0x00000013)
178 #define IS_OPAMP_INPUT(INPUT) (((INPUT) == OPAMP_Input_Inverting) || \
179  ((INPUT) == OPAMP_Input_NonInverting))
180 
189 #define OPAMP_Vref_3VDDA ((uint32_t)0x00000000)
190 #define OPAMP_Vref_10VDDA OPAMP_CSR_CALSEL_0
191 #define OPAMP_Vref_50VDDA OPAMP_CSR_CALSEL_1
192 #define OPAMP_Vref_90VDDA OPAMP_CSR_CALSEL
194 #define IS_OPAMP_VREF(VREF) (((VREF) == OPAMP_Vref_3VDDA) || \
195  ((VREF) == OPAMP_Vref_10VDDA) || \
196  ((VREF) == OPAMP_Vref_50VDDA) || \
197  ((VREF) == OPAMP_Vref_90VDDA))
206 #define OPAMP_Trimming_Factory ((uint32_t)0x00000000)
207 #define OPAMP_Trimming_User OPAMP_CSR_USERTRIM
209 #define IS_OPAMP_TRIMMING(TRIMMING) (((TRIMMING) == OPAMP_Trimming_Factory) || \
210  ((TRIMMING) == OPAMP_Trimming_User))
211 
220 #define IS_OPAMP_TRIMMINGVALUE(VALUE) ((VALUE) <= 0x0000001F)
230 #define OPAMP_OutputLevel_High OPAMP_CSR_OUTCAL
231 #define OPAMP_OutputLevel_Low ((uint32_t)0x00000000)
232 
237 /* Exported macro ------------------------------------------------------------*/
238 /* Exported functions ------------------------------------------------------- */
239 
240 /* Function used to set the OPAMP configuration to the default reset state ***/
241 void OPAMP_DeInit(uint32_t OPAMP_Selection);
242 
243 /* Initialization and Configuration functions *********************************/
244 void OPAMP_Init(uint32_t OPAMP_Selection, OPAMP_InitTypeDef* OPAMP_InitStruct);
245 void OPAMP_StructInit(OPAMP_InitTypeDef* OPAMP_InitStruct);
246 void OPAMP_PGAConfig(uint32_t OPAMP_Selection, uint32_t OPAMP_PGAGain, uint32_t OPAMP_PGAConnect);
247 void OPAMP_VrefConfig(uint32_t OPAMP_Selection, uint32_t OPAMP_Vref);
248 void OPAMP_VrefConnectADCCmd(uint32_t OPAMP_Selection, FunctionalState NewState);
249 void OPAMP_TimerControlledMuxConfig(uint32_t OPAMP_Selection, OPAMP_InitTypeDef* OPAMP_InitStruct);
250 void OPAMP_TimerControlledMuxCmd(uint32_t OPAMP_Selection, FunctionalState NewState);
251 void OPAMP_Cmd(uint32_t OPAMP_Selection, FunctionalState NewState);
252 uint32_t OPAMP_GetOutputLevel(uint32_t OPAMP_Selection);
253 
254 /* Calibration functions ******************************************************/
255 void OPAMP_VrefConnectNonInvertingInput(uint32_t OPAMP_Selection, FunctionalState NewState);
256 void OPAMP_OffsetTrimModeSelect(uint32_t OPAMP_Selection, uint32_t OPAMP_Trimming);
257 void OPAMP_OffsetTrimConfig(uint32_t OPAMP_Selection, uint32_t OPAMP_Input, uint32_t OPAMP_TrimValue);
258 void OPAMP_StartCalibration(uint32_t OPAMP_Selection, FunctionalState NewState);
259 
260 /* OPAMP configuration locking function ***************************************/
261 void OPAMP_LockConfig(uint32_t OPAMP_Selection);
262 
263 #ifdef __cplusplus
264 }
265 #endif
266 
267 #endif /*__STM32F30x_OPAMP_H */
268 
277 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
void OPAMP_DeInit(uint32_t OPAMP_Selection)
Deinitializes OPAMP peripheral registers to their default reset values.
FunctionalState
Definition: stm32f4xx.h:708
uint32_t OPAMP_NonInvertingInput
uint32_t OPAMP_GetOutputLevel(uint32_t OPAMP_Selection)
Return the output level (high or low) during calibration of the selected OPAMP.
void OPAMP_PGAConfig(uint32_t OPAMP_Selection, uint32_t OPAMP_PGAGain, uint32_t OPAMP_PGAConnect)
Configure the feedback resistor gain.
void OPAMP_TimerControlledMuxCmd(uint32_t OPAMP_Selection, FunctionalState NewState)
Enable or disable the timer-controlled mux mode.
void OPAMP_VrefConnectADCCmd(uint32_t OPAMP_Selection, FunctionalState NewState)
Enables or disables connecting the OPAMP&#39;s internal reference to ADC.
uint32_t OPAMP_InvertingInput
void OPAMP_VrefConfig(uint32_t OPAMP_Selection, uint32_t OPAMP_Vref)
Configure the OPAMP&#39;s internal reference.
void OPAMP_VrefConnectNonInvertingInput(uint32_t OPAMP_Selection, FunctionalState NewState)
Connnect the internal reference to the OPAMP&#39;s non inverting input.
void OPAMP_LockConfig(uint32_t OPAMP_Selection)
Lock the selected OPAMP configuration.
void OPAMP_Init(uint32_t OPAMP_Selection, OPAMP_InitTypeDef *OPAMP_InitStruct)
Initializes the OPAMP peripheral according to the specified parameters in OPAMP_InitStruct.
void OPAMP_Cmd(uint32_t OPAMP_Selection, FunctionalState NewState)
Enable or disable the OPAMP peripheral.
void OPAMP_OffsetTrimModeSelect(uint32_t OPAMP_Selection, uint32_t OPAMP_Trimming)
Select the trimming mode.
void OPAMP_StartCalibration(uint32_t OPAMP_Selection, FunctionalState NewState)
Start or stop the calibration of selected OPAMP peripheral.
void OPAMP_StructInit(OPAMP_InitTypeDef *OPAMP_InitStruct)
Fills each OPAMP_InitStruct member with its default value.
void OPAMP_TimerControlledMuxConfig(uint32_t OPAMP_Selection, OPAMP_InitTypeDef *OPAMP_InitStruct)
Configure the OPAMP peripheral (secondary inputs) for timer-controlled mux mode according to the spec...
void OPAMP_OffsetTrimConfig(uint32_t OPAMP_Selection, uint32_t OPAMP_Input, uint32_t OPAMP_TrimValue)
Configure the trimming value of the OPAMP.
OPAMP Init structure definition.


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:48