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.

Files

file  fsl_clock.h
 

Data Structures

struct  clock_sys_pll_config_t
 PLL configuration for SYSPLL. More...
 
struct  clock_audio_pll_config_t
 PLL configuration for SYSPLL. More...
 
struct  clock_frg_clk_config_t
 PLL configuration for FRG. More...
 

Macros

#define CMP_CLOCKS
 Clock ip name array for ACMP. More...
 
#define FLEXCOMM_CLOCKS
 Clock ip name array for FLEXCOMM. More...
 
#define USART_CLOCKS
 Clock ip name array for LPUART. More...
 
#define I2C_CLOCKS
 Clock ip name array for I2C. More...
 
#define I3C_CLOCKS
 Clock ip name array for I3C. More...
 
#define SPI_CLOCKS
 Clock ip name array for SPI. More...
 
#define FLEXI2S_CLOCKS
 Clock ip name array for FLEXI2S. More...
 
#define UTICK_CLOCKS
 Clock ip name array for UTICK. More...
 
#define DMIC_CLOCKS
 Clock ip name array for DMIC. More...
 
#define CTIMER_CLOCKS
 Clock ip name array for CT32B. More...
 
#define GPIO_CLOCKS
 Clock ip name array for GPIO. More...
 
#define LPADC_CLOCKS
 Clock ip name array for ADC. More...
 
#define MRT_CLOCKS
 Clock ip name array for MRT. More...
 
#define SCT_CLOCKS
 Clock ip name array for SCT. More...
 
#define RTC_CLOCKS
 Clock ip name array for RTC. More...
 
#define WWDT_CLOCKS
 Clock ip name array for WWDT. More...
 
#define CRC_CLOCKS
 Clock ip name array for CRC. More...
 
#define USBD_CLOCKS
 Clock ip name array for USBD. More...
 
#define DMA_CLOCKS
 Clock ip name array for DMA. More...
 
#define PINT_CLOCKS
 Clock ip name array for PINT. More...
 
#define QSPI_CLOCKS
 Clock ip name array for QSPI.
 
#define MU_CLOCKS
 Clock ip name array for MUA.
 
#define SEMA42_CLOCKS
 Clock ip name array for SEMA.
 
#define TRNG_CLOCKS
 Clock ip name array for RNG.
 
#define USDHC_CLOCKS
 Clock ip name array for uSDHC.
 
#define OSTIMER_CLOCKS
 Clock ip name array for OSTimer.
 
#define CLK_GATE_REG_OFFSET_SHIFT   8U
 Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. More...
 
#define SYSPLL0CLKSEL_OFFSET   0x200
 Clock Mux Switches The encoding is as follows each connection identified is 32bits wide starting from LSB upwards. More...
 

Enumerations

enum  clock_ip_name_t
 Clock gate name used for CLOCK_EnableClock/CLOCK_DisableClock. More...
 
enum  clock_name_t {
  kCLOCK_CoreSysClk,
  kCLOCK_BusClk,
  kCLOCK_MclkClk,
  kCLOCK_ClockOuClk,
  kCLOCK_AdcClk,
  kCLOCK_QspiClk,
  kCLOCK_SctClk,
  kCLOCK_Wdt0Clk,
  kCLOCK_Wdt1Clk,
  kCLOCK_SystickClk,
  kCLOCK_Sdio0Clk,
  kCLOCK_I3cClk,
  kCLOCK_UsbClk,
  kCLOCK_DmicClk,
  kCLOCK_DspCpuClk,
  kCLOCK_AcmpClk,
  kCLOCK_Flexcomm0,
  kCLOCK_Flexcomm1,
  kCLOCK_Flexcomm2,
  kCLOCK_Flexcomm3,
  kCLOCK_Flexcomm4,
  kCLOCK_Flexcomm5,
  kCLOCK_Flexcomm14,
  kCLOCK_Flexcomm15
}
 Clock name used to get clock frequency. More...
 
enum  clock_pfd_t {
  kCLOCK_Pfd0 = 0U,
  kCLOCK_Pfd1 = 1U,
  kCLOCK_Pfd2 = 2U,
  kCLOCK_Pfd3 = 3U
}
 

Functions

void CLOCK_AttachClk (clock_attach_id_t connection)
 Configure the clock selection muxes. More...
 
void CLOCK_SetClkDiv (clock_div_name_t div_name, uint32_t divider)
 Setup peripheral clock dividers. More...
 
uint32_t CLOCK_GetFreq (clock_name_t clockName)
 Return Frequency of selected clock. More...
 
uint32_t CLOCK_GetFRGClock (uint32_t id)
 Return Input frequency for the Fractional baud rate generator. More...
 
void CLOCK_SetFRGClock (const clock_frg_clk_config_t *config)
 Set output of the Fractional baud rate generator. More...
 
static uint32_t CLOCK_GetSFroFreq (void)
 Return Frequency of FRO 16MHz. More...
 
uint32_t CLOCK_GetSysPllFreq (void)
 Return Frequency of SYSPLL. More...
 
uint32_t CLOCK_GetSysPfdFreq (clock_pfd_t pfd)
 Get current output frequency of specific System PLL PFD. More...
 
uint32_t CLOCK_GetAudioPllFreq (void)
 Return Frequency of AUDIO PLL. More...
 
uint32_t CLOCK_GetAudioPfdFreq (clock_pfd_t pfd)
 Get current output frequency of specific Audio PLL PFD. More...
 
static uint32_t CLOCK_GetFFroFreq (void)
 Return Frequency of High-Freq output of FRO. More...
 
uint32_t CLOCK_GetMainClkFreq (void)
 Return Frequency of main clk. More...
 
uint32_t CLOCK_GetDspMainClkFreq (void)
 Return Frequency of DSP main clk. More...
 
uint32_t CLOCK_GetAcmpClkFreq (void)
 Return Frequency of ACMP clk. More...
 
uint32_t CLOCK_GetDmicClkFreq (void)
 Return Frequency of DMIC clk. More...
 
uint32_t CLOCK_GetUsbClkFreq (void)
 Return Frequency of USB clk. More...
 
uint32_t CLOCK_GetSdioClkFreq (void)
 Return Frequency of SDIO clk. More...
 
uint32_t CLOCK_GetI3cClkFreq (void)
 Return Frequency of I3C clk. More...
 
uint32_t CLOCK_GetSystickClkFreq (void)
 Return Frequency of systick clk. More...
 
uint32_t CLOCK_GetWdtClkFreq (uint32_t id)
 Return Frequency of WDT clk. More...
 
uint32_t CLOCK_GetMclkClkFreq (void)
 Return Frequency of mclk. More...
 
uint32_t CLOCK_GetSctClkFreq (void)
 Return Frequency of sct. More...
 
void CLOCK_EnableSysOscClk (bool enable, uint32_t delay_us)
 Enable/Disable sys osc clock from external crystal clock. More...
 
static uint32_t CLOCK_GetXtalInClkFreq (void)
 Return Frequency of sys osc Clock. More...
 
static uint32_t CLOCK_GetLpOscFreq (void)
 Return Frequency of Lower power osc. More...
 
static uint32_t CLOCK_GetOsc32KFreq (void)
 Return Frequency of 32kHz osc. More...
 
static void CLOCK_EnableOsc32K (bool enable)
 Enables and disables 32kHz osc. More...
 
static uint32_t CLOCK_GetWakeClk32KFreq (void)
 Return Frequency of 32khz wake clk. More...
 
static void CLOCK_SetXtalFreq (uint32_t freq)
 Set the XTALIN (system OSC) frequency based on board setting. More...
 
static void CLOCK_SetMclkInFreq (uint32_t freq)
 Set the MCLK in (mclk_in) clock frequency based on pin drive. More...
 
uint32_t CLOCK_GetMclkInClkFreq (void)
 brief Return Frequency of mclk_in return Frequency of mclk clk Note The pin need associated with MCLK function.
 
uint32_t CLOCK_GetFlexCommClkFreq (uint32_t id)
 Return Frequency of Flexcomm functional Clock. More...
 
uint32_t CLOCK_GetCtimerClkFreq (uint32_t id)
 Return Frequency of Ctimer Clock. More...
 
uint32_t CLOCK_GetClockOutClkFreq (void)
 Return Frequency of ClockOut. More...
 
uint32_t CLOCK_GetAdcClkFreq (void)
 Return Frequency of Adc Clock. More...
 
uint32_t CLOCK_GetQspiClkFreq (void)
 Return Frequency of QSPI Clock. More...
 
void CLOCK_InitSysPll (const clock_sys_pll_config_t *config)
 Initialize the System PLL. More...
 
static void CLOCK_DeinitSysPll (void)
 brief Deinit the System PLL. More...
 
void CLOCK_InitSysPfd (clock_pfd_t pfd, uint8_t divider)
 Initialize the System PLL PFD. More...
 
static void CLOCK_DeinitSysPfd (clock_pfd_t pfd)
 brief Disable the audio PLL PFD. More...
 
void CLOCK_InitAudioPll (const clock_audio_pll_config_t *config)
 Initialize the audio PLL. More...
 
static void CLOCK_DeinitAudioPll (void)
 brief Deinit the Audio PLL. More...
 
void CLOCK_InitAudioPfd (clock_pfd_t pfd, uint8_t divider)
 Initialize the audio PLL PFD. More...
 
static void CLOCK_DeinitAudioPfd (uint32_t pfd)
 brief Disable the audio PLL PFD. More...
 
void CLOCK_EnableUsbhsDeviceClock (void)
 Enable USB HS device PLL clock. More...
 
void CLOCK_EnableUsbhsHostClock (void)
 Enable USB HS host PLL clock. More...
 
void CLOCK_EnableUsbhsPhyClock (void)
 Enable USB HS PHY PLL clock. More...
 
void SDK_DelayAtLeastUs (uint32_t delay_us)
 Use DWT to delay at least for some time. More...
 

Variables

volatile uint32_t g_xtalFreq
 External XTAL (SYSOSC) clock frequency. More...
 
volatile uint32_t g_MclkInFreq
 External XTAL (SYSOSC) clock frequency. More...
 

Driver version

#define FSL_CLOCK_DRIVER_VERSION   (MAKE_VERSION(2, 3, 0))
 CLOCK driver version 2.3.0. More...
 

Data Structure Documentation

struct clock_sys_pll_config_t

Public Types

enum  {
  kCLOCK_SysPllSFroClk = 0,
  kCLOCK_SysPllXtalIn,
  kCLOCK_SysPllFFroDiv2
}
 

Data Fields

uint32_t numerator
 30 bit numerator of fractional loop divider. More...
 
uint32_t denominator
 30 bit numerator of fractional loop divider. More...
 

Member Enumeration Documentation

anonymous enum
Enumerator
kCLOCK_SysPllSFroClk 

16MHz FRO clock

kCLOCK_SysPllXtalIn 

OSC clock.

kCLOCK_SysPllFFroDiv2 

FRO48/60 clock.

Field Documentation

uint32_t clock_sys_pll_config_t::numerator
uint32_t clock_sys_pll_config_t::denominator
struct clock_audio_pll_config_t

Public Types

enum  {
  kCLOCK_AudioPllSFroClk = 0,
  kCLOCK_AudioPllXtalIn,
  kCLOCK_AudioPllFFroDiv2
}
 

Data Fields

uint32_t numerator
 30 bit numerator of fractional loop divider. More...
 
uint32_t denominator
 30 bit numerator of fractional loop divider. More...
 
uint8_t mult
 PLL loop divider. More...
 

Member Enumeration Documentation

anonymous enum
Enumerator
kCLOCK_AudioPllSFroClk 

16MHz FRO clock

kCLOCK_AudioPllXtalIn 

OSC clock.

kCLOCK_AudioPllFFroDiv2 

FRO48/60 clock.

Field Documentation

uint32_t clock_audio_pll_config_t::numerator
uint32_t clock_audio_pll_config_t::denominator
uint8_t clock_audio_pll_config_t::mult
struct clock_frg_clk_config_t

Public Types

enum  {
  kCLOCK_FrgMainClk = 0,
  kCLOCK_FrgPllDiv,
  kCLOCK_FrgSFro,
  kCLOCK_FrgFFro
}
 

Data Fields

uint8_t num
 FRG clock.
 
uint8_t divider
 PLL loop divider. More...
 
uint8_t mult
 PLL loop divider. More...
 

Member Enumeration Documentation

anonymous enum
Enumerator
kCLOCK_FrgMainClk 

Main System clock.

kCLOCK_FrgPllDiv 

Main pll clock divider.

kCLOCK_FrgSFro 

16MHz FRO

kCLOCK_FrgFFro 

FRO48/60.

Field Documentation

uint8_t clock_frg_clk_config_t::divider
uint8_t clock_frg_clk_config_t::mult

Macro Definition Documentation

#define FSL_CLOCK_DRIVER_VERSION   (MAKE_VERSION(2, 3, 0))
#define CMP_CLOCKS
Value:
{ \
kCLOCK_Acmp0 \
}
#define FLEXCOMM_CLOCKS
Value:
{ \
kCLOCK_FlexComm0, kCLOCK_FlexComm1, kCLOCK_FlexComm2, kCLOCK_FlexComm3, kCLOCK_FlexComm4, kCLOCK_FlexComm5, \
kCLOCK_FlexComm14, kCLOCK_FlexComm15 \
}
#define USART_CLOCKS
Value:
{ \
kCLOCK_Usart0, kCLOCK_Usart1, kCLOCK_Usart2, kCLOCK_Usart3, kCLOCK_Usart4, kCLOCK_Usart5 \
}
#define I2C_CLOCKS
Value:
{ \
kCLOCK_I2c0, kCLOCK_I2c1, kCLOCK_I2c2, kCLOCK_I2c3, kCLOCK_I2c4, kCLOCK_I2c5, kCLOCK_I2c15 \
}
#define I3C_CLOCKS
Value:
{ \
kCLOCK_I3c \
}
#define SPI_CLOCKS
Value:
{ \
kCLOCK_Spi0, kCLOCK_Spi1, kCLOCK_Spi2, kCLOCK_Spi3, kCLOCK_Spi4, kCLOCK_Spi5, kCLOCK_Spi14 \
}
#define FLEXI2S_CLOCKS
Value:
{ \
kCLOCK_FlexI2s0, kCLOCK_FlexI2s1, kCLOCK_FlexI2s2, kCLOCK_FlexI2s3, kCLOCK_FlexI2s4, kCLOCK_FlexI2s5 \
}
#define UTICK_CLOCKS
Value:
{ \
kCLOCK_Utick0 \
}
#define DMIC_CLOCKS
Value:
{ \
kCLOCK_Dmic0 \
}
#define CTIMER_CLOCKS
Value:
{ \
kCLOCK_Ct32b0, kCLOCK_Ct32b1, kCLOCK_Ct32b2, kCLOCK_Ct32b3, kCLOCK_Ct32b4 \
}
#define GPIO_CLOCKS
Value:
{ \
kCLOCK_HsGpio0, kCLOCK_HsGpio1, kCLOCK_HsGpio2, kCLOCK_HsGpio3, kCLOCK_HsGpio4, kCLOCK_HsGpio5, \
kCLOCK_HsGpio6, kCLOCK_HsGpio7 \
}
#define LPADC_CLOCKS
Value:
{ \
kCLOCK_Adc0 \
}
#define MRT_CLOCKS
Value:
{ \
kCLOCK_Mrt0 \
}
#define SCT_CLOCKS
Value:
{ \
kCLOCK_Sct \
}
#define RTC_CLOCKS
Value:
{ \
kCLOCK_Rtc \
}
#define WWDT_CLOCKS
Value:
{ \
kCLOCK_Wwdt0, kCLOCK_Wwdt1 \
}
#define CRC_CLOCKS
Value:
{ \
kCLOCK_Crc \
}
#define USBD_CLOCKS
Value:
{ \
kCLOCK_UsbhsDevice \
}
#define DMA_CLOCKS
Value:
{ \
kCLOCK_Dmac0, kCLOCK_Dmac1 \
}
#define PINT_CLOCKS
Value:
{ \
kCLOCK_Pint \
}
#define CLK_GATE_REG_OFFSET_SHIFT   8U
#define SYSPLL0CLKSEL_OFFSET   0x200

[12 bits for reg offset, 0 means end of descriptor, 4 bits for choice] [bit 31 define CLKCTL0 or CLKCTL1]*

Enumeration Type Documentation

Enumerator
kCLOCK_CoreSysClk 

Core clock (aka HCLK)

kCLOCK_BusClk 

Bus clock (AHB/APB clock, aka HCLK)

kCLOCK_MclkClk 

MCLK, to MCLK pin.

kCLOCK_ClockOuClk 

CLOCKOUT.

kCLOCK_AdcClk 

ADC.

kCLOCK_QspiClk 

QSPI.

kCLOCK_SctClk 

SCT.

kCLOCK_Wdt0Clk 

Watchdog0.

kCLOCK_Wdt1Clk 

Watchdog1.

kCLOCK_SystickClk 

Systick.

kCLOCK_Sdio0Clk 

SDIO0.

kCLOCK_I3cClk 

I3C.

kCLOCK_UsbClk 

USB0.

kCLOCK_DmicClk 

Digital Mic clock.

kCLOCK_DspCpuClk 

DSP clock.

kCLOCK_AcmpClk 

Acmp clock.

kCLOCK_Flexcomm0 

Flexcomm0Clock.

kCLOCK_Flexcomm1 

Flexcomm1Clock.

kCLOCK_Flexcomm2 

Flexcomm2Clock.

kCLOCK_Flexcomm3 

Flexcomm3Clock.

kCLOCK_Flexcomm4 

Flexcomm4Clock.

kCLOCK_Flexcomm5 

Flexcomm5Clock.

kCLOCK_Flexcomm14 

Flexcomm14Clock.

kCLOCK_Flexcomm15 

Flexcomm15Clock.

PLL PFD clock name

Enumerator
kCLOCK_Pfd0 

PLL PFD0.

kCLOCK_Pfd1 

PLL PFD1.

kCLOCK_Pfd2 

PLL PFD2.

kCLOCK_Pfd3 

PLL PFD3.

Function Documentation

void CLOCK_AttachClk ( clock_attach_id_t  connection)
Parameters
connection: Clock to be configured.
Returns
Nothing
void CLOCK_SetClkDiv ( clock_div_name_t  div_name,
uint32_t  divider 
)
Parameters
div_name: Clock divider name
divider: Value to be divided.
Returns
Nothing
uint32_t CLOCK_GetFreq ( clock_name_t  clockName)
Returns
Frequency of selected clock
uint32_t CLOCK_GetFRGClock ( uint32_t  id)
Returns
Input Frequency for FRG
void CLOCK_SetFRGClock ( const clock_frg_clk_config_t config)
Parameters
config: Configuration to set to FRGn clock.
static uint32_t CLOCK_GetSFroFreq ( void  )
inlinestatic
Returns
Frequency of FRO 12MHz
uint32_t CLOCK_GetSysPllFreq ( void  )
Returns
Frequency of SYSPLL
uint32_t CLOCK_GetSysPfdFreq ( clock_pfd_t  pfd)
Parameters
pfd: pfd name to get frequency.
Returns
Frequency of SYSPLL PFD.
uint32_t CLOCK_GetAudioPllFreq ( void  )
Returns
Frequency of AUDIO PLL
uint32_t CLOCK_GetAudioPfdFreq ( clock_pfd_t  pfd)
Parameters
pfd: pfd name to get frequency.
Returns
Frequency of AUDIO PLL PFD.
static uint32_t CLOCK_GetFFroFreq ( void  )
inlinestatic
Returns
Frequency of High-Freq output of FRO
uint32_t CLOCK_GetMainClkFreq ( void  )
Returns
Frequency of main clk
uint32_t CLOCK_GetDspMainClkFreq ( void  )
Returns
Frequency of DSP main clk
uint32_t CLOCK_GetAcmpClkFreq ( void  )
Returns
Frequency of ACMP clk
uint32_t CLOCK_GetDmicClkFreq ( void  )
Returns
Frequency of DMIC clk
uint32_t CLOCK_GetUsbClkFreq ( void  )
Returns
Frequency of USB clk
uint32_t CLOCK_GetSdioClkFreq ( void  )
Parameters
sel: clock source select
divider: clock divider
Returns
Frequency of SDIO clk
uint32_t CLOCK_GetI3cClkFreq ( void  )
Returns
Frequency of I3C clk
uint32_t CLOCK_GetSystickClkFreq ( void  )
Returns
Frequency of systick clk
uint32_t CLOCK_GetWdtClkFreq ( uint32_t  id)
Parameters
id: WDT index to get frequency.
Returns
Frequency of WDT clk
uint32_t CLOCK_GetMclkClkFreq ( void  )
Returns
Frequency of mclk clk
uint32_t CLOCK_GetSctClkFreq ( void  )
Returns
Frequency of sct clk
void CLOCK_EnableSysOscClk ( bool  enable,
uint32_t  delay_us 
)
Parameters
enable: true to enable system osc clock, false to bypass system osc.
delay_us: Delay time after OSC power up.
static uint32_t CLOCK_GetXtalInClkFreq ( void  )
inlinestatic
Returns
Frequency of sys osc Clock. If no external clock is used returns 0.
static uint32_t CLOCK_GetLpOscFreq ( void  )
inlinestatic
Returns
Frequency of LPOSC
static uint32_t CLOCK_GetOsc32KFreq ( void  )
inlinestatic
Returns
Frequency of 32kHz osc
static void CLOCK_EnableOsc32K ( bool  enable)
inlinestatic
Parameters
enable: true to enable 32k osc clock, false to disable clock
static uint32_t CLOCK_GetWakeClk32KFreq ( void  )
inlinestatic
Returns
Frequency of 32kHz wake clk
static void CLOCK_SetXtalFreq ( uint32_t  freq)
inlinestatic
Parameters
freq: The XTAL input clock frequency in Hz.
static void CLOCK_SetMclkInFreq ( uint32_t  freq)
inlinestatic
Parameters
freq: The MCLK input clock frequency in Hz.
uint32_t CLOCK_GetFlexCommClkFreq ( uint32_t  id)
Parameters
id: flexcomm index to get frequency.
Returns
Frequency of Flexcomm functional Clock
uint32_t CLOCK_GetCtimerClkFreq ( uint32_t  id)
Parameters
id: ctimer index to get frequency.
Returns
Frequency of Ctimer Clock
uint32_t CLOCK_GetClockOutClkFreq ( void  )
Returns
Frequency of ClockOut
uint32_t CLOCK_GetAdcClkFreq ( void  )
Returns
Frequency of Adc Clock.
uint32_t CLOCK_GetQspiClkFreq ( void  )
Returns
Frequency of Qspi.
void CLOCK_InitSysPll ( const clock_sys_pll_config_t config)
Parameters
config: Configuration to set to PLL.
static void CLOCK_DeinitSysPll ( void  )
inlinestatic

param none.

void CLOCK_InitSysPfd ( clock_pfd_t  pfd,
uint8_t  divider 
)
Parameters
pfd: Which PFD clock to enable.
divider: The PFD divider value.
Note
It is recommended that PFD settings are kept between 12-35.
static void CLOCK_DeinitSysPfd ( clock_pfd_t  pfd)
inlinestatic

param pfd : Which PFD clock to disable.

void CLOCK_InitAudioPll ( const clock_audio_pll_config_t config)
Parameters
config: Configuration to set to PLL.
static void CLOCK_DeinitAudioPll ( void  )
inlinestatic

param none.

void CLOCK_InitAudioPfd ( clock_pfd_t  pfd,
uint8_t  divider 
)
Parameters
pfd: Which PFD clock to enable.
divider: The PFD divider value.
Note
It is recommended that PFD settings are kept between 12-35.
static void CLOCK_DeinitAudioPfd ( uint32_t  pfd)
inlinestatic

param pfd : Which PFD clock to disable.

void CLOCK_EnableUsbhsDeviceClock ( void  )

This function enables USB HS device PLL clock.

void CLOCK_EnableUsbhsHostClock ( void  )

This function enables USB HS host PLL clock.

void CLOCK_EnableUsbhsPhyClock ( void  )

This function enables USB HS PHY PLL clock.

void SDK_DelayAtLeastUs ( uint32_t  delay_us)

Please note that, this API will calculate the microsecond period with the maximum supported CPU frequency, so this API will only delay for at least the given microseconds, if precise delay count was needed, please implement a new timer count to achieve this function.

Parameters
delay_usDelay time in unit of microsecond.

Variable Documentation

volatile uint32_t g_xtalFreq

The XTAL (SYSOSC) clock frequency in Hz, when the clock is setup, use the function CLOCK_SetXtalFreq to set the value in to clock driver. For example, if XTAL is 16MHz,

* CLOCK_SetXtalFreq(160000000); // Set the XTALIN value to clock driver.
*
volatile uint32_t g_MclkInFreq

The MCLK in (mclk_in) PIN clock frequency in Hz, when the clock is setup, use the function CLOCK_SetMclkInFreq to set the value in to clock driver. For example, if mclk_In is 16MHz,

* CLOCK_SetMclkInFreq(160000000); // Set the MCLK_IN value to clock driver.
*