MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
CLOCK: Clock Driver

Overview

Macros

#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL   0
 Configure whether driver controls clock. More...
 
#define FSL_CLOCK_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))
 CLOCK driver version. More...
 

Enumerations

enum  clock_name_t { kCLOCK_CoreSysClk }
 Clock name used to get clock frequency. More...
 
enum  clock_ip_name_t {
  kCLOCK_Timer = E_PN76_PCRM_TIMERS_CLK,
  kCLOCK_Crc = E_PN76_PCRM_CRC_CLK,
  kCLOCK_Rng = E_PN76_PCRM_RNG_CLK,
  kCLOCK_Hostif = E_PN76_PCRM_HOSTIF_CLK,
  kCLOCK_Usb = E_PN76_PCRM_USB_CLK,
  kCLOCK_IpInvalid
}
 Peripheral clock name difinition used for clock gate. More...
 
enum  clock_usb_pll_src_t {
  kCLOCK_UsbPllSrcXtal = 0,
  kCLOCK_UsbPllSrcClifPll
}
 Enum for selection of the USB PLL reference clock. More...
 

Functions

static void CLOCK_InitClockGeneration (void)
 Performs Clock Module Initialization. More...
 
uint32_t CLOCK_GetFreq (clock_name_t clockName)
 Gets the clock frequency for a specific clock name. More...
 
uint32_t CLOCK_GetCoreSysClkFreq (void)
 Get the core clock or system clock frequency. More...
 
static void CLOCK_EnableClock (clock_ip_name_t name)
 Enable the clock for specific IP. More...
 
static void CLOCK_DisableClock (clock_ip_name_t name)
 Disable the clock for specific IP. More...
 
static status_t CLOCK_SetUsbPllSource (clock_usb_pll_src_t source)
 Select the USB PLL Reference Clock Source. More...
 
static status_t CLOCK_StartUsbPll (void)
 This function enables the USB PLL and returns after the PLL is Locked. More...
 
status_t CLOCK_InitOsc (void)
 Start the Crystal oscillator (XTAL). More...
 
static void CLOCK_SwitchSystemClockToHfo (void)
 Switch system clock and CLIF clock to HFO. More...
 

Macro Definition Documentation

#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL   0

When set to 0, peripheral drivers will enable clock in initialize function and disable clock in de-initialize function. When set to 1, peripheral driver will not control the clock, application could control the clock out of the driver.

Note
All drivers share this feature switcher. If it is set to 1, application should handle clock enable and disable for all drivers.
#define FSL_CLOCK_DRIVER_VERSION   (MAKE_VERSION(2, 0, 1))

Enumeration Type Documentation

Enumerator
kCLOCK_CoreSysClk 

Core/system clock.

Enumerator
kCLOCK_Timer 

TIMER CLOCK.

kCLOCK_Crc 

CRC CLOCK.

kCLOCK_Rng 

RNG CLOCK.

kCLOCK_Hostif 

HOST IF CLOCK.

kCLOCK_Usb 

USB IP CLOCK.

kCLOCK_IpInvalid 

Invalid IP clock.

Enumerator
kCLOCK_UsbPllSrcXtal 

27.12MHz XTAL clock

kCLOCK_UsbPllSrcClifPll 

27.12MHz CLIF PLL clock

Function Documentation

static void CLOCK_InitClockGeneration ( void  )
inlinestatic

This function initialize XTAL, SYSTEM CLK (HFO) and also configures the clock to the CLIF Module as SYSTEM Clock till PLL is available/locked.

uint32_t CLOCK_GetFreq ( clock_name_t  clockName)

This function checks the current clock configurations and then calculates the clock frequency for a specific clock name defined in clock_name_t. The MCG must be properly configured before using this function.

Parameters
clockNameClock names defined in clock_name_t
Returns
Clock frequency value in Hertz
uint32_t CLOCK_GetCoreSysClkFreq ( void  )
Returns
Clock frequency in Hz.
static void CLOCK_EnableClock ( clock_ip_name_t  name)
inlinestatic
Parameters
nameWhich clock to enable, see clock_ip_name_t.
static void CLOCK_DisableClock ( clock_ip_name_t  name)
inlinestatic
Parameters
nameWhich clock to disable, see clock_ip_name_t.
static status_t CLOCK_SetUsbPllSource ( clock_usb_pll_src_t  source)
inlinestatic
Parameters
sourceClock source for the USB PLL Reference Clock clock_usb_pll_src_t.
Return values
kStatus_SuccessOperation Successful
kStatus_InvalidArgumentInvalid parameter
static status_t CLOCK_StartUsbPll ( void  )
inlinestatic
Note
Pre-Requisite for this function is that USB PLL reference clock source should be selected and running.
Return values
kStatus_SuccessOperation Successful
kStatus_TimeoutOperation failed.
status_t CLOCK_InitOsc ( void  )
Note
This function should only be used when XTAL is used as the CLIF Clock source.
Returns
Returns kStatus_Success if succeed, otherwise returns kStatus_Fail.
static void CLOCK_SwitchSystemClockToHfo ( void  )
inlinestatic

This function is used to initialize the System clock to HFO and revert the CLIF Clock from XTAL/PLL to HFO before entering Standby/ULP Standby.