![]() |
STM32F0 Standard Peripheral bibliotheek
1.0
ST Microelectronics standard peripheral bibliotheek documentatie voor de STM32F0 familie
|
COMP driver modules. More...
Modules | |
| COMP_Exported_Constants | |
| COMP_Private_Functions | |
Data Structures | |
| struct | COMP_InitTypeDef |
| COMP Init structure definition. More... | |
Macros | |
| #define | COMP_CSR_CLEAR_MASK ((uint32_t)0x00003FFE) |
Functions | |
| void | COMP_DeInit (void) |
| Deinitializes COMP peripheral registers to their default reset values. More... | |
| void | COMP_Init (uint32_t COMP_Selection, COMP_InitTypeDef *COMP_InitStruct) |
| Initializes the COMP peripheral according to the specified parameters in COMP_InitStruct. More... | |
| void | COMP_StructInit (COMP_InitTypeDef *COMP_InitStruct) |
| Fills each COMP_InitStruct member with its default value. More... | |
| void | COMP_Cmd (uint32_t COMP_Selection, FunctionalState NewState) |
| Enable or disable the COMP peripheral. More... | |
| void | COMP_SwitchCmd (FunctionalState NewState) |
| Close or Open the SW1 switch. More... | |
| uint32_t | COMP_GetOutputLevel (uint32_t COMP_Selection) |
| Return the output level (high or low) of the selected comparator. More... | |
| void | COMP_WindowCmd (FunctionalState NewState) |
| Enables or disables the window mode. More... | |
| void | COMP_LockConfig (uint32_t COMP_Selection) |
| Lock the selected comparator (COMP1/COMP2) configuration. More... | |
COMP driver modules.
| void COMP_Cmd | ( | uint32_t | COMP_Selection, |
| FunctionalState | NewState | ||
| ) |
Enable or disable the COMP peripheral.
| COMP_Selection,: | the selected comparator. This parameter can be one of the following values:
|
| NewState,: | new state of the COMP peripheral. This parameter can be: ENABLE or DISABLE. |
| None |
| void COMP_DeInit | ( | void | ) |
Deinitializes COMP peripheral registers to their default reset values.
| None |
| None |
< Set COMP_CSR register to reset value
| uint32_t COMP_GetOutputLevel | ( | uint32_t | COMP_Selection | ) |
Return the output level (high or low) of the selected comparator.
| COMP_Selection,: | the selected comparator. This parameter can be one of the following values:
|
| Returns | the selected comparator output level: low or high. |
| void COMP_Init | ( | uint32_t | COMP_Selection, |
| COMP_InitTypeDef * | COMP_InitStruct | ||
| ) |
Initializes the COMP peripheral according to the specified parameters in COMP_InitStruct.
| COMP_Selection,: | the selected comparator. This parameter can be one of the following values:
|
| COMP_InitStruct,: | pointer to an COMP_InitTypeDef structure that contains the configuration information for the specified COMP peripheral. |
| None |
< Get the COMP_CSR register value
< Clear the COMP1SW1, COMPx_IN_SEL, COMPx_OUT_TIM_SEL, COMPx_POL, COMPx_HYST and COMPx_PWR_MODE bits
< Configure COMP: inverting input, output redirection, hysteresis value and power mode
< Set COMPxINSEL bits according to COMP_InitStruct->COMP_InvertingInput value
< Set COMPxOUTSEL bits according to COMP_InitStruct->COMP_Output value
< Set COMPxPOL bit according to COMP_InitStruct->COMP_OutputPol value
< Set COMPxHYST bits according to COMP_InitStruct->COMP_Hysteresis value
< Set COMPxMODE bits according to COMP_InitStruct->COMP_Mode value
< Write to COMP_CSR register
| void COMP_LockConfig | ( | uint32_t | COMP_Selection | ) |
Lock the selected comparator (COMP1/COMP2) configuration.
| COMP_Selection,: | selects the comparator to be locked This parameter can be a value of the following values:
|
| None |
| void COMP_StructInit | ( | COMP_InitTypeDef * | COMP_InitStruct | ) |
Fills each COMP_InitStruct member with its default value.
| COMP_InitStruct,: | pointer to an COMP_InitTypeDef structure which will be initialized. |
| None |
| void COMP_SwitchCmd | ( | FunctionalState | NewState | ) |
Close or Open the SW1 switch.
| NewState,: | New state of the analog switch. This parameter can be: ENABLE or DISABLE. |
| None |
| void COMP_WindowCmd | ( | FunctionalState | NewState | ) |
Enables or disables the window mode.
| NewState,: | new state of the window mode. This parameter can be :
|
| None |