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

Enumerations

enum  _mcglite_constant {
  kMcgliteConst0 = 0U,
  kMcgliteConst2M = 2000000U,
  kMcgliteConst8M = 8000000U,
  kMcgliteConst48M = 48000000U
}
 MCG_Lite constant definitions. More...
 
enum  mcglite_mcgoutclk_source_t {
  kMcgliteClkSrcHirc,
  kMcgliteClkSrcLirc,
  kMcgliteClkSrcExt,
  kMcgliteClkSrcReserved
}
 MCG_Lite clock source selection. More...
 
enum  mcglite_lirc_select_t {
  kMcgliteLircSel2M,
  kMcgliteLircSel8M
}
 MCG_Lite LIRC select. More...
 
enum  mcglite_lirc_div_t {
  kMcgliteLircDivBy1 = 0U,
  kMcgliteLircDivBy2,
  kMcgliteLircDivBy4,
  kMcgliteLircDivBy8,
  kMcgliteLircDivBy16,
  kMcgliteLircDivBy32,
  kMcgliteLircDivBy64,
  kMcgliteLircDivBy128
}
 MCG_Lite divider factor selection for clock source. More...
 
enum  osc_src_t {
  kOscSrcExt,
  kOscSrcOsc,
  kOscSrcExt,
  kOscSrcOsc
}
 MCG_Lite external clock Select. More...
 
enum  osc_range_t {
  kOscRangeLow,
  kOscRangeHigh,
  kOscRangeVeryHigh,
  kOscRangeVeryHigh1,
  kOscRangeLow,
  kOscRangeHigh,
  kOscRangeVeryHigh,
  kOscRangeVeryHigh1
}
 MCG frequency range select. More...
 
enum  osc_gain_t {
  kOscGainLow,
  kOscGainHigh,
  kOscGainLow,
  kOscGainHigh
}
 MCG high gain oscillator select. More...
 

Functions

MCG_Lite output clock access API
uint32_t CLOCK_HAL_GetPeripheralClk (MCG_Type *base)
 Gets the current MCGPCLK frequency. More...
 
uint32_t CLOCK_HAL_GetLircClk (MCG_Type *base)
 Gets the current MCG_Lite low internal reference clock(2 MHz or 8 MHz) More...
 
uint32_t CLOCK_HAL_GetLircDiv1Clk (MCG_Type *base)
 Gets the current MCG_Lite LIRC_DIV1_CLK frequency. More...
 
uint32_t CLOCK_HAL_GetInternalRefClk (MCG_Type *base)
 Gets the current MCGIRCLK frequency. More...
 
uint32_t CLOCK_HAL_GetOutClk (MCG_Type *base)
 Gets the current MCGOUTCLK frequency. More...
 
MCG_Lite control register access API
static void CLOCK_HAL_SetLircSelMode (MCG_Type *base, mcglite_lirc_select_t select)
 Sets the Low Internal Reference Select. More...
 
static void CLOCK_HAL_SetLircRefDiv (MCG_Type *base, mcglite_lirc_div_t setting)
 Sets the low internal reference divider 1. More...
 
static void CLOCK_HAL_SetLircDiv2 (MCG_Type *base, mcglite_lirc_div_t setting)
 Sets the low internal reference divider 2. More...
 
static void CLOCK_HAL_SetLircCmd (MCG_Type *base, bool enable)
 Enables the Low Internal Reference Clock setting. More...
 
static void CLOCK_HAL_SetLircStopCmd (MCG_Type *base, bool enable)
 Sets the Low Internal Reference Clock disabled or not in STOP mode. More...
 
static void CLOCK_HAL_SetHircCmd (MCG_Type *base, bool enable)
 Enable or disable the High Internal Reference Clock setting. More...
 
static void CLOCK_HAL_SetExtRefSelMode0 (MCG_Type *base, osc_src_t select)
 Sets the External Reference Select. More...
 
static mcglite_mcgoutclk_source_t CLOCK_HAL_GetClkSrcStat (MCG_Type *base)
 Gets the Clock Mode Status. More...
 
static bool CLOCK_HAL_IsOscStable (MCG_Type *base)
 Gets the OSC Initialization Status. More...
 

Variables

uint32_t g_xtalRtcClkFreq
 
uint32_t g_xtal0ClkFreq