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