![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
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 | MIPI_DSI_HOST_CLOCKS |
Clock ip name array for MIPI DSI. More... | |
#define | LCDIF_CLOCKS |
Clock ip name array for LCDIF. More... | |
#define | SCT_CLOCKS |
Clock ip name array for SCT. More... | |
#define | USBD_CLOCKS |
Clock ip name array for USBD. More... | |
#define | FLEXSPI_CLOCKS |
Clock ip name array for FlexSPI. | |
#define | CACHE64_CLOCKS |
Clock ip name array for Cache64. | |
#define | TRNG_CLOCKS |
Clock ip name array for RNG. | |
#define | PUF_CLOCKS |
Clock ip name array for PUF. | |
#define | HASHCRYPT_CLOCKS |
Clock ip name array for HashCrypt. | |
#define | CASPER_CLOCKS |
Clock ip name array for Casper. | |
#define | POWERQUAD_CLOCKS |
Clock ip name array for Powerquad. | |
#define | LPADC_CLOCKS |
Clock ip name array for ADC. More... | |
#define | CMP_CLOCKS |
Clock ip name array for ACMP. More... | |
#define | USDHC_CLOCKS |
Clock ip name array for uSDHC. | |
#define | WWDT_CLOCKS |
Clock ip name array for WWDT. More... | |
#define | UTICK_CLOCKS |
Clock ip name array for UTICK. More... | |
#define | FLEXIO_CLOCKS |
Clock ip name array for FlexIO. More... | |
#define | OSTIMER_CLOCKS |
Clock ip name array for OSTimer. | |
#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 | SPI_CLOCKS |
Clock ip name array for SPI. More... | |
#define | I2S_CLOCKS |
Clock ip name array for FLEXI2S. More... | |
#define | DMIC_CLOCKS |
Clock ip name array for DMIC. More... | |
#define | SEMA42_CLOCKS |
Clock ip name array for SEMA. | |
#define | MU_CLOCKS |
Clock ip name array for MUA. | |
#define | DMA_CLOCKS |
Clock ip name array for DMA. More... | |
#define | CRC_CLOCKS |
Clock ip name array for CRC. More... | |
#define | GPIO_CLOCKS |
Clock ip name array for GPIO. More... | |
#define | PINT_CLOCKS |
Clock ip name array for PINT. More... | |
#define | I3C_CLOCKS |
Clock ip name array for I3C. More... | |
#define | MRT_CLOCKS |
Clock ip name array for MRT. More... | |
#define | RTC_CLOCKS |
Clock ip name array for RTC. More... | |
#define | CTIMER_CLOCKS |
Clock ip name array for CT32B. More... | |
#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... | |
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_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 output 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... | |
void | CLOCK_EnableFroClk (uint32_t divOutEnable) |
Enable/Disable FRO192M clock output. More... | |
void | CLOCK_EnableLpOscClk (void) |
Enable LPOSC 1MHz clock. | |
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_SetMclkFreq (uint32_t freq) |
Set the MCLK IN frequency based on board setting. More... | |
uint32_t | CLOCK_GetFlexcommClkFreq (uint32_t id) |
Return Frequency of Flexcomm functional Clock. More... | |
uint32_t | CLOCK_GetFlexioClkFreq (void) |
Return Frequency of Flexio 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 (uint32_t id) |
Return Frequency of FLEXSPI Clock. More... | |
uint32_t | CLOCK_GetGpuClkFreq (void) |
Return Frequency of GPU functional Clock. More... | |
uint32_t | CLOCK_GetDcPixelClkFreq (void) |
Return Frequency of DCNano Pixel functional Clock. More... | |
uint32_t | CLOCK_GetMipiDphyClkFreq (void) |
Return Frequency of MIPI DPHY functional Clock. More... | |
uint32_t | CLOCK_GetMipiDphyEscRxClkFreq (void) |
Return Frequency of MIPI DPHY Esc RX functional Clock. More... | |
uint32_t | CLOCK_GetMipiDphyEscTxClkFreq (void) |
Return Frequency of MIPI DPHY Esc Tx functional 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_EnableFroTuning (bool enable) |
Enable/Disable FRO tuning. More... | |
void | CLOCK_EnableUsbHs0DeviceClock (clock_attach_id_t src, uint8_t divider) |
Enable USB HS device clock. More... | |
void | CLOCK_DisableUsbHs0DeviceClock (void) |
Disable USB HS device clock. More... | |
void | CLOCK_EnableUsbHs0HostClock (clock_attach_id_t src, uint8_t divider) |
Enable USB HS host clock. More... | |
void | CLOCK_DisableUsbHs0HostClock (void) |
Disable USB HS host clock. More... | |
bool | CLOCK_EnableUsbHs0PhyPllClock (clock_attach_id_t src, uint32_t freq) |
brief Enable USB hs0PhyPll clock. More... | |
void | CLOCK_DisableUsbHs0PhyPllClock (void) |
Disable USB hs0PhyPll clock. More... | |
Variables | |
volatile uint32_t | g_xtalFreq |
External XTAL (SYSOSC) clock frequency. More... | |
volatile uint32_t | g_mclkFreq |
External MCLK IN clock frequency. More... | |
Driver version | |
#define | FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 3, 1)) |
CLOCK driver version 2.3.1. More... | |
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_FrgFro48M } |
Data Fields | |
uint8_t | num |
FRG clock, [0 - 16]: Flexcomm, [17]: Flexio. | |
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, 3, 1)) |
#define MIPI_DSI_HOST_CLOCKS |
#define LCDIF_CLOCKS |
#define SCT_CLOCKS |
#define USBD_CLOCKS |
#define LPADC_CLOCKS |
#define CMP_CLOCKS |
#define WWDT_CLOCKS |
#define UTICK_CLOCKS |
#define FLEXIO_CLOCKS |
#define FLEXCOMM_CLOCKS |
#define USART_CLOCKS |
#define I2C_CLOCKS |
#define SPI_CLOCKS |
#define I2S_CLOCKS |
#define DMIC_CLOCKS |
#define DMA_CLOCKS |
#define CRC_CLOCKS |
#define GPIO_CLOCKS |
#define PINT_CLOCKS |
#define I3C_CLOCKS |
#define MRT_CLOCKS |
#define RTC_CLOCKS |
#define CTIMER_CLOCKS |
#define CLK_GATE_REG_OFFSET_SHIFT 8U |
#define SYSPLL0CLKSEL_OFFSET 0x200 |
[ 31 30 29:28 27:25 24:14 13:11 10:0 ] [CLKCTL index]:[FRODIVSEL onoff]:[FRODIVSEL]:[MUXB choice]:[MUXB offset]:[MUXA choice]:[MUXA offset] FRODIVSEL onoff '1' means need to set FRODIVSEL. MUX offset 0 means end of descriptor.
enum clock_ip_name_t |
enum clock_name_t |
enum clock_pfd_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. |
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_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. |
void CLOCK_EnableFroClk | ( | uint32_t | divOutEnable | ) |
divOutEnable | : Or'ed value of clock_fro_output_en_t to enable certain clock freq output. |
|
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 MCLK input clock frequency in Hz. |
uint32_t CLOCK_GetFlexcommClkFreq | ( | uint32_t | id | ) |
id | : flexcomm index to get frequency. |
uint32_t CLOCK_GetFlexioClkFreq | ( | void | ) |
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 | ( | uint32_t | id | ) |
id | : flexspi index to get frequency. |
uint32_t CLOCK_GetGpuClkFreq | ( | void | ) |
uint32_t CLOCK_GetDcPixelClkFreq | ( | void | ) |
uint32_t CLOCK_GetMipiDphyClkFreq | ( | void | ) |
uint32_t CLOCK_GetMipiDphyEscRxClkFreq | ( | void | ) |
uint32_t CLOCK_GetMipiDphyEscTxClkFreq | ( | void | ) |
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_EnableFroTuning | ( | bool | enable | ) |
On enable, the function will wait until FRO is close to the target frequency.
void CLOCK_EnableUsbHs0DeviceClock | ( | clock_attach_id_t | src, |
uint8_t | divider | ||
) |
This function enables USB HS device clock.
void CLOCK_DisableUsbHs0DeviceClock | ( | void | ) |
This function disables USB HS device clock.
void CLOCK_EnableUsbHs0HostClock | ( | clock_attach_id_t | src, |
uint8_t | divider | ||
) |
This function enables USB HS host clock.
void CLOCK_DisableUsbHs0HostClock | ( | void | ) |
This function disables USB HS host clock.
bool CLOCK_EnableUsbHs0PhyPllClock | ( | clock_attach_id_t | src, |
uint32_t | freq | ||
) |
param src USB HS clock source. param freq The frequency specified by src. retval true The clock is set successfully. retval false The clock source is invalid to get proper USB HS clock.
void CLOCK_DisableUsbHs0PhyPllClock | ( | void | ) |
This function disables USB hs0PhyPll clock.
volatile uint32_t g_xtalFreq |
The XTAL (YSOSC) 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_mclkFreq |
The MCLK IN clock frequency in Hz, when the clock is setup, use the function CLOCK_SetMclkFreq to set the value in to clock driver. For example, if MCLK IN is 16MHz,