Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
#include <stdint.h>
#include <stdbool.h>
#include <assert.h>
#include "fsl_device_registers.h"
Functions | |
MCG out clock access API | |
uint32_t | CLOCK_HAL_TestOscFreq (MCG_Type *base, mcg_oscsel_select_t oscselVal) |
Tests the external clock frequency. More... | |
uint32_t | CLOCK_HAL_TestFllExternalRefFreq (MCG_Type *base, uint32_t extFreq, uint8_t frdivVal, osc_range_t range0, mcg_oscsel_select_t oscsel) |
Tests the FLL external reference frequency based on the input parameters. More... | |
uint32_t | CLOCK_HAL_GetFllRefClk (MCG_Type *base) |
Gets the current MCG FLL clock. More... | |
uint32_t | CLOCK_HAL_TestFllFreq (MCG_Type *base, uint32_t fllRef, mcg_dmx32_select_t dmx32, mcg_dco_range_select_t drs) |
Calculates the FLL frequency based on the input parameters. More... | |
uint32_t | CLOCK_HAL_GetFllClk (MCG_Type *base) |
Gets the current MCG FLL clock. More... | |
uint32_t | CLOCK_HAL_GetInternalRefClk (MCG_Type *base) |
Gets the current MCG internal reference clock(MCGIRCLK). More... | |
uint32_t | CLOCK_HAL_GetFixedFreqClk (MCG_Type *base) |
Gets the current MCG fixed frequency clock(MCGFFCLK). More... | |
uint32_t | CLOCK_HAL_GetOutClk (MCG_Type *base) |
Gets the current MCG out clock. More... | |
MCG control register access API | |
static void | CLOCK_HAL_SetClkOutSrc (MCG_Type *base, mcg_clkout_src_t select) |
Sets the Clock Source Select. More... | |
static void | CLOCK_HAL_SetClksFrdivIrefs (MCG_Type *base, mcg_clkout_src_t clks, uint8_t frdiv, mcg_fll_src_t irefs) |
Sets the CLKS, FRDIV, IREFS at the same time. More... | |
static mcg_clkout_stat_t | CLOCK_HAL_GetClkOutStat (MCG_Type *base) |
Gets the Clock Mode Status. More... | |
static void | CLOCK_HAL_SetLowPowerModeCmd (MCG_Type *base, bool enable) |
Sets the Low Power Select. More... | |
void | CLOCK_HAL_PrepareOsc (MCG_Type *base, mcg_oscsel_select_t setting) |
Prepare the OSC external clock. More... | |
MCG FLL API | |
static mcg_fll_src_t | CLOCK_HAL_GetFllSrc (MCG_Type *base) |
Gets the FLL source status. More... | |
static void | CLOCK_HAL_SetFllFilterPreserveCmd (MCG_Type *base, bool enable) |
Sets the FLL Filter Preserve Enable Setting. More... | |
mcg_status_t | CLOCK_HAL_GetAvailableFrdiv (osc_range_t range0, mcg_oscsel_select_t oscsel, uint32_t inputFreq, uint8_t *frdiv) |
Calculates the proper FRDIV setting. More... | |
MCG internal reference clock APIs | |
static void | CLOCK_HAL_SetInternalRefClkEnableCmd (MCG_Type *base, bool enable) |
Sets the internal reference clock enable or not. More... | |
static void | CLOCK_HAL_SetInternalRefClkEnableInStopCmd (MCG_Type *base, bool enable) |
Sets the internal reference clock enable or nor in stop mode. More... | |
static void | CLOCK_HAL_SetInternalRefClkMode (MCG_Type *base, mcg_irc_mode_t mode) |
Sets the Internal Reference Clock Select. More... | |
static mcg_irc_mode_t | CLOCK_HAL_GetInternalRefClkMode (MCG_Type *base) |
Gets the Internal Reference Clock Status. More... | |
void | CLOCK_HAL_UpdateFastClkInternalRefDiv (MCG_Type *base, uint8_t fcrdiv) |
Updates the Fast Clock Internal Reference Divider Setting. More... | |
void | CLOCK_HAL_UpdateInternalRefClk (MCG_Type *base, mcg_irc_mode_t ircs, uint8_t fcrdiv, bool enableInStop) |
Updates the Internal Reference clock (MCGIRCLK) More... | |
MCG OSC APIs | |
void | CLOCK_HAL_SetOsc0Mode (MCG_Type *base, osc_range_t range, osc_gain_t hgo, osc_src_t erefs) |
Sets the OSC0 work mode. More... | |
static bool | CLOCK_HAL_IsOsc0Stable (MCG_Type *base) |
Gets the OSC initialization status. More... | |
void | CLOCK_HAL_EnableOsc0Monitor (MCG_Type *base, mcg_osc_monitor_mode_t mode) |
Enables the OSC0 external clock monitor. More... | |
static void | CLOCK_HAL_DisableOsc0Monitor (MCG_Type *base) |
Disables the OSC0 external clock monitor. More... | |
static bool | CLOCK_HAL_IsOsc0MonitorEnabled (MCG_Type *base) |
Checks the OSC0 external clock monitor is enabled or not. More... | |
static bool | CLOCK_HAL_IsOsc0LostLock (MCG_Type *base) |
Gets the OSC0 Loss of Clock Status. More... | |
static void | CLOCK_HAL_ClearOsc0LostLock (MCG_Type *base) |
Clears the OSC0 Loss of Clock Status. More... | |
MCG Auto Trim Machine (ATM) | |
mcg_atm_error_t | CLOCK_HAL_TrimInternalRefClk (MCG_Type *base, uint32_t extFreq, uint32_t desireFreq, uint32_t *actualFreq, mcg_atm_select_t atms) |
Auto trims the internal reference clock. More... | |
static bool | CLOCK_HAL_IsAutoTrimMachineFailed (MCG_Type *base) |
Gets the Automatic Trim machine Fail Flag. More... | |
static void | CLOCK_HAL_ClearAutoTrimMachineFailed (MCG_Type *base) |
Clears the Automatic Trim machine Fail Flag. More... | |
Variables | |
uint32_t | g_xtal0ClkFreq |
uint32_t | g_xtalRtcClkFreq |
uint32_t | g_fastInternalRefClkFreq |
uint32_t | g_slowInternalRefClkFreq |