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

Overview

The MCUXpresso SDK provides APIs for MCUXpresso SDK devices' clock operation.

The clock driver supports:

Files

file  fsl_clock.h
 

Data Structures

struct  sim_clock_config_t
 SIM configuration structure for clock setting. More...
 
struct  osc_config_t
 OSC Initialization Configuration Structure. More...
 
struct  ics_config_t
 ICS configuration structure. More...
 

Macros

#define ICS_CONFIG_CHECK_PARAM   0U
 Configures whether to check a parameter in a function. More...
 
#define FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL   0
 Configure whether driver controls clock. More...
 
#define UART_CLOCKS
 Clock ip name array for UART. More...
 
#define ADC_CLOCKS
 Clock ip name array for ADC16. More...
 
#define IRQ_CLOCKS
 Clock ip name array for IRQ. More...
 
#define KBI_CLOCKS
 Clock ip name array for KBI. More...
 
#define SPI_CLOCKS
 Clock ip name array for SPI. More...
 
#define I2C_CLOCKS
 Clock ip name array for I2C. More...
 
#define FTM_CLOCKS
 Clock ip name array for FTM. More...
 
#define ACMP_CLOCKS
 Clock ip name array for CMP. More...
 
#define CRC_CLOCKS
 Clock ip name array for CRC. More...
 
#define PWT_CLOCKS
 Clock ip name array for PWT. More...
 
#define PIT_CLOCKS
 Clock ip name array for PIT. More...
 
#define RTC_CLOCKS
 Clock ip name array for RTC. More...
 
#define MSCAN_CLOCKS
 Clock ip name array for MSCAN. More...
 
#define LPO_CLK_FREQ   1000U
 LPO clock frequency.
 

Enumerations

enum  clock_name_t {
  kCLOCK_CoreSysClk,
  kCLOCK_PlatClk,
  kCLOCK_BusClk,
  kCLOCK_FlashClk,
  kCLOCK_Osc0ErClk,
  kCLOCK_ICSFixedFreqClk,
  kCLOCK_ICSInternalRefClk,
  kCLOCK_ICSFllClk,
  kCLOCK_ICSOutClk,
  kCLOCK_TimerClk,
  kCLOCK_LpoClk
}
 Clock name used to get clock frequency. More...
 
enum  clock_ip_name_t
 Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. More...
 
enum  _osc_work_mode {
  kOSC_ModeExt = 0U,
  kOSC_ModeOscLowPower = OSC_CR_OSCOS_MASK,
  kOSC_ModeOscHighGain = OSC_CR_HGO_MASK | OSC_CR_OSCOS_MASK
}
 OSC work mode. More...
 
enum  _osc_enable_mode {
  kOSC_Enable = OSC_CR_OSCEN_MASK,
  kOSC_EnableInStop = OSC_CR_OSCSTEN_MASK
}
 OSC enable mode. More...
 
enum  ics_fll_src_t {
  kICS_FllSrcExternal,
  kICS_FllSrcInternal
}
 ICS FLL reference clock source select. More...
 
enum  ics_clkout_src_t {
  kICS_ClkOutSrcFll,
  kICS_ClkOutSrcInternal,
  kICS_ClkOutSrcExternal
}
 ICSOUT clock source. More...
 
enum  _ics_status {
  kStatus_ICS_ModeUnreachable = MAKE_STATUS(kStatusGroup_ICS, 0),
  kStatus_ICS_SourceUsed = MAKE_STATUS(kStatusGroup_ICS, 1)
}
 ICS status. More...
 
enum  _ics_irclk_enable_mode {
  kICS_IrclkDisable = 0U,
  kICS_IrclkEnable = ICS_C1_IRCLKEN_MASK,
  kICS_IrclkEnableInStop = ICS_C1_IREFSTEN_MASK
}
 ICS internal reference clock (ICSIRCLK) enable mode definition. More...
 
enum  ics_mode_t {
  kICS_ModeFEI = 0U,
  kICS_ModeFBI,
  kICS_ModeBILP,
  kICS_ModeFEE,
  kICS_ModeFBE,
  kICS_ModeBELP,
  kICS_ModeError
}
 ICS mode definitions. More...
 

Functions

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 void CLOCK_SetOutDiv (uint32_t outdiv1, uint32_t outdiv2, uint32_t outdiv3)
 clock divider 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...
 
uint32_t CLOCK_GetBusClkFreq (void)
 Get the bus clock frequency. More...
 
uint32_t CLOCK_GetFlashClkFreq (void)
 Get the flash clock frequency. More...
 
uint32_t CLOCK_GetOsc0ErClkFreq (void)
 Get the OSC0 external reference clock frequency (OSC0ERCLK). More...
 
void CLOCK_SetSimConfig (sim_clock_config_t const *config)
 Set the clock configure in SIM module. More...
 
static void CLOCK_SetSimSafeDivs (void)
 Set the system clock dividers in SIM to safe value. More...
 

Variables

volatile uint32_t g_xtal0Freq
 External XTAL0 (OSC0) clock frequency. More...
 

Driver version

#define FSL_CLOCK_DRIVER_VERSION   (MAKE_VERSION(2, 2, 1))
 CLOCK driver version 2.2.1. More...
 

ICS frequency functions.

uint32_t CLOCK_GetICSOutClkFreq (void)
 Gets the ICS output clock (ICSOUTCLK) frequency. More...
 
uint32_t CLOCK_GetFllFreq (void)
 Gets the ICS FLL clock (ICSFLLCLK) frequency. More...
 
uint32_t CLOCK_GetInternalRefClkFreq (void)
 Gets the ICS internal reference clock (ICSIRCLK) frequency. More...
 
uint32_t CLOCK_GetICSFixedFreqClkFreq (void)
 Gets the ICS fixed frequency clock (ICSFFCLK) frequency. More...
 
uint32_t CLOCK_GetTimerClkFreq (void)
 Gets the Timer(FTM/PWT) clock frequency. More...
 

ICS clock configuration.

static void CLOCK_SetLowPowerEnable (bool enable)
 Enables or disables the ICS low power. More...
 
static void CLOCK_SetInternalRefClkConfig (uint8_t enableMode)
 Configures the Internal Reference clock (ICSIRCLK). More...
 
static void CLOCK_SetFllExtRefDiv (uint8_t rdiv)
 Set the FLL external reference clock divider value. More...
 

ICS clock lock monitor functions.

static void CLOCK_SetOsc0MonitorMode (bool enable)
 Sets the OSC0 clock monitor mode. More...
 

OSC configuration

void CLOCK_InitOsc0 (osc_config_t const *config)
 Initializes the OSC0. More...
 
void CLOCK_DeinitOsc0 (void)
 Deinitializes the OSC0. More...
 

External clock frequency

static void CLOCK_SetXtal0Freq (uint32_t freq)
 Sets the XTAL0 frequency based on board settings. More...
 
static void CLOCK_SetOsc0Enable (uint8_t enable)
 Sets the OSC enable. More...
 

ICS mode functions.

ics_mode_t CLOCK_GetMode (void)
 Gets the current ICS mode. More...
 
status_t CLOCK_SetFeiMode (uint8_t bDiv)
 Sets the ICS to FEI mode. More...
 
status_t CLOCK_SetFeeMode (uint8_t bDiv, uint8_t rDiv)
 Sets the ICS to FEE mode. More...
 
status_t CLOCK_SetFbiMode (uint8_t bDiv)
 Sets the ICS to FBI mode. More...
 
status_t CLOCK_SetFbeMode (uint8_t bDiv, uint8_t rDiv)
 Sets the ICS to FBE mode. More...
 
status_t CLOCK_SetBilpMode (uint8_t bDiv)
 Sets the ICS to BILP mode. More...
 
status_t CLOCK_SetBelpMode (uint8_t bDiv)
 Sets the ICS to BELP mode. More...
 
status_t CLOCK_BootToFeiMode (uint8_t bDiv)
 Sets the ICS to FEI mode during system boot up. More...
 
status_t CLOCK_BootToFeeMode (uint8_t bDiv, uint8_t rDiv)
 Sets the ICS to FEE mode during system bootup. More...
 
status_t CLOCK_BootToBilpMode (uint8_t bDiv)
 Sets the ICS to BILP mode during system boot up. More...
 
status_t CLOCK_BootToBelpMode (uint8_t bDiv)
 Sets the ICS to BELP mode during system boot up. More...
 
status_t CLOCK_SetIcsConfig (ics_config_t const *config)
 Sets the ICS to a target mode. More...
 

Data Structure Documentation

struct sim_clock_config_t

Data Fields

uint8_t outDiv1
 OUTDIV1.
 
uint8_t outDiv2
 OUTDIV2.
 
uint8_t outDiv3
 OUTDIV3.
 
uint8_t busClkPrescaler
 A option prescaler for bus clock.
 
struct osc_config_t

Defines the configuration data structure to initialize the OSC. When porting to a new board, set the following members according to the board setting:

  1. freq: The external frequency.
  2. workMode: The OSC module mode.
  3. enableMode: The OSC enable mode.

Data Fields

uint32_t freq
 External clock frequency. More...
 
uint8_t workMode
 OSC work mode setting. More...
 
uint8_t enableMode
 Configuration for OSCERCLK. More...
 

Field Documentation

uint32_t osc_config_t::freq
uint8_t osc_config_t::workMode
uint8_t osc_config_t::enableMode
struct ics_config_t

When porting to a new board, set the following members according to the board setting:

  1. icsMode: ICS mode
  2. irClkEnableMode: ICSIRCLK enable mode
  3. rDiv: If the FLL uses the external reference clock, set this value to ensure that the external reference clock divided by rDiv is in the 31.25 kHz to 39.0625 kHz range.
  4. bDiv, this divider determine the ISCOUT clock

Data Fields

ics_mode_t icsMode
 ICS mode. More...
 
uint8_t irClkEnableMode
 ICSIRCLK enable mode. More...
 
uint8_t rDiv
 Divider for external reference clock, ICS_C1[RDIV]. More...
 
uint8_t bDiv
 Divider for ICS output clock ICS_C2[BDIV]. More...
 

Field Documentation

ics_mode_t ics_config_t::icsMode
uint8_t ics_config_t::irClkEnableMode
uint8_t ics_config_t::rDiv
uint8_t ics_config_t::bDiv

Macro Definition Documentation

#define ICS_CONFIG_CHECK_PARAM   0U

Some ICS settings must be changed with conditions, for example:

  1. ICSIRCLK settings, such as the source, divider, and the trim value should not change when ICSIRCLK is used as a system clock source.
  2. ICS_C7[OSCSEL] should not be changed when the external reference clock is used as a system clock source. For example, in FBE/BELP/PBE modes.
  3. The users should only switch between the supported clock modes.

ICS functions check the parameter and ICS status before setting, if not allowed to change, the functions return error. The parameter checking increases code size, if code size is a critical requirement, change ICS_CONFIG_CHECK_PARAM to 0 to disable parameter checking.

#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, 2, 1))
#define UART_CLOCKS
Value:
{ \
kCLOCK_Uart0, kCLOCK_Uart1, kCLOCK_Uart2 \
}
#define ADC_CLOCKS
Value:
{ \
kCLOCK_Adc0 \
}
#define IRQ_CLOCKS
Value:
{ \
kCLOCK_Irq0 \
}
#define KBI_CLOCKS
Value:
{ \
kCLOCK_Kbi0, kCLOCK_Kbi1 \
}
#define SPI_CLOCKS
Value:
{ \
kCLOCK_Spi0, kCLOCK_Spi1 \
}
#define I2C_CLOCKS
Value:
{ \
kCLOCK_I2c0, kCLOCK_I2c1 \
}
#define FTM_CLOCKS
Value:
{ \
kCLOCK_Ftm0, kCLOCK_Ftm1, kCLOCK_Ftm2 \
}
#define ACMP_CLOCKS
Value:
{ \
kCLOCK_Acmp0, kCLOCK_Acmp1 \
}
#define CRC_CLOCKS
Value:
{ \
kCLOCK_Crc0, \
}
#define PWT_CLOCKS
Value:
{ \
kCLOCK_Pwt0, \
}
#define PIT_CLOCKS
Value:
{ \
kCLOCK_Pit0, \
}
#define RTC_CLOCKS
Value:
{ \
kCLOCK_Rtc0, \
}
#define MSCAN_CLOCKS
Value:
{ \
kCLOCK_Mscan0, \
}

Enumeration Type Documentation

Enumerator
kCLOCK_CoreSysClk 

Core/system clock.

kCLOCK_PlatClk 

Platform clock.

kCLOCK_BusClk 

Bus clock.

kCLOCK_FlashClk 

Flash clock.

kCLOCK_Osc0ErClk 

OSC0 external reference clock (OSC0ERCLK)

kCLOCK_ICSFixedFreqClk 

ICS fixed frequency clock (ICSFFCLK)

kCLOCK_ICSInternalRefClk 

ICS internal reference clock (ICSIRCLK)

kCLOCK_ICSFllClk 

ICSFLLCLK.

kCLOCK_ICSOutClk 

ICS Output clock.

kCLOCK_TimerClk 

TIMER clock for FTM and PWT.

kCLOCK_LpoClk 

LPO clock.

Enumerator
kOSC_ModeExt 

OSC source from external clock.

kOSC_ModeOscLowPower 

Oscillator low freq low power.

kOSC_ModeOscHighGain 

Oscillator low freq high gain.

Enumerator
kOSC_Enable 

Enable.

kOSC_EnableInStop 

Enable in stop mode.

Enumerator
kICS_FllSrcExternal 

External reference clock is selected.

kICS_FllSrcInternal 

The slow internal reference clock is selected.

Enumerator
kICS_ClkOutSrcFll 

Output of the FLL is selected (reset default)

kICS_ClkOutSrcInternal 

Internal reference clock is selected, FLL is bypassed.

kICS_ClkOutSrcExternal 

External reference clock is selected, FLL is bypassed.

Enumerator
kStatus_ICS_ModeUnreachable 

Can't switch to target mode.

kStatus_ICS_SourceUsed 

Can't change the clock source because it is in use.

Enumerator
kICS_IrclkDisable 

ICSIRCLK disable.

kICS_IrclkEnable 

ICSIRCLK enable.

kICS_IrclkEnableInStop 

ICSIRCLK enable in stop mode.

enum ics_mode_t
Enumerator
kICS_ModeFEI 

FEI - FLL Engaged Internal.

kICS_ModeFBI 

FBI - FLL Bypassed Internal.

kICS_ModeBILP 

BILP - Bypassed Low Power Internal.

kICS_ModeFEE 

FEE - FLL Engaged External.

kICS_ModeFBE 

FBE - FLL Bypassed External.

kICS_ModeBELP 

BELP - Bypassed Low Power External.

kICS_ModeError 

Unknown mode.

Function Documentation

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 void CLOCK_SetOutDiv ( uint32_t  outdiv1,
uint32_t  outdiv2,
uint32_t  outdiv3 
)
inlinestatic

Set the SIM_CLKDIV[OUTDIV1], SIM_CLKDIV[OUTDIV2], SIM_CLKDIV[OUTDIV3]. Carefully configure the OUTDIV1 and OUTDIV2 to avoid bus clock frequency higher than 24MHZ.

Parameters
outdiv1Clock 1 output divider value.
outdiv2Clock 2 output divider value.
outdiv3Clock 3 output divider value.
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 ICS 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.
uint32_t CLOCK_GetBusClkFreq ( void  )
Returns
Clock frequency in Hz.
uint32_t CLOCK_GetFlashClkFreq ( void  )
Returns
Clock frequency in Hz.
uint32_t CLOCK_GetOsc0ErClkFreq ( void  )
Returns
Clock frequency in Hz.
void CLOCK_SetSimConfig ( sim_clock_config_t const *  config)

This function sets system layer clock settings in SIM module.

Parameters
configPointer to the configure structure.
static void CLOCK_SetSimSafeDivs ( void  )
inlinestatic

The system level clocks (core clock, bus clock, and flash clock) must be in allowed ranges. During ICS clock mode switch, the ICS output clock changes then the system level clocks may be out of range. This function could be used before ICS mode change, to make sure system level clocks are in allowed range.

uint32_t CLOCK_GetICSOutClkFreq ( void  )

This function gets the ICS output clock frequency in Hz based on the current ICS register value.

Returns
The frequency of ICSOUTCLK.
uint32_t CLOCK_GetFllFreq ( void  )

This function gets the ICS FLL clock frequency in Hz based on the current ICS register value. The FLL is enabled in FEI/FBI/FEE/FBE mode and disabled in low power state in other modes.

Returns
The frequency of ICSFLLCLK.
uint32_t CLOCK_GetInternalRefClkFreq ( void  )

This function gets the ICS internal reference clock frequency in Hz based on the current ICS register value.

Returns
The frequency of ICSIRCLK.
uint32_t CLOCK_GetICSFixedFreqClkFreq ( void  )

This function gets the ICS fixed frequency clock frequency in Hz based on the current ICS register value.

Returns
The frequency of ICSFFCLK.
uint32_t CLOCK_GetTimerClkFreq ( void  )

This function gets the Timer clock frequency in Hz based on the current ICSOUTCLK.

Returns
The frequency of Timer(FTM/PWT) clock.
static void CLOCK_SetLowPowerEnable ( bool  enable)
inlinestatic

Enabling the ICS low power disables the PLL and FLL in bypass modes. In other words, in FBE and PBE modes, enabling low power sets the ICS to BELP mode. In FBI and PBI modes, enabling low power sets the ICS to BILP mode. When disabling the ICS low power, the PLL or FLL are enabled based on ICS settings.

Parameters
enableTrue to enable ICS low power, false to disable ICS low power.
static void CLOCK_SetInternalRefClkConfig ( uint8_t  enableMode)
inlinestatic

This function sets the ICSIRCLK base on parameters. This function also sets whether the ICSIRCLK is enabled in stop mode.

Parameters
enableModeICSIRCLK enable mode, OR'ed value of _ics_irclk_enable_mode.
static void CLOCK_SetFllExtRefDiv ( uint8_t  rdiv)
inlinestatic

Sets the FLL external reference clock divider value, the register ICS_C1[RDIV]. Resulting frequency must be in the range 31.25KHZ to 39.0625KHZ.

Parameters
rdivThe FLL external reference clock divider value, ICS_C1[RDIV].
static void CLOCK_SetOsc0MonitorMode ( bool  enable)
inlinestatic

This function sets the OSC0 clock monitor mode.

Parameters
enabletrue to enable clock monitor, false to disable clock monitor.
void CLOCK_InitOsc0 ( osc_config_t const *  config)

This function initializes the OSC0 according to the board configuration.

Parameters
configPointer to the OSC0 configuration structure.
void CLOCK_DeinitOsc0 ( void  )

This function deinitializes the OSC0.

static void CLOCK_SetXtal0Freq ( uint32_t  freq)
inlinestatic
Parameters
freqThe XTAL0/EXTAL0 input clock frequency in Hz.
static void CLOCK_SetOsc0Enable ( uint8_t  enable)
inlinestatic
Parameters
enableosc enable mode.
ics_mode_t CLOCK_GetMode ( void  )

This function checks the ICS registers and determines the current ICS mode.

Returns
Current ICS mode or error code; See ics_mode_t.
status_t CLOCK_SetFeiMode ( uint8_t  bDiv)

This function sets the ICS to FEI mode. If setting to FEI mode fails from the current mode, this function returns an error.

Parameters
bDivbus clock divider
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_SetFeeMode ( uint8_t  bDiv,
uint8_t  rDiv 
)

This function sets the ICS to FEE mode. If setting to FEE mode fails from the current mode, this function returns an error.

Parameters
bDivbus clock divider
rDivFLL reference clock divider setting, RDIV.
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_SetFbiMode ( uint8_t  bDiv)

This function sets the ICS to FBI mode. If setting to FBI mode fails from the current mode, this function returns an error.

Parameters
bDivbus clock divider
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_SetFbeMode ( uint8_t  bDiv,
uint8_t  rDiv 
)

This function sets the ICS to FBE mode. If setting to FBE mode fails from the current mode, this function returns an error.

Parameters
bDivbus clock divider
rDivFLL reference clock divider setting, RDIV.
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_SetBilpMode ( uint8_t  bDiv)

This function sets the ICS to BILP mode. If setting to BILP mode fails from the current mode, this function returns an error.

Parameters
bDivbus clock divider
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_SetBelpMode ( uint8_t  bDiv)

This function sets the ICS to BELP mode. If setting to BELP mode fails from the current mode, this function returns an error.

Parameters
bDivbus clock divider
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_BootToFeiMode ( uint8_t  bDiv)

This function sets the ICS to FEI mode from the reset mode. It can also be used to set up ICS during system boot up.

Parameters
bDivbus clock divider.
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_BootToFeeMode ( uint8_t  bDiv,
uint8_t  rDiv 
)

This function sets ICS to FEE mode from the reset mode. It can also be used to set up the ICS during system boot up.

Parameters
bDivbus clock divider.
rDivFLL reference clock divider setting, RDIV.
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_BootToBilpMode ( uint8_t  bDiv)

This function sets the ICS to BILP mode from the reset mode. It can also be used to set up the ICS during system boot up.

Parameters
bDivbus clock divider.
Return values
kStatus_ICS_SourceUsedCould not change ICSIRCLK setting.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_BootToBelpMode ( uint8_t  bDiv)

This function sets the ICS to BELP mode from the reset mode. It can also be used to set up the ICS during system boot up.

Parameters
bDivbus clock divider.
Return values
kStatus_ICS_ModeUnreachableCould not switch to the target mode.
kStatus_SuccessSwitched to the target mode successfully.
status_t CLOCK_SetIcsConfig ( ics_config_t const *  config)

This function sets ICS to a target mode defined by the configuration structure. If switching to the target mode fails, this function chooses the correct path.

Parameters
configPointer to the target ICS mode configuration structure.
Returns
Return kStatus_Success if switched successfully; Otherwise, it returns an error code _ics_status.
Note
If the external clock is used in the target mode, ensure that it is enabled. For example, if the OSC0 is used, set up OSC0 correctly before calling this function.

Variable Documentation

volatile uint32_t g_xtal0Freq

The XTAL0/EXTAL0 (OSC0) clock frequency in Hz. When the clock is set up, use the function CLOCK_SetXtal0Freq to set the value in the clock driver. For example, if XTAL0 is 8 MHz:

* CLOCK_SetXtal0Freq(80000000);
*

This is important for the multicore platforms where only one core needs to set up the OSC0 using the CLOCK_InitOsc0. All other cores need to call the CLOCK_SetXtal0Freq to get a valid clock frequency.