Peripheral Control functions.
More...
Peripheral Control functions.
===============================================================================
##### Peripheral Control functions #####
===============================================================================
[..]
This subsection provides a set of functions allowing to control the OPAMP data
transfers.
◆ HAL_OPAMP_GetTrimOffset()
Return the OPAMP factory trimming value.
- Note
- On STM32L4 OPAMP, user can retrieve factory trimming if OPAMP has never been set to user trimming before. Therefore, this function must be called when OPAMP init parameter "UserTrimming" is set to trimming factory, and before OPAMP calibration (function "HAL_OPAMP_SelfCalibrate()"). Otherwise, factory trimming value cannot be retrieved and error status is returned.
- Parameters
-
| hopamp | : OPAMP handle |
| trimmingoffset | : Trimming offset (P or N) This parameter must be a value of OPAMP Factory Trimming |
- Note
- Calibration parameter retrieved is corresponding to the mode specified in OPAMP init structure (mode normal or low-power). To retrieve calibration parameters for both modes, repeat this function after OPAMP init structure accordingly updated.
- Return values
-
| Trimming | value (P or N): range: 0->31 or OPAMP_FACTORYTRIMMING_DUMMY if trimming value is not available |
Definition at line 919 of file stm32l4xx_hal_opamp.c.
922 __IO uint32_t* tmp_opamp_reg_trimming;
928 return OPAMP_FACTORYTRIMMING_DUMMY;
938 assert_param(IS_OPAMP_POWERMODE(hopamp->Init.PowerMode));
941 if (READ_BIT(hopamp->Instance->CSR,OPAMP_CSR_USERTRIM) != 0U)
948 trimmingvalue = OPAMP_FACTORYTRIMMING_DUMMY;
953 if (hopamp->Init.PowerMode == OPAMP_POWERMODE_NORMAL)
955 tmp_opamp_reg_trimming = &OPAMP->OTR;
959 tmp_opamp_reg_trimming = &OPAMP->LPOTR;
963 if (trimmingoffset == OPAMP_FACTORYTRIMMING_P)
966 trimmingvalue = ((*tmp_opamp_reg_trimming) & OPAMP_OTR_TRIMOFFSETP) >> OPAMP_INPUT_NONINVERTING;
971 trimmingvalue = (*tmp_opamp_reg_trimming) & OPAMP_OTR_TRIMOFFSETN;
977 return OPAMP_FACTORYTRIMMING_DUMMY;
979 return trimmingvalue;
uint32_t HAL_OPAMP_TrimmingValueTypeDef
HAl_OPAMP_TrimmingValueTypeDef definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_OPAMP_Lock()
Lock the selected OPAMP configuration.
- Note
- On STM32L4, HAL OPAMP lock is software lock only (in contrast of hardware lock available on some other STM32 devices).
- Parameters
-
- Return values
-
Definition at line 870 of file stm32l4xx_hal_opamp.c.
872 HAL_StatusTypeDef status =
HAL_OK;
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_OPAMP_RegisterCallback()
Register a User OPAMP Callback To be used instead of the weak (surcharged) predefined callback.
- Parameters
-
| hopamp | : OPAMP handle |
| CallbackID | : ID of the callback to be registered This parameter can be one of the following values:
|
| pCallback | : pointer to the Callback function |
- Return values
-
Definition at line 1037 of file stm32l4xx_hal_opamp.c.
1039 HAL_StatusTypeDef status =
HAL_OK;
1041 if(pCallback == NULL)
1054 hopamp->MspInitCallback = pCallback;
1057 hopamp->MspDeInitCallback = pCallback;
1070 hopamp->MspInitCallback = pCallback;
1073 hopamp->MspDeInitCallback = pCallback;
◆ HAL_OPAMP_UnRegisterCallback()
Unregister a User OPAMP Callback OPAMP Callback is redirected to the weak (surcharged) predefined callback.
- Parameters
-
| hopamp | : OPAMP handle |
| CallbackID | : ID of the callback to be unregistered This parameter can be one of the following values:
|
- Return values
-
Definition at line 1104 of file stm32l4xx_hal_opamp.c.
1106 HAL_StatusTypeDef status =
HAL_OK;
void HAL_OPAMP_MspDeInit(OPAMP_HandleTypeDef *hopamp)
DeInitialize OPAMP MSP.
void HAL_OPAMP_MspInit(OPAMP_HandleTypeDef *hopamp)
Initialize the OPAMP MSP.