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_manager.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include "fsl_device_registers.h"
#include "fsl_sim_hal.h"

Data Structures

struct  oscer_config_t
 OSC configuration for OSCERCLK. More...
 
struct  osc_user_config_t
 OSC Initialization Configuration Structure. More...
 
struct  rtc_osc_user_config_t
 RTC OSC Initialization Configuration Structure. More...
 
struct  mcglite_config_t
 MCG_LITE configure structure for mode change. More...
 
struct  clock_manager_user_config_t
 Clock configuration structure. More...
 
struct  clock_notify_struct_t
 Clock notification structure passed to clock callback function. More...
 
struct  clock_manager_callback_user_config_t
 The structure for callback function and its parameter. More...
 
struct  clock_manager_state_t
 Clock manager state structure. More...
 

Macros

#define CPU_LPO_CLK_HZ   1000U
 Frequency of the LPO. More...
 

Typedefs

typedef
clock_manager_error_code_t(* 
clock_manager_callback_t )(clock_notify_struct_t *notify, void *callbackData)
 Type of the clock callback functions. More...
 

Enumerations

enum  clock_systick_src_t {
  kClockSystickSrcExtRef = 0U,
  kClockSystickSrcCore = 1U
}
 Systick clock source selection. More...
 
enum  clock_names_t {
  kCoreClock,
  kSystemClock,
  kPlatformClock,
  kBusClock,
  kFlexBusClock,
  kFlashClock,
  kFastPeripheralClock,
  kSystickClock,
  kOsc32kClock,
  kOsc0ErClock,
  kOsc1ErClock,
  kOsc0ErClockUndiv,
  kIrc48mClock,
  kRtcoutClock,
  kMcgFfClock,
  kMcgFllClock,
  kMcgPll0Clock,
  kMcgPll1Clock,
  kMcgExtPllClock,
  kMcgOutClock,
  kMcgIrClock,
  kLpoClock,
  kClockNameCount
}
 A clock name used to get the clock frequency. More...
 
enum  clock_manager_error_code_t {
  kClockManagerSuccess,
  kClockManagerError,
  kClockManagerNoSuchClockName,
  kClockManagerInvalidParam,
  kClockManagerErrorOutOfRange,
  kClockManagerErrorNotificationBefore,
  kClockManagerErrorNotificationAfter,
  kClockManagerErrorUnknown
}
 Error code definition for the clock manager APIs. More...
 
enum  clock_manager_notify_t {
  kClockManagerNotifyRecover = 0x00U,
  kClockManagerNotifyBefore = 0x01U,
  kClockManagerNotifyAfter = 0x02U
}
 The clock notification type. More...
 
enum  clock_manager_callback_type_t {
  kClockManagerCallbackBefore = 0x01U,
  kClockManagerCallbackAfter = 0x02U,
  kClockManagerCallbackBeforeAfter = 0x03U
}
 The callback type, which indicates the kinds of notification this callback handles. More...
 
enum  clock_manager_policy_t {
  kClockManagerPolicyAgreement,
  kClockManagerPolicyForcible
}
 Clock transition policy. More...
 

Functions

clock_manager_error_code_t CLOCK_SYS_GetFreq (clock_names_t clockName, uint32_t *frequency)
 Gets the clock frequency for a specific clock name. More...
 
uint32_t CLOCK_SYS_GetCoreClockFreq (void)
 Gets the core clock frequency. More...
 
uint32_t CLOCK_SYS_GetSystemClockFreq (void)
 Gets the system clock frequency. More...
 
uint32_t CLOCK_SYS_GetBusClockFreq (void)
 Gets the bus clock frequency. More...
 
uint32_t CLOCK_SYS_GetFlashClockFreq (void)
 Gets the flash clock frequency. More...
 
static uint32_t CLOCK_SYS_GetLpoClockFreq (void)
 Gets the LPO clock frequency. More...
 
static void CLOCK_SYS_SetSystickSrc (clock_systick_src_t src)
 Sets the Systick clock source SYST_CSR[CLKSOURCE]. More...
 
static uint32_t CLOCK_SYS_GetSystickFreq (void)
 Gets the Systick clock frequency. More...
 
Dynamic clock setting
clock_manager_error_code_t CLOCK_SYS_Init (clock_manager_user_config_t const **clockConfigsPtr, uint8_t configsNumber, clock_manager_callback_user_config_t **callbacksPtr, uint8_t callbacksNumber)
 Installs pre-defined clock configurations. More...
 
clock_manager_error_code_t CLOCK_SYS_UpdateConfiguration (uint8_t targetConfigIndex, clock_manager_policy_t policy)
 Sets the system clock configuration according to a pre-defined structure. More...
 
clock_manager_error_code_t CLOCK_SYS_SetConfiguration (clock_manager_user_config_t const *config)
 Sets the system clock configuration. More...
 
uint8_t CLOCK_SYS_GetCurrentConfiguration (void)
 Gets the current system clock configuration. More...
 
clock_manager_callback_user_config_tCLOCK_SYS_GetErrorCallback (void)
 Gets the callback which returns an error in the last clock switch. More...
 
mcglite_mode_error_t CLOCK_SYS_SetMcgliteMode (mcglite_config_t const *targetConfig)
 Sets the MCGLite to a specific mode. More...
 
void CLOCK_SYS_SetSimConfigration (sim_config_t const *simConfig)
 Sets the clock configuration in SIM module. More...
 
OSC configuration
clock_manager_error_code_t CLOCK_SYS_OscInit (uint32_t instance, osc_user_config_t *config)
 Initializes the OSC. More...
 
void CLOCK_SYS_OscDeinit (uint32_t instance)
 Deinitializes the OSC. More...
 
void CLOCK_SYS_SetOscerConfigration (uint32_t instance, oscer_config_t const *config)
 Configures the OSCERCLK. More...
 
RTC OSC configuration
clock_manager_error_code_t CLOCK_SYS_RtcOscInit (uint32_t instance, rtc_osc_user_config_t *config)
 Initializes the RTC OSC. More...
 
void CLOCK_SYS_RtcOscDeinit (uint32_t instance)
 Deinitializes the RTC OSC. More...
 

Variables

SIM_Type *const g_simBase []
 The register base of the SIM module. More...
 
MCG_Type *const g_mcgBase []
 The register base of the MCG/MCG_LITE module. More...
 
OSC_Type *const g_oscBase []
 The register base of the OSC module. More...