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.

Committer:
Kojto
Date:
Tue Feb 14 11:24:20 2017 +0000
Revision:
136:ef9c61f8c49f
Parent:
135:176b8275d35d
Child:
168:b9e159c1930a
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?

UserRevisionLine numberNew contents of line
<> 135:176b8275d35d 1 /**
<> 135:176b8275d35d 2 ******************************************************************************
<> 135:176b8275d35d 3 * @file stm32f3xx_ll_opamp.h
<> 135:176b8275d35d 4 * @author MCD Application Team
<> 135:176b8275d35d 5 * @version V1.4.0
<> 135:176b8275d35d 6 * @date 16-December-2016
<> 135:176b8275d35d 7 * @brief Header file of OPAMP LL module.
<> 135:176b8275d35d 8 ******************************************************************************
<> 135:176b8275d35d 9 * @attention
<> 135:176b8275d35d 10 *
<> 135:176b8275d35d 11 * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
<> 135:176b8275d35d 12 *
<> 135:176b8275d35d 13 * Redistribution and use in source and binary forms, with or without modification,
<> 135:176b8275d35d 14 * are permitted provided that the following conditions are met:
<> 135:176b8275d35d 15 * 1. Redistributions of source code must retain the above copyright notice,
<> 135:176b8275d35d 16 * this list of conditions and the following disclaimer.
<> 135:176b8275d35d 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 135:176b8275d35d 18 * this list of conditions and the following disclaimer in the documentation
<> 135:176b8275d35d 19 * and/or other materials provided with the distribution.
<> 135:176b8275d35d 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 135:176b8275d35d 21 * may be used to endorse or promote products derived from this software
<> 135:176b8275d35d 22 * without specific prior written permission.
<> 135:176b8275d35d 23 *
<> 135:176b8275d35d 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 135:176b8275d35d 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 135:176b8275d35d 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 135:176b8275d35d 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 135:176b8275d35d 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 135:176b8275d35d 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 135:176b8275d35d 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 135:176b8275d35d 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 135:176b8275d35d 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 135:176b8275d35d 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 135:176b8275d35d 34 *
<> 135:176b8275d35d 35 ******************************************************************************
<> 135:176b8275d35d 36 */
<> 135:176b8275d35d 37
<> 135:176b8275d35d 38 /* Define to prevent recursive inclusion -------------------------------------*/
<> 135:176b8275d35d 39 #ifndef __STM32F3xx_LL_OPAMP_H
<> 135:176b8275d35d 40 #define __STM32F3xx_LL_OPAMP_H
<> 135:176b8275d35d 41
<> 135:176b8275d35d 42 #ifdef __cplusplus
<> 135:176b8275d35d 43 extern "C" {
<> 135:176b8275d35d 44 #endif
<> 135:176b8275d35d 45
<> 135:176b8275d35d 46 /* Includes ------------------------------------------------------------------*/
<> 135:176b8275d35d 47 #include "stm32f3xx.h"
<> 135:176b8275d35d 48
<> 135:176b8275d35d 49 /** @addtogroup STM32F3xx_LL_Driver
<> 135:176b8275d35d 50 * @{
<> 135:176b8275d35d 51 */
<> 135:176b8275d35d 52
<> 135:176b8275d35d 53 #if defined (OPAMP1) || defined (OPAMP2) || defined (OPAMP3) || defined (OPAMP4)
<> 135:176b8275d35d 54
<> 135:176b8275d35d 55 /** @defgroup OPAMP_LL OPAMP
<> 135:176b8275d35d 56 * @{
<> 135:176b8275d35d 57 */
<> 135:176b8275d35d 58
<> 135:176b8275d35d 59 /* Private types -------------------------------------------------------------*/
<> 135:176b8275d35d 60 /* Private variables ---------------------------------------------------------*/
<> 135:176b8275d35d 61
<> 135:176b8275d35d 62 /* Private constants ---------------------------------------------------------*/
<> 135:176b8275d35d 63 /** @defgroup OPAMP_LL_Private_Constants OPAMP Private Constants
<> 135:176b8275d35d 64 * @{
<> 135:176b8275d35d 65 */
<> 135:176b8275d35d 66
<> 135:176b8275d35d 67 /* Internal mask for OPAMP trimming of transistors differential pair NMOS */
<> 135:176b8275d35d 68 /* or PMOS. */
<> 135:176b8275d35d 69 /* To select into literal LL_OPAMP_TRIMMING_x the relevant bits for: */
<> 135:176b8275d35d 70 /* - OPAMP trimming selection of transistors differential pair */
<> 135:176b8275d35d 71 /* - OPAMP trimming values of transistors differential pair */
<> 135:176b8275d35d 72 #define OPAMP_TRIMMING_SELECT_MASK (OPAMP_CSR_CALSEL)
<> 135:176b8275d35d 73 #define OPAMP_TRIMMING_VALUE_MASK (OPAMP_CSR_TRIMOFFSETN | OPAMP_CSR_TRIMOFFSETP)
<> 135:176b8275d35d 74
<> 135:176b8275d35d 75 /**
<> 135:176b8275d35d 76 * @}
<> 135:176b8275d35d 77 */
<> 135:176b8275d35d 78
<> 135:176b8275d35d 79
<> 135:176b8275d35d 80 /* Private macros ------------------------------------------------------------*/
<> 135:176b8275d35d 81 /** @defgroup OPAMP_LL_Private_Macros OPAMP Private Macros
<> 135:176b8275d35d 82 * @{
<> 135:176b8275d35d 83 */
<> 135:176b8275d35d 84
<> 135:176b8275d35d 85 /**
<> 135:176b8275d35d 86 * @brief Driver macro reserved for internal use: set a pointer to
<> 135:176b8275d35d 87 * a register from a register basis from which an offset
<> 135:176b8275d35d 88 * is applied.
<> 135:176b8275d35d 89 * @param __REG__ Register basis from which the offset is applied.
<> 135:176b8275d35d 90 * @param __REG_OFFSET__ Offset to be applied (unit: number of registers).
<> 135:176b8275d35d 91 * @retval Register address
<> 135:176b8275d35d 92 */
<> 135:176b8275d35d 93 #define __OPAMP_PTR_REG_OFFSET(__REG__, __REG_OFFSET__) \
<> 135:176b8275d35d 94 ((uint32_t *)((uint32_t) ((uint32_t)(&(__REG__)) + ((__REG_OFFSET__) << 2U))))
<> 135:176b8275d35d 95
<> 135:176b8275d35d 96
<> 135:176b8275d35d 97
<> 135:176b8275d35d 98
<> 135:176b8275d35d 99 /**
<> 135:176b8275d35d 100 * @}
<> 135:176b8275d35d 101 */
<> 135:176b8275d35d 102
<> 135:176b8275d35d 103
<> 135:176b8275d35d 104 /* Exported types ------------------------------------------------------------*/
<> 135:176b8275d35d 105 #if defined(USE_FULL_LL_DRIVER)
<> 135:176b8275d35d 106 /** @defgroup OPAMP_LL_ES_INIT OPAMP Exported Init structure
<> 135:176b8275d35d 107 * @{
<> 135:176b8275d35d 108 */
<> 135:176b8275d35d 109
<> 135:176b8275d35d 110 /**
<> 135:176b8275d35d 111 * @brief Structure definition of some features of OPAMP instance.
<> 135:176b8275d35d 112 */
<> 135:176b8275d35d 113 typedef struct
<> 135:176b8275d35d 114 {
<> 135:176b8275d35d 115 uint32_t FunctionalMode; /*!< Set OPAMP functional mode by setting internal connections: OPAMP operation in standalone, follower, ...
<> 135:176b8275d35d 116 This parameter can be a value of @ref OPAMP_LL_EC_FUNCTIONAL_MODE
<> 135:176b8275d35d 117 @note If OPAMP is configured in mode PGA, the gain can be configured using function @ref LL_OPAMP_SetPGAGain().
<> 135:176b8275d35d 118
<> 135:176b8275d35d 119 This feature can be modified afterwards using unitary function @ref LL_OPAMP_SetFunctionalMode(). */
<> 135:176b8275d35d 120
<> 135:176b8275d35d 121 uint32_t InputNonInverting; /*!< Set OPAMP input non-inverting connection.
<> 135:176b8275d35d 122 This parameter can be a value of @ref OPAMP_LL_EC_INPUT_NONINVERTING
<> 135:176b8275d35d 123
<> 135:176b8275d35d 124 This feature can be modified afterwards using unitary function @ref LL_OPAMP_SetInputNonInverting(). */
<> 135:176b8275d35d 125
<> 135:176b8275d35d 126 uint32_t InputInverting; /*!< Set OPAMP inverting input connection.
<> 135:176b8275d35d 127 This parameter can be a value of @ref OPAMP_LL_EC_INPUT_INVERTING
<> 135:176b8275d35d 128 @note OPAMP inverting input is used with OPAMP in mode standalone or PGA with external capacitors for filtering circuit. Otherwise (OPAMP in mode follower), OPAMP inverting input is not used (not connected to GPIO pin), this parameter is discarded.
<> 135:176b8275d35d 129
<> 135:176b8275d35d 130 This feature can be modified afterwards using unitary function @ref LL_OPAMP_SetInputInverting(). */
<> 135:176b8275d35d 131
<> 135:176b8275d35d 132 } LL_OPAMP_InitTypeDef;
<> 135:176b8275d35d 133
<> 135:176b8275d35d 134 /**
<> 135:176b8275d35d 135 * @}
<> 135:176b8275d35d 136 */
<> 135:176b8275d35d 137 #endif /* USE_FULL_LL_DRIVER */
<> 135:176b8275d35d 138
<> 135:176b8275d35d 139 /* Exported constants --------------------------------------------------------*/
<> 135:176b8275d35d 140 /** @defgroup OPAMP_LL_Exported_Constants OPAMP Exported Constants
<> 135:176b8275d35d 141 * @{
<> 135:176b8275d35d 142 */
<> 135:176b8275d35d 143
<> 135:176b8275d35d 144 /** @defgroup OPAMP_LL_EC_MODE OPAMP mode calibration or functional.
<> 135:176b8275d35d 145 * @{
<> 135:176b8275d35d 146 */
<> 135:176b8275d35d 147 #define LL_OPAMP_MODE_FUNCTIONAL ((uint32_t)0x00000000U) /*!< OPAMP functional mode */
<> 135:176b8275d35d 148 #define LL_OPAMP_MODE_CALIBRATION (OPAMP_CSR_CALON) /*!< OPAMP calibration mode */
<> 135:176b8275d35d 149 /**
<> 135:176b8275d35d 150 * @}
<> 135:176b8275d35d 151 */
<> 135:176b8275d35d 152
<> 135:176b8275d35d 153 /** @defgroup OPAMP_LL_EC_FUNCTIONAL_MODE OPAMP functional mode
<> 135:176b8275d35d 154 * @{
<> 135:176b8275d35d 155 */
<> 135:176b8275d35d 156 #define LL_OPAMP_MODE_STANDALONE ((uint32_t)0x00000000U) /*!< OPAMP functional mode, OPAMP operation in standalone */
<> 135:176b8275d35d 157 #define LL_OPAMP_MODE_FOLLOWER (OPAMP_CSR_VMSEL_1 | OPAMP_CSR_VMSEL_0) /*!< OPAMP functional mode, OPAMP operation in follower */
<> 135:176b8275d35d 158 #define LL_OPAMP_MODE_PGA (OPAMP_CSR_VMSEL_1) /*!< OPAMP functional mode, OPAMP operation in PGA */
<> 135:176b8275d35d 159 #define LL_OPAMP_MODE_PGA_EXT_FILT_IO0 (OPAMP_CSR_PGGAIN_3 | OPAMP_CSR_VMSEL_1) /*!< OPAMP functional mode, OPAMP operation in PGA with external filtering on OPAMP input IO0. */
<> 135:176b8275d35d 160 #define LL_OPAMP_MODE_PGA_EXT_FILT_IO1 (OPAMP_CSR_PGGAIN_3 | OPAMP_CSR_PGGAIN_2 | OPAMP_CSR_VMSEL_1) /*!< OPAMP functional mode, OPAMP operation in PGA with external filtering on OPAMP input IO1. */
<> 135:176b8275d35d 161 /**
<> 135:176b8275d35d 162 * @}
<> 135:176b8275d35d 163 */
<> 135:176b8275d35d 164
<> 135:176b8275d35d 165 /** @defgroup OPAMP_LL_EC_MODE_PGA_GAIN OPAMP PGA gain (relevant when OPAMP is in functional mode PGA)
<> 135:176b8275d35d 166 * @{
<> 135:176b8275d35d 167 */
<> 135:176b8275d35d 168 #define LL_OPAMP_PGA_GAIN_2 ((uint32_t)0x00000000U) /*!< OPAMP PGA gain 2 */
<> 135:176b8275d35d 169 #define LL_OPAMP_PGA_GAIN_4 (OPAMP_CSR_PGGAIN_0) /*!< OPAMP PGA gain 4 */
<> 135:176b8275d35d 170 #define LL_OPAMP_PGA_GAIN_8 (OPAMP_CSR_PGGAIN_1) /*!< OPAMP PGA gain 8 */
<> 135:176b8275d35d 171 #define LL_OPAMP_PGA_GAIN_16 (OPAMP_CSR_PGGAIN_1 | OPAMP_CSR_PGGAIN_0 ) /*!< OPAMP PGA gain 16 */
<> 135:176b8275d35d 172 /**
<> 135:176b8275d35d 173 * @}
<> 135:176b8275d35d 174 */
<> 135:176b8275d35d 175
<> 135:176b8275d35d 176 /** @defgroup OPAMP_LL_EC_INPUT_NONINVERTING OPAMP input non-inverting
<> 135:176b8275d35d 177 * @{
<> 135:176b8275d35d 178 */
<> 135:176b8275d35d 179 #define LL_OPAMP_INPUT_NONINVERT_IO0 (OPAMP_CSR_VPSEL) /*!< OPAMP non inverting input connected to GPIO pin (pin PA1 for OPAMP1, pin PA7 for OPAMP2, pin PB0 for OPAMP3, pin PB13 for OPAMP4) */
<> 135:176b8275d35d 180 #define LL_OPAMP_INPUT_NONINVERT_IO1 ((uint32_t)0x00000000) /*!< OPAMP non inverting input connected to GPIO pin (pin PA7 for OPAMP1, pin PD14 for OPAMP2, pin PB13 for OPAMP3, pin PD11 for OPAMP4) */
<> 135:176b8275d35d 181 #define LL_OPAMP_INPUT_NONINVERT_IO2 (OPAMP_CSR_VPSEL_1) /*!< OPAMP non inverting input connected to GPIO pin (pin PA3 for OPAMP1, pin PB0 for OPAMP2, pin PA1 for OPAMP3, pin PB11 for OPAMP4) */
<> 135:176b8275d35d 182 #define LL_OPAMP_INPUT_NONINVERT_IO3 (OPAMP_CSR_VPSEL_0) /*!< OPAMP non inverting input connected to GPIO pin (pin PA5 for OPAMP1, pin PB14 for OPAMP2, pin PA5 for OPAMP3, pin PA4 for OPAMP4) */
<> 135:176b8275d35d 183 #define LL_OPAMP_INPUT_NONINV_DAC1_CH1 (LL_OPAMP_INPUT_NONINVERT_IO3) /*!< OPAMP non inverting input connected to DAC1 channel1 output (specific to OPAMP instances: OPAMP4) */
<> 135:176b8275d35d 184 #define LL_OPAMP_INPUT_NONINV_DAC1_CH2 (LL_OPAMP_INPUT_NONINVERT_IO3) /*!< OPAMP non inverting input connected to DAC1 channel2 output (specific to OPAMP instances: OPAMP1, OPAMP3) */
<> 135:176b8275d35d 185 /**
<> 135:176b8275d35d 186 * @}
<> 135:176b8275d35d 187 */
<> 135:176b8275d35d 188
<> 135:176b8275d35d 189 /** @defgroup OPAMP_LL_EC_INPUT_INVERTING OPAMP input inverting
<> 135:176b8275d35d 190 * @{
<> 135:176b8275d35d 191 */
<> 135:176b8275d35d 192 #define LL_OPAMP_INPUT_INVERT_IO0 ((uint32_t)0x00000000U) /*!< OPAMP inverting input connected to GPIO pin (pin PC5 for OPAMP1, pin PC5 for OPAMP2, pin PB10 for OPAMP3, pin PB10 for OPAMP4). Note: OPAMP inverting input is used with OPAMP in mode standalone or PGA with external capacitors for filtering circuit. Otherwise (OPAMP in mode follower), OPAMP inverting input is not used (not connected to GPIO pin). */
<> 135:176b8275d35d 193 #define LL_OPAMP_INPUT_INVERT_IO1 (OPAMP_CSR_VMSEL_0) /*!< OPAMP inverting input connected to GPIO pin (pin PA3 for OPAMP1, pin PA5 for OPAMP2, pin PB2 for OPAMP3, pin PD8 for OPAMP4). Note: OPAMP inverting input is used with OPAMP in mode standalone or PGA with external capacitors for filtering circuit. Otherwise (OPAMP in mode follower), OPAMP inverting input is not used (not connected to GPIO pin). */
<> 135:176b8275d35d 194 #define LL_OPAMP_INPUT_INVERT_CONNECT_NO (OPAMP_CSR_VMSEL_1) /*!< OPAMP inverting input not externally connected (intended for OPAMP in mode follower or PGA without external capacitors for filtering). Note: On this STM32 serie, this literal include cases of value 0x11 for mode follower and value 0x10 for mode PGA. */
<> 135:176b8275d35d 195 /**
<> 135:176b8275d35d 196 * @}
<> 135:176b8275d35d 197 */
<> 135:176b8275d35d 198
<> 135:176b8275d35d 199 /** @defgroup OPAMP_LL_EC_INPUT_NONINVERTING_SECONDARY OPAMP input non-inverting secondary
<> 135:176b8275d35d 200 * @{
<> 135:176b8275d35d 201 */
<> 135:176b8275d35d 202 #define LL_OPAMP_INPUT_NONINVERT_IO0_SEC (LL_OPAMP_INPUT_NONINVERT_IO0 << (OPAMP_CSR_VPSSEL_Pos - OPAMP_CSR_VPSEL_Pos)) /*!< OPAMP non inverting input secondary connected to GPIO pin (pin PA1 for OPAMP1, pin PA7 for OPAMP2, pin PB0 for OPAMP3, pin PB13 for OPAMP4) */
<> 135:176b8275d35d 203 #define LL_OPAMP_INPUT_NONINVERT_IO1_SEC (LL_OPAMP_INPUT_NONINVERT_IO1 << (OPAMP_CSR_VPSSEL_Pos - OPAMP_CSR_VPSEL_Pos)) /*!< OPAMP non inverting input secondary connected to GPIO pin (pin PA7 for OPAMP1, pin PD14 for OPAMP2, pin PB13 for OPAMP3, pin PD11 for OPAMP4) */
<> 135:176b8275d35d 204 #define LL_OPAMP_INPUT_NONINVERT_IO2_SEC (LL_OPAMP_INPUT_NONINVERT_IO2 << (OPAMP_CSR_VPSSEL_Pos - OPAMP_CSR_VPSEL_Pos)) /*!< OPAMP non inverting input secondary connected to GPIO pin (pin PA3 for OPAMP1, pin PB0 for OPAMP2, pin PA1 for OPAMP3, pin PB11 for OPAMP4) */
<> 135:176b8275d35d 205 #define LL_OPAMP_INPUT_NONINVERT_IO3_SEC (LL_OPAMP_INPUT_NONINVERT_IO3 << (OPAMP_CSR_VPSSEL_Pos - OPAMP_CSR_VPSEL_Pos)) /*!< OPAMP non inverting input secondary connected to GPIO pin (pin PA5 for OPAMP1, pin PD14 for OPAMP2, pin PA5 for OPAMP3, pin PA4 for OPAMP4) */
<> 135:176b8275d35d 206 #define LL_OPAMP_INPUT_NONINV_DAC1_CH1_SEC (LL_OPAMP_INPUT_NONINV_DAC1_CH1 << (OPAMP_CSR_VPSSEL_Pos - OPAMP_CSR_VPSEL_Pos)) /*!< OPAMP non inverting input secondary connected to DAC1 channel1 output (specific to OPAMP instances: OPAMP4) */
<> 135:176b8275d35d 207 #define LL_OPAMP_INPUT_NONINV_DAC1_CH2_SEC (LL_OPAMP_INPUT_NONINV_DAC1_CH2 << (OPAMP_CSR_VPSSEL_Pos - OPAMP_CSR_VPSEL_Pos)) /*!< OPAMP non inverting input secondary connected to DAC1 channel2 output (specific to OPAMP instances: OPAMP1, OPAMP3) */
<> 135:176b8275d35d 208
<> 135:176b8275d35d 209 /**
<> 135:176b8275d35d 210 * @}
<> 135:176b8275d35d 211 */
<> 135:176b8275d35d 212
<> 135:176b8275d35d 213 /** @defgroup OPAMP_LL_EC_INPUT_INVERTING_SECONDARY OPAMP input inverting secondary
<> 135:176b8275d35d 214 * @{
<> 135:176b8275d35d 215 */
<> 135:176b8275d35d 216 #define LL_OPAMP_INPUT_INVERT_IO0_SEC (LL_OPAMP_INPUT_INVERT_IO0 << (OPAMP_CSR_VMSSEL_Pos - OPAMP_CSR_VMSEL_Pos)) /*!< OPAMP inverting input secondary connected to GPIO pin (pin PC5 for OPAMP1, pin PC5 for OPAMP2, pin PB10 for OPAMP3, pin PB10 for OPAMP4). Note: OPAMP inverting input is used with OPAMP in mode standalone or PGA with external capacitors for filtering circuit. Otherwise (OPAMP in mode follower), OPAMP inverting input is not used (not connected to GPIO pin). */
<> 135:176b8275d35d 217 #define LL_OPAMP_INPUT_INVERT_IO1_SEC (LL_OPAMP_INPUT_INVERT_IO1 << (OPAMP_CSR_VMSSEL_Pos - OPAMP_CSR_VMSEL_Pos)) /*!< OPAMP inverting input secondary connected to GPIO pin (pin PA3 for OPAMP1, pin PA5 for OPAMP2, pin PB2 for OPAMP3, pin PD8 for OPAMP4). Note: OPAMP inverting input is used with OPAMP in mode standalone or PGA with external capacitors for filtering circuit. Otherwise (OPAMP in mode follower), OPAMP inverting input is not used (not connected to GPIO pin). */
<> 135:176b8275d35d 218 /**
<> 135:176b8275d35d 219 * @}
<> 135:176b8275d35d 220 */
<> 135:176b8275d35d 221
<> 135:176b8275d35d 222 /** @defgroup OPAMP_LL_EC_INPUT_MUX_MODE OPAMP inputs multiplexer mode
<> 135:176b8275d35d 223 * @{
<> 135:176b8275d35d 224 */
<> 135:176b8275d35d 225 #define LL_OPAMP_INPUT_MUX_DISABLE ((uint32_t)0x00000000U) /*!< OPAMP inputs multiplexer mode dosabled. */
<> 135:176b8275d35d 226 #define LL_OPAMP_INPUT_MUX_TIM1_CH6 (OPAMP_CSR_TCMEN) /*!< OPAMP inputs multiplexer mode enabled, controlled by TIM1 CC6. */
<> 135:176b8275d35d 227 /**
<> 135:176b8275d35d 228 * @}
<> 135:176b8275d35d 229 */
<> 135:176b8275d35d 230
<> 135:176b8275d35d 231 /** @defgroup OPAMP_LL_EC_VREF_OUTPUT OPAMP internal reference voltage path state to output
<> 135:176b8275d35d 232 * @{
<> 135:176b8275d35d 233 */
<> 135:176b8275d35d 234 #define LL_OPAMP_VREF_OUTPUT_DISABLE ((uint32_t)0x00000000U) /*!< OPAMP internal reference voltage path to output is disabled. */
<> 135:176b8275d35d 235 #define LL_OPAMP_VREF_OUTPUT_ENABLE (OPAMP_CSR_TSTREF) /*!< OPAMP internal reference voltage path to output is enabled. */
<> 135:176b8275d35d 236 /**
<> 135:176b8275d35d 237 * @}
<> 135:176b8275d35d 238 */
<> 135:176b8275d35d 239
<> 135:176b8275d35d 240 /** @defgroup OPAMP_LL_EC_TRIMMING_MODE OPAMP trimming mode
<> 135:176b8275d35d 241 * @{
<> 135:176b8275d35d 242 */
<> 135:176b8275d35d 243 #define LL_OPAMP_TRIMMING_FACTORY ((uint32_t)0x00000000U) /*!< OPAMP trimming factors set to factory values */
<> 135:176b8275d35d 244 #define LL_OPAMP_TRIMMING_USER (OPAMP_CSR_USERTRIM) /*!< OPAMP trimming factors set to user values */
<> 135:176b8275d35d 245 /**
<> 135:176b8275d35d 246 * @}
<> 135:176b8275d35d 247 */
<> 135:176b8275d35d 248
<> 135:176b8275d35d 249 /** @defgroup OPAMP_LL_EC_TRIMMING_TRANSISTORS_DIFF_PAIR OPAMP trimming of transistors differential pair NMOS or PMOS
<> 135:176b8275d35d 250 * @{
<> 135:176b8275d35d 251 */
<> 135:176b8275d35d 252 #define LL_OPAMP_TRIMMING_NMOS_VREF_90PC_VDDA (OPAMP_CSR_TRIMOFFSETN | OPAMP_CSR_CALSEL_1 | OPAMP_CSR_CALSEL_0) /*!< OPAMP trimming of transistors differential pair NMOS (internal reference voltage set to 0.9*Vdda). Default parameters to be used for calibration using two trimming steps (one with each transistors differential pair NMOS and PMOS). */
<> 135:176b8275d35d 253 #define LL_OPAMP_TRIMMING_NMOS_VREF_50PC_VDDA (OPAMP_CSR_TRIMOFFSETN | OPAMP_CSR_CALSEL_1 ) /*!< OPAMP trimming of transistors differential pair NMOS (internal reference voltage set to 0.5*Vdda). */
<> 135:176b8275d35d 254 #define LL_OPAMP_TRIMMING_PMOS_VREF_10PC_VDDA (OPAMP_CSR_TRIMOFFSETP | OPAMP_CSR_CALSEL_0) /*!< OPAMP trimming of transistors differential pair PMOS (internal reference voltage set to 0.1*Vdda). Default parameters to be used for calibration using two trimming steps (one with each transistors differential pair NMOS and PMOS). */
<> 135:176b8275d35d 255 #define LL_OPAMP_TRIMMING_PMOS_VREF_3_3PC_VDDA (OPAMP_CSR_TRIMOFFSETP ) /*!< OPAMP trimming of transistors differential pair PMOS (internal reference voltage set to 0.33*Vdda). */
<> 135:176b8275d35d 256 #define LL_OPAMP_TRIMMING_NMOS (LL_OPAMP_TRIMMING_NMOS_VREF_90PC_VDDA) /*!< OPAMP trimming of transistors differential pair NMOS (internal reference voltage set to 0.9*Vdda). Default parameters to be used for calibration using two trimming steps (one with each transistors differential pair NMOS and PMOS). */
<> 135:176b8275d35d 257 #define LL_OPAMP_TRIMMING_PMOS (LL_OPAMP_TRIMMING_PMOS_VREF_10PC_VDDA) /*!< OPAMP trimming of transistors differential pair PMOS (internal reference voltage set to 0.1*Vdda). Default parameters to be used for calibration using two trimming steps (one with each transistors differential pair NMOS and PMOS). */
<> 135:176b8275d35d 258 /**
<> 135:176b8275d35d 259 * @}
<> 135:176b8275d35d 260 */
<> 135:176b8275d35d 261
<> 135:176b8275d35d 262 /** @defgroup OPAMP_LL_EC_HW_DELAYS Definitions of OPAMP hardware constraints delays
<> 135:176b8275d35d 263 * @note Only OPAMP IP HW delays are defined in OPAMP LL driver driver,
<> 135:176b8275d35d 264 * not timeout values.
<> 135:176b8275d35d 265 * For details on delays values, refer to descriptions in source code
<> 135:176b8275d35d 266 * above each literal definition.
<> 135:176b8275d35d 267 * @{
<> 135:176b8275d35d 268 */
<> 135:176b8275d35d 269
<> 135:176b8275d35d 270 /* Delay for OPAMP startup time (transition from state disable to enable). */
<> 135:176b8275d35d 271 /* Note: OPAMP startup time depends on board application environment: */
<> 135:176b8275d35d 272 /* impedance connected to OPAMP output. */
<> 135:176b8275d35d 273 /* The delay below is specified under conditions: */
<> 135:176b8275d35d 274 /* - OPAMP in functional mode follower */
<> 135:176b8275d35d 275 /* - load impedance of 4kOhm (min), 50pF (max) */
<> 135:176b8275d35d 276 /* Literal set to maximum value (refer to device datasheet, */
<> 135:176b8275d35d 277 /* parameter "tWAKEUP"). */
<> 135:176b8275d35d 278 /* Unit: us */
<> 135:176b8275d35d 279 #define LL_OPAMP_DELAY_STARTUP_US ((uint32_t) 5U) /*!< Delay for OPAMP startup time */
<> 135:176b8275d35d 280
<> 135:176b8275d35d 281 /**
<> 135:176b8275d35d 282 * @}
<> 135:176b8275d35d 283 */
<> 135:176b8275d35d 284
<> 135:176b8275d35d 285 /**
<> 135:176b8275d35d 286 * @}
<> 135:176b8275d35d 287 */
<> 135:176b8275d35d 288
<> 135:176b8275d35d 289 /* Exported macro ------------------------------------------------------------*/
<> 135:176b8275d35d 290 /** @defgroup OPAMP_LL_Exported_Macros OPAMP Exported Macros
<> 135:176b8275d35d 291 * @{
<> 135:176b8275d35d 292 */
<> 135:176b8275d35d 293 /** @defgroup OPAMP_LL_EM_WRITE_READ Common write and read registers macro
<> 135:176b8275d35d 294 * @{
<> 135:176b8275d35d 295 */
<> 135:176b8275d35d 296 /**
<> 135:176b8275d35d 297 * @brief Write a value in OPAMP register
<> 135:176b8275d35d 298 * @param __INSTANCE__ OPAMP Instance
<> 135:176b8275d35d 299 * @param __REG__ Register to be written
<> 135:176b8275d35d 300 * @param __VALUE__ Value to be written in the register
<> 135:176b8275d35d 301 * @retval None
<> 135:176b8275d35d 302 */
<> 135:176b8275d35d 303 #define LL_OPAMP_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
<> 135:176b8275d35d 304
<> 135:176b8275d35d 305 /**
<> 135:176b8275d35d 306 * @brief Read a value in OPAMP register
<> 135:176b8275d35d 307 * @param __INSTANCE__ OPAMP Instance
<> 135:176b8275d35d 308 * @param __REG__ Register to be read
<> 135:176b8275d35d 309 * @retval Register value
<> 135:176b8275d35d 310 */
<> 135:176b8275d35d 311 #define LL_OPAMP_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
<> 135:176b8275d35d 312 /**
<> 135:176b8275d35d 313 * @}
<> 135:176b8275d35d 314 */
<> 135:176b8275d35d 315
<> 135:176b8275d35d 316 /**
<> 135:176b8275d35d 317 * @}
<> 135:176b8275d35d 318 */
<> 135:176b8275d35d 319
<> 135:176b8275d35d 320 /* Exported functions --------------------------------------------------------*/
<> 135:176b8275d35d 321 /** @defgroup OPAMP_LL_Exported_Functions OPAMP Exported Functions
<> 135:176b8275d35d 322 * @{
<> 135:176b8275d35d 323 */
<> 135:176b8275d35d 324
<> 135:176b8275d35d 325 /** @defgroup OPAMP_LL_EF_CONFIGURATION_OPAMP_INSTANCE Configuration of OPAMP hierarchical scope: OPAMP instance
<> 135:176b8275d35d 326 * @{
<> 135:176b8275d35d 327 */
<> 135:176b8275d35d 328
<> 135:176b8275d35d 329 /**
<> 135:176b8275d35d 330 * @brief Set OPAMP mode calibration or functional.
<> 135:176b8275d35d 331 * @note OPAMP mode corresponds to functional or calibration mode:
<> 135:176b8275d35d 332 * - functional mode: OPAMP operation in standalone, follower, ...
<> 135:176b8275d35d 333 * Set functional mode using function
<> 135:176b8275d35d 334 * @ref LL_OPAMP_SetFunctionalMode().
<> 135:176b8275d35d 335 * - calibration mode: offset calibration of the selected
<> 135:176b8275d35d 336 * transistors differential pair NMOS or PMOS.
<> 135:176b8275d35d 337 * @rmtoll CSR CALON LL_OPAMP_SetMode
<> 135:176b8275d35d 338 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 339 * @param Mode This parameter can be one of the following values:
<> 135:176b8275d35d 340 * @arg @ref LL_OPAMP_MODE_FUNCTIONAL
<> 135:176b8275d35d 341 * @arg @ref LL_OPAMP_MODE_CALIBRATION
<> 135:176b8275d35d 342 * @retval None
<> 135:176b8275d35d 343 */
<> 135:176b8275d35d 344 __STATIC_INLINE void LL_OPAMP_SetMode(OPAMP_TypeDef *OPAMPx, uint32_t Mode)
<> 135:176b8275d35d 345 {
<> 135:176b8275d35d 346 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_CALON, Mode);
<> 135:176b8275d35d 347 }
<> 135:176b8275d35d 348
<> 135:176b8275d35d 349 /**
<> 135:176b8275d35d 350 * @brief Get OPAMP mode calibration or functional.
<> 135:176b8275d35d 351 * @note OPAMP mode corresponds to functional or calibration mode:
<> 135:176b8275d35d 352 * - functional mode: OPAMP operation in standalone, follower, ...
<> 135:176b8275d35d 353 * Set functional mode using function
<> 135:176b8275d35d 354 * @ref LL_OPAMP_SetFunctionalMode().
<> 135:176b8275d35d 355 * - calibration mode: offset calibration of the selected
<> 135:176b8275d35d 356 * transistors differential pair NMOS or PMOS.
<> 135:176b8275d35d 357 * @rmtoll CSR CALON LL_OPAMP_GetMode
<> 135:176b8275d35d 358 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 359 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 360 * @arg @ref LL_OPAMP_MODE_FUNCTIONAL
<> 135:176b8275d35d 361 * @arg @ref LL_OPAMP_MODE_CALIBRATION
<> 135:176b8275d35d 362 */
<> 135:176b8275d35d 363 __STATIC_INLINE uint32_t LL_OPAMP_GetMode(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 364 {
<> 135:176b8275d35d 365 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_CALON));
<> 135:176b8275d35d 366 }
<> 135:176b8275d35d 367
<> 135:176b8275d35d 368 /**
<> 135:176b8275d35d 369 * @brief Set OPAMP functional mode by setting internal connections.
<> 135:176b8275d35d 370 * OPAMP operation in standalone, follower, ...
<> 135:176b8275d35d 371 * @note This function reset bit of calibration mode to ensure
<> 135:176b8275d35d 372 * to be in functional mode, in order to have OPAMP parameters
<> 135:176b8275d35d 373 * (inputs selection, ...) set with the corresponding OPAMP mode
<> 135:176b8275d35d 374 * to be effective.
<> 135:176b8275d35d 375 * @rmtoll CSR VMSEL LL_OPAMP_SetFunctionalMode
<> 135:176b8275d35d 376 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 377 * @param FunctionalMode This parameter can be one of the following values:
<> 135:176b8275d35d 378 * @arg @ref LL_OPAMP_MODE_STANDALONE
<> 135:176b8275d35d 379 * @arg @ref LL_OPAMP_MODE_FOLLOWER
<> 135:176b8275d35d 380 * @arg @ref LL_OPAMP_MODE_PGA
<> 135:176b8275d35d 381 * @arg @ref LL_OPAMP_MODE_PGA_EXT_FILT_IO0
<> 135:176b8275d35d 382 * @arg @ref LL_OPAMP_MODE_PGA_EXT_FILT_IO1
<> 135:176b8275d35d 383 * @retval None
<> 135:176b8275d35d 384 */
<> 135:176b8275d35d 385 __STATIC_INLINE void LL_OPAMP_SetFunctionalMode(OPAMP_TypeDef *OPAMPx, uint32_t FunctionalMode)
<> 135:176b8275d35d 386 {
<> 135:176b8275d35d 387 /* Note: Bit OPAMP_CSR_CALON reset to ensure to be in functional mode */
<> 135:176b8275d35d 388 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_PGGAIN_3 | OPAMP_CSR_PGGAIN_2 | OPAMP_CSR_VMSEL | OPAMP_CSR_CALON, FunctionalMode);
<> 135:176b8275d35d 389 }
<> 135:176b8275d35d 390
<> 135:176b8275d35d 391 /**
<> 135:176b8275d35d 392 * @brief Get OPAMP functional mode from setting of internal connections.
<> 135:176b8275d35d 393 * OPAMP operation in standalone, follower, ...
<> 135:176b8275d35d 394 * @rmtoll CSR VMSEL LL_OPAMP_GetFunctionalMode
<> 135:176b8275d35d 395 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 396 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 397 * @arg @ref LL_OPAMP_MODE_STANDALONE
<> 135:176b8275d35d 398 * @arg @ref LL_OPAMP_MODE_FOLLOWER
<> 135:176b8275d35d 399 * @arg @ref LL_OPAMP_MODE_PGA
<> 135:176b8275d35d 400 * @arg @ref LL_OPAMP_MODE_PGA_EXT_FILT_IO0
<> 135:176b8275d35d 401 * @arg @ref LL_OPAMP_MODE_PGA_EXT_FILT_IO1
<> 135:176b8275d35d 402 */
<> 135:176b8275d35d 403 __STATIC_INLINE uint32_t LL_OPAMP_GetFunctionalMode(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 404 {
<> 135:176b8275d35d 405 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_PGGAIN_3 | OPAMP_CSR_PGGAIN_2 | OPAMP_CSR_VMSEL));
<> 135:176b8275d35d 406 }
<> 135:176b8275d35d 407
<> 135:176b8275d35d 408 /**
<> 135:176b8275d35d 409 * @brief Set OPAMP PGA gain.
<> 135:176b8275d35d 410 * @note Preliminarily, OPAMP must be set in mode PGA
<> 135:176b8275d35d 411 * using function @ref LL_OPAMP_SetFunctionalMode().
<> 135:176b8275d35d 412 * @rmtoll CSR PGGAIN LL_OPAMP_SetPGAGain
<> 135:176b8275d35d 413 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 414 * @param PGAGain This parameter can be one of the following values:
<> 135:176b8275d35d 415 * @arg @ref LL_OPAMP_PGA_GAIN_2
<> 135:176b8275d35d 416 * @arg @ref LL_OPAMP_PGA_GAIN_4
<> 135:176b8275d35d 417 * @arg @ref LL_OPAMP_PGA_GAIN_8
<> 135:176b8275d35d 418 * @arg @ref LL_OPAMP_PGA_GAIN_16
<> 135:176b8275d35d 419 * @retval None
<> 135:176b8275d35d 420 */
<> 135:176b8275d35d 421 __STATIC_INLINE void LL_OPAMP_SetPGAGain(OPAMP_TypeDef *OPAMPx, uint32_t PGAGain)
<> 135:176b8275d35d 422 {
<> 135:176b8275d35d 423 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_PGGAIN_1 | OPAMP_CSR_PGGAIN_0, PGAGain);
<> 135:176b8275d35d 424 }
<> 135:176b8275d35d 425
<> 135:176b8275d35d 426 /**
<> 135:176b8275d35d 427 * @brief Get OPAMP PGA gain.
<> 135:176b8275d35d 428 * @note Preliminarily, OPAMP must be set in mode PGA
<> 135:176b8275d35d 429 * using function @ref LL_OPAMP_SetFunctionalMode().
<> 135:176b8275d35d 430 * @rmtoll CSR PGGAIN LL_OPAMP_GetPGAGain
<> 135:176b8275d35d 431 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 432 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 433 * @arg @ref LL_OPAMP_PGA_GAIN_2
<> 135:176b8275d35d 434 * @arg @ref LL_OPAMP_PGA_GAIN_4
<> 135:176b8275d35d 435 * @arg @ref LL_OPAMP_PGA_GAIN_8
<> 135:176b8275d35d 436 * @arg @ref LL_OPAMP_PGA_GAIN_16
<> 135:176b8275d35d 437 */
<> 135:176b8275d35d 438 __STATIC_INLINE uint32_t LL_OPAMP_GetPGAGain(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 439 {
<> 135:176b8275d35d 440 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_PGGAIN_1 | OPAMP_CSR_PGGAIN_0));
<> 135:176b8275d35d 441 }
<> 135:176b8275d35d 442
<> 135:176b8275d35d 443 /**
<> 135:176b8275d35d 444 * @}
<> 135:176b8275d35d 445 */
<> 135:176b8275d35d 446
<> 135:176b8275d35d 447 /** @defgroup OPAMP_LL_EF_CONFIGURATION_INPUTS Configuration of OPAMP inputs
<> 135:176b8275d35d 448 * @{
<> 135:176b8275d35d 449 */
<> 135:176b8275d35d 450
<> 135:176b8275d35d 451 /**
<> 135:176b8275d35d 452 * @brief Set OPAMP non-inverting input connection.
<> 135:176b8275d35d 453 * @rmtoll CSR VPSEL LL_OPAMP_SetInputNonInverting
<> 135:176b8275d35d 454 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 455 * @param InputNonInverting This parameter can be one of the following values:
<> 135:176b8275d35d 456 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO0
<> 135:176b8275d35d 457 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO1
<> 135:176b8275d35d 458 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO2
<> 135:176b8275d35d 459 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO3
<> 135:176b8275d35d 460 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH1 (1)
<> 135:176b8275d35d 461 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH2 (2)
<> 135:176b8275d35d 462 *
<> 135:176b8275d35d 463 * (1) Parameter specific to OPAMP instances: OPAMP4.\n
<> 135:176b8275d35d 464 * (2) Parameter specific to OPAMP instances: OPAMP1, OPAMP3.
<> 135:176b8275d35d 465 * @retval None
<> 135:176b8275d35d 466 */
<> 135:176b8275d35d 467 __STATIC_INLINE void LL_OPAMP_SetInputNonInverting(OPAMP_TypeDef *OPAMPx, uint32_t InputNonInverting)
<> 135:176b8275d35d 468 {
<> 135:176b8275d35d 469 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_VPSEL, InputNonInverting);
<> 135:176b8275d35d 470 }
<> 135:176b8275d35d 471
<> 135:176b8275d35d 472 /**
<> 135:176b8275d35d 473 * @brief Get OPAMP non-inverting input connection.
<> 135:176b8275d35d 474 * @rmtoll CSR VPSEL LL_OPAMP_GetInputNonInverting
<> 135:176b8275d35d 475 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 476 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 477 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO0
<> 135:176b8275d35d 478 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO1
<> 135:176b8275d35d 479 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO2
<> 135:176b8275d35d 480 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO3
<> 135:176b8275d35d 481 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH1 (1)
<> 135:176b8275d35d 482 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH2 (2)
<> 135:176b8275d35d 483 *
<> 135:176b8275d35d 484 * (1) Parameter specific to OPAMP instances: OPAMP4.\n
<> 135:176b8275d35d 485 * (2) Parameter specific to OPAMP instances: OPAMP1, OPAMP3.
<> 135:176b8275d35d 486 */
<> 135:176b8275d35d 487 __STATIC_INLINE uint32_t LL_OPAMP_GetInputNonInverting(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 488 {
<> 135:176b8275d35d 489 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_VPSEL));
<> 135:176b8275d35d 490 }
<> 135:176b8275d35d 491
<> 135:176b8275d35d 492 /**
<> 135:176b8275d35d 493 * @brief Set OPAMP inverting input connection.
<> 135:176b8275d35d 494 * @note OPAMP inverting input is used with OPAMP in mode standalone
<> 135:176b8275d35d 495 * or PGA with external capacitors for filtering circuit.
<> 135:176b8275d35d 496 * Otherwise (OPAMP in mode follower), OPAMP inverting input
<> 135:176b8275d35d 497 * is not used (not connected to GPIO pin).
<> 135:176b8275d35d 498 * @rmtoll CSR VMSEL LL_OPAMP_SetInputInverting
<> 135:176b8275d35d 499 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 500 * @param InputInverting This parameter can be one of the following values:
<> 135:176b8275d35d 501 * @arg @ref LL_OPAMP_INPUT_INVERT_IO0
<> 135:176b8275d35d 502 * @arg @ref LL_OPAMP_INPUT_INVERT_IO1
<> 135:176b8275d35d 503 * @arg @ref LL_OPAMP_INPUT_INVERT_CONNECT_NO
<> 135:176b8275d35d 504 * @retval None
<> 135:176b8275d35d 505 */
<> 135:176b8275d35d 506 __STATIC_INLINE void LL_OPAMP_SetInputInverting(OPAMP_TypeDef *OPAMPx, uint32_t InputInverting)
<> 135:176b8275d35d 507 {
<> 135:176b8275d35d 508 /* Manage cases of OPAMP inverting input not connected (0x10 and 0x11) */
<> 135:176b8275d35d 509 /* to not modify OPAMP mode follower or PGA. */
<> 135:176b8275d35d 510 /* Bit OPAMP_CSR_VMSEL_1 is set by OPAMP mode (follower, PGA). */
<> 135:176b8275d35d 511 MODIFY_REG(OPAMPx->CSR, (~(InputInverting >> 1)) & OPAMP_CSR_VMSEL_0, InputInverting);
<> 135:176b8275d35d 512 }
<> 135:176b8275d35d 513
<> 135:176b8275d35d 514 /**
<> 135:176b8275d35d 515 * @brief Get OPAMP inverting input connection.
<> 135:176b8275d35d 516 * @rmtoll CSR VMSEL LL_OPAMP_GetInputInverting
<> 135:176b8275d35d 517 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 518 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 519 * @arg @ref LL_OPAMP_INPUT_INVERT_IO0
<> 135:176b8275d35d 520 * @arg @ref LL_OPAMP_INPUT_INVERT_IO1
<> 135:176b8275d35d 521 * @arg @ref LL_OPAMP_INPUT_INVERT_CONNECT_NO
<> 135:176b8275d35d 522 */
<> 135:176b8275d35d 523 __STATIC_INLINE uint32_t LL_OPAMP_GetInputInverting(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 524 {
<> 135:176b8275d35d 525 register uint32_t input_inverting = READ_BIT(OPAMPx->CSR, OPAMP_CSR_VMSEL);
<> 135:176b8275d35d 526
<> 135:176b8275d35d 527 /* Manage cases 0x10 and 0x11 to return the same value: OPAMP inverting */
<> 135:176b8275d35d 528 /* input not connected. */
<> 135:176b8275d35d 529 return (input_inverting & ~((input_inverting >> 1) & OPAMP_CSR_VMSEL_0));
<> 135:176b8275d35d 530 }
<> 135:176b8275d35d 531
<> 135:176b8275d35d 532 /**
<> 135:176b8275d35d 533 * @brief Set OPAMP non-inverting input secondary connection.
<> 135:176b8275d35d 534 * @rmtoll CSR VPSSEL LL_OPAMP_SetInputNonInvertingSecondary
<> 135:176b8275d35d 535 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 536 * @param InputNonInverting This parameter can be one of the following values:
<> 135:176b8275d35d 537 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO0_SEC
<> 135:176b8275d35d 538 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO1_SEC
<> 135:176b8275d35d 539 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO2_SEC
<> 135:176b8275d35d 540 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO3_SEC
<> 135:176b8275d35d 541 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH1_SEC (1)
<> 135:176b8275d35d 542 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH2_SEC (2)
<> 135:176b8275d35d 543 *
<> 135:176b8275d35d 544 * (1) Parameter specific to OPAMP instances: OPAMP4.\n
<> 135:176b8275d35d 545 * (2) Parameter specific to OPAMP instances: OPAMP1, OPAMP3.
<> 135:176b8275d35d 546 * @retval None
<> 135:176b8275d35d 547 */
<> 135:176b8275d35d 548 __STATIC_INLINE void LL_OPAMP_SetInputNonInvertingSecondary(OPAMP_TypeDef *OPAMPx, uint32_t InputNonInverting)
<> 135:176b8275d35d 549 {
<> 135:176b8275d35d 550 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_VPSSEL, InputNonInverting);
<> 135:176b8275d35d 551 }
<> 135:176b8275d35d 552
<> 135:176b8275d35d 553 /**
<> 135:176b8275d35d 554 * @brief Get OPAMP non-inverting input secondary connection.
<> 135:176b8275d35d 555 * @rmtoll CSR VPSSEL LL_OPAMP_GetInputNonInvertingSecondary
<> 135:176b8275d35d 556 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 557 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 558 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO0_SEC
<> 135:176b8275d35d 559 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO1_SEC
<> 135:176b8275d35d 560 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO2_SEC
<> 135:176b8275d35d 561 * @arg @ref LL_OPAMP_INPUT_NONINVERT_IO3_SEC
<> 135:176b8275d35d 562 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH1_SEC (1)
<> 135:176b8275d35d 563 * @arg @ref LL_OPAMP_INPUT_NONINV_DAC1_CH2_SEC (2)
<> 135:176b8275d35d 564 *
<> 135:176b8275d35d 565 * (1) Parameter specific to OPAMP instances: OPAMP4.\n
<> 135:176b8275d35d 566 * (2) Parameter specific to OPAMP instances: OPAMP1, OPAMP3.
<> 135:176b8275d35d 567 */
<> 135:176b8275d35d 568 __STATIC_INLINE uint32_t LL_OPAMP_GetInputNonInvertingSecondary(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 569 {
<> 135:176b8275d35d 570 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_VPSSEL));
<> 135:176b8275d35d 571 }
<> 135:176b8275d35d 572
<> 135:176b8275d35d 573 /**
<> 135:176b8275d35d 574 * @brief Set OPAMP inverting input secondary connection.
<> 135:176b8275d35d 575 * @note OPAMP inverting input is used with OPAMP in mode standalone
<> 135:176b8275d35d 576 * or PGA with external capacitors for filtering circuit.
<> 135:176b8275d35d 577 * Otherwise (OPAMP in mode follower), OPAMP inverting input
<> 135:176b8275d35d 578 * is not used (not connected to GPIO pin).
<> 135:176b8275d35d 579 * @rmtoll CSR VMSSEL LL_OPAMP_SetInputInvertingSecondary
<> 135:176b8275d35d 580 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 581 * @param InputInverting This parameter can be one of the following values:
<> 135:176b8275d35d 582 * @arg @ref LL_OPAMP_INPUT_INVERT_IO0_SEC
<> 135:176b8275d35d 583 * @arg @ref LL_OPAMP_INPUT_INVERT_IO1_SEC
<> 135:176b8275d35d 584 * @retval None
<> 135:176b8275d35d 585 */
<> 135:176b8275d35d 586 __STATIC_INLINE void LL_OPAMP_SetInputInvertingSecondary (OPAMP_TypeDef *OPAMPx, uint32_t InputInverting)
<> 135:176b8275d35d 587 {
<> 135:176b8275d35d 588 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_VMSSEL, InputInverting);
<> 135:176b8275d35d 589 }
<> 135:176b8275d35d 590
<> 135:176b8275d35d 591 /**
<> 135:176b8275d35d 592 * @brief Get OPAMP inverting input secondary connection.
<> 135:176b8275d35d 593 * @rmtoll CSR VMSSEL LL_OPAMP_GetInputInvertingSecondary
<> 135:176b8275d35d 594 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 595 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 596 * @arg @ref LL_OPAMP_INPUT_INVERT_IO0_SEC
<> 135:176b8275d35d 597 * @arg @ref LL_OPAMP_INPUT_INVERT_IO1_SEC
<> 135:176b8275d35d 598 */
<> 135:176b8275d35d 599 __STATIC_INLINE uint32_t LL_OPAMP_GetInputInvertingSecondary(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 600 {
<> 135:176b8275d35d 601 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_VMSSEL));
<> 135:176b8275d35d 602 }
<> 135:176b8275d35d 603
<> 135:176b8275d35d 604 /**
<> 135:176b8275d35d 605 * @brief Set OPAMP inputs multiplexer mode.
<> 135:176b8275d35d 606 * @rmtoll CSR TCMEN LL_OPAMP_SetInputsMuxMode
<> 135:176b8275d35d 607 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 608 * @param InputsMuxMode This parameter can be one of the following values:
<> 135:176b8275d35d 609 * @arg @ref LL_OPAMP_INPUT_MUX_DISABLE
<> 135:176b8275d35d 610 * @arg @ref LL_OPAMP_INPUT_MUX_TIM1_CH6
<> 135:176b8275d35d 611 * @retval None
<> 135:176b8275d35d 612 */
<> 135:176b8275d35d 613 __STATIC_INLINE void LL_OPAMP_SetInputsMuxMode(OPAMP_TypeDef *OPAMPx, uint32_t InputsMuxMode)
<> 135:176b8275d35d 614 {
<> 135:176b8275d35d 615 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_TCMEN, InputsMuxMode);
<> 135:176b8275d35d 616 }
<> 135:176b8275d35d 617
<> 135:176b8275d35d 618 /**
<> 135:176b8275d35d 619 * @brief Get OPAMP inputs multiplexer mode.
<> 135:176b8275d35d 620 * @rmtoll CSR TCMEN LL_OPAMP_GetInputsMuxMode
<> 135:176b8275d35d 621 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 622 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 623 * @arg @ref LL_OPAMP_INPUT_MUX_DISABLE
<> 135:176b8275d35d 624 * @arg @ref LL_OPAMP_INPUT_MUX_TIM1_CH6
<> 135:176b8275d35d 625 */
<> 135:176b8275d35d 626 __STATIC_INLINE uint32_t LL_OPAMP_GetInputsMuxMode(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 627 {
<> 135:176b8275d35d 628 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_TCMEN));
<> 135:176b8275d35d 629 }
<> 135:176b8275d35d 630
<> 135:176b8275d35d 631 /**
<> 135:176b8275d35d 632 * @}
<> 135:176b8275d35d 633 */
<> 135:176b8275d35d 634
<> 135:176b8275d35d 635 /** @defgroup OPAMP_LL_EF_OPAMP_TRIMMING Configuration and operation of OPAMP trimming
<> 135:176b8275d35d 636 * @{
<> 135:176b8275d35d 637 */
<> 135:176b8275d35d 638
<> 135:176b8275d35d 639 /**
<> 135:176b8275d35d 640 * @brief Set OPAMP trimming mode.
<> 135:176b8275d35d 641 * @rmtoll CSR USERTRIM LL_OPAMP_SetTrimmingMode
<> 135:176b8275d35d 642 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 643 * @param TrimmingMode This parameter can be one of the following values:
<> 135:176b8275d35d 644 * @arg @ref LL_OPAMP_TRIMMING_FACTORY
<> 135:176b8275d35d 645 * @arg @ref LL_OPAMP_TRIMMING_USER
<> 135:176b8275d35d 646 * @retval None
<> 135:176b8275d35d 647 */
<> 135:176b8275d35d 648 __STATIC_INLINE void LL_OPAMP_SetTrimmingMode(OPAMP_TypeDef *OPAMPx, uint32_t TrimmingMode)
<> 135:176b8275d35d 649 {
<> 135:176b8275d35d 650 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_USERTRIM, TrimmingMode);
<> 135:176b8275d35d 651 }
<> 135:176b8275d35d 652
<> 135:176b8275d35d 653 /**
<> 135:176b8275d35d 654 * @brief Get OPAMP trimming mode.
<> 135:176b8275d35d 655 * @rmtoll CSR USERTRIM LL_OPAMP_GetTrimmingMode
<> 135:176b8275d35d 656 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 657 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 658 * @arg @ref LL_OPAMP_TRIMMING_FACTORY
<> 135:176b8275d35d 659 * @arg @ref LL_OPAMP_TRIMMING_USER
<> 135:176b8275d35d 660 */
<> 135:176b8275d35d 661 __STATIC_INLINE uint32_t LL_OPAMP_GetTrimmingMode(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 662 {
<> 135:176b8275d35d 663 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_USERTRIM));
<> 135:176b8275d35d 664 }
<> 135:176b8275d35d 665
<> 135:176b8275d35d 666 /**
<> 135:176b8275d35d 667 * @brief Set OPAMP offset to calibrate the selected transistors
<> 135:176b8275d35d 668 * differential pair NMOS or PMOS.
<> 135:176b8275d35d 669 * @note Preliminarily, OPAMP must be set in mode calibration
<> 135:176b8275d35d 670 * using function @ref LL_OPAMP_SetMode().
<> 135:176b8275d35d 671 * @rmtoll CSR CALSEL LL_OPAMP_SetCalibrationSelection
<> 135:176b8275d35d 672 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 673 * @param TransistorsDiffPair This parameter can be one of the following values:
<> 135:176b8275d35d 674 * @arg @ref LL_OPAMP_TRIMMING_NMOS (1)
<> 135:176b8275d35d 675 * @arg @ref LL_OPAMP_TRIMMING_PMOS (1)
<> 135:176b8275d35d 676 * @arg @ref LL_OPAMP_TRIMMING_NMOS_VREF_50PC_VDDA
<> 135:176b8275d35d 677 * @arg @ref LL_OPAMP_TRIMMING_PMOS_VREF_3_3PC_VDDA
<> 135:176b8275d35d 678 *
<> 135:176b8275d35d 679 * (1) Default parameters to be used for calibration
<> 135:176b8275d35d 680 * using two trimming steps (one with each transistors differential
<> 135:176b8275d35d 681 * pair NMOS and PMOS)
<> 135:176b8275d35d 682 * @retval None
<> 135:176b8275d35d 683 */
<> 135:176b8275d35d 684 __STATIC_INLINE void LL_OPAMP_SetCalibrationSelection(OPAMP_TypeDef *OPAMPx, uint32_t TransistorsDiffPair)
<> 135:176b8275d35d 685 {
<> 135:176b8275d35d 686 /* Parameter used with mask "OPAMP_TRIMMING_SELECT_MASK" because */
<> 135:176b8275d35d 687 /* containing other bits reserved for other purpose. */
<> 135:176b8275d35d 688 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_CALSEL, (TransistorsDiffPair & OPAMP_TRIMMING_SELECT_MASK));
<> 135:176b8275d35d 689 }
<> 135:176b8275d35d 690
<> 135:176b8275d35d 691 /**
<> 135:176b8275d35d 692 * @brief Get OPAMP offset to calibrate the selected transistors
<> 135:176b8275d35d 693 * differential pair NMOS or PMOS.
<> 135:176b8275d35d 694 * @note Preliminarily, OPAMP must be set in mode calibration
<> 135:176b8275d35d 695 * using function @ref LL_OPAMP_SetMode().
<> 135:176b8275d35d 696 * @rmtoll CSR CALSEL LL_OPAMP_GetCalibrationSelection
<> 135:176b8275d35d 697 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 698 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 699 * @arg @ref LL_OPAMP_TRIMMING_NMOS (1)
<> 135:176b8275d35d 700 * @arg @ref LL_OPAMP_TRIMMING_PMOS (1)
<> 135:176b8275d35d 701 * @arg @ref LL_OPAMP_TRIMMING_NMOS_VREF_50PC_VDDA
<> 135:176b8275d35d 702 * @arg @ref LL_OPAMP_TRIMMING_PMOS_VREF_3_3PC_VDDA
<> 135:176b8275d35d 703 *
<> 135:176b8275d35d 704 * (1) Default parameters to be used for calibration
<> 135:176b8275d35d 705 * using two trimming steps (one with each transistors differential
<> 135:176b8275d35d 706 * pair NMOS and PMOS)
<> 135:176b8275d35d 707 */
<> 135:176b8275d35d 708 __STATIC_INLINE uint32_t LL_OPAMP_GetCalibrationSelection(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 709 {
<> 135:176b8275d35d 710 register uint32_t CalibrationSelection = (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_CALSEL));
<> 135:176b8275d35d 711
<> 135:176b8275d35d 712 return (CalibrationSelection |
<> 135:176b8275d35d 713 ((OPAMP_CSR_TRIMOFFSETN) << (POSITION_VAL(OPAMP_CSR_TRIMOFFSETP) * (CalibrationSelection && OPAMP_CSR_CALSEL))));
<> 135:176b8275d35d 714 }
<> 135:176b8275d35d 715
<> 135:176b8275d35d 716 /**
<> 135:176b8275d35d 717 * @brief Set OPAMP calibration internal reference voltage to output.
<> 135:176b8275d35d 718 * @rmtoll CSR TSTREF LL_OPAMP_SetCalibrationVrefOutput
<> 135:176b8275d35d 719 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 720 * @param CalibrationVrefOutput This parameter can be one of the following values:
<> 135:176b8275d35d 721 * @arg @ref LL_OPAMP_VREF_OUTPUT_DISABLE
<> 135:176b8275d35d 722 * @arg @ref LL_OPAMP_VREF_OUTPUT_ENABLE
<> 135:176b8275d35d 723 * @retval None
<> 135:176b8275d35d 724 */
<> 135:176b8275d35d 725 __STATIC_INLINE void LL_OPAMP_SetCalibrationVrefOutput(OPAMP_TypeDef *OPAMPx, uint32_t CalibrationVrefOutput)
<> 135:176b8275d35d 726 {
<> 135:176b8275d35d 727 MODIFY_REG(OPAMPx->CSR, OPAMP_CSR_TSTREF, CalibrationVrefOutput);
<> 135:176b8275d35d 728 }
<> 135:176b8275d35d 729
<> 135:176b8275d35d 730 /**
<> 135:176b8275d35d 731 * @brief Get OPAMP calibration internal reference voltage to output.
<> 135:176b8275d35d 732 * @rmtoll CSR TSTREF LL_OPAMP_GetCalibrationVrefOutput
<> 135:176b8275d35d 733 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 734 * @retval Returned value can be one of the following values:
<> 135:176b8275d35d 735 * @arg @ref LL_OPAMP_VREF_OUTPUT_DISABLE
<> 135:176b8275d35d 736 * @arg @ref LL_OPAMP_VREF_OUTPUT_ENABLE
<> 135:176b8275d35d 737 */
<> 135:176b8275d35d 738 __STATIC_INLINE uint32_t LL_OPAMP_GetCalibrationVrefOutput(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 739 {
<> 135:176b8275d35d 740 return (uint32_t)(READ_BIT(OPAMPx->CSR, OPAMP_CSR_TSTREF));
<> 135:176b8275d35d 741 }
<> 135:176b8275d35d 742
<> 135:176b8275d35d 743 /**
<> 135:176b8275d35d 744 * @brief Get OPAMP calibration result of toggling output.
<> 135:176b8275d35d 745 * @note This functions returns:
<> 135:176b8275d35d 746 * 0 if OPAMP calibration output is reset
<> 135:176b8275d35d 747 * 1 if OPAMP calibration output is set
<> 135:176b8275d35d 748 * @rmtoll CSR OUTCAL LL_OPAMP_IsCalibrationOutputSet
<> 135:176b8275d35d 749 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 750 * @retval State of bit (1 or 0).
<> 135:176b8275d35d 751 */
<> 135:176b8275d35d 752 __STATIC_INLINE uint32_t LL_OPAMP_IsCalibrationOutputSet(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 753 {
<> 135:176b8275d35d 754 return (READ_BIT(OPAMPx->CSR, OPAMP_CSR_OUTCAL) == OPAMP_CSR_OUTCAL);
<> 135:176b8275d35d 755 }
<> 135:176b8275d35d 756
<> 135:176b8275d35d 757 /**
<> 135:176b8275d35d 758 * @brief Set OPAMP trimming factor for the selected transistors
<> 135:176b8275d35d 759 * differential pair NMOS or PMOS, corresponding to the selected
<> 135:176b8275d35d 760 * power mode.
<> 135:176b8275d35d 761 * @rmtoll CSR TRIMOFFSETN LL_OPAMP_SetTrimmingValue\n
<> 135:176b8275d35d 762 * CSR TRIMOFFSETP LL_OPAMP_SetTrimmingValue
<> 135:176b8275d35d 763 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 764 * @param TransistorsDiffPair This parameter can be one of the following values:
<> 135:176b8275d35d 765 * @arg @ref LL_OPAMP_TRIMMING_NMOS
<> 135:176b8275d35d 766 * @arg @ref LL_OPAMP_TRIMMING_PMOS
<> 135:176b8275d35d 767 * @param TrimmingValue 0x00...0x1F
<> 135:176b8275d35d 768 * @retval None
<> 135:176b8275d35d 769 */
<> 135:176b8275d35d 770 __STATIC_INLINE void LL_OPAMP_SetTrimmingValue(OPAMP_TypeDef* OPAMPx, uint32_t TransistorsDiffPair, uint32_t TrimmingValue)
<> 135:176b8275d35d 771 {
<> 135:176b8275d35d 772 MODIFY_REG(OPAMPx->CSR,
<> 135:176b8275d35d 773 (TransistorsDiffPair & OPAMP_TRIMMING_VALUE_MASK),
<> 135:176b8275d35d 774 TrimmingValue << (POSITION_VAL(TransistorsDiffPair & OPAMP_TRIMMING_VALUE_MASK)));
<> 135:176b8275d35d 775 }
<> 135:176b8275d35d 776
<> 135:176b8275d35d 777 /**
<> 135:176b8275d35d 778 * @brief Get OPAMP trimming factor for the selected transistors
<> 135:176b8275d35d 779 * differential pair NMOS or PMOS, corresponding to the selected
<> 135:176b8275d35d 780 * power mode.
<> 135:176b8275d35d 781 * @rmtoll CSR TRIMOFFSETN LL_OPAMP_GetTrimmingValue\n
<> 135:176b8275d35d 782 * CSR TRIMOFFSETP LL_OPAMP_GetTrimmingValue
<> 135:176b8275d35d 783 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 784 * @param TransistorsDiffPair This parameter can be one of the following values:
<> 135:176b8275d35d 785 * @arg @ref LL_OPAMP_TRIMMING_NMOS
<> 135:176b8275d35d 786 * @arg @ref LL_OPAMP_TRIMMING_PMOS
<> 135:176b8275d35d 787 * @retval 0x0...0x1F
<> 135:176b8275d35d 788 */
<> 135:176b8275d35d 789 __STATIC_INLINE uint32_t LL_OPAMP_GetTrimmingValue(OPAMP_TypeDef* OPAMPx, uint32_t TransistorsDiffPair)
<> 135:176b8275d35d 790 {
<> 135:176b8275d35d 791 return (uint32_t)(READ_BIT(OPAMPx->CSR, (TransistorsDiffPair & OPAMP_TRIMMING_VALUE_MASK))
<> 135:176b8275d35d 792 >> (POSITION_VAL(TransistorsDiffPair & OPAMP_TRIMMING_VALUE_MASK))
<> 135:176b8275d35d 793 );
<> 135:176b8275d35d 794 }
<> 135:176b8275d35d 795
<> 135:176b8275d35d 796 /**
<> 135:176b8275d35d 797 * @}
<> 135:176b8275d35d 798 */
<> 135:176b8275d35d 799
<> 135:176b8275d35d 800 /** @defgroup OPAMP_LL_EF_OPERATION Operation on OPAMP instance
<> 135:176b8275d35d 801 * @{
<> 135:176b8275d35d 802 */
<> 135:176b8275d35d 803 /**
<> 135:176b8275d35d 804 * @brief Enable OPAMP instance.
<> 135:176b8275d35d 805 * @note After enable from off state, OPAMP requires a delay
<> 135:176b8275d35d 806 * to fullfill wake up time specification.
<> 135:176b8275d35d 807 * Refer to device datasheet, parameter "tWAKEUP".
<> 135:176b8275d35d 808 * @rmtoll CSR OPAMPXEN LL_OPAMP_Enable
<> 135:176b8275d35d 809 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 810 * @retval None
<> 135:176b8275d35d 811 */
<> 135:176b8275d35d 812 __STATIC_INLINE void LL_OPAMP_Enable(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 813 {
<> 135:176b8275d35d 814 SET_BIT(OPAMPx->CSR, OPAMP_CSR_OPAMPxEN);
<> 135:176b8275d35d 815 }
<> 135:176b8275d35d 816
<> 135:176b8275d35d 817 /**
<> 135:176b8275d35d 818 * @brief Disable OPAMP instance.
<> 135:176b8275d35d 819 * @rmtoll CSR OPAMPXEN LL_OPAMP_Disable
<> 135:176b8275d35d 820 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 821 * @retval None
<> 135:176b8275d35d 822 */
<> 135:176b8275d35d 823 __STATIC_INLINE void LL_OPAMP_Disable(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 824 {
<> 135:176b8275d35d 825 CLEAR_BIT(OPAMPx->CSR, OPAMP_CSR_OPAMPxEN);
<> 135:176b8275d35d 826 }
<> 135:176b8275d35d 827
<> 135:176b8275d35d 828 /**
<> 135:176b8275d35d 829 * @brief Get OPAMP instance enable state
<> 135:176b8275d35d 830 * (0: OPAMP is disabled, 1: OPAMP is enabled)
<> 135:176b8275d35d 831 * @rmtoll CSR OPAMPXEN LL_OPAMP_IsEnabled
<> 135:176b8275d35d 832 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 833 * @retval State of bit (1 or 0).
<> 135:176b8275d35d 834 */
<> 135:176b8275d35d 835 __STATIC_INLINE uint32_t LL_OPAMP_IsEnabled(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 836 {
<> 135:176b8275d35d 837 return (READ_BIT(OPAMPx->CSR, OPAMP_CSR_OPAMPxEN) == (OPAMP_CSR_OPAMPxEN));
<> 135:176b8275d35d 838 }
<> 135:176b8275d35d 839
<> 135:176b8275d35d 840 /**
<> 135:176b8275d35d 841 * @brief Lock OPAMP instance.
<> 135:176b8275d35d 842 * @note Once locked, OPAMP configuration can be accessed in read-only.
<> 135:176b8275d35d 843 * @note The only way to unlock the OPAMP is a device hardware reset.
<> 135:176b8275d35d 844 * @rmtoll CSR LOCK LL_OPAMP_Lock
<> 135:176b8275d35d 845 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 846 * @retval None
<> 135:176b8275d35d 847 */
<> 135:176b8275d35d 848 __STATIC_INLINE void LL_OPAMP_Lock(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 849 {
<> 135:176b8275d35d 850 SET_BIT(OPAMPx->CSR, OPAMP_CSR_LOCK);
<> 135:176b8275d35d 851 }
<> 135:176b8275d35d 852
<> 135:176b8275d35d 853 /**
<> 135:176b8275d35d 854 * @brief Get OPAMP lock state
<> 135:176b8275d35d 855 * (0: OPAMP is unlocked, 1: OPAMP is locked).
<> 135:176b8275d35d 856 * @note Once locked, OPAMP configuration can be accessed in read-only.
<> 135:176b8275d35d 857 * @note The only way to unlock the OPAMP is a device hardware reset.
<> 135:176b8275d35d 858 * @rmtoll CSR LOCK LL_OPAMP_IsLocked
<> 135:176b8275d35d 859 * @param OPAMPx OPAMP instance
<> 135:176b8275d35d 860 * @retval State of bit (1 or 0).
<> 135:176b8275d35d 861 */
<> 135:176b8275d35d 862 __STATIC_INLINE uint32_t LL_OPAMP_IsLocked(OPAMP_TypeDef *OPAMPx)
<> 135:176b8275d35d 863 {
<> 135:176b8275d35d 864 return (READ_BIT(OPAMPx->CSR, OPAMP_CSR_LOCK) == (OPAMP_CSR_LOCK));
<> 135:176b8275d35d 865 }
<> 135:176b8275d35d 866
<> 135:176b8275d35d 867 /**
<> 135:176b8275d35d 868 * @}
<> 135:176b8275d35d 869 */
<> 135:176b8275d35d 870
<> 135:176b8275d35d 871 #if defined(USE_FULL_LL_DRIVER)
<> 135:176b8275d35d 872 /** @defgroup OPAMP_LL_EF_Init Initialization and de-initialization functions
<> 135:176b8275d35d 873 * @{
<> 135:176b8275d35d 874 */
<> 135:176b8275d35d 875
<> 135:176b8275d35d 876 ErrorStatus LL_OPAMP_DeInit(OPAMP_TypeDef *OPAMPx);
<> 135:176b8275d35d 877 ErrorStatus LL_OPAMP_Init(OPAMP_TypeDef *OPAMPx, LL_OPAMP_InitTypeDef *OPAMP_InitStruct);
<> 135:176b8275d35d 878 void LL_OPAMP_StructInit(LL_OPAMP_InitTypeDef *OPAMP_InitStruct);
<> 135:176b8275d35d 879
<> 135:176b8275d35d 880 /**
<> 135:176b8275d35d 881 * @}
<> 135:176b8275d35d 882 */
<> 135:176b8275d35d 883 #endif /* USE_FULL_LL_DRIVER */
<> 135:176b8275d35d 884
<> 135:176b8275d35d 885 /**
<> 135:176b8275d35d 886 * @}
<> 135:176b8275d35d 887 */
<> 135:176b8275d35d 888
<> 135:176b8275d35d 889 /**
<> 135:176b8275d35d 890 * @}
<> 135:176b8275d35d 891 */
<> 135:176b8275d35d 892
<> 135:176b8275d35d 893 #endif /* OPAMP1 || OPAMP2 || OPAMP3 || OPAMP4 */
<> 135:176b8275d35d 894
<> 135:176b8275d35d 895 /**
<> 135:176b8275d35d 896 * @}
<> 135:176b8275d35d 897 */
<> 135:176b8275d35d 898
<> 135:176b8275d35d 899 #ifdef __cplusplus
<> 135:176b8275d35d 900 }
<> 135:176b8275d35d 901 #endif
<> 135:176b8275d35d 902
<> 135:176b8275d35d 903 #endif /* __STM32F3xx_LL_OPAMP_H */
<> 135:176b8275d35d 904
<> 135:176b8275d35d 905 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/