STM32L486xx HAL User Manual
|
COMP HAL module driver. This file provides firmware functions to manage the following functionalities of the COMP peripheral: + Initialization and de-initialization functions + Start/Stop operation functions in polling mode + Start/Stop operation functions in interrupt mode (through EXTI interrupt) + Peripheral control functions + Peripheral state functions. More...
#include "stm32l4xx_hal.h"
Go to the source code of this file.
Defines | |
#define | COMP_DELAY_STARTUP_US (80U) |
#define | COMP_DELAY_VOLTAGE_SCALER_STAB_US (200U) |
#define | COMP_OUTPUT_LEVEL_BITOFFSET_POS (30U) |
Functions | |
HAL_StatusTypeDef | HAL_COMP_Init (COMP_HandleTypeDef *hcomp) |
Initialize the COMP according to the specified parameters in the COMP_InitTypeDef and initialize the associated handle. | |
HAL_StatusTypeDef | HAL_COMP_DeInit (COMP_HandleTypeDef *hcomp) |
DeInitialize the COMP peripheral. | |
__weak void | HAL_COMP_MspInit (COMP_HandleTypeDef *hcomp) |
Initialize the COMP MSP. | |
__weak void | HAL_COMP_MspDeInit (COMP_HandleTypeDef *hcomp) |
DeInitialize the COMP MSP. | |
HAL_StatusTypeDef | HAL_COMP_RegisterCallback (COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID, pCOMP_CallbackTypeDef pCallback) |
Register a User COMP Callback To be used instead of the weak predefined callback. | |
HAL_StatusTypeDef | HAL_COMP_UnRegisterCallback (COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID) |
Unregister a COMP Callback COMP callback is redirected to the weak predefined callback. | |
HAL_StatusTypeDef | HAL_COMP_Start (COMP_HandleTypeDef *hcomp) |
Start the comparator. | |
HAL_StatusTypeDef | HAL_COMP_Stop (COMP_HandleTypeDef *hcomp) |
Stop the comparator. | |
void | HAL_COMP_IRQHandler (COMP_HandleTypeDef *hcomp) |
Comparator IRQ handler. | |
HAL_StatusTypeDef | HAL_COMP_Lock (COMP_HandleTypeDef *hcomp) |
Lock the selected comparator configuration. | |
uint32_t | HAL_COMP_GetOutputLevel (COMP_HandleTypeDef *hcomp) |
Return the output level (high or low) of the selected comparator. | |
__weak void | HAL_COMP_TriggerCallback (COMP_HandleTypeDef *hcomp) |
Comparator trigger callback. | |
HAL_COMP_StateTypeDef | HAL_COMP_GetState (COMP_HandleTypeDef *hcomp) |
Return the COMP handle state. | |
uint32_t | HAL_COMP_GetError (COMP_HandleTypeDef *hcomp) |
Return the COMP error code. |
COMP HAL module driver. This file provides firmware functions to manage the following functionalities of the COMP peripheral: + Initialization and de-initialization functions + Start/Stop operation functions in polling mode + Start/Stop operation functions in interrupt mode (through EXTI interrupt) + Peripheral control functions + Peripheral state functions.
Table 1. COMP inputs and output for STM32L4xx devices +---------------------------------------------------------+ | | | COMP1 | COMP2 | |----------------|----------------|-----------|-----------| | | IO1 | PC5 | PB4 | | Input plus | IO2 | PB2 | PB6 | | | IO3 (3) | PA1 | PA3 | |----------------|----------------|-----------------------| | | 1/4 VrefInt | Available | Available | | | 1/2 VrefInt | Available | Available | | | 3/4 VrefInt | Available | Available | | Input minus | VrefInt | Available | Available | | | DAC1 channel 1 | Available | Available | | | DAC1 channel 2 | Available | Available | | | IO1 | PB1 | PB3 | | | IO2 | PC4 | PB7 | | | IO3 (3) | PA0 | PA2 | | | IO4 (3) | PA4 | PA4 | | | IO5 (3) | PA5 | PA5 | +---------------------------------------------------------+ | Output | | PB0 (1) | PB5 (1) | | | | PB10 (1) | PB11 (1) | | | | TIM (2) | TIM (2) | +---------------------------------------------------------+ (1) GPIO must be set to alternate function for comparator (2) Comparators output to timers is set in timers instances. (3) Only STM32L43x/L44x
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition in file stm32l4xx_hal_comp.c.