STM8L15x Standard Peripherals Drivers
|
COMP driver modules. More...
Modules | |
COMP_Exported_Types | |
COMP_Private_Functions | |
Functions | |
void | COMP_ClearFlag (COMP_Selection_TypeDef COMP_Selection) |
Clears the comparator�s pending flag. | |
void | COMP_ClearITPendingBit (COMP_Selection_TypeDef COMP_Selection) |
Clears the interrupt pending bits of the comparator. | |
void | COMP_DeInit (void) |
Deinitializes the COMPx peripheral registers to their default reset values. | |
void | COMP_EdgeConfig (COMP_Selection_TypeDef COMP_Selection, COMP_Edge_TypeDef COMP_Edge) |
Configures the COMP edge detection. | |
FlagStatus | COMP_GetFlagStatus (COMP_Selection_TypeDef COMP_Selection) |
Checks whether the comparator flag is set or not. | |
ITStatus | COMP_GetITStatus (COMP_Selection_TypeDef COMP_Selection) |
Checks whether the comparator interrupt has occurred or not. | |
COMP_OutputLevel_TypeDef | COMP_GetOutputLevel (COMP_Selection_TypeDef COMP_Selection) |
Returns the output level of the comparator. | |
void | COMP_Init (COMP_InvertingInput_Typedef COMP_InvertingInput, COMP_OutputSelect_Typedef COMP_OutputSelect, COMP_Speed_TypeDef COMP_Speed) |
Initializes the comparator inverting input, output and speed. | |
void | COMP_ITConfig (COMP_Selection_TypeDef COMP_Selection, FunctionalState NewState) |
Enables or disables the interrupt generation when an event is detected. | |
void | COMP_SchmittTriggerCmd (FunctionalState NewState) |
Enables or disables the schmitt trigger. | |
void | COMP_TriggerConfig (COMP_TriggerGroup_TypeDef COMP_TriggerGroup, COMP_TriggerPin_TypeDef COMP_TriggerPin, FunctionalState NewState) |
Enables or disables trigger on the specified input/output group. | |
void | COMP_VrefintOutputCmd (FunctionalState NewState) |
Enables or disables the output of the internal reference voltage. | |
void | COMP_VrefintToCOMP1Connect (FunctionalState NewState) |
Enables or disables connection between VREFINT and COMP1 inverting input. | |
void | COMP_WindowCmd (FunctionalState NewState) |
Enables or disables the window mode. |
Detailed Description
COMP driver modules.
Function Documentation
void COMP_ClearFlag | ( | COMP_Selection_TypeDef | COMP_Selection | ) |
Clears the comparator�s pending flag.
Definition at line 605 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_EF1, COMP_CSR2_EF2, COMP_Selection_COMP1, and IS_COMP_ALL_PERIPH.
void COMP_ClearITPendingBit | ( | COMP_Selection_TypeDef | COMP_Selection | ) |
Clears the interrupt pending bits of the comparator.
Definition at line 689 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_EF1, COMP_CSR2_EF2, COMP_Selection_COMP1, and IS_COMP_ALL_PERIPH.
void COMP_DeInit | ( | void | ) |
Deinitializes the COMPx peripheral registers to their default reset values.
Definition at line 105 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_RESET_VALUE, COMP_CSR2_RESET_VALUE, COMP_CSR3_RESET_VALUE, COMP_CSR4_RESET_VALUE, and COMP_CSR5_RESET_VALUE.
void COMP_EdgeConfig | ( | COMP_Selection_TypeDef | COMP_Selection, |
COMP_Edge_TypeDef | COMP_Edge | ||
) |
Configures the COMP edge detection.
Definition at line 206 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_CMP1, COMP_CSR2_CMP2, COMP_Selection_COMP1, IS_COMP_ALL_PERIPH, and IS_COMP_EDGE.
FlagStatus COMP_GetFlagStatus | ( | COMP_Selection_TypeDef | COMP_Selection | ) |
Checks whether the comparator flag is set or not.
Definition at line 558 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_EF1, COMP_CSR2_EF2, COMP_Selection_COMP1, IS_COMP_ALL_PERIPH, RESET, and SET.
ITStatus COMP_GetITStatus | ( | COMP_Selection_TypeDef | COMP_Selection | ) |
Checks whether the comparator interrupt has occurred or not.
Definition at line 630 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_EF1, COMP_CSR1_IE1, COMP_CSR2_EF2, COMP_CSR2_IE2, COMP_Selection_COMP1, IS_COMP_ALL_PERIPH, RESET, and SET.
COMP_OutputLevel_TypeDef COMP_GetOutputLevel | ( | COMP_Selection_TypeDef | COMP_Selection | ) |
Returns the output level of the comparator.
- Note:
- Comparators outputs aren't available on GPIO (outputs levels are only internal).
Definition at line 245 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_CMP1OUT, COMP_CSR2_CMP2OUT, COMP_OutputLevel_High, COMP_OutputLevel_Low, COMP_Selection_COMP1, IS_COMP_ALL_PERIPH, and RESET.
void COMP_Init | ( | COMP_InvertingInput_Typedef | COMP_InvertingInput, |
COMP_OutputSelect_Typedef | COMP_OutputSelect, | ||
COMP_Speed_TypeDef | COMP_Speed | ||
) |
Initializes the comparator inverting input, output and speed.
- Note:
- This function configures only COMP2.
Definition at line 147 of file stm8l15x_comp.c.
References COMP, COMP_CSR2_SPEED, COMP_CSR3_INSEL, COMP_CSR3_OUTSEL, IS_COMP_INVERTING_INPUT, IS_COMP_OUTPUT, and IS_COMP_SPEED.
void COMP_ITConfig | ( | COMP_Selection_TypeDef | COMP_Selection, |
FunctionalState | NewState | ||
) |
Enables or disables the interrupt generation when an event is detected.
Definition at line 515 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_IE1, COMP_CSR2_IE2, COMP_Selection_COMP1, DISABLE, IS_COMP_ALL_PERIPH, and IS_FUNCTIONAL_STATE.
void COMP_SchmittTriggerCmd | ( | FunctionalState | NewState | ) |
Enables or disables the schmitt trigger.
Definition at line 395 of file stm8l15x_comp.c.
References COMP, COMP_CSR1_STE, DISABLE, and IS_FUNCTIONAL_STATE.
void COMP_TriggerConfig | ( | COMP_TriggerGroup_TypeDef | COMP_TriggerGroup, |
COMP_TriggerPin_TypeDef | COMP_TriggerPin, | ||
FunctionalState | NewState | ||
) |
Enables or disables trigger on the specified input/output group.
Definition at line 429 of file stm8l15x_comp.c.
References COMP, COMP_TriggerGroup_DACOutput, COMP_TriggerGroup_InvertingInput, COMP_TriggerGroup_NonInvertingInput, COMP_TriggerGroup_VREFINTOutput, DISABLE, IS_COMP_TRIGGERGROUP, and IS_COMP_TRIGGERPIN.
void COMP_VrefintOutputCmd | ( | FunctionalState | NewState | ) |
Enables or disables the output of the internal reference voltage.
Definition at line 356 of file stm8l15x_comp.c.
References COMP, COMP_CSR3_VREFOUTEN, DISABLE, and IS_FUNCTIONAL_STATE.
void COMP_VrefintToCOMP1Connect | ( | FunctionalState | NewState | ) |
Enables or disables connection between VREFINT and COMP1 inverting input.
Definition at line 177 of file stm8l15x_comp.c.
References COMP, COMP_CSR3_VREFEN, DISABLE, and IS_FUNCTIONAL_STATE.
void COMP_WindowCmd | ( | FunctionalState | NewState | ) |
Enables or disables the window mode.
Definition at line 318 of file stm8l15x_comp.c.
References COMP, COMP_CSR3_WNDWE, DISABLE, and IS_FUNCTIONAL_STATE.