Kinetis SDK v.1.3 API Reference Manual  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
fsl_clock_MKL02Z4.h File Reference
#include "fsl_mcg_hal.h"
#include "fsl_mcg_hal_modes.h"
#include "fsl_osc_hal.h"

Data Structures

struct  sim_config_kl02z4_t
 SIM configuration structure for dynamic clock setting. More...
 

Macros

#define TPM_EXT_CLK_COUNT   2
 TPM external clock source count. More...
 

Functions

static void CLOCK_SYS_SetOutDiv1 (uint8_t outdiv1)
 Sets the clock out divider1 setting(OUTDIV1). More...
 
static uint8_t CLOCK_SYS_GetOutDiv1 (void)
 Gets the clock out divider1 setting(OUTDIV1). More...
 
static void CLOCK_SYS_SetOutDiv4 (uint8_t outdiv4)
 Sets the clock out divider4 setting(OUTDIV4). More...
 
static uint8_t CLOCK_SYS_GetOutDiv4 (void)
 Gets the clock out divider4 setting(OUTDIV4). More...
 
static void CLOCK_SYS_SetOutDiv (uint8_t outdiv1, uint8_t outdiv2, uint8_t outdiv3, uint8_t outdiv4)
 Sets the clock out dividers setting. More...
 
static void CLOCK_SYS_GetOutDiv (uint8_t *outdiv1, uint8_t *outdiv2, uint8_t *outdiv3, uint8_t *outdiv4)
 Gets the clock out dividers setting. More...
 
uint32_t CLOCK_SYS_GetFllClockFreq (void)
 Get the MCGFLLCLK clock frequency. More...
 
static uint32_t CLOCK_SYS_GetFixedFreqClockFreq (void)
 Gets the MCGFFCLK clock frequency. More...
 
static uint32_t CLOCK_SYS_GetInternalRefClockFreq (void)
 Get internal reference clock frequency. More...
 
uint32_t CLOCK_SYS_GetOsc0ExternalRefClockFreq (void)
 Gets the OSC0ERCLK frequency. More...
 
uint32_t CLOCK_SYS_GetCopFreq (uint32_t instance, clock_cop_src_t copSrc)
 Gets the COP clock frequency. More...
 
uint32_t CLOCK_SYS_GetLptmrFreq (uint32_t instance, clock_lptmr_src_t lptmrSrc)
 Gets LPTMRx pre-scaler/glitch filter clock frequency. More...
 
uint32_t CLOCK_SYS_GetTpmFreq (uint32_t instance)
 Gets TPM clock frequency. More...
 
static void CLOCK_SYS_SetTpmSrc (uint32_t instance, clock_tpm_src_t tpmSrc)
 Set the TPM clock source selection. More...
 
static clock_tpm_src_t CLOCK_SYS_GetTpmSrc (uint32_t instance)
 Get the TPM clock source selection. More...
 
uint32_t CLOCK_SYS_GetTpmExternalFreq (uint32_t instance)
 Get the TPM external clock source frequency. More...
 
static void CLOCK_SYS_SetTpmExternalSrc (uint32_t instance, sim_tpm_clk_sel_t src)
 Set the TPM external clock source selection. More...
 
static sim_tpm_clk_sel_t CLOCK_SYS_GetTpmExternalSrc (uint32_t instance)
 Set the TPM external clock source selection. More...
 
static uint32_t CLOCK_SYS_GetSpiFreq (uint32_t instance)
 Gets the clock frequency for SPI module. More...
 
static uint32_t CLOCK_SYS_GetI2cFreq (uint32_t instance)
 Gets the clock frequency for I2C module. More...
 
uint32_t CLOCK_SYS_GetLpsciFreq (uint32_t instance)
 Gets the clock frequency for LPSCI module. More...
 
static void CLOCK_SYS_SetLpsciSrc (uint32_t instance, clock_lpsci_src_t lpsciSrc)
 Set the LPSCI clock source selection. More...
 
static clock_lpsci_src_t CLOCK_SYS_GetLpsciSrc (uint32_t instance)
 Get the LPSCI clock source selection. More...
 
static uint32_t CLOCK_SYS_GetAdcAltFreq (uint32_t instance)
 Gets ADC alternate clock frequency. More...
 
static uint32_t CLOCK_SYS_GetGpioFreq (uint32_t instance)
 Gets the clock frequency for GPIO module. More...
 
static uint32_t CLOCK_SYS_GetCmpFreq (uint32_t instance)
 Gets the clock frequency for CMP module. More...
 
static uint32_t CLOCK_SYS_GetFtfFreq (uint32_t instance)
 Gets the clock frequency for FTF module. More...
 
void CLOCK_SYS_EnablePortClock (uint32_t instance)
 Enable the clock for PORT module. More...
 
void CLOCK_SYS_DisablePortClock (uint32_t instance)
 Disable the clock for PORT module. More...
 
bool CLOCK_SYS_GetPortGateCmd (uint32_t instance)
 Get the the clock gate state for PORT module. More...
 
static void CLOCK_SYS_EnableFtfClock (uint32_t instance)
 Enable the clock for FTF module. More...
 
static void CLOCK_SYS_DisableFtfClock (uint32_t instance)
 Disable the clock for FTF module. More...
 
static bool CLOCK_SYS_GetFtfGateCmd (uint32_t instance)
 Get the the clock gate state for FTF module. More...
 
void CLOCK_SYS_EnableAdcClock (uint32_t instance)
 Enable the clock for ADC module. More...
 
void CLOCK_SYS_DisableAdcClock (uint32_t instance)
 Disable the clock for ADC module. More...
 
bool CLOCK_SYS_GetAdcGateCmd (uint32_t instance)
 Get the the clock gate state for ADC module. More...
 
static void CLOCK_SYS_EnableCmpClock (uint32_t instance)
 Enable the clock for CMP module. More...
 
static void CLOCK_SYS_DisableCmpClock (uint32_t instance)
 Disable the clock for CMP module. More...
 
static bool CLOCK_SYS_GetCmpGateCmd (uint32_t instance)
 Get the the clock gate state for CMP module. More...
 
void CLOCK_SYS_EnableTpmClock (uint32_t instance)
 Enable the clock for TPM module. More...
 
void CLOCK_SYS_DisableTpmClock (uint32_t instance)
 Disable the clock for TPM module. More...
 
bool CLOCK_SYS_GetTpmGateCmd (uint32_t instance)
 Get the the clock gate state for TPM module. More...
 
static void CLOCK_SYS_EnableLptmrClock (uint32_t instance)
 Enable the clock for LPTIMER module. More...
 
static void CLOCK_SYS_DisableLptmrClock (uint32_t instance)
 Disable the clock for LPTIMER module. More...
 
static bool CLOCK_SYS_GetLptmrGateCmd (uint32_t instance)
 Get the the clock gate state for LPTIMER module. More...
 
void CLOCK_SYS_EnableSpiClock (uint32_t instance)
 Enable the clock for SPI module. More...
 
void CLOCK_SYS_DisableSpiClock (uint32_t instance)
 Disable the clock for SPI module. More...
 
bool CLOCK_SYS_GetSpiGateCmd (uint32_t instance)
 Get the the clock gate state for SPI module. More...
 
void CLOCK_SYS_EnableLpsciClock (uint32_t instance)
 Enable the clock for LPSCI module. More...
 
void CLOCK_SYS_DisableLpsciClock (uint32_t instance)
 Disable the clock for LPSCI module. More...
 
bool CLOCK_SYS_GetLpsciGateCmd (uint32_t instance)
 Get the the clock gate state for LPSCI module. More...
 
void CLOCK_SYS_EnableI2cClock (uint32_t instance)
 Enable the clock for I2C module. More...
 
void CLOCK_SYS_DisableI2cClock (uint32_t instance)
 Disable the clock for I2C module. More...
 
bool CLOCK_SYS_GetI2cGateCmd (uint32_t instance)
 Get the the clock gate state for I2C module. More...
 
static void CLOCK_SYS_SetTpmExternalFreq (uint32_t srcInstance, uint32_t freq)
 Set the TPM external clock frequency(TPM_CLKx). More...
 

Variables

uint32_t g_tpmClkFreq [TPM_EXT_CLK_COUNT]
 TPM external clock frequency(TPM_CLK). More...
 

Function Documentation

static void CLOCK_SYS_SetOutDiv1 ( uint8_t  outdiv1)
inlinestatic

This function sets divide value OUTDIV1.

Parameters
outdiv1Outdivider1 setting
static uint8_t CLOCK_SYS_GetOutDiv1 ( void  )
inlinestatic

This function gets divide value OUTDIV1.

Returns
Outdivider1 setting
static void CLOCK_SYS_SetOutDiv4 ( uint8_t  outdiv4)
inlinestatic

This function sets divide value OUTDIV4.

Parameters
outdiv4Outdivider4 setting
static uint8_t CLOCK_SYS_GetOutDiv4 ( void  )
inlinestatic

This function gets divide value OUTDIV4.

Returns
Outdivider4 setting
static void CLOCK_SYS_SetOutDiv ( uint8_t  outdiv1,
uint8_t  outdiv2,
uint8_t  outdiv3,
uint8_t  outdiv4 
)
inlinestatic

This function sets the setting for all clock out dividers at the same time.

Parameters
outdiv1Outdivider1 setting
outdiv2Outdivider2 setting
outdiv3Outdivider3 setting
outdiv4Outdivider4 setting
static void CLOCK_SYS_GetOutDiv ( uint8_t *  outdiv1,
uint8_t *  outdiv2,
uint8_t *  outdiv3,
uint8_t *  outdiv4 
)
inlinestatic

This function gets the setting for all clock out dividers at the same time.

Parameters
outdiv1Outdivider1 setting
outdiv2Outdivider2 setting
outdiv3Outdivider3 setting
outdiv4Outdivider4 setting
static uint32_t CLOCK_SYS_GetFixedFreqClockFreq ( void  )
inlinestatic

This function gets the MCG fixed frequency clock (MCGFFCLK) frequency.

Returns
Current clock frequency.
static uint32_t CLOCK_SYS_GetInternalRefClockFreq ( void  )
inlinestatic

This function gets the internal reference clock frequency.

Returns
Current clock frequency.
static void CLOCK_SYS_SetTpmSrc ( uint32_t  instance,
clock_tpm_src_t  tpmSrc 
)
inlinestatic

This function sets the TPM clock source selection.

Parameters
instanceIP instance.
tpmSrcThe value to set.
static clock_tpm_src_t CLOCK_SYS_GetTpmSrc ( uint32_t  instance)
inlinestatic

This function gets the TPM clock source selection.

Parameters
instanceIP instance.
Returns
Current selection.
static void CLOCK_SYS_SetTpmExternalSrc ( uint32_t  instance,
sim_tpm_clk_sel_t  src 
)
inlinestatic

This function sets the TPM external clock source selection.

Parameters
instanceIP instance.
srcTPM external clock source.
static sim_tpm_clk_sel_t CLOCK_SYS_GetTpmExternalSrc ( uint32_t  instance)
inlinestatic

This function sets the TPM external clock source selection.

Parameters
instanceIP instance.
Returns
setting Current TPM external clock source.
static uint32_t CLOCK_SYS_GetAdcAltFreq ( uint32_t  instance)
inlinestatic

This function gets the ADC alternate clock frequency.

Parameters
instancemodule device instance
Returns
freq Current frequency.
static uint32_t CLOCK_SYS_GetGpioFreq ( uint32_t  instance)
inlinestatic

This function gets the clock frequency for GPIO module.

Parameters
instancemodule device instance
Returns
freq clock frequency for this module
static uint32_t CLOCK_SYS_GetCmpFreq ( uint32_t  instance)
inlinestatic

This function gets the clock frequency for CMP module.

Parameters
instancemodule device instance
Returns
freq clock frequency for this module
static uint32_t CLOCK_SYS_GetFtfFreq ( uint32_t  instance)
inlinestatic

(Flash Memory)

This function gets the clock frequency for FTF module. (Flash Memory)

Parameters
instancemodule device instance
Returns
freq clock frequency for this module
static void CLOCK_SYS_EnableFtfClock ( uint32_t  instance)
inlinestatic

This function enables the clock for FTF module.

Parameters
instancemodule device instance
static void CLOCK_SYS_DisableFtfClock ( uint32_t  instance)
inlinestatic

This function disables the clock for FTF module.

Parameters
instancemodule device instance
static bool CLOCK_SYS_GetFtfGateCmd ( uint32_t  instance)
inlinestatic

This function will get the clock gate state for FTF module.

Parameters
instancemodule device instance
Returns
state true - ungated(Enabled), false - gated (Disabled)
static void CLOCK_SYS_EnableCmpClock ( uint32_t  instance)
inlinestatic

This function enables the clock for CMP module.

Parameters
instancemodule device instance
static void CLOCK_SYS_DisableCmpClock ( uint32_t  instance)
inlinestatic

This function disables the clock for CMP module.

Parameters
instancemodule device instance
static bool CLOCK_SYS_GetCmpGateCmd ( uint32_t  instance)
inlinestatic

This function will get the clock gate state for CMP module.

Parameters
instancemodule device instance
Returns
state true - ungated(Enabled), false - gated (Disabled)
static void CLOCK_SYS_EnableLptmrClock ( uint32_t  instance)
inlinestatic

This function enables the clock for LPTIMER module.

Parameters
instancemodule device instance
static void CLOCK_SYS_DisableLptmrClock ( uint32_t  instance)
inlinestatic

This function disables the clock for LPTIMER module.

Parameters
instancemodule device instance
static bool CLOCK_SYS_GetLptmrGateCmd ( uint32_t  instance)
inlinestatic

This function will get the clock gate state for LPTIMER module.

Parameters
instancemodule device instance
Returns
state true - ungated(Enabled), false - gated (Disabled)