The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_NUCLEO_L486RG/TARGET_STM/TARGET_STM32L4/device/stm32l4xx_hal_opamp.h@145:64910690c574, 2017-06-21 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Jun 21 17:31:38 2017 +0100
- Revision:
- 145:64910690c574
- Parent:
- 128:9bcdf88f62b0
Release 145 of the mbed library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 122:f9eeca106725 | 1 | /** |
Kojto | 122:f9eeca106725 | 2 | ****************************************************************************** |
Kojto | 122:f9eeca106725 | 3 | * @file stm32l4xx_hal_opamp.h |
Kojto | 122:f9eeca106725 | 4 | * @author MCD Application Team |
AnnaBridge | 145:64910690c574 | 5 | * @version V1.7.1 |
AnnaBridge | 145:64910690c574 | 6 | * @date 21-April-2017 |
Kojto | 122:f9eeca106725 | 7 | * @brief Header file of OPAMP HAL module. |
Kojto | 122:f9eeca106725 | 8 | ****************************************************************************** |
Kojto | 122:f9eeca106725 | 9 | * @attention |
Kojto | 122:f9eeca106725 | 10 | * |
AnnaBridge | 145:64910690c574 | 11 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
Kojto | 122:f9eeca106725 | 12 | * |
Kojto | 122:f9eeca106725 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
Kojto | 122:f9eeca106725 | 14 | * are permitted provided that the following conditions are met: |
Kojto | 122:f9eeca106725 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
Kojto | 122:f9eeca106725 | 16 | * this list of conditions and the following disclaimer. |
Kojto | 122:f9eeca106725 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Kojto | 122:f9eeca106725 | 18 | * this list of conditions and the following disclaimer in the documentation |
Kojto | 122:f9eeca106725 | 19 | * and/or other materials provided with the distribution. |
Kojto | 122:f9eeca106725 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Kojto | 122:f9eeca106725 | 21 | * may be used to endorse or promote products derived from this software |
Kojto | 122:f9eeca106725 | 22 | * without specific prior written permission. |
Kojto | 122:f9eeca106725 | 23 | * |
Kojto | 122:f9eeca106725 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 122:f9eeca106725 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 122:f9eeca106725 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Kojto | 122:f9eeca106725 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Kojto | 122:f9eeca106725 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Kojto | 122:f9eeca106725 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Kojto | 122:f9eeca106725 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Kojto | 122:f9eeca106725 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Kojto | 122:f9eeca106725 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Kojto | 122:f9eeca106725 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Kojto | 122:f9eeca106725 | 34 | * |
Kojto | 122:f9eeca106725 | 35 | ****************************************************************************** |
Kojto | 122:f9eeca106725 | 36 | */ |
Kojto | 122:f9eeca106725 | 37 | |
Kojto | 122:f9eeca106725 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
Kojto | 122:f9eeca106725 | 39 | #ifndef __STM32L4xx_HAL_OPAMP_H |
Kojto | 122:f9eeca106725 | 40 | #define __STM32L4xx_HAL_OPAMP_H |
Kojto | 122:f9eeca106725 | 41 | |
Kojto | 122:f9eeca106725 | 42 | #ifdef __cplusplus |
Kojto | 122:f9eeca106725 | 43 | extern "C" { |
Kojto | 122:f9eeca106725 | 44 | #endif |
Kojto | 122:f9eeca106725 | 45 | |
Kojto | 122:f9eeca106725 | 46 | /* Includes ------------------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 47 | #include "stm32l4xx_hal_def.h" |
Kojto | 122:f9eeca106725 | 48 | |
Kojto | 122:f9eeca106725 | 49 | /** @addtogroup STM32L4xx_HAL_Driver |
Kojto | 122:f9eeca106725 | 50 | * @{ |
Kojto | 122:f9eeca106725 | 51 | */ |
Kojto | 122:f9eeca106725 | 52 | |
Kojto | 122:f9eeca106725 | 53 | /** @addtogroup OPAMP |
Kojto | 122:f9eeca106725 | 54 | * @{ |
Kojto | 122:f9eeca106725 | 55 | */ |
Kojto | 122:f9eeca106725 | 56 | |
Kojto | 122:f9eeca106725 | 57 | /* Exported types ------------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 58 | |
Kojto | 122:f9eeca106725 | 59 | /** @defgroup OPAMP_Exported_Types OPAMP Exported Types |
Kojto | 122:f9eeca106725 | 60 | * @{ |
Kojto | 122:f9eeca106725 | 61 | */ |
Kojto | 122:f9eeca106725 | 62 | |
Kojto | 122:f9eeca106725 | 63 | /** |
Kojto | 122:f9eeca106725 | 64 | * @brief OPAMP Init structure definition |
Kojto | 122:f9eeca106725 | 65 | */ |
Kojto | 122:f9eeca106725 | 66 | |
Kojto | 122:f9eeca106725 | 67 | typedef struct |
Kojto | 122:f9eeca106725 | 68 | { |
Kojto | 122:f9eeca106725 | 69 | uint32_t PowerSupplyRange; /*!< Specifies the power supply range: above or under 2.4V. |
Kojto | 122:f9eeca106725 | 70 | This parameter must be a value of @ref OPAMP_PowerSupplyRange |
Kojto | 122:f9eeca106725 | 71 | Caution: This parameter is common to all OPAMP instances: a modification of this parameter for the selected OPAMP impacts the other OPAMP instances. */ |
Kojto | 122:f9eeca106725 | 72 | |
Kojto | 122:f9eeca106725 | 73 | uint32_t PowerMode; /*!< Specifies the power mode Normal or Low-Power. |
Kojto | 122:f9eeca106725 | 74 | This parameter must be a value of @ref OPAMP_PowerMode */ |
Kojto | 122:f9eeca106725 | 75 | |
Kojto | 122:f9eeca106725 | 76 | uint32_t Mode; /*!< Specifies the OPAMP mode |
Kojto | 122:f9eeca106725 | 77 | This parameter must be a value of @ref OPAMP_Mode |
Kojto | 122:f9eeca106725 | 78 | mode is either Standalone, - Follower or PGA */ |
Kojto | 122:f9eeca106725 | 79 | |
Kojto | 122:f9eeca106725 | 80 | uint32_t InvertingInput; /*!< Specifies the inverting input in Standalone & PGA modes |
Kojto | 122:f9eeca106725 | 81 | - In Standalone mode: i.e. when mode is OPAMP_STANDALONE_MODE |
Kojto | 122:f9eeca106725 | 82 | & PGA mode: i.e. when mode is OPAMP_PGA_MODE |
Kojto | 122:f9eeca106725 | 83 | This parameter must be a value of @ref OPAMP_InvertingInput |
Kojto | 122:f9eeca106725 | 84 | - In Follower mode i.e. when mode is OPAMP_FOLLOWER_MODE |
Kojto | 122:f9eeca106725 | 85 | This parameter is Not Applicable */ |
Kojto | 122:f9eeca106725 | 86 | |
Kojto | 122:f9eeca106725 | 87 | uint32_t NonInvertingInput; /*!< Specifies the non inverting input of the opamp: |
Kojto | 122:f9eeca106725 | 88 | This parameter must be a value of @ref OPAMP_NonInvertingInput */ |
Kojto | 122:f9eeca106725 | 89 | |
Kojto | 122:f9eeca106725 | 90 | uint32_t PgaGain; /*!< Specifies the gain in PGA mode |
Kojto | 122:f9eeca106725 | 91 | i.e. when mode is OPAMP_PGA_MODE. |
Kojto | 122:f9eeca106725 | 92 | This parameter must be a value of @ref OPAMP_PgaGain (2, 4, 8 or 16 ) */ |
Kojto | 122:f9eeca106725 | 93 | |
Kojto | 122:f9eeca106725 | 94 | uint32_t UserTrimming; /*!< Specifies the trimming mode |
Kojto | 122:f9eeca106725 | 95 | This parameter must be a value of @ref OPAMP_UserTrimming |
Kojto | 122:f9eeca106725 | 96 | UserTrimming is either factory or user trimming.*/ |
Kojto | 122:f9eeca106725 | 97 | |
Kojto | 122:f9eeca106725 | 98 | uint32_t TrimmingValueP; /*!< Specifies the offset trimming value (PMOS) |
Kojto | 122:f9eeca106725 | 99 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
Kojto | 122:f9eeca106725 | 100 | This parameter must be a number between Min_Data = 0 and Max_Data = 31 |
Kojto | 122:f9eeca106725 | 101 | 16 is typical default value */ |
Kojto | 122:f9eeca106725 | 102 | |
Kojto | 122:f9eeca106725 | 103 | uint32_t TrimmingValueN; /*!< Specifies the offset trimming value (NMOS) |
Kojto | 122:f9eeca106725 | 104 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
Kojto | 122:f9eeca106725 | 105 | This parameter must be a number between Min_Data = 0 and Max_Data = 31 |
Kojto | 122:f9eeca106725 | 106 | 16 is typical default value */ |
Kojto | 122:f9eeca106725 | 107 | |
Kojto | 122:f9eeca106725 | 108 | uint32_t TrimmingValuePLowPower; /*!< Specifies the offset trimming value (PMOS) |
Kojto | 122:f9eeca106725 | 109 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
Kojto | 122:f9eeca106725 | 110 | This parameter must be a number between Min_Data = 0 and Max_Data = 31 |
Kojto | 122:f9eeca106725 | 111 | 16 is typical default value */ |
Kojto | 122:f9eeca106725 | 112 | |
Kojto | 122:f9eeca106725 | 113 | uint32_t TrimmingValueNLowPower; /*!< Specifies the offset trimming value (NMOS) |
Kojto | 122:f9eeca106725 | 114 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
Kojto | 122:f9eeca106725 | 115 | This parameter must be a number between Min_Data = 0 and Max_Data = 31 |
Kojto | 122:f9eeca106725 | 116 | 16 is typical default value */ |
Kojto | 122:f9eeca106725 | 117 | |
Kojto | 122:f9eeca106725 | 118 | }OPAMP_InitTypeDef; |
Kojto | 122:f9eeca106725 | 119 | |
Kojto | 122:f9eeca106725 | 120 | /** |
Kojto | 122:f9eeca106725 | 121 | * @brief HAL State structures definition |
Kojto | 122:f9eeca106725 | 122 | */ |
Kojto | 122:f9eeca106725 | 123 | |
Kojto | 122:f9eeca106725 | 124 | typedef enum |
Kojto | 122:f9eeca106725 | 125 | { |
Kojto | 122:f9eeca106725 | 126 | HAL_OPAMP_STATE_RESET = 0x00000000, /*!< OPAMP is not yet Initialized */ |
Kojto | 122:f9eeca106725 | 127 | |
Kojto | 122:f9eeca106725 | 128 | HAL_OPAMP_STATE_READY = 0x00000001, /*!< OPAMP is initialized and ready for use */ |
Kojto | 122:f9eeca106725 | 129 | HAL_OPAMP_STATE_CALIBBUSY = 0x00000002, /*!< OPAMP is enabled in auto calibration mode */ |
Kojto | 122:f9eeca106725 | 130 | |
Kojto | 122:f9eeca106725 | 131 | HAL_OPAMP_STATE_BUSY = 0x00000004, /*!< OPAMP is enabled and running in normal mode */ |
Kojto | 122:f9eeca106725 | 132 | HAL_OPAMP_STATE_BUSYLOCKED = 0x00000005 /*!< OPAMP is locked |
Kojto | 122:f9eeca106725 | 133 | only system reset allows reconfiguring the opamp. */ |
Kojto | 122:f9eeca106725 | 134 | |
Kojto | 122:f9eeca106725 | 135 | }HAL_OPAMP_StateTypeDef; |
Kojto | 122:f9eeca106725 | 136 | |
Kojto | 122:f9eeca106725 | 137 | /** |
Kojto | 122:f9eeca106725 | 138 | * @brief OPAMP Handle Structure definition |
Kojto | 122:f9eeca106725 | 139 | */ |
Kojto | 122:f9eeca106725 | 140 | typedef struct |
Kojto | 122:f9eeca106725 | 141 | { |
Kojto | 122:f9eeca106725 | 142 | OPAMP_TypeDef *Instance; /*!< OPAMP instance's registers base address */ |
Kojto | 122:f9eeca106725 | 143 | OPAMP_InitTypeDef Init; /*!< OPAMP required parameters */ |
Kojto | 122:f9eeca106725 | 144 | HAL_StatusTypeDef Status; /*!< OPAMP peripheral status */ |
Kojto | 122:f9eeca106725 | 145 | HAL_LockTypeDef Lock; /*!< Locking object */ |
Kojto | 122:f9eeca106725 | 146 | __IO HAL_OPAMP_StateTypeDef State; /*!< OPAMP communication state */ |
Kojto | 122:f9eeca106725 | 147 | |
Kojto | 122:f9eeca106725 | 148 | } OPAMP_HandleTypeDef; |
Kojto | 122:f9eeca106725 | 149 | |
Kojto | 122:f9eeca106725 | 150 | /** |
Kojto | 122:f9eeca106725 | 151 | * @brief HAl_OPAMP_TrimmingValueTypeDef definition |
Kojto | 122:f9eeca106725 | 152 | */ |
Kojto | 122:f9eeca106725 | 153 | |
Kojto | 122:f9eeca106725 | 154 | typedef uint32_t HAL_OPAMP_TrimmingValueTypeDef; |
Kojto | 122:f9eeca106725 | 155 | |
Kojto | 122:f9eeca106725 | 156 | /** |
Kojto | 122:f9eeca106725 | 157 | * @} |
Kojto | 122:f9eeca106725 | 158 | */ |
Kojto | 122:f9eeca106725 | 159 | |
Kojto | 122:f9eeca106725 | 160 | /* Exported constants --------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 161 | |
Kojto | 122:f9eeca106725 | 162 | /** @defgroup OPAMP_Exported_Constants OPAMP Exported Constants |
Kojto | 122:f9eeca106725 | 163 | * @{ |
Kojto | 122:f9eeca106725 | 164 | */ |
Kojto | 122:f9eeca106725 | 165 | |
Kojto | 122:f9eeca106725 | 166 | /** @defgroup OPAMP_Mode OPAMP Mode |
Kojto | 122:f9eeca106725 | 167 | * @{ |
Kojto | 122:f9eeca106725 | 168 | */ |
Kojto | 122:f9eeca106725 | 169 | #define OPAMP_STANDALONE_MODE ((uint32_t)0x00000000) /*!< standalone mode */ |
Kojto | 122:f9eeca106725 | 170 | #define OPAMP_PGA_MODE OPAMP_CSR_OPAMODE_1 /*!< PGA mode */ |
Kojto | 122:f9eeca106725 | 171 | #define OPAMP_FOLLOWER_MODE OPAMP_CSR_OPAMODE /*!< follower mode */ |
Kojto | 122:f9eeca106725 | 172 | |
Kojto | 122:f9eeca106725 | 173 | /** |
Kojto | 122:f9eeca106725 | 174 | * @} |
Kojto | 122:f9eeca106725 | 175 | */ |
Kojto | 122:f9eeca106725 | 176 | |
Kojto | 122:f9eeca106725 | 177 | /** @defgroup OPAMP_NonInvertingInput OPAMP Non Inverting Input |
Kojto | 122:f9eeca106725 | 178 | * @{ |
Kojto | 122:f9eeca106725 | 179 | */ |
Kojto | 122:f9eeca106725 | 180 | |
Kojto | 122:f9eeca106725 | 181 | #define OPAMP_NONINVERTINGINPUT_IO0 ((uint32_t)0x00000000) /*!< OPAMP non-inverting input connected to dedicated IO pin */ |
Kojto | 122:f9eeca106725 | 182 | #define OPAMP_NONINVERTINGINPUT_DAC_CH OPAMP_CSR_VPSEL /*!< OPAMP non-inverting input connected internally to DAC channel */ |
Kojto | 122:f9eeca106725 | 183 | |
Kojto | 122:f9eeca106725 | 184 | /** |
Kojto | 122:f9eeca106725 | 185 | * @} |
Kojto | 122:f9eeca106725 | 186 | */ |
Kojto | 122:f9eeca106725 | 187 | |
Kojto | 122:f9eeca106725 | 188 | /** @defgroup OPAMP_InvertingInput OPAMP Inverting Input |
Kojto | 122:f9eeca106725 | 189 | * @{ |
Kojto | 122:f9eeca106725 | 190 | */ |
Kojto | 122:f9eeca106725 | 191 | |
Kojto | 122:f9eeca106725 | 192 | #define OPAMP_INVERTINGINPUT_IO0 ((uint32_t)0x00000000) /*!< OPAMP inverting input connected to dedicated IO pin low-leakage */ |
Kojto | 122:f9eeca106725 | 193 | #define OPAMP_INVERTINGINPUT_IO1 OPAMP_CSR_VMSEL_0 /*!< OPAMP inverting input connected to alternative IO pin available on some device packages */ |
Kojto | 122:f9eeca106725 | 194 | #define OPAMP_INVERTINGINPUT_CONNECT_NO OPAMP_CSR_VMSEL_1 /*!< OPAMP inverting input not connected externally (PGA mode only) */ |
Kojto | 122:f9eeca106725 | 195 | |
Kojto | 122:f9eeca106725 | 196 | /** |
Kojto | 122:f9eeca106725 | 197 | * @} |
Kojto | 122:f9eeca106725 | 198 | */ |
Kojto | 122:f9eeca106725 | 199 | |
Kojto | 122:f9eeca106725 | 200 | /** @defgroup OPAMP_PgaGain OPAMP Pga Gain |
Kojto | 122:f9eeca106725 | 201 | * @{ |
Kojto | 122:f9eeca106725 | 202 | */ |
Kojto | 122:f9eeca106725 | 203 | |
Kojto | 122:f9eeca106725 | 204 | #define OPAMP_PGA_GAIN_2 ((uint32_t)0x00000000) /*!< PGA gain = 2 */ |
Kojto | 122:f9eeca106725 | 205 | #define OPAMP_PGA_GAIN_4 OPAMP_CSR_PGGAIN_0 /*!< PGA gain = 4 */ |
Kojto | 122:f9eeca106725 | 206 | #define OPAMP_PGA_GAIN_8 OPAMP_CSR_PGGAIN_1 /*!< PGA gain = 8 */ |
Kojto | 122:f9eeca106725 | 207 | #define OPAMP_PGA_GAIN_16 (OPAMP_CSR_PGGAIN_0 | OPAMP_CSR_PGGAIN_1) /*!< PGA gain = 16 */ |
Kojto | 122:f9eeca106725 | 208 | |
Kojto | 122:f9eeca106725 | 209 | /** |
Kojto | 122:f9eeca106725 | 210 | * @} |
Kojto | 122:f9eeca106725 | 211 | */ |
Kojto | 122:f9eeca106725 | 212 | |
Kojto | 122:f9eeca106725 | 213 | /** @defgroup OPAMP_PowerMode OPAMP PowerMode |
Kojto | 122:f9eeca106725 | 214 | * @{ |
Kojto | 122:f9eeca106725 | 215 | */ |
Kojto | 122:f9eeca106725 | 216 | #define OPAMP_POWERMODE_NORMAL ((uint32_t)0x00000000) |
Kojto | 122:f9eeca106725 | 217 | #define OPAMP_POWERMODE_LOWPOWER OPAMP_CSR_OPALPM |
Kojto | 122:f9eeca106725 | 218 | |
Kojto | 122:f9eeca106725 | 219 | /** |
Kojto | 122:f9eeca106725 | 220 | * @} |
Kojto | 122:f9eeca106725 | 221 | */ |
Kojto | 122:f9eeca106725 | 222 | |
Kojto | 122:f9eeca106725 | 223 | /** @defgroup OPAMP_PowerSupplyRange OPAMP PowerSupplyRange |
Kojto | 122:f9eeca106725 | 224 | * @{ |
Kojto | 122:f9eeca106725 | 225 | */ |
Kojto | 122:f9eeca106725 | 226 | #define OPAMP_POWERSUPPLY_LOW ((uint32_t)0x00000000) /*!< Power supply range low (VDDA lower than 2.4V) */ |
Kojto | 122:f9eeca106725 | 227 | #define OPAMP_POWERSUPPLY_HIGH OPAMP1_CSR_OPARANGE /*!< Power supply range high (VDDA higher than 2.4V) */ |
Kojto | 122:f9eeca106725 | 228 | |
Kojto | 122:f9eeca106725 | 229 | /** |
Kojto | 122:f9eeca106725 | 230 | * @} |
Kojto | 122:f9eeca106725 | 231 | */ |
Kojto | 122:f9eeca106725 | 232 | |
Kojto | 122:f9eeca106725 | 233 | /** @defgroup OPAMP_UserTrimming OPAMP User Trimming |
Kojto | 122:f9eeca106725 | 234 | * @{ |
Kojto | 122:f9eeca106725 | 235 | */ |
Kojto | 122:f9eeca106725 | 236 | #define OPAMP_TRIMMING_FACTORY ((uint32_t)0x00000000) /*!< Factory trimming */ |
Kojto | 122:f9eeca106725 | 237 | #define OPAMP_TRIMMING_USER OPAMP_CSR_USERTRIM /*!< User trimming */ |
Kojto | 122:f9eeca106725 | 238 | |
Kojto | 122:f9eeca106725 | 239 | /** |
Kojto | 122:f9eeca106725 | 240 | * @} |
Kojto | 122:f9eeca106725 | 241 | */ |
Kojto | 122:f9eeca106725 | 242 | |
Kojto | 122:f9eeca106725 | 243 | /** @defgroup OPAMP_FactoryTrimming OPAMP Factory Trimming |
Kojto | 122:f9eeca106725 | 244 | * @{ |
Kojto | 122:f9eeca106725 | 245 | */ |
Kojto | 122:f9eeca106725 | 246 | #define OPAMP_FACTORYTRIMMING_DUMMY ((uint32_t)0xFFFFFFFF) /*!< Dummy value if trimming value could not be retrieved */ |
Kojto | 122:f9eeca106725 | 247 | |
Kojto | 122:f9eeca106725 | 248 | #define OPAMP_FACTORYTRIMMING_N ((uint32_t)0x00000000) /*!< Offset trimming N */ |
Kojto | 122:f9eeca106725 | 249 | #define OPAMP_FACTORYTRIMMING_P ((uint32_t)0x00000001) /*!< Offset trimming P */ |
Kojto | 122:f9eeca106725 | 250 | |
Kojto | 122:f9eeca106725 | 251 | /** |
Kojto | 122:f9eeca106725 | 252 | * @} |
Kojto | 122:f9eeca106725 | 253 | */ |
Kojto | 122:f9eeca106725 | 254 | |
Kojto | 122:f9eeca106725 | 255 | /** |
Kojto | 122:f9eeca106725 | 256 | * @} |
Kojto | 122:f9eeca106725 | 257 | */ |
Kojto | 122:f9eeca106725 | 258 | |
Kojto | 122:f9eeca106725 | 259 | /* Private constants ---------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 260 | /** @defgroup OPAMP_Private_Constants OPAMP Private Constants |
Kojto | 122:f9eeca106725 | 261 | * @brief OPAMP Private constants and defines |
Kojto | 122:f9eeca106725 | 262 | * @{ |
Kojto | 122:f9eeca106725 | 263 | */ |
Kojto | 122:f9eeca106725 | 264 | |
Kojto | 122:f9eeca106725 | 265 | /* NONINVERTING bit position in OTR & LPOTR */ |
Kojto | 122:f9eeca106725 | 266 | #define OPAMP_INPUT_NONINVERTING ((uint32_t) 8) /*!< Non inverting input */ |
Kojto | 122:f9eeca106725 | 267 | |
Kojto | 122:f9eeca106725 | 268 | /* Offset trimming time: during calibration, minimum time needed between two */ |
Kojto | 122:f9eeca106725 | 269 | /* steps to have 1 mV accuracy. */ |
Kojto | 122:f9eeca106725 | 270 | /* Refer to datasheet, electrical characteristics: parameter tOFFTRIM Typ=1ms.*/ |
Kojto | 122:f9eeca106725 | 271 | /* Unit: ms. */ |
Kojto | 122:f9eeca106725 | 272 | #define OPAMP_TRIMMING_DELAY ((uint32_t) 1) |
Kojto | 122:f9eeca106725 | 273 | |
Kojto | 122:f9eeca106725 | 274 | /** |
Kojto | 122:f9eeca106725 | 275 | * @} |
Kojto | 122:f9eeca106725 | 276 | */ |
Kojto | 122:f9eeca106725 | 277 | |
Kojto | 122:f9eeca106725 | 278 | /* Exported macros -----------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 279 | /** @defgroup OPAMP_Exported_Macros OPAMP Exported Macros |
Kojto | 122:f9eeca106725 | 280 | * @{ |
Kojto | 122:f9eeca106725 | 281 | */ |
Kojto | 122:f9eeca106725 | 282 | |
Kojto | 122:f9eeca106725 | 283 | /** @brief Reset OPAMP handle state. |
Kojto | 122:f9eeca106725 | 284 | * @param __HANDLE__: OPAMP handle. |
Kojto | 122:f9eeca106725 | 285 | * @retval None |
Kojto | 122:f9eeca106725 | 286 | */ |
Kojto | 122:f9eeca106725 | 287 | #define __HAL_OPAMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_OPAMP_STATE_RESET) |
Kojto | 122:f9eeca106725 | 288 | |
Kojto | 122:f9eeca106725 | 289 | /** |
Kojto | 122:f9eeca106725 | 290 | * @} |
Kojto | 122:f9eeca106725 | 291 | */ |
Kojto | 122:f9eeca106725 | 292 | |
Kojto | 122:f9eeca106725 | 293 | /* Private macro -------------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 294 | |
Kojto | 122:f9eeca106725 | 295 | /** @defgroup OPAMP_Private_Macros OPAMP Private Macros |
Kojto | 122:f9eeca106725 | 296 | * @{ |
Kojto | 122:f9eeca106725 | 297 | */ |
Kojto | 122:f9eeca106725 | 298 | |
Kojto | 122:f9eeca106725 | 299 | #define IS_OPAMP_FUNCTIONAL_NORMALMODE(INPUT) (((INPUT) == OPAMP_STANDALONE_MODE) || \ |
Kojto | 122:f9eeca106725 | 300 | ((INPUT) == OPAMP_PGA_MODE) || \ |
Kojto | 122:f9eeca106725 | 301 | ((INPUT) == OPAMP_FOLLOWER_MODE)) |
Kojto | 122:f9eeca106725 | 302 | |
AnnaBridge | 145:64910690c574 | 303 | #if defined (STM32L471xx) || defined (STM32L475xx) || defined (STM32L476xx) || defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || defined (STM32L4A6xx) |
AnnaBridge | 145:64910690c574 | 304 | |
Kojto | 122:f9eeca106725 | 305 | #define IS_OPAMP_INVERTING_INPUT_STANDALONE(INPUT) (((INPUT) == OPAMP_INVERTINGINPUT_IO0) || \ |
Kojto | 122:f9eeca106725 | 306 | ((INPUT) == OPAMP_INVERTINGINPUT_IO1)) |
AnnaBridge | 145:64910690c574 | 307 | #endif /* STM32L471xx STM32L475xx STM32L476xx STM32L485xx STM32L486xx STM32L496xx STM32L4A6xx */ |
AnnaBridge | 145:64910690c574 | 308 | |
AnnaBridge | 145:64910690c574 | 309 | #if defined (STM32L431xx) || defined (STM32L432xx) || defined (STM32L433xx) || defined (STM32L442xx) || defined (STM32L443xx) || defined (STM32L451xx) || defined (STM32L452xx) || defined (STM32L462xx) |
Kojto | 122:f9eeca106725 | 310 | #define IS_OPAMP_INVERTING_INPUT_STANDALONE(INPUT) ((INPUT) == OPAMP_INVERTINGINPUT_IO0) |
AnnaBridge | 145:64910690c574 | 311 | #endif /* STM32L431xx STM32L432xx STM32L433xx STM32L442xx STM32L443xx STM32L451xx STM32L452xx STM32L462xx */ |
Kojto | 122:f9eeca106725 | 312 | |
Kojto | 122:f9eeca106725 | 313 | #define IS_OPAMP_NONINVERTING_INPUT(INPUT) (((INPUT) == OPAMP_NONINVERTINGINPUT_IO0) || \ |
Kojto | 122:f9eeca106725 | 314 | ((INPUT) == OPAMP_NONINVERTINGINPUT_DAC_CH)) |
Kojto | 122:f9eeca106725 | 315 | |
AnnaBridge | 145:64910690c574 | 316 | #if defined (STM32L471xx) || defined (STM32L475xx) || defined (STM32L476xx) || defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || defined (STM32L4A6xx) |
Kojto | 122:f9eeca106725 | 317 | #define IS_OPAMP_INVERTING_INPUT_PGA(INPUT) (((INPUT) == OPAMP_INVERTINGINPUT_IO0) || \ |
Kojto | 122:f9eeca106725 | 318 | ((INPUT) == OPAMP_INVERTINGINPUT_IO1)|| \ |
Kojto | 122:f9eeca106725 | 319 | ((INPUT) == OPAMP_INVERTINGINPUT_CONNECT_NO)) |
AnnaBridge | 145:64910690c574 | 320 | #endif /* STM32L471xx STM32L475xx STM32L476xx STM32L485xx STM32L486xx STM32L496xx STM32L4A6xx */ |
AnnaBridge | 145:64910690c574 | 321 | |
AnnaBridge | 145:64910690c574 | 322 | #if defined (STM32L431xx) || defined (STM32L432xx) || defined (STM32L433xx) || defined (STM32L442xx) || defined (STM32L443xx) || defined (STM32L451xx) || defined (STM32L452xx) || defined (STM32L462xx) |
Kojto | 122:f9eeca106725 | 323 | #define IS_OPAMP_INVERTING_INPUT_PGA(INPUT) (((INPUT) == OPAMP_INVERTINGINPUT_IO0) || \ |
Kojto | 122:f9eeca106725 | 324 | ((INPUT) == OPAMP_INVERTINGINPUT_CONNECT_NO)) |
AnnaBridge | 145:64910690c574 | 325 | #endif /* STM32L431xx STM32L432xx STM32L433xx STM32L442xx STM32L443xx STM32L451xx STM32L452xx STM32L462xx */ |
Kojto | 122:f9eeca106725 | 326 | |
Kojto | 122:f9eeca106725 | 327 | #define IS_OPAMP_PGA_GAIN(GAIN) (((GAIN) == OPAMP_PGA_GAIN_2) || \ |
Kojto | 122:f9eeca106725 | 328 | ((GAIN) == OPAMP_PGA_GAIN_4) || \ |
Kojto | 122:f9eeca106725 | 329 | ((GAIN) == OPAMP_PGA_GAIN_8) || \ |
Kojto | 122:f9eeca106725 | 330 | ((GAIN) == OPAMP_PGA_GAIN_16)) |
Kojto | 122:f9eeca106725 | 331 | |
Kojto | 122:f9eeca106725 | 332 | #define IS_OPAMP_POWERMODE(TRIMMING) (((TRIMMING) == OPAMP_POWERMODE_NORMAL) || \ |
Kojto | 122:f9eeca106725 | 333 | ((TRIMMING) == OPAMP_POWERMODE_LOWPOWER) ) |
Kojto | 122:f9eeca106725 | 334 | |
Kojto | 122:f9eeca106725 | 335 | #define IS_OPAMP_POWER_SUPPLY_RANGE(RANGE) (((RANGE) == OPAMP_POWERSUPPLY_LOW) || \ |
Kojto | 122:f9eeca106725 | 336 | ((RANGE) == OPAMP_POWERSUPPLY_HIGH) ) |
Kojto | 122:f9eeca106725 | 337 | |
Kojto | 122:f9eeca106725 | 338 | #define IS_OPAMP_TRIMMING(TRIMMING) (((TRIMMING) == OPAMP_TRIMMING_FACTORY) || \ |
Kojto | 122:f9eeca106725 | 339 | ((TRIMMING) == OPAMP_TRIMMING_USER)) |
Kojto | 122:f9eeca106725 | 340 | |
Kojto | 122:f9eeca106725 | 341 | |
Kojto | 122:f9eeca106725 | 342 | #define IS_OPAMP_TRIMMINGVALUE(TRIMMINGVALUE) ((TRIMMINGVALUE) <= 0x1F) |
Kojto | 122:f9eeca106725 | 343 | |
Kojto | 122:f9eeca106725 | 344 | #define IS_OPAMP_FACTORYTRIMMING(TRIMMING) (((TRIMMING) == OPAMP_FACTORYTRIMMING_N) || \ |
Kojto | 122:f9eeca106725 | 345 | ((TRIMMING) == OPAMP_FACTORYTRIMMING_P)) |
Kojto | 122:f9eeca106725 | 346 | |
Kojto | 122:f9eeca106725 | 347 | /** |
Kojto | 122:f9eeca106725 | 348 | * @} |
Kojto | 122:f9eeca106725 | 349 | */ |
Kojto | 122:f9eeca106725 | 350 | |
Kojto | 122:f9eeca106725 | 351 | /* Include OPAMP HAL Extended module */ |
Kojto | 122:f9eeca106725 | 352 | #include "stm32l4xx_hal_opamp_ex.h" |
Kojto | 122:f9eeca106725 | 353 | |
Kojto | 122:f9eeca106725 | 354 | /* Exported functions --------------------------------------------------------*/ |
Kojto | 122:f9eeca106725 | 355 | /** @addtogroup OPAMP_Exported_Functions |
Kojto | 122:f9eeca106725 | 356 | * @{ |
Kojto | 122:f9eeca106725 | 357 | */ |
Kojto | 122:f9eeca106725 | 358 | |
Kojto | 122:f9eeca106725 | 359 | /** @addtogroup OPAMP_Exported_Functions_Group1 |
Kojto | 122:f9eeca106725 | 360 | * @{ |
Kojto | 122:f9eeca106725 | 361 | */ |
Kojto | 122:f9eeca106725 | 362 | /* Initialization/de-initialization functions **********************************/ |
Kojto | 122:f9eeca106725 | 363 | HAL_StatusTypeDef HAL_OPAMP_Init(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 364 | HAL_StatusTypeDef HAL_OPAMP_DeInit (OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 365 | void HAL_OPAMP_MspInit(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 366 | void HAL_OPAMP_MspDeInit(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 367 | /** |
Kojto | 122:f9eeca106725 | 368 | * @} |
Kojto | 122:f9eeca106725 | 369 | */ |
Kojto | 122:f9eeca106725 | 370 | |
Kojto | 122:f9eeca106725 | 371 | /** @addtogroup OPAMP_Exported_Functions_Group2 |
Kojto | 122:f9eeca106725 | 372 | * @{ |
Kojto | 122:f9eeca106725 | 373 | */ |
Kojto | 122:f9eeca106725 | 374 | |
Kojto | 122:f9eeca106725 | 375 | /* I/O operation functions *****************************************************/ |
Kojto | 122:f9eeca106725 | 376 | HAL_StatusTypeDef HAL_OPAMP_Start(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 377 | HAL_StatusTypeDef HAL_OPAMP_Stop(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 378 | HAL_StatusTypeDef HAL_OPAMP_SelfCalibrate(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 379 | |
Kojto | 122:f9eeca106725 | 380 | /** |
Kojto | 122:f9eeca106725 | 381 | * @} |
Kojto | 122:f9eeca106725 | 382 | */ |
Kojto | 122:f9eeca106725 | 383 | |
Kojto | 122:f9eeca106725 | 384 | /** @addtogroup OPAMP_Exported_Functions_Group3 |
Kojto | 122:f9eeca106725 | 385 | * @{ |
Kojto | 122:f9eeca106725 | 386 | */ |
Kojto | 122:f9eeca106725 | 387 | |
Kojto | 122:f9eeca106725 | 388 | /* Peripheral Control functions ************************************************/ |
Kojto | 122:f9eeca106725 | 389 | HAL_StatusTypeDef HAL_OPAMP_Lock(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 390 | HAL_OPAMP_TrimmingValueTypeDef HAL_OPAMP_GetTrimOffset (OPAMP_HandleTypeDef *hopamp, uint32_t trimmingoffset); |
Kojto | 122:f9eeca106725 | 391 | |
Kojto | 122:f9eeca106725 | 392 | /** |
Kojto | 122:f9eeca106725 | 393 | * @} |
Kojto | 122:f9eeca106725 | 394 | */ |
Kojto | 122:f9eeca106725 | 395 | |
Kojto | 122:f9eeca106725 | 396 | /** @addtogroup OPAMP_Exported_Functions_Group4 |
Kojto | 122:f9eeca106725 | 397 | * @{ |
Kojto | 122:f9eeca106725 | 398 | */ |
Kojto | 122:f9eeca106725 | 399 | |
Kojto | 122:f9eeca106725 | 400 | /* Peripheral State functions **************************************************/ |
Kojto | 122:f9eeca106725 | 401 | HAL_OPAMP_StateTypeDef HAL_OPAMP_GetState(OPAMP_HandleTypeDef *hopamp); |
Kojto | 122:f9eeca106725 | 402 | |
Kojto | 122:f9eeca106725 | 403 | /** |
Kojto | 122:f9eeca106725 | 404 | * @} |
Kojto | 122:f9eeca106725 | 405 | */ |
Kojto | 122:f9eeca106725 | 406 | |
Kojto | 122:f9eeca106725 | 407 | /** |
Kojto | 122:f9eeca106725 | 408 | * @} |
Kojto | 122:f9eeca106725 | 409 | */ |
Kojto | 122:f9eeca106725 | 410 | |
Kojto | 122:f9eeca106725 | 411 | /** |
Kojto | 122:f9eeca106725 | 412 | * @} |
Kojto | 122:f9eeca106725 | 413 | */ |
Kojto | 122:f9eeca106725 | 414 | |
Kojto | 122:f9eeca106725 | 415 | /** |
Kojto | 122:f9eeca106725 | 416 | * @} |
Kojto | 122:f9eeca106725 | 417 | */ |
Kojto | 122:f9eeca106725 | 418 | |
Kojto | 122:f9eeca106725 | 419 | #ifdef __cplusplus |
Kojto | 122:f9eeca106725 | 420 | } |
Kojto | 122:f9eeca106725 | 421 | #endif |
Kojto | 122:f9eeca106725 | 422 | |
Kojto | 122:f9eeca106725 | 423 | #endif /* __STM32L4xx_HAL_OPAMP_H */ |
Kojto | 122:f9eeca106725 | 424 | |
Kojto | 122:f9eeca106725 | 425 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |