Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
TARGET_NUCLEO_L152RE/stm32l1xx_hal_opamp.h@122:f9eeca106725, 2016-07-07 (annotated)
- Committer:
- Kojto
- Date:
- Thu Jul 07 14:34:11 2016 +0100
- Revision:
- 122:f9eeca106725
- Parent:
- 90:cb3d968589d8
Release 122 of the mbed library
Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Kojto | 90:cb3d968589d8 | 1 | /** |
| Kojto | 90:cb3d968589d8 | 2 | ****************************************************************************** |
| Kojto | 90:cb3d968589d8 | 3 | * @file stm32l1xx_hal_opamp.h |
| Kojto | 90:cb3d968589d8 | 4 | * @author MCD Application Team |
| Kojto | 122:f9eeca106725 | 5 | * @version V1.1.3 |
| Kojto | 122:f9eeca106725 | 6 | * @date 04-March-2016 |
| Kojto | 90:cb3d968589d8 | 7 | * @brief Header file of OPAMP HAL module. |
| Kojto | 90:cb3d968589d8 | 8 | ****************************************************************************** |
| Kojto | 90:cb3d968589d8 | 9 | * @attention |
| Kojto | 90:cb3d968589d8 | 10 | * |
| Kojto | 122:f9eeca106725 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
| Kojto | 90:cb3d968589d8 | 12 | * |
| Kojto | 90:cb3d968589d8 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
| Kojto | 90:cb3d968589d8 | 14 | * are permitted provided that the following conditions are met: |
| Kojto | 90:cb3d968589d8 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
| Kojto | 90:cb3d968589d8 | 16 | * this list of conditions and the following disclaimer. |
| Kojto | 90:cb3d968589d8 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| Kojto | 90:cb3d968589d8 | 18 | * this list of conditions and the following disclaimer in the documentation |
| Kojto | 90:cb3d968589d8 | 19 | * and/or other materials provided with the distribution. |
| Kojto | 90:cb3d968589d8 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| Kojto | 90:cb3d968589d8 | 21 | * may be used to endorse or promote products derived from this software |
| Kojto | 90:cb3d968589d8 | 22 | * without specific prior written permission. |
| Kojto | 90:cb3d968589d8 | 23 | * |
| Kojto | 90:cb3d968589d8 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| Kojto | 90:cb3d968589d8 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| Kojto | 90:cb3d968589d8 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| Kojto | 90:cb3d968589d8 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| Kojto | 90:cb3d968589d8 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| Kojto | 90:cb3d968589d8 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| Kojto | 90:cb3d968589d8 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| Kojto | 90:cb3d968589d8 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| Kojto | 90:cb3d968589d8 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| Kojto | 90:cb3d968589d8 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| Kojto | 90:cb3d968589d8 | 34 | * |
| Kojto | 90:cb3d968589d8 | 35 | ****************************************************************************** |
| Kojto | 90:cb3d968589d8 | 36 | */ |
| Kojto | 90:cb3d968589d8 | 37 | |
| Kojto | 90:cb3d968589d8 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
| Kojto | 90:cb3d968589d8 | 39 | #ifndef __STM32L1xx_HAL_OPAMP_H |
| Kojto | 90:cb3d968589d8 | 40 | #define __STM32L1xx_HAL_OPAMP_H |
| Kojto | 90:cb3d968589d8 | 41 | |
| Kojto | 90:cb3d968589d8 | 42 | #ifdef __cplusplus |
| Kojto | 90:cb3d968589d8 | 43 | extern "C" { |
| Kojto | 90:cb3d968589d8 | 44 | #endif |
| Kojto | 90:cb3d968589d8 | 45 | |
| Kojto | 122:f9eeca106725 | 46 | #if defined (STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L151xE) || defined (STM32L151xDX) || defined (STM32L152xE) || defined (STM32L152xDX) || defined (STM32L162xE) || defined (STM32L162xDX) || defined (STM32L162xC) || defined (STM32L152xC) || defined (STM32L151xC) |
| Kojto | 90:cb3d968589d8 | 47 | |
| Kojto | 90:cb3d968589d8 | 48 | /* Includes ------------------------------------------------------------------*/ |
| Kojto | 90:cb3d968589d8 | 49 | #include "stm32l1xx_hal_def.h" |
| Kojto | 90:cb3d968589d8 | 50 | |
| Kojto | 90:cb3d968589d8 | 51 | /** @addtogroup STM32L1xx_HAL_Driver |
| Kojto | 90:cb3d968589d8 | 52 | * @{ |
| Kojto | 90:cb3d968589d8 | 53 | */ |
| Kojto | 90:cb3d968589d8 | 54 | |
| Kojto | 90:cb3d968589d8 | 55 | /** @addtogroup OPAMP |
| Kojto | 90:cb3d968589d8 | 56 | * @{ |
| Kojto | 90:cb3d968589d8 | 57 | */ |
| Kojto | 90:cb3d968589d8 | 58 | |
| Kojto | 90:cb3d968589d8 | 59 | /* Exported types ------------------------------------------------------------*/ |
| Kojto | 90:cb3d968589d8 | 60 | |
| Kojto | 90:cb3d968589d8 | 61 | /** @defgroup OPAMP_Exported_Types OPAMP Exported Types |
| Kojto | 90:cb3d968589d8 | 62 | * @{ |
| Kojto | 90:cb3d968589d8 | 63 | */ |
| Kojto | 122:f9eeca106725 | 64 | |
| Kojto | 90:cb3d968589d8 | 65 | /** |
| Kojto | 90:cb3d968589d8 | 66 | * @brief OPAMP Init structure definition |
| Kojto | 90:cb3d968589d8 | 67 | */ |
| Kojto | 90:cb3d968589d8 | 68 | |
| Kojto | 90:cb3d968589d8 | 69 | typedef struct |
| Kojto | 90:cb3d968589d8 | 70 | { |
| Kojto | 90:cb3d968589d8 | 71 | uint32_t PowerSupplyRange; /*!< Specifies the power supply range: above or under 2.4V. |
| Kojto | 90:cb3d968589d8 | 72 | This parameter must be a value of @ref OPAMP_PowerSupplyRange |
| Kojto | 90:cb3d968589d8 | 73 | 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 | 74 | |
| Kojto | 122:f9eeca106725 | 75 | uint32_t PowerMode; /*!< Specifies the power mode Normal or Low-Power. |
| Kojto | 122:f9eeca106725 | 76 | This parameter must be a value of @ref OPAMP_PowerMode */ |
| Kojto | 122:f9eeca106725 | 77 | |
| Kojto | 90:cb3d968589d8 | 78 | uint32_t Mode; /*!< Specifies the OPAMP mode |
| Kojto | 90:cb3d968589d8 | 79 | This parameter must be a value of @ref OPAMP_Mode |
| Kojto | 90:cb3d968589d8 | 80 | mode is either Standalone or Follower */ |
| Kojto | 90:cb3d968589d8 | 81 | |
| Kojto | 90:cb3d968589d8 | 82 | uint32_t InvertingInput; /*!< Specifies the inverting input in Standalone mode |
| Kojto | 90:cb3d968589d8 | 83 | - In Standalone mode: i.e when mode is OPAMP_STANDALONE_MODE |
| Kojto | 90:cb3d968589d8 | 84 | This parameter must be a value of @ref OPAMP_InvertingInput |
| Kojto | 90:cb3d968589d8 | 85 | InvertingInput is either VM0 or VM1 |
| Kojto | 90:cb3d968589d8 | 86 | - In Follower mode: i.e when mode is OPAMP_FOLLOWER_MODE |
| Kojto | 90:cb3d968589d8 | 87 | This parameter is Not Applicable */ |
| Kojto | 90:cb3d968589d8 | 88 | |
| Kojto | 122:f9eeca106725 | 89 | uint32_t NonInvertingInput; /*!< Specifies the non inverting input of the opamp: |
| Kojto | 122:f9eeca106725 | 90 | This parameter must be a value of @ref OPAMP_NonInvertingInput |
| Kojto | 122:f9eeca106725 | 91 | Note: Non-inverting input availability depends on OPAMP instance: |
| Kojto | 122:f9eeca106725 | 92 | OPAMP1: Non-inverting input is either IO0, DAC_Channel1 |
| Kojto | 122:f9eeca106725 | 93 | OPAMP2: Non-inverting input is either IO0, DAC_Channel1, DAC_Channel2 |
| Kojto | 122:f9eeca106725 | 94 | OPAMP3: Non-inverting input is either IO0, DAC_Channel2 (OPAMP3 availability depends on STM32L1 devices) */ |
| Kojto | 90:cb3d968589d8 | 95 | |
| Kojto | 122:f9eeca106725 | 96 | uint32_t UserTrimming; /*!< Specifies the trimming mode |
| Kojto | 122:f9eeca106725 | 97 | This parameter must be a value of @ref OPAMP_UserTrimming |
| Kojto | 122:f9eeca106725 | 98 | UserTrimming is either factory or user trimming. |
| Kojto | 122:f9eeca106725 | 99 | Caution: This parameter is common to all OPAMP instances: a modification of this parameter for the selected OPAMP impacts the other OPAMP instances. */ |
| Kojto | 90:cb3d968589d8 | 100 | |
| Kojto | 90:cb3d968589d8 | 101 | uint32_t TrimmingValueP; /*!< Specifies the offset trimming value (PMOS) |
| Kojto | 90:cb3d968589d8 | 102 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
| Kojto | 122:f9eeca106725 | 103 | This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden) |
| Kojto | 122:f9eeca106725 | 104 | 16 is typical default value */ |
| Kojto | 122:f9eeca106725 | 105 | |
| Kojto | 90:cb3d968589d8 | 106 | uint32_t TrimmingValueN; /*!< Specifies the offset trimming value (NMOS) |
| Kojto | 90:cb3d968589d8 | 107 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
| Kojto | 122:f9eeca106725 | 108 | This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden) |
| Kojto | 122:f9eeca106725 | 109 | 16 is typical default value */ |
| Kojto | 122:f9eeca106725 | 110 | |
| Kojto | 90:cb3d968589d8 | 111 | uint32_t TrimmingValuePLowPower; /*!< Specifies the offset trimming value (PMOS) |
| Kojto | 90:cb3d968589d8 | 112 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
| Kojto | 122:f9eeca106725 | 113 | This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden) |
| Kojto | 122:f9eeca106725 | 114 | 16 is typical default value */ |
| Kojto | 90:cb3d968589d8 | 115 | |
| Kojto | 90:cb3d968589d8 | 116 | uint32_t TrimmingValueNLowPower; /*!< Specifies the offset trimming value (NMOS) |
| Kojto | 90:cb3d968589d8 | 117 | i.e. when UserTrimming is OPAMP_TRIMMING_USER. |
| Kojto | 122:f9eeca106725 | 118 | This parameter must be a number between Min_Data = 0 and Max_Data = 30 (Trimming value 31 is forbidden) |
| Kojto | 122:f9eeca106725 | 119 | 16 is typical default value */ |
| Kojto | 90:cb3d968589d8 | 120 | |
| Kojto | 90:cb3d968589d8 | 121 | }OPAMP_InitTypeDef; |
| Kojto | 90:cb3d968589d8 | 122 | |
| Kojto | 90:cb3d968589d8 | 123 | /** |
| Kojto | 90:cb3d968589d8 | 124 | * @brief HAL State structures definition |
| Kojto | 90:cb3d968589d8 | 125 | */ |
| Kojto | 90:cb3d968589d8 | 126 | |
| Kojto | 90:cb3d968589d8 | 127 | typedef enum |
| Kojto | 90:cb3d968589d8 | 128 | { |
| Kojto | 90:cb3d968589d8 | 129 | HAL_OPAMP_STATE_RESET = 0x00000000, /*!< OPMAP is not yet Initialized */ |
| Kojto | 90:cb3d968589d8 | 130 | |
| Kojto | 90:cb3d968589d8 | 131 | HAL_OPAMP_STATE_READY = 0x00000001, /*!< OPAMP is initialized and ready for use */ |
| Kojto | 90:cb3d968589d8 | 132 | HAL_OPAMP_STATE_CALIBBUSY = 0x00000002, /*!< OPAMP is enabled in auto calibration mode */ |
| Kojto | 90:cb3d968589d8 | 133 | |
| Kojto | 90:cb3d968589d8 | 134 | HAL_OPAMP_STATE_BUSY = 0x00000004, /*!< OPAMP is enabled and running in normal mode */ |
| Kojto | 90:cb3d968589d8 | 135 | HAL_OPAMP_STATE_BUSYLOCKED = 0x00000005, /*!< OPAMP is locked |
| Kojto | 90:cb3d968589d8 | 136 | only system reset allows reconfiguring the opamp. */ |
| Kojto | 90:cb3d968589d8 | 137 | |
| Kojto | 90:cb3d968589d8 | 138 | }HAL_OPAMP_StateTypeDef; |
| Kojto | 90:cb3d968589d8 | 139 | |
| Kojto | 90:cb3d968589d8 | 140 | /** |
| Kojto | 122:f9eeca106725 | 141 | * @brief OPAMP Handle Structure definition |
| Kojto | 90:cb3d968589d8 | 142 | */ |
| Kojto | 90:cb3d968589d8 | 143 | typedef struct |
| Kojto | 90:cb3d968589d8 | 144 | { |
| Kojto | 90:cb3d968589d8 | 145 | OPAMP_TypeDef *Instance; /*!< OPAMP instance's registers base address */ |
| Kojto | 90:cb3d968589d8 | 146 | OPAMP_InitTypeDef Init; /*!< OPAMP required parameters */ |
| Kojto | 90:cb3d968589d8 | 147 | HAL_StatusTypeDef Status; /*!< OPAMP peripheral status */ |
| Kojto | 90:cb3d968589d8 | 148 | HAL_LockTypeDef Lock; /*!< Locking object */ |
| Kojto | 90:cb3d968589d8 | 149 | __IO HAL_OPAMP_StateTypeDef State; /*!< OPAMP communication state */ |
| Kojto | 90:cb3d968589d8 | 150 | |
| Kojto | 90:cb3d968589d8 | 151 | } OPAMP_HandleTypeDef; |
| Kojto | 90:cb3d968589d8 | 152 | |
| Kojto | 90:cb3d968589d8 | 153 | /** |
| Kojto | 122:f9eeca106725 | 154 | * @brief HAl_OPAMP_TrimmingValueTypeDef definition |
| Kojto | 90:cb3d968589d8 | 155 | */ |
| Kojto | 90:cb3d968589d8 | 156 | |
| Kojto | 122:f9eeca106725 | 157 | typedef uint32_t HAL_OPAMP_TrimmingValueTypeDef; |
| Kojto | 90:cb3d968589d8 | 158 | |
| Kojto | 90:cb3d968589d8 | 159 | /** |
| Kojto | 90:cb3d968589d8 | 160 | * @} |
| Kojto | 90:cb3d968589d8 | 161 | */ |
| Kojto | 90:cb3d968589d8 | 162 | |
| Kojto | 90:cb3d968589d8 | 163 | /* Exported constants --------------------------------------------------------*/ |
| Kojto | 122:f9eeca106725 | 164 | |
| Kojto | 90:cb3d968589d8 | 165 | /** @defgroup OPAMP_Exported_Constants OPAMP Exported Constants |
| Kojto | 90:cb3d968589d8 | 166 | * @{ |
| Kojto | 90:cb3d968589d8 | 167 | */ |
| Kojto | 90:cb3d968589d8 | 168 | |
| Kojto | 90:cb3d968589d8 | 169 | /** |
| Kojto | 90:cb3d968589d8 | 170 | * OTR register Mask |
| Kojto | 90:cb3d968589d8 | 171 | */ |
| Kojto | 90:cb3d968589d8 | 172 | #define OPAMP_TRIM_VALUE_MASK OPAMP_OTR_AO1_OPT_OFFSET_TRIM_LOW |
| Kojto | 90:cb3d968589d8 | 173 | |
| Kojto | 90:cb3d968589d8 | 174 | /** |
| Kojto | 90:cb3d968589d8 | 175 | * CSR register Mask |
| Kojto | 90:cb3d968589d8 | 176 | */ |
| Kojto | 90:cb3d968589d8 | 177 | #define OPAMP_CSR_INSTANCE_OFFSET ((uint32_t) 8) /* Offset of each OPAMP instance into register CSR */ |
| Kojto | 90:cb3d968589d8 | 178 | #define OPAMP_OTR_INSTANCE_OFFSET ((uint32_t) 10) /* Offset of each OPAMP instance into register OTR */ |
| Kojto | 90:cb3d968589d8 | 179 | |
| Kojto | 90:cb3d968589d8 | 180 | |
| Kojto | 90:cb3d968589d8 | 181 | /** @defgroup OPAMP_Mode OPAMP Mode |
| Kojto | 90:cb3d968589d8 | 182 | * @{ |
| Kojto | 90:cb3d968589d8 | 183 | */ |
| Kojto | 90:cb3d968589d8 | 184 | #define OPAMP_STANDALONE_MODE ((uint32_t)0x00000000) /*!< OPAMP standalone mode */ |
| Kojto | 90:cb3d968589d8 | 185 | #define OPAMP_FOLLOWER_MODE ((uint32_t)0x00000001) /*!< OPAMP follower mode */ |
| Kojto | 90:cb3d968589d8 | 186 | |
| Kojto | 90:cb3d968589d8 | 187 | /** |
| Kojto | 90:cb3d968589d8 | 188 | * @} |
| Kojto | 90:cb3d968589d8 | 189 | */ |
| Kojto | 90:cb3d968589d8 | 190 | |
| Kojto | 90:cb3d968589d8 | 191 | /** @defgroup OPAMP_NonInvertingInput OPAMP NonInvertingInput |
| Kojto | 90:cb3d968589d8 | 192 | * @{ |
| Kojto | 90:cb3d968589d8 | 193 | */ |
| Kojto | 122:f9eeca106725 | 194 | #define OPAMP_NONINVERTINGINPUT_IO0 ((uint32_t)0x00000000) /*!< Comparator non-inverting input connected to dedicated IO pin low-leakage */ |
| Kojto | 122:f9eeca106725 | 195 | #define OPAMP_NONINVERTINGINPUT_DAC_CH1 ((uint32_t)0x00000001) /*!< Comparator non-inverting input connected internally to DAC channel 1. Available only on OPAMP1 and OPAMP2. */ |
| Kojto | 122:f9eeca106725 | 196 | #define OPAMP_NONINVERTINGINPUT_DAC_CH2 ((uint32_t)0x00000002) /*!< Comparator non-inverting input connected internally to DAC channel 2. Available only on OPAMP2 and OPAMP3 (OPAMP3 availability depends on STM32L1 devices). */ |
| Kojto | 90:cb3d968589d8 | 197 | |
| Kojto | 90:cb3d968589d8 | 198 | /** |
| Kojto | 90:cb3d968589d8 | 199 | * @} |
| Kojto | 90:cb3d968589d8 | 200 | */ |
| Kojto | 90:cb3d968589d8 | 201 | |
| Kojto | 90:cb3d968589d8 | 202 | /** @defgroup OPAMP_InvertingInput OPAMP InvertingInput |
| Kojto | 90:cb3d968589d8 | 203 | * @{ |
| Kojto | 90:cb3d968589d8 | 204 | */ |
| Kojto | 122:f9eeca106725 | 205 | /* Note: Literal "OPAMP_SEC_INVERTINGINPUT_IO1" is a legacy naming of "OPAMP_INVERTINGINPUT_IO1". It is equivalent and must be replaced by "OPAMP_INVERTINGINPUT_IO1". */ |
| Kojto | 122:f9eeca106725 | 206 | #define OPAMP_INVERTINGINPUT_IO0 ((uint32_t)0x00000000) /*!< Comparator inverting input connected to dedicated IO pin low-leakage */ |
| Kojto | 122:f9eeca106725 | 207 | #define OPAMP_INVERTINGINPUT_IO1 ((uint32_t)0x00000001) /*!< Comparator inverting input connected to alternative IO pin available on some device packages */ |
| Kojto | 90:cb3d968589d8 | 208 | |
| Kojto | 90:cb3d968589d8 | 209 | /** |
| Kojto | 90:cb3d968589d8 | 210 | * @} |
| Kojto | 90:cb3d968589d8 | 211 | */ |
| Kojto | 90:cb3d968589d8 | 212 | |
| Kojto | 90:cb3d968589d8 | 213 | /** @defgroup OPAMP_PowerMode OPAMP PowerMode |
| Kojto | 90:cb3d968589d8 | 214 | * @{ |
| Kojto | 90:cb3d968589d8 | 215 | */ |
| Kojto | 90:cb3d968589d8 | 216 | #define OPAMP_POWERMODE_NORMAL ((uint32_t)0x00000000) |
| Kojto | 90:cb3d968589d8 | 217 | #define OPAMP_POWERMODE_LOWPOWER ((uint32_t)0x00000001) |
| Kojto | 90:cb3d968589d8 | 218 | |
| Kojto | 90:cb3d968589d8 | 219 | /** |
| Kojto | 90:cb3d968589d8 | 220 | * @} |
| Kojto | 90:cb3d968589d8 | 221 | */ |
| Kojto | 90:cb3d968589d8 | 222 | |
| Kojto | 90:cb3d968589d8 | 223 | /** @defgroup OPAMP_PowerSupplyRange OPAMP PowerSupplyRange |
| Kojto | 90:cb3d968589d8 | 224 | * @{ |
| Kojto | 90:cb3d968589d8 | 225 | */ |
| Kojto | 90:cb3d968589d8 | 226 | #define OPAMP_POWERSUPPLY_LOW ((uint32_t)0x00000000) /*!< Power supply range low (VDDA lower than 2.4V) */ |
| Kojto | 90:cb3d968589d8 | 227 | #define OPAMP_POWERSUPPLY_HIGH OPAMP_CSR_AOP_RANGE /*!< Power supply range high (VDDA higher than 2.4V) */ |
| Kojto | 90:cb3d968589d8 | 228 | |
| Kojto | 90:cb3d968589d8 | 229 | /** |
| Kojto | 90:cb3d968589d8 | 230 | * @} |
| Kojto | 90:cb3d968589d8 | 231 | */ |
| Kojto | 90:cb3d968589d8 | 232 | |
| Kojto | 122:f9eeca106725 | 233 | /** @defgroup OPAMP_UserTrimming OPAMP User Trimming |
| Kojto | 90:cb3d968589d8 | 234 | * @{ |
| Kojto | 90:cb3d968589d8 | 235 | */ |
| Kojto | 90:cb3d968589d8 | 236 | #define OPAMP_TRIMMING_FACTORY ((uint32_t)0x00000000) /*!< Factory trimming */ |
| Kojto | 90:cb3d968589d8 | 237 | #define OPAMP_TRIMMING_USER OPAMP_OTR_OT_USER /*!< User trimming */ |
| Kojto | 90:cb3d968589d8 | 238 | |
| Kojto | 90:cb3d968589d8 | 239 | /** |
| Kojto | 90:cb3d968589d8 | 240 | * @} |
| Kojto | 90:cb3d968589d8 | 241 | */ |
| Kojto | 90:cb3d968589d8 | 242 | |
| Kojto | 90:cb3d968589d8 | 243 | /** @defgroup OPAMP_FactoryTrimming OPAMP FactoryTrimming |
| Kojto | 90:cb3d968589d8 | 244 | * @{ |
| Kojto | 90:cb3d968589d8 | 245 | */ |
| Kojto | 90:cb3d968589d8 | 246 | #define OPAMP_FACTORYTRIMMING_DUMMY ((uint32_t)0xFFFFFFFF) /*!< Dummy value if trimming value could not be retrieved */ |
| Kojto | 90:cb3d968589d8 | 247 | |
| Kojto | 90:cb3d968589d8 | 248 | #define OPAMP_FACTORYTRIMMING_P ((uint32_t)0x00000000) /*!< Offset trimming P */ |
| Kojto | 90:cb3d968589d8 | 249 | #define OPAMP_FACTORYTRIMMING_N POSITION_VAL(OPAMP_OTR_AO1_OPT_OFFSET_TRIM_HIGH) /*!< Offset trimming N */ |
| Kojto | 90:cb3d968589d8 | 250 | |
| Kojto | 90:cb3d968589d8 | 251 | /** |
| Kojto | 90:cb3d968589d8 | 252 | * @} |
| Kojto | 90:cb3d968589d8 | 253 | */ |
| Kojto | 90:cb3d968589d8 | 254 | |
| Kojto | 90:cb3d968589d8 | 255 | /** |
| Kojto | 90:cb3d968589d8 | 256 | * @} |
| Kojto | 90:cb3d968589d8 | 257 | */ |
| Kojto | 90:cb3d968589d8 | 258 | |
| Kojto | 90:cb3d968589d8 | 259 | /* Private constants ---------------------------------------------------------*/ |
| Kojto | 90:cb3d968589d8 | 260 | /** @defgroup OPAMP_Private_Constants OPAMP Private Constants |
| Kojto | 90:cb3d968589d8 | 261 | * @{ |
| Kojto | 90:cb3d968589d8 | 262 | */ |
| Kojto | 90:cb3d968589d8 | 263 | |
| Kojto | 90:cb3d968589d8 | 264 | /* Offset trimming time: during calibration, minimum time needed between two */ |
| Kojto | 90:cb3d968589d8 | 265 | /* steps to have 1 mV accuracy. */ |
| Kojto | 90:cb3d968589d8 | 266 | /* Refer to datasheet, electrical characteristics: parameter tOFFTRIM Typ=1ms.*/ |
| Kojto | 90:cb3d968589d8 | 267 | /* Unit: ms. */ |
| Kojto | 90:cb3d968589d8 | 268 | #define OPAMP_TRIMMING_DELAY ((uint32_t) 1) |
| Kojto | 90:cb3d968589d8 | 269 | |
| Kojto | 90:cb3d968589d8 | 270 | /** |
| Kojto | 90:cb3d968589d8 | 271 | * @} |
| Kojto | 90:cb3d968589d8 | 272 | */ |
| Kojto | 90:cb3d968589d8 | 273 | |
| Kojto | 90:cb3d968589d8 | 274 | /* Exported macros -----------------------------------------------------------*/ |
| Kojto | 90:cb3d968589d8 | 275 | |
| Kojto | 90:cb3d968589d8 | 276 | /** @defgroup OPAMP_Private_Macro OPAMP Private Macro |
| Kojto | 90:cb3d968589d8 | 277 | * @{ |
| Kojto | 90:cb3d968589d8 | 278 | */ |
| Kojto | 122:f9eeca106725 | 279 | |
| Kojto | 90:cb3d968589d8 | 280 | /** @brief Reset OPAMP handle state |
| Kojto | 90:cb3d968589d8 | 281 | * @param __HANDLE__: OPAMP handle. |
| Kojto | 90:cb3d968589d8 | 282 | * @retval None |
| Kojto | 90:cb3d968589d8 | 283 | */ |
| Kojto | 90:cb3d968589d8 | 284 | #define __HAL_OPAMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_OPAMP_STATE_RESET) |
| Kojto | 122:f9eeca106725 | 285 | |
| Kojto | 90:cb3d968589d8 | 286 | /** |
| Kojto | 90:cb3d968589d8 | 287 | * @} |
| Kojto | 90:cb3d968589d8 | 288 | */ |
| Kojto | 90:cb3d968589d8 | 289 | |
| Kojto | 90:cb3d968589d8 | 290 | /* Private macro -------------------------------------------------------------*/ |
| Kojto | 90:cb3d968589d8 | 291 | |
| Kojto | 90:cb3d968589d8 | 292 | /** @defgroup OPAMP_Private_Macro OPAMP Private Macro |
| Kojto | 90:cb3d968589d8 | 293 | * @{ |
| Kojto | 90:cb3d968589d8 | 294 | */ |
| Kojto | 90:cb3d968589d8 | 295 | |
| Kojto | 90:cb3d968589d8 | 296 | /** |
| Kojto | 90:cb3d968589d8 | 297 | * @brief Select the OPAMP bit OPAxPD (power-down) corresponding to the |
| Kojto | 90:cb3d968589d8 | 298 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 299 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 300 | * @retval None |
| Kojto | 90:cb3d968589d8 | 301 | */ |
| Kojto | 122:f9eeca106725 | 302 | #define OPAMP_CSR_OPAXPD(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 303 | (OPAMP_CSR_OPA1PD << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 304 | |
| Kojto | 90:cb3d968589d8 | 305 | /** |
| Kojto | 90:cb3d968589d8 | 306 | * @brief Select the OPAMP bit S3SELx (switch 3) corresponding to the |
| Kojto | 90:cb3d968589d8 | 307 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 308 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 309 | * @retval None |
| Kojto | 90:cb3d968589d8 | 310 | */ |
| Kojto | 122:f9eeca106725 | 311 | #define OPAMP_CSR_S3SELX(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 312 | (OPAMP_CSR_S3SEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 313 | |
| Kojto | 90:cb3d968589d8 | 314 | /** |
| Kojto | 90:cb3d968589d8 | 315 | * @brief Select the OPAMP bit S4SELx (switch 4) corresponding to the |
| Kojto | 90:cb3d968589d8 | 316 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 317 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 318 | * @retval None |
| Kojto | 90:cb3d968589d8 | 319 | */ |
| Kojto | 122:f9eeca106725 | 320 | #define OPAMP_CSR_S4SELX(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 321 | (OPAMP_CSR_S4SEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 322 | |
| Kojto | 90:cb3d968589d8 | 323 | /** |
| Kojto | 90:cb3d968589d8 | 324 | * @brief Select the OPAMP bit S5SELx (switch 5) corresponding to the |
| Kojto | 90:cb3d968589d8 | 325 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 326 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 327 | * @retval None |
| Kojto | 90:cb3d968589d8 | 328 | */ |
| Kojto | 122:f9eeca106725 | 329 | #define OPAMP_CSR_S5SELX(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 330 | (OPAMP_CSR_S5SEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 331 | |
| Kojto | 90:cb3d968589d8 | 332 | /** |
| Kojto | 90:cb3d968589d8 | 333 | * @brief Select the OPAMP bit S3SELx (switch 6) corresponding to the |
| Kojto | 90:cb3d968589d8 | 334 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 335 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 336 | * @retval None |
| Kojto | 90:cb3d968589d8 | 337 | */ |
| Kojto | 122:f9eeca106725 | 338 | #define OPAMP_CSR_S6SELX(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 339 | (OPAMP_CSR_S6SEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 340 | |
| Kojto | 90:cb3d968589d8 | 341 | /** |
| Kojto | 90:cb3d968589d8 | 342 | * @brief Select the OPAMP bit OPAxCAL_L (offset calibration for differential |
| Kojto | 90:cb3d968589d8 | 343 | * pair P) corresponding to the selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 344 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 345 | * @retval None |
| Kojto | 90:cb3d968589d8 | 346 | */ |
| Kojto | 122:f9eeca106725 | 347 | #define OPAMP_CSR_OPAXCAL_L(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 348 | (OPAMP_CSR_OPA1CAL_L << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 349 | |
| Kojto | 90:cb3d968589d8 | 350 | /** |
| Kojto | 90:cb3d968589d8 | 351 | * @brief Select the OPAMP bit OPAxCAL_H (offset calibration for differential |
| Kojto | 90:cb3d968589d8 | 352 | * pair N) corresponding to the selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 353 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 354 | * @retval None |
| Kojto | 90:cb3d968589d8 | 355 | */ |
| Kojto | 122:f9eeca106725 | 356 | #define OPAMP_CSR_OPAXCAL_H(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 357 | (OPAMP_CSR_OPA1CAL_H << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 358 | |
| Kojto | 90:cb3d968589d8 | 359 | /** |
| Kojto | 90:cb3d968589d8 | 360 | * @brief Select the OPAMP bit OPAxLPM (low power mode) corresponding to the |
| Kojto | 90:cb3d968589d8 | 361 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 362 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 363 | * @retval None |
| Kojto | 90:cb3d968589d8 | 364 | */ |
| Kojto | 122:f9eeca106725 | 365 | #define OPAMP_CSR_OPAXLPM(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 366 | (OPAMP_CSR_OPA1LPM << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) |
| Kojto | 90:cb3d968589d8 | 367 | |
| Kojto | 90:cb3d968589d8 | 368 | /** |
| Kojto | 90:cb3d968589d8 | 369 | * @brief Select the OPAMP bits of all switches corresponding to the |
| Kojto | 90:cb3d968589d8 | 370 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 371 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 372 | * @retval None |
| Kojto | 90:cb3d968589d8 | 373 | */ |
| Kojto | 122:f9eeca106725 | 374 | #define OPAMP_CSR_ALL_SWITCHES(__HANDLE__) \ |
| Kojto | 90:cb3d968589d8 | 375 | ( ( ((__HANDLE__)->Instance != OPAMP2) \ |
| Kojto | 90:cb3d968589d8 | 376 | )? \ |
| Kojto | 90:cb3d968589d8 | 377 | ( \ |
| Kojto | 122:f9eeca106725 | 378 | ((OPAMP_CSR_S3SEL1 | OPAMP_CSR_S4SEL1 | OPAMP_CSR_S5SEL1 | OPAMP_CSR_S6SEL1) << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) \ |
| Kojto | 90:cb3d968589d8 | 379 | | \ |
| Kojto | 122:f9eeca106725 | 380 | (OPAMP_CSR_ANAWSEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__))) \ |
| Kojto | 90:cb3d968589d8 | 381 | ) \ |
| Kojto | 90:cb3d968589d8 | 382 | : \ |
| Kojto | 90:cb3d968589d8 | 383 | ( \ |
| Kojto | 122:f9eeca106725 | 384 | ((OPAMP_CSR_S3SEL1 | OPAMP_CSR_S4SEL1 | OPAMP_CSR_S5SEL1 | OPAMP_CSR_S6SEL1) << (OPAMP_INSTANCE_DECIMAL(__HANDLE__) * OPAMP_CSR_INSTANCE_OFFSET)) \ |
| Kojto | 90:cb3d968589d8 | 385 | | \ |
| Kojto | 122:f9eeca106725 | 386 | (OPAMP_CSR_ANAWSEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__))) \ |
| Kojto | 90:cb3d968589d8 | 387 | | \ |
| Kojto | 90:cb3d968589d8 | 388 | (OPAMP_CSR_S7SEL2) \ |
| Kojto | 90:cb3d968589d8 | 389 | ) \ |
| Kojto | 90:cb3d968589d8 | 390 | ) |
| Kojto | 90:cb3d968589d8 | 391 | |
| Kojto | 90:cb3d968589d8 | 392 | /** |
| Kojto | 90:cb3d968589d8 | 393 | * @brief Select the OPAMP bit ANAWSELx (switch SanA) corresponding to the |
| Kojto | 90:cb3d968589d8 | 394 | * selected OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 395 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 396 | * @retval None |
| Kojto | 90:cb3d968589d8 | 397 | */ |
| Kojto | 122:f9eeca106725 | 398 | #define OPAMP_CSR_ANAWSELX(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 399 | (OPAMP_CSR_ANAWSEL1 << (OPAMP_INSTANCE_DECIMAL(__HANDLE__))) |
| Kojto | 90:cb3d968589d8 | 400 | |
| Kojto | 90:cb3d968589d8 | 401 | /** |
| Kojto | 90:cb3d968589d8 | 402 | * @brief Select the OPAMP bit OPAxCALOUT in function of the selected |
| Kojto | 90:cb3d968589d8 | 403 | * OPAMP instance. |
| Kojto | 90:cb3d968589d8 | 404 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 405 | * @retval None |
| Kojto | 90:cb3d968589d8 | 406 | */ |
| Kojto | 122:f9eeca106725 | 407 | #define OPAMP_CSR_OPAXCALOUT(__HANDLE__) \ |
| Kojto | 122:f9eeca106725 | 408 | (OPAMP_CSR_OPA1CALOUT << (OPAMP_INSTANCE_DECIMAL(__HANDLE__))) |
| Kojto | 90:cb3d968589d8 | 409 | |
| Kojto | 90:cb3d968589d8 | 410 | /** |
| Kojto | 90:cb3d968589d8 | 411 | * @brief Select the OPAMP trimming bits position value (position of LSB) |
| Kojto | 90:cb3d968589d8 | 412 | * in register OPAMP_OTR or register OPAMP_LPOTR in function of the selected |
| Kojto | 90:cb3d968589d8 | 413 | * OPAMP instance and the transistors differential pair high (PMOS) or |
| Kojto | 90:cb3d968589d8 | 414 | * low (NMOS). |
| Kojto | 90:cb3d968589d8 | 415 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 416 | * @param __TRIM_HIGH_LOW__: transistors differential pair high or low. |
| Kojto | 90:cb3d968589d8 | 417 | * Must be a value of @ref OPAMP_FactoryTrimming. |
| Kojto | 90:cb3d968589d8 | 418 | * @retval None |
| Kojto | 90:cb3d968589d8 | 419 | */ |
| Kojto | 122:f9eeca106725 | 420 | #define OPAMP_OFFSET_TRIM_BITSPOSITION(__HANDLE__, __TRIM_HIGH_LOW__) \ |
| Kojto | 122:f9eeca106725 | 421 | ((OPAMP_INSTANCE_DECIMAL((__HANDLE__)) * OPAMP_OTR_INSTANCE_OFFSET) + (__TRIM_HIGH_LOW__)) |
| Kojto | 90:cb3d968589d8 | 422 | |
| Kojto | 90:cb3d968589d8 | 423 | /** |
| Kojto | 90:cb3d968589d8 | 424 | * @brief Shift the OPAMP trimming bits to register OPAMP_OTR or register |
| Kojto | 90:cb3d968589d8 | 425 | * OPAMP_LPOTR in function of the selected OPAMP instance and the transistors |
| Kojto | 90:cb3d968589d8 | 426 | * differential pair high (PMOS) or low (NMOS). |
| Kojto | 90:cb3d968589d8 | 427 | * @param __HANDLE__: OPAMP handle |
| Kojto | 90:cb3d968589d8 | 428 | * @param __TRIM_HIGH_LOW__: transistors differential pair high or low. |
| Kojto | 90:cb3d968589d8 | 429 | * Must be a value of @ref OPAMP_FactoryTrimming. |
| Kojto | 90:cb3d968589d8 | 430 | * @param __TRIMMING_VALUE__: Trimming value |
| Kojto | 90:cb3d968589d8 | 431 | * @retval None |
| Kojto | 90:cb3d968589d8 | 432 | */ |
| Kojto | 122:f9eeca106725 | 433 | #define OPAMP_OFFSET_TRIM_SET(__HANDLE__, __TRIM_HIGH_LOW__, __TRIMMING_VALUE__) \ |
| Kojto | 122:f9eeca106725 | 434 | ((__TRIMMING_VALUE__) << (OPAMP_OFFSET_TRIM_BITSPOSITION((__HANDLE__), (__TRIM_HIGH_LOW__)))) |
| Kojto | 90:cb3d968589d8 | 435 | |
| Kojto | 90:cb3d968589d8 | 436 | /** |
| Kojto | 90:cb3d968589d8 | 437 | * @brief Check that trimming value is within correct range |
| Kojto | 90:cb3d968589d8 | 438 | * @param TRIMMINGVALUE: OPAMP trimming value |
| Kojto | 90:cb3d968589d8 | 439 | * @retval None |
| Kojto | 90:cb3d968589d8 | 440 | */ |
| Kojto | 90:cb3d968589d8 | 441 | #define IS_OPAMP_TRIMMINGVALUE(TRIMMINGVALUE) ((TRIMMINGVALUE) <= 0x1E) |
| Kojto | 90:cb3d968589d8 | 442 | |
| Kojto | 122:f9eeca106725 | 443 | #define IS_OPAMP_FUNCTIONAL_NORMALMODE(INPUT) (((INPUT) == OPAMP_STANDALONE_MODE) || \ |
| Kojto | 122:f9eeca106725 | 444 | ((INPUT) == OPAMP_FOLLOWER_MODE)) |
| Kojto | 122:f9eeca106725 | 445 | |
| Kojto | 122:f9eeca106725 | 446 | #define IS_OPAMP_INVERTING_INPUT(INPUT) (((INPUT) == OPAMP_INVERTINGINPUT_IO0) || \ |
| Kojto | 122:f9eeca106725 | 447 | ((INPUT) == OPAMP_INVERTINGINPUT_IO1) ) |
| Kojto | 122:f9eeca106725 | 448 | |
| Kojto | 122:f9eeca106725 | 449 | #define IS_OPAMP_POWERMODE(TRIMMING) (((TRIMMING) == OPAMP_POWERMODE_NORMAL) || \ |
| Kojto | 122:f9eeca106725 | 450 | ((TRIMMING) == OPAMP_POWERMODE_LOWPOWER) ) |
| Kojto | 122:f9eeca106725 | 451 | |
| Kojto | 122:f9eeca106725 | 452 | #define IS_OPAMP_POWER_SUPPLY_RANGE(RANGE) (((RANGE) == OPAMP_POWERSUPPLY_LOW) || \ |
| Kojto | 122:f9eeca106725 | 453 | ((RANGE) == OPAMP_POWERSUPPLY_HIGH) ) |
| Kojto | 122:f9eeca106725 | 454 | |
| Kojto | 122:f9eeca106725 | 455 | #define IS_OPAMP_TRIMMING(TRIMMING) (((TRIMMING) == OPAMP_TRIMMING_FACTORY) || \ |
| Kojto | 122:f9eeca106725 | 456 | ((TRIMMING) == OPAMP_TRIMMING_USER)) |
| Kojto | 122:f9eeca106725 | 457 | |
| Kojto | 122:f9eeca106725 | 458 | #define IS_OPAMP_FACTORYTRIMMING(TRIMMING) (((TRIMMING) == OPAMP_FACTORYTRIMMING_N) || \ |
| Kojto | 122:f9eeca106725 | 459 | ((TRIMMING) == OPAMP_FACTORYTRIMMING_P) ) |
| Kojto | 122:f9eeca106725 | 460 | |
| Kojto | 90:cb3d968589d8 | 461 | /** |
| Kojto | 90:cb3d968589d8 | 462 | * @} |
| Kojto | 90:cb3d968589d8 | 463 | */ |
| Kojto | 90:cb3d968589d8 | 464 | |
| Kojto | 122:f9eeca106725 | 465 | |
| Kojto | 90:cb3d968589d8 | 466 | /* Include OPAMP HAL Extension module */ |
| Kojto | 90:cb3d968589d8 | 467 | #include "stm32l1xx_hal_opamp_ex.h" |
| Kojto | 90:cb3d968589d8 | 468 | |
| Kojto | 90:cb3d968589d8 | 469 | /* Exported functions --------------------------------------------------------*/ |
| Kojto | 90:cb3d968589d8 | 470 | /** @addtogroup OPAMP_Exported_Functions |
| Kojto | 90:cb3d968589d8 | 471 | * @{ |
| Kojto | 122:f9eeca106725 | 472 | */ |
| Kojto | 90:cb3d968589d8 | 473 | |
| Kojto | 90:cb3d968589d8 | 474 | /** @addtogroup OPAMP_Exported_Functions_Group1 |
| Kojto | 90:cb3d968589d8 | 475 | * @{ |
| Kojto | 90:cb3d968589d8 | 476 | */ |
| Kojto | 90:cb3d968589d8 | 477 | /* Initialization/de-initialization functions **********************************/ |
| Kojto | 90:cb3d968589d8 | 478 | HAL_StatusTypeDef HAL_OPAMP_Init(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 90:cb3d968589d8 | 479 | HAL_StatusTypeDef HAL_OPAMP_DeInit (OPAMP_HandleTypeDef *hopamp); |
| Kojto | 90:cb3d968589d8 | 480 | void HAL_OPAMP_MspInit(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 90:cb3d968589d8 | 481 | void HAL_OPAMP_MspDeInit(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 90:cb3d968589d8 | 482 | /** |
| Kojto | 90:cb3d968589d8 | 483 | * @} |
| Kojto | 90:cb3d968589d8 | 484 | */ |
| Kojto | 90:cb3d968589d8 | 485 | |
| Kojto | 90:cb3d968589d8 | 486 | /** @addtogroup OPAMP_Exported_Functions_Group2 |
| Kojto | 90:cb3d968589d8 | 487 | * @{ |
| Kojto | 90:cb3d968589d8 | 488 | */ |
| Kojto | 122:f9eeca106725 | 489 | |
| Kojto | 90:cb3d968589d8 | 490 | /* I/O operation functions *****************************************************/ |
| Kojto | 90:cb3d968589d8 | 491 | HAL_StatusTypeDef HAL_OPAMP_Start(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 90:cb3d968589d8 | 492 | HAL_StatusTypeDef HAL_OPAMP_Stop(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 90:cb3d968589d8 | 493 | HAL_StatusTypeDef HAL_OPAMP_SelfCalibrate(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 90:cb3d968589d8 | 494 | /** |
| Kojto | 90:cb3d968589d8 | 495 | * @} |
| Kojto | 90:cb3d968589d8 | 496 | */ |
| Kojto | 90:cb3d968589d8 | 497 | |
| Kojto | 90:cb3d968589d8 | 498 | /** @addtogroup OPAMP_Exported_Functions_Group3 |
| Kojto | 90:cb3d968589d8 | 499 | * @{ |
| Kojto | 90:cb3d968589d8 | 500 | */ |
| Kojto | 122:f9eeca106725 | 501 | |
| Kojto | 90:cb3d968589d8 | 502 | /* Peripheral Control functions ************************************************/ |
| Kojto | 90:cb3d968589d8 | 503 | HAL_StatusTypeDef HAL_OPAMP_Lock(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 122:f9eeca106725 | 504 | HAL_OPAMP_TrimmingValueTypeDef HAL_OPAMP_GetTrimOffset (OPAMP_HandleTypeDef *hopamp, uint32_t trimmingoffset); |
| Kojto | 90:cb3d968589d8 | 505 | /** |
| Kojto | 90:cb3d968589d8 | 506 | * @} |
| Kojto | 90:cb3d968589d8 | 507 | */ |
| Kojto | 90:cb3d968589d8 | 508 | |
| Kojto | 90:cb3d968589d8 | 509 | /** @addtogroup OPAMP_Exported_Functions_Group4 |
| Kojto | 90:cb3d968589d8 | 510 | * @{ |
| Kojto | 90:cb3d968589d8 | 511 | */ |
| Kojto | 122:f9eeca106725 | 512 | |
| Kojto | 90:cb3d968589d8 | 513 | /* Peripheral State functions **************************************************/ |
| Kojto | 90:cb3d968589d8 | 514 | HAL_OPAMP_StateTypeDef HAL_OPAMP_GetState(OPAMP_HandleTypeDef *hopamp); |
| Kojto | 122:f9eeca106725 | 515 | |
| Kojto | 90:cb3d968589d8 | 516 | /** |
| Kojto | 90:cb3d968589d8 | 517 | * @} |
| Kojto | 90:cb3d968589d8 | 518 | */ |
| Kojto | 90:cb3d968589d8 | 519 | |
| Kojto | 90:cb3d968589d8 | 520 | /** |
| Kojto | 90:cb3d968589d8 | 521 | * @} |
| Kojto | 122:f9eeca106725 | 522 | */ |
| Kojto | 90:cb3d968589d8 | 523 | |
| Kojto | 90:cb3d968589d8 | 524 | /** |
| Kojto | 90:cb3d968589d8 | 525 | * @} |
| Kojto | 90:cb3d968589d8 | 526 | */ |
| Kojto | 90:cb3d968589d8 | 527 | |
| Kojto | 90:cb3d968589d8 | 528 | /** |
| Kojto | 90:cb3d968589d8 | 529 | * @} |
| Kojto | 90:cb3d968589d8 | 530 | */ |
| Kojto | 90:cb3d968589d8 | 531 | |
| Kojto | 122:f9eeca106725 | 532 | #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD || STM32L151xE || STM32L151xDX || STM32L152xE || STM32L152xDX || STM32L162xE || STM32L162xDX || STM32L162xC || STM32L152xC || STM32L151xC */ |
| Kojto | 90:cb3d968589d8 | 533 | #ifdef __cplusplus |
| Kojto | 90:cb3d968589d8 | 534 | } |
| Kojto | 90:cb3d968589d8 | 535 | #endif |
| Kojto | 90:cb3d968589d8 | 536 | |
| Kojto | 90:cb3d968589d8 | 537 | #endif /* __STM32L1xx_HAL_OPAMP_H */ |
| Kojto | 90:cb3d968589d8 | 538 | |
| Kojto | 90:cb3d968589d8 | 539 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |


