MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
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 | FLEXSPI_CLOCKS |
Clock ip name array for FLEXSPI. | |
#define | CACHE64_CLOCKS |
Clock ip name array for Cache64. | |
#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... | |
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... | |
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 (uint32_t id) |
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, bool enableLowPower, 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_GetMclkInClkFreq (void) |
Return Frequency of MCLK Input 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_SetClkinFreq (uint32_t freq) |
Set the CLKIN (CLKIN pin) frequency based on board setting. More... | |
static void | CLOCK_SetMclkFreq (uint32_t freq) |
Set the MCLK in (mclk_in) clock frequency based on board setting. More... | |
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_GetFlexspiClkFreq (void) |
Return Frequency of Flexspi Clock. More... | |
void | CLOCK_EnableFfroClk (clock_ffro_freq_t ffroFreq) |
void | CLOCK_EnableSfroClk (void) |
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... | |
Variables | |
volatile uint32_t | g_xtalFreq |
External XTAL (SYSOSC) clock frequency. More... | |
volatile uint32_t | g_clkinFreq |
External CLK_IN pin clock frequency (clkin) clock frequency. More... | |
volatile uint32_t | g_mclkFreq |
External XTAL (SYSOSC) clock frequency. More... | |
Driver version | |
#define | FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 6, 1)) |
CLOCK driver version 2.6.1. More... | |
The MCUXpresso SDK provides APIs for MCUXpresso SDK devices' clock operation.
struct clock_sys_pll_config_t |
Data Fields | |
sys_pll_src_t | sys_pll_src |
Reference Input Clock Source. | |
uint32_t | numerator |
30 bit numerator of fractional loop divider. More... | |
uint32_t | denominator |
30 bit numerator of fractional loop divider. More... | |
sys_pll_mult_t | sys_pll_mult |
Multiplication Factor. | |
uint32_t clock_sys_pll_config_t::numerator |
uint32_t clock_sys_pll_config_t::denominator |
struct clock_audio_pll_config_t |
Data Fields | |
audio_pll_src_t | audio_pll_src |
Reference Input Clock Source. | |
uint32_t | numerator |
30 bit numerator of fractional loop divider. More... | |
uint32_t | denominator |
30 bit numerator of fractional loop divider. More... | |
audio_pll_mult_t | audio_pll_mult |
Multiplication Factor. | |
uint32_t clock_audio_pll_config_t::numerator |
uint32_t clock_audio_pll_config_t::denominator |
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 |
Denominator of the fractional divider. More... | |
uint8_t | mult |
Numerator of the fractional divider. More... | |
anonymous enum |
uint8_t clock_frg_clk_config_t::divider |
uint8_t clock_frg_clk_config_t::mult |
#define FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 6, 1)) |
#define CMP_CLOCKS |
#define FLEXCOMM_CLOCKS |
#define USART_CLOCKS |
#define I2C_CLOCKS |
#define I3C_CLOCKS |
#define SPI_CLOCKS |
#define FLEXI2S_CLOCKS |
#define UTICK_CLOCKS |
#define DMIC_CLOCKS |
#define CTIMER_CLOCKS |
#define GPIO_CLOCKS |
#define LPADC_CLOCKS |
#define MRT_CLOCKS |
#define SCT_CLOCKS |
#define RTC_CLOCKS |
#define WWDT_CLOCKS |
#define CRC_CLOCKS |
#define USBD_CLOCKS |
#define DMA_CLOCKS |
#define PINT_CLOCKS |
#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]*
enum clock_ip_name_t |
enum clock_name_t |
enum clock_pfd_t |
enum clock_ffro_freq_t |
enum sys_pll_src_t |
enum sys_pll_mult_t |
enum audio_pll_src_t |
enum audio_pll_mult_t |
void CLOCK_AttachClk | ( | clock_attach_id_t | connection | ) |
connection | : Clock to be configured. |
void CLOCK_SetClkDiv | ( | clock_div_name_t | div_name, |
uint32_t | divider | ||
) |
div_name | : Clock divider name |
divider | : Value to be divided. |
uint32_t CLOCK_GetFreq | ( | clock_name_t | clockName | ) |
uint32_t CLOCK_GetFRGClock | ( | uint32_t | id | ) |
void CLOCK_SetFRGClock | ( | const clock_frg_clk_config_t * | config | ) |
config | : Configuration to set to FRGn clock. |
|
inlinestatic |
uint32_t CLOCK_GetSysPllFreq | ( | void | ) |
uint32_t CLOCK_GetSysPfdFreq | ( | clock_pfd_t | pfd | ) |
pfd | : pfd name to get frequency. |
uint32_t CLOCK_GetAudioPllFreq | ( | void | ) |
uint32_t CLOCK_GetAudioPfdFreq | ( | clock_pfd_t | pfd | ) |
pfd | : pfd name to get frequency. |
uint32_t CLOCK_GetFFroFreq | ( | void | ) |
uint32_t CLOCK_GetMainClkFreq | ( | void | ) |
uint32_t CLOCK_GetDspMainClkFreq | ( | void | ) |
uint32_t CLOCK_GetAcmpClkFreq | ( | void | ) |
uint32_t CLOCK_GetDmicClkFreq | ( | void | ) |
uint32_t CLOCK_GetUsbClkFreq | ( | void | ) |
uint32_t CLOCK_GetSdioClkFreq | ( | uint32_t | id | ) |
id | : SDIO index to get frequency. |
uint32_t CLOCK_GetI3cClkFreq | ( | void | ) |
uint32_t CLOCK_GetSystickClkFreq | ( | void | ) |
uint32_t CLOCK_GetWdtClkFreq | ( | uint32_t | id | ) |
id | : WDT index to get frequency. |
uint32_t CLOCK_GetMclkClkFreq | ( | void | ) |
uint32_t CLOCK_GetSctClkFreq | ( | void | ) |
void CLOCK_EnableSysOscClk | ( | bool | enable, |
bool | enableLowPower, | ||
uint32_t | delay_us | ||
) |
enable | : true to enable system osc clock, false to bypass system osc. |
enableLowPower | : true to enable low power mode, false to enable high gain mode. |
delay_us | : Delay time after OSC power up. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
enable | : true to enable 32k osc clock, false to disable clock |
|
inlinestatic |
|
inlinestatic |
freq | : The XTAL input clock frequency in Hz. |
|
inlinestatic |
freq | : The CLK_IN pin input clock frequency in Hz. |
|
inlinestatic |
freq | : The MCLK input clock frequency in Hz. |
uint32_t CLOCK_GetFlexCommClkFreq | ( | uint32_t | id | ) |
id | : flexcomm index to get frequency. |
uint32_t CLOCK_GetCtimerClkFreq | ( | uint32_t | id | ) |
id | : ctimer index to get frequency. |
uint32_t CLOCK_GetClockOutClkFreq | ( | void | ) |
uint32_t CLOCK_GetAdcClkFreq | ( | void | ) |
uint32_t CLOCK_GetFlexspiClkFreq | ( | void | ) |
void CLOCK_EnableFfroClk | ( | clock_ffro_freq_t | ffroFreq | ) |
brief Enable FFRO 48M/60M clock. param ffroFreq : target fro frequency. return Nothing
void CLOCK_EnableSfroClk | ( | void | ) |
brief Enable SFRO clock. param Nothing return Nothing
void CLOCK_InitSysPll | ( | const clock_sys_pll_config_t * | config | ) |
config | : Configuration to set to PLL. |
|
inlinestatic |
param none.
void CLOCK_InitSysPfd | ( | clock_pfd_t | pfd, |
uint8_t | divider | ||
) |
pfd | : Which PFD clock to enable. |
divider | : The PFD divider value. |
|
inlinestatic |
param pfd : Which PFD clock to disable.
void CLOCK_InitAudioPll | ( | const clock_audio_pll_config_t * | config | ) |
config | : Configuration to set to PLL. |
|
inlinestatic |
param none.
void CLOCK_InitAudioPfd | ( | clock_pfd_t | pfd, |
uint8_t | divider | ||
) |
pfd | : Which PFD clock to enable. |
divider | : The PFD divider value. |
|
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.
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,
volatile uint32_t g_clkinFreq |
The CLK_IN pin (clkin) clock frequency in Hz, when the clock is setup, use the function CLOCK_SetClkinFreq to set the value in to clock driver. For example, if CLK_IN is 16MHz,
volatile uint32_t g_mclkFreq |
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,