STM8S/A Standard Peripherals Drivers
|
Functions | |
void | CLK_AdjustHSICalibrationValue (CLK_HSITrimValue_TypeDef CLK_HSICalibrationValue) |
Adjusts the Internal High Speed oscillator (HSI) calibration value. | |
void | CLK_CCOCmd (FunctionalState NewState) |
Enables or disablle the Configurable Clock Output (CCO). | |
void | CLK_CCOConfig (CLK_Output_TypeDef CLK_CCO) |
Output the selected clock on a dedicated I/O pin. | |
void | CLK_ClearITPendingBit (CLK_IT_TypeDef CLK_IT) |
Clears the CLK�s interrupt pending bits. | |
void | CLK_ClockSecuritySystemEnable (void) |
Enables the Clock Security System. | |
void | CLK_ClockSwitchCmd (FunctionalState NewState) |
Starts or Stops manually the clock switch execution. | |
ErrorStatus | CLK_ClockSwitchConfig (CLK_SwitchMode_TypeDef CLK_SwitchMode, CLK_Source_TypeDef CLK_NewClock, FunctionalState ITState, CLK_CurrentClockState_TypeDef CLK_CurrentClockState) |
configures the Switch from one clock to another | |
void | CLK_DeInit (void) |
Deinitializes the CLK peripheral registers to their default reset values. | |
void | CLK_FastHaltWakeUpCmd (FunctionalState NewState) |
Configures the High Speed Internal oscillator (HSI). | |
uint32_t | CLK_GetClockFreq (void) |
This function returns the frequencies of different on chip clocks. | |
FlagStatus | CLK_GetFlagStatus (CLK_Flag_TypeDef CLK_FLAG) |
Checks whether the specified CLK flag is set or not. | |
ITStatus | CLK_GetITStatus (CLK_IT_TypeDef CLK_IT) |
Checks whether the specified CLK interrupt has is enabled or not. | |
CLK_Source_TypeDef | CLK_GetSYSCLKSource (void) |
Returns the clock source used as system clock. | |
void | CLK_HSECmd (FunctionalState NewState) |
Enable or Disable the External High Speed oscillator (HSE). | |
void | CLK_HSICmd (FunctionalState NewState) |
Enables or disables the Internal High Speed oscillator (HSI). | |
void | CLK_HSIPrescalerConfig (CLK_Prescaler_TypeDef HSIPrescaler) |
Configures the HSI clock dividers. | |
void | CLK_ITConfig (CLK_IT_TypeDef CLK_IT, FunctionalState NewState) |
Enables or disables the specified CLK interrupts. | |
void | CLK_LSICmd (FunctionalState NewState) |
Enables or disables the Internal Low Speed oscillator (LSI). | |
void | CLK_PeripheralClockConfig (CLK_Peripheral_TypeDef CLK_Peripheral, FunctionalState NewState) |
Enables or disables the specified peripheral CLK. | |
void | CLK_SlowActiveHaltWakeUpCmd (FunctionalState NewState) |
Configures the slow active halt wake up. | |
void | CLK_SWIMConfig (CLK_SWIMDivider_TypeDef CLK_SWIMDivider) |
Configures the SWIM clock frequency on the fly. | |
void | CLK_SYSCLKConfig (CLK_Prescaler_TypeDef CLK_Prescaler) |
Configures the HSI and CPU clock dividers. | |
void | CLK_SYSCLKEmergencyClear (void) |
Reset the SWBSY flag (SWICR Register) |
Function Documentation
void CLK_AdjustHSICalibrationValue | ( | CLK_HSITrimValue_TypeDef | CLK_HSICalibrationValue | ) |
Adjusts the Internal High Speed oscillator (HSI) calibration value.
Definition at line 604 of file stm8s_clk.c.
References CLK, CLK_HSITRIMR_HSITRIM, and IS_CLK_HSITRIMVALUE_OK.
void CLK_CCOCmd | ( | FunctionalState | NewState | ) |
Enables or disablle the Configurable Clock Output (CCO).
Definition at line 189 of file stm8s_clk.c.
References CLK, CLK_CCOR_CCOEN, DISABLE, and IS_FUNCTIONALSTATE_OK.
void CLK_CCOConfig | ( | CLK_Output_TypeDef | CLK_CCO | ) |
Output the selected clock on a dedicated I/O pin.
Definition at line 436 of file stm8s_clk.c.
References CLK, CLK_CCOR_CCOEN, CLK_CCOR_CCOSEL, and IS_CLK_OUTPUT_OK.
void CLK_ClearITPendingBit | ( | CLK_IT_TypeDef | CLK_IT | ) |
Clears the CLK�s interrupt pending bits.
Definition at line 729 of file stm8s_clk.c.
References CLK, CLK_CSSR_CSSD, CLK_IT_CSSD, CLK_SWCR_SWIF, and IS_CLK_IT_OK.
void CLK_ClockSecuritySystemEnable | ( | void | ) |
Enables the Clock Security System.
Definition at line 547 of file stm8s_clk.c.
References CLK, and CLK_CSSR_CSSEN.
void CLK_ClockSwitchCmd | ( | FunctionalState | NewState | ) |
Starts or Stops manually the clock switch execution.
Definition at line 213 of file stm8s_clk.c.
References CLK, CLK_SWCR_SWEN, DISABLE, and IS_FUNCTIONALSTATE_OK.
ErrorStatus CLK_ClockSwitchConfig | ( | CLK_SwitchMode_TypeDef | CLK_SwitchMode, |
CLK_Source_TypeDef | CLK_NewClock, | ||
FunctionalState | ITState, | ||
CLK_CurrentClockState_TypeDef | CLK_CurrentClockState | ||
) |
configures the Switch from one clock to another
- Note:
- LSI selected as master clock source only if LSI_EN option bit is set.
Definition at line 309 of file stm8s_clk.c.
References CLK, CLK_CURRENTCLOCKSTATE_DISABLE, CLK_ECKR_HSEEN, CLK_ICKR_HSIEN, CLK_ICKR_LSIEN, CLK_SOURCE_HSE, CLK_SOURCE_HSI, CLK_SOURCE_LSI, CLK_SWCR_SWBSY, CLK_SWCR_SWEN, CLK_SWCR_SWIEN, CLK_SWCR_SWIF, CLK_SWITCHMODE_AUTO, CLK_TIMEOUT, DISABLE, ERROR, IS_CLK_CURRENTCLOCKSTATE_OK, IS_CLK_SOURCE_OK, IS_CLK_SWITCHMODE_OK, IS_FUNCTIONALSTATE_OK, and SUCCESS.
void CLK_DeInit | ( | void | ) |
Deinitializes the CLK peripheral registers to their default reset values.
Definition at line 72 of file stm8s_clk.c.
References CLK, CLK_CCOR_CCOEN, CLK_CCOR_RESET_VALUE, CLK_CKDIVR_RESET_VALUE, CLK_CSSR_RESET_VALUE, CLK_ECKR_RESET_VALUE, CLK_HSITRIMR_RESET_VALUE, CLK_ICKR_RESET_VALUE, CLK_PCKENR1_RESET_VALUE, CLK_PCKENR2_RESET_VALUE, CLK_SWCR_RESET_VALUE, CLK_SWIMCCR_RESET_VALUE, and CLK_SWR_RESET_VALUE.
void CLK_FastHaltWakeUpCmd | ( | FunctionalState | NewState | ) |
Configures the High Speed Internal oscillator (HSI).
Definition at line 99 of file stm8s_clk.c.
References CLK, CLK_ICKR_FHWU, DISABLE, and IS_FUNCTIONALSTATE_OK.
uint32_t CLK_GetClockFreq | ( | void | ) |
This function returns the frequencies of different on chip clocks.
Definition at line 569 of file stm8s_clk.c.
References CLK, CLK_CKDIVR_HSIDIV, CLK_SOURCE_HSI, CLK_SOURCE_LSI, HSE_VALUE, HSI_VALUE, HSIDivFactor, and LSI_VALUE.
Referenced by UART1_Init(), UART2_Init(), UART3_Init(), and UART4_Init().
FlagStatus CLK_GetFlagStatus | ( | CLK_Flag_TypeDef | CLK_FLAG | ) |
Checks whether the specified CLK flag is set or not.
Definition at line 634 of file stm8s_clk.c.
References CLK, IS_CLK_FLAG_OK, RESET, and SET.
ITStatus CLK_GetITStatus | ( | CLK_IT_TypeDef | CLK_IT | ) |
Checks whether the specified CLK interrupt has is enabled or not.
Definition at line 687 of file stm8s_clk.c.
References CLK, CLK_IT_SWIF, IS_CLK_IT_OK, RESET, and SET.
CLK_Source_TypeDef CLK_GetSYSCLKSource | ( | void | ) |
Returns the clock source used as system clock.
Definition at line 559 of file stm8s_clk.c.
References CLK.
void CLK_HSECmd | ( | FunctionalState | NewState | ) |
Enable or Disable the External High Speed oscillator (HSE).
Definition at line 121 of file stm8s_clk.c.
References CLK, CLK_ECKR_HSEEN, DISABLE, and IS_FUNCTIONALSTATE_OK.
void CLK_HSICmd | ( | FunctionalState | NewState | ) |
Enables or disables the Internal High Speed oscillator (HSI).
Definition at line 143 of file stm8s_clk.c.
References CLK, CLK_ICKR_HSIEN, DISABLE, and IS_FUNCTIONALSTATE_OK.
void CLK_HSIPrescalerConfig | ( | CLK_Prescaler_TypeDef | HSIPrescaler | ) |
Configures the HSI clock dividers.
Definition at line 415 of file stm8s_clk.c.
References CLK, CLK_CKDIVR_HSIDIV, and IS_CLK_HSIPRESCALER_OK.
void CLK_ITConfig | ( | CLK_IT_TypeDef | CLK_IT, |
FunctionalState | NewState | ||
) |
Enables or disables the specified CLK interrupts.
Definition at line 459 of file stm8s_clk.c.
References CLK, CLK_CSSR_CSSDIE, CLK_IT_CSSD, CLK_IT_SWIF, CLK_SWCR_SWIEN, DISABLE, IS_CLK_IT_OK, and IS_FUNCTIONALSTATE_OK.
void CLK_LSICmd | ( | FunctionalState | NewState | ) |
Enables or disables the Internal Low Speed oscillator (LSI).
- Note:
- Before using the LSI clock you have to enable the option bytes (LSI_EN option bit is set).
Definition at line 166 of file stm8s_clk.c.
References CLK, CLK_ICKR_LSIEN, DISABLE, and IS_FUNCTIONALSTATE_OK.
void CLK_PeripheralClockConfig | ( | CLK_Peripheral_TypeDef | CLK_Peripheral, |
FunctionalState | NewState | ||
) |
Enables or disables the specified peripheral CLK.
Definition at line 263 of file stm8s_clk.c.
References CLK, DISABLE, IS_CLK_PERIPHERAL_OK, and IS_FUNCTIONALSTATE_OK.
void CLK_SlowActiveHaltWakeUpCmd | ( | FunctionalState | NewState | ) |
Configures the slow active halt wake up.
Definition at line 238 of file stm8s_clk.c.
References CLK, CLK_ICKR_SWUAH, DISABLE, and IS_FUNCTIONALSTATE_OK.
void CLK_SWIMConfig | ( | CLK_SWIMDivider_TypeDef | CLK_SWIMDivider | ) |
Configures the SWIM clock frequency on the fly.
Definition at line 523 of file stm8s_clk.c.
References CLK, CLK_SWIMCCR_SWIMDIV, CLK_SWIMDIVIDER_2, and IS_CLK_SWIMDIVIDER_OK.
void CLK_SYSCLKConfig | ( | CLK_Prescaler_TypeDef | CLK_Prescaler | ) |
Configures the HSI and CPU clock dividers.
Definition at line 500 of file stm8s_clk.c.
References CLK, CLK_CKDIVR_CPUDIV, CLK_CKDIVR_HSIDIV, and IS_CLK_PRESCALER_OK.
void CLK_SYSCLKEmergencyClear | ( | void | ) |
Reset the SWBSY flag (SWICR Register)
Definition at line 622 of file stm8s_clk.c.
References CLK, and CLK_SWCR_SWBSY.