PDL for FM4  Version1.2
Peripheral Driverl Library for FM4
clk.c File Reference
#include "clk.h"
Include dependency graph for clk.c:

Go to the source code of this file.

Functions

void ClkIrqHandler (void)
 Clock Stabilization Interrupt Handler. More...
 
en_result_t Clk_MainGetParameters (stc_clk_main_config_t *pstcConfig)
 Get current Main/PLL Clock parameters. More...
 
en_result_t Clk_SubGetParameters (stc_clk_sub_config_t *pstcConfig)
 Get current Sub Clock parameters. More...
 
en_result_t Clk_VbatGetParameters (stc_clk_vbat_config_t *pstcConfig)
 Get current VBAT parameters. More...
 
en_result_t Clk_SetDividers (stc_clk_main_config_t *pstcConfig)
 Set Clock Dividers. More...
 
en_result_t Clk_MainSetStabilizationWaitTime (stc_clk_main_config_t *pstcConfig)
 Set Main Oscillation Stabilization Wait Time. More...
 
en_result_t Clk_WaitForMainOscillator (uint32_t u32MaxTimeOut)
 Wait for Main Oscillation Stabilization. More...
 
en_result_t Clk_WaitForPllOscillator (uint32_t u32MaxTimeOut)
 Wait for PLL Oscillation Stabilization. More...
 
en_result_t Clk_WaitForClockSourceReady (en_clk_source_t enSource, uint32_t u32MaxTimeOut)
 Wait for Clock Mode ready (transition finished) More...
 
en_result_t Clk_MainOscillatorReady (void)
 Main Oscillation Ready? More...
 
en_result_t Clk_SubOscillatorReady (void)
 Sub Oscillation Ready? More...
 
en_result_t Clk_PllOscillatorReady (void)
 PLL Oscillation Ready? More...
 
en_result_t Clk_SetSource (stc_clk_main_config_t *pstcConfigMain, stc_clk_sub_config_t *pstcConfigSub)
 Set Clock Source. More...
 
en_result_t Clk_SetMode (stc_clk_main_config_t *pstcConfig)
 Set Clock Mode. More...
 
en_result_t Clk_DisableSubClock (void)
 Disable Sub Clock. More...
 
en_result_t Clk_EnableMainClock (void)
 Enable Main Clock. More...
 
en_result_t Clk_EnablePllClock (stc_clk_main_config_t *pstcConfigMain)
 Enable PLL Clock with parameter. More...
 
en_result_t Clk_DisableMainClock (void)
 Disable Main Clock. More...
 
en_result_t Clk_DisablePllClock (void)
 Disable PLL Clock. More...
 
en_result_t Clk_SetIrq (stc_clk_main_config_t *pstcConfigMain, stc_clk_sub_config_t *pstcConfigSub, boolean_t bTouchNvic)
 Set/Clear Clock interrupts. More...
 
en_result_t Clk_ClockVbatInit (stc_clk_vbat_config_t *pstcConfig)
 Init Sub Clock with VBAT settings. More...
 
en_result_t Clk_EnableSubClock (void)
 Enable Sub Clock. More...
 
en_result_t Clk_SubSetStabilizationWaitTime (stc_clk_sub_config_t *pstcConfig)
 Set Sub Oscillation Stabilization Wait Time. More...
 
en_result_t Clk_WaitForSubOscillator (uint32_t u32MaxTimeOut)
 Wait for Sub Oscillation Stabilization. More...
 
en_result_t Clk_RequestVccPowerDown (void)
 Request VCC Power-Down. More...
 
en_result_t Clk_PeripheralClockEnable (en_clk_gate_peripheral_t enPeripheral)
 Enables the clock gate of a peripheral. More...
 
boolean_t Clk_PeripheralGetClockState (en_clk_gate_peripheral_t enPeripheral)
 Read the clock gate state of a peripheral. More...
 
en_result_t Clk_PeripheralClockDisable (en_clk_gate_peripheral_t enPeripheral)
 Disables the clock gate of a peripheral. More...
 
en_result_t Clk_PeripheralSetReset (en_clk_reset_peripheral_t enPeripheral)
 Set reset bit a peripheral. More...
 
en_result_t Clk_PeripheralClearReset (en_clk_reset_peripheral_t enPeripheral)
 Clear reset bit a peripheral. More...
 
en_result_t Clk_SwitchToMainClock (void)
 Switch to Main Clock. More...
 
en_result_t Clk_SwitchToMainPllClock (void)
 Switch to Main PLL Clock. More...
 
en_result_t Clk_SwitchToSubClock (void)
 Switch to Sub Clock. More...
 
en_result_t Clk_SwitchToLsCrClock (void)
 Switch to Low Speed CR Clock. More...
 
en_result_t Clk_SwitchToHsCrClock (void)
 Switch to High Speed CR Clock. More...
 
en_result_t Clk_SwitchToHsCrPllClock (void)
 Switch to High Speed CR PLL Clock. More...
 

Variables

stc_clk_intern_data_t stcClkInternData
 

Detailed Description

A detailed description is available at Clock Module description

History:

  • 2012-02-21 1.0 MWi First version.
  • 2013-06-03 1.1 MWi VBAT settings added
  • 2013-07-12 1.2 MWi Clk_SwitchTo* functions added, bVbPXXeripheral GPIO initialization corrected
  • 2013-10-24 1.3 MWi Clk_DisablePllClock, ClkDeepStop mode added, Deep standby modes corrected

Definition in file clk.c.