![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
The MCUXpresso SDK provides APIs for MCUXpresso SDK devices' clock operation.
The clock driver supports:
Modules | |
System Clock Generator (SCG) | |
Files | |
file | fsl_clock.h |
Data Structures | |
struct | _cgc_rtd_sys_clk_config |
CGC system clock configuration for RTD. More... | |
struct | _cgc_hifi_sys_clk_config |
CGC system clock configuration for HIFI4 DSP. More... | |
struct | _cgc_lpav_sys_clk_config |
CGC system clock configuration for LPAV. More... | |
struct | _cgc_ddr_sys_clk_config |
CGC system clock configuration for DDR in LPAV. More... | |
struct | _cgc_sosc_config |
CGC system OSC configuration. More... | |
struct | _cgc_fro_config |
CGC FRO clock configuration. More... | |
struct | _cgc_lposc_config |
CGC LPOSC clock configuration. More... | |
struct | _cgc_pll0_config |
CGC PLL0 configuration. More... | |
struct | _cgc_rosc_config |
CGC RTC OSC configuration. More... | |
struct | _cgc_pll1_config |
CGC PLL1 configuration. More... | |
struct | _cgc_pll4_config |
CGC PLL4 configuration. More... | |
Macros | |
#define | FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL 0 |
Configure whether driver controls clock. More... | |
#define | CGC_PLLPFD_PFD_VAL(pfdClkout, fracValue) ((uint32_t)((uint32_t)(fracValue) << (uint32_t)(pfdClkout))) |
CGC (A/S)PLLPFD[PFDx] value. | |
#define | CGC_PLLPFD_PFD_MASK(pfdClkout) ((uint32_t)((uint32_t)(CGC_PLL0PFDCFG_PFD0_MASK) << (uint32_t)(pfdClkout))) |
CGC (A/S)PLLPFD[PFD] mask. | |
#define | CGC_PLLPFD_PFD_VALID_MASK(pfdClkout) ((uint32_t)((uint32_t)CGC_PLL0PFDCFG_PFD0_VALID_MASK << (uint32_t)(pfdClkout))) |
CGC (A/S)PLLPFD[PFDx_VALID] mask. | |
#define | CGC_PLLPFD_PFD_CLKGATE_MASK(pfdClkout) ((uint32_t)((uint32_t)CGC_PLL0PFDCFG_PFD0_CLKGATE_MASK << (uint32_t)(pfdClkout))) |
CGC (A/S)PLLPFD[PFDx_CLKGATE] mask. | |
#define | PCC_CLKCFG_PCD_MASK (0x7U) |
Re-define PCC register masks and bitfield operations to unify the different namings in the soc header file. | |
#define | PCC_PCS_VAL(reg) (((reg)&PCC_CLKCFG_PCS_MASK) >> PCC_CLKCFG_PCS_SHIFT) |
Bitfield values for general PCC registers. More... | |
#define | CLOCK_IP_SOURCE_PCC_INDEX(idx) ((idx) << 8U) |
Clock source index macros for clock_ip_src_t. | |
#define | PCC_PCS_AVAIL_MASK (0x2U) |
Define PCC bit available mask for clock_ip_name_t. | |
#define | IP_NAME_NON_PCC_FLAG_MASK ((uint32_t)1U << 30) |
Define Non-PCC register flag mask for clock_ip_name_t. | |
#define | PCC_REG(name) (*(volatile uint32_t *)((uint32_t)(name) & ~(PCC_PCS_AVAIL_MASK | PCC_PCD_FRAC_AVAIL_MASK))) |
Define PCC register content for clock_ip_name_t. | |
#define | RGPIO_CLOCKS |
Clock ip name array for RGPIO2P. More... | |
#define | SAI_CLOCKS |
Clock ip name array for SAI. More... | |
#define | PCTL_CLOCKS |
Clock ip name array for PCTL. More... | |
#define | LPI2C_CLOCKS |
Clock ip name array for LPI2C. More... | |
#define | I3C_CLOCKS |
Clock ip name array for I3C. More... | |
#define | FLEXIO_CLOCKS |
Clock ip name array for FLEXIO. More... | |
#define | FLEXCAN_CLOCKS |
Clock ip name array for FLEXCAN. More... | |
#define | PDM_CLOCKS |
Clock ip name array for PDM. More... | |
#define | LCDIF_CLOCKS |
Clock ip name array for LCDIF/DCNANO. More... | |
#define | MIPI_DSI_HOST_CLOCKS |
Clock ip name array for MIPI DSI. More... | |
#define | EDMA_CLOCKS |
Clock ip name array for EDMA. More... | |
#define | EDMA_CHAN_CLOCKS |
Clock ip name array for EDMA Channels. More... | |
#define | LPUART_CLOCKS |
Clock ip name array for LPUART. More... | |
#define | DAC_CLOCKS |
Clock ip name array for DAC. More... | |
#define | LPTMR_CLOCKS |
Clock ip name array for LPTMR. More... | |
#define | LPADC_CLOCKS |
Clock ip name array for LPADC. More... | |
#define | LPSPI_CLOCKS |
Clock ip name array for LPSPI. More... | |
#define | TPM_CLOCKS |
Clock ip name array for TPM. More... | |
#define | LPIT_CLOCKS |
Clock ip name array for LPIT. More... | |
#define | CMP_CLOCKS |
Clock ip name array for CMP. More... | |
#define | WDOG_CLOCKS |
Clock ip name array for MU. More... | |
#define | SEMA42_CLOCKS |
Clock ip name array for SEMA42. More... | |
#define | TPIU_CLOCKS |
Clock ip name array for TPIU. More... | |
#define | FLEXSPI_CLOCKS |
Clock ip name array for QSPI. More... | |
#define | MRT_CLOCKS |
Clock ip name array for MRT. More... | |
#define | BBNSM_CLOCKS |
Clock ip name array for BBNSM. More... | |
#define | PXP_CLOCKS |
Clock ip name array for PXP. More... | |
#define | EPDC_CLOCKS |
Clock ip name array for EPDC. More... | |
Typedefs | |
typedef enum _clock_name | clock_name_t |
Clock name used to get clock frequency. More... | |
typedef enum _clock_ip_src | clock_ip_src_t |
Clock source for peripherals that support various clock selections. | |
typedef enum _clock_lptmr_src | clock_lptmr_src_t |
Clock source for LPTMR. | |
typedef enum _clock_ip_name | clock_ip_name_t |
Peripheral clock name difinition used for clock gate, clock source and clock divider setting. More... | |
typedef enum _cgc_sys_clk | cgc_sys_clk_t |
CGC system clock type. | |
typedef enum _cgc_rtd_sys_clk_src | cgc_rtd_sys_clk_src_t |
CGC system clock source for RTD. | |
typedef enum _cgc_nic_sys_clk_src | cgc_nic_sys_clk_src_t |
CGC system clock source for NIC in AD. | |
typedef enum _cgc_hifi_sys_clk_src | cgc_hifi_sys_clk_src_t |
CGC system clock source for HIFI4 in LPAV. | |
typedef enum _cgc_lpav_sys_clk_src | cgc_lpav_sys_clk_src_t |
CGC system clock source for LPAV. | |
typedef enum _cgc_ddr_sys_clk_src | cgc_ddr_sys_clk_src_t |
CGC system clock source for DDR. | |
typedef struct _cgc_rtd_sys_clk_config | cgc_rtd_sys_clk_config_t |
CGC system clock configuration for RTD. | |
typedef struct _cgc_hifi_sys_clk_config | cgc_hifi_sys_clk_config_t |
CGC system clock configuration for HIFI4 DSP. | |
typedef struct _cgc_lpav_sys_clk_config | cgc_lpav_sys_clk_config_t |
CGC system clock configuration for LPAV. | |
typedef struct _cgc_ddr_sys_clk_config | cgc_ddr_sys_clk_config_t |
CGC system clock configuration for DDR in LPAV. | |
typedef enum _clock_rtd_clkout_src | clock_rtd_clkout_src_t |
CGC clock out configuration (CLKOUTCFG) in RTD. | |
typedef enum _clock_lpav_clkout_src | clock_lpav_clkout_src_t |
CGC clock out configuration (CLKOUTCFG) in LPAV. | |
typedef enum _cgc_async_clk | cgc_async_clk_t |
CGC asynchronous clock type. | |
typedef enum _cgc_sosc_monitor_mode | cgc_sosc_monitor_mode_t |
CGC system OSC monitor mode. | |
typedef enum _cgc_sosc_mode | cgc_sosc_mode_t |
OSC work mode. More... | |
typedef struct _cgc_sosc_config | cgc_sosc_config_t |
CGC system OSC configuration. | |
typedef struct _cgc_fro_config | cgc_fro_config_t |
CGC FRO clock configuration. | |
typedef struct _cgc_lposc_config | cgc_lposc_config_t |
CGC LPOSC clock configuration. | |
typedef enum _cgc_pll_src | cgc_pll_src_t |
CGC PLL clock source. | |
typedef enum _cgc_pll_pfd_clkout | cgc_pll_pfd_clkout_t |
CGC PLL PFD clouk out select. | |
typedef enum _cgc_pll0_mult | cgc_pll0_mult_t |
PLL0 Multiplication Factor. | |
typedef struct _cgc_pll0_config | cgc_pll0_config_t |
CGC PLL0 configuration. | |
typedef enum _cgc_rosc_monitor_mode | cgc_rosc_monitor_mode_t |
CGC RTC OSC monitor mode. | |
typedef struct _cgc_rosc_config | cgc_rosc_config_t |
CGC RTC OSC configuration. | |
typedef enum _cgc_pll1_mult | cgc_pll1_mult_t |
PLL1 Multiplication Factor. | |
typedef struct _cgc_pll1_config | cgc_pll1_config_t |
CGC PLL1 configuration. | |
typedef enum _cgc_pll4_mult | cgc_pll4_mult_t |
PLL4 Multiplication Factor. | |
typedef struct _cgc_pll4_config | cgc_pll4_config_t |
CGC PLL4 configuration. | |
typedef enum _cgc_rtd_audclk_src | cgc_rtd_audclk_src_t |
AUD_CLK0 source in RTD. | |
typedef enum _cgc_ad_audclk_src | cgc_ad_audclk_src_t |
AUD_CLK1 source in AD. | |
typedef enum _cgc_lpav_audclk_src | cgc_lpav_audclk_src_t |
AUD_CLK2 source in LPAV. | |
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 bool | CLOCK_IsEnabledByOtherCore (clock_ip_name_t name) |
Check whether the clock is already enabled and configured by any other core. More... | |
void | CLOCK_SetIpSrc (clock_ip_name_t name, clock_ip_src_t src) |
Set the clock source for specific IP module. More... | |
void | CLOCK_SetIpSrcDiv (clock_ip_name_t name, clock_ip_src_t src, uint8_t divValue, uint8_t fracValue) |
Set the clock source and divider for specific IP module. More... | |
static void | CLOCK_SetRtdAudClkSrc (cgc_rtd_audclk_src_t src) |
Set the AUD_CLK0 source in RTD. More... | |
static void | CLOCK_SetAdAudClkSrc (cgc_ad_audclk_src_t src) |
Set the AUD_CLK1 source in AD. More... | |
static void | CLOCK_SetLpavAudClkSrc (cgc_lpav_audclk_src_t src) |
Set the AUD_CLK2 source in LPAV. More... | |
uint32_t | CLOCK_GetFreq (clock_name_t clockName) |
Gets the clock frequency for a specific clock name. More... | |
uint32_t | CLOCK_GetCm33CorePlatClkFreq (void) |
Get the CM33 core/platform clock frequency. More... | |
uint32_t | CLOCK_GetCm33BusClkFreq (void) |
Get the CM33 bus clock frequency. More... | |
uint32_t | CLOCK_GetCm33SlowClkFreq (void) |
Get the CM33 slow clock frequency. More... | |
uint32_t | CLOCK_GetFusionDspCorePlatClkFreq (void) |
Get the Fusion DSP core/platform clock frequency. More... | |
uint32_t | CLOCK_GetFusionDspBusClkFreq (void) |
Get the Fusion DSP bus clock frequency. More... | |
uint32_t | CLOCK_GetFusionDspSlowClkFreq (void) |
Get the Fusion DSP slow clock frequency. More... | |
uint32_t | CLOCK_GetLvdsClkFreq (void) |
Get the external LVDS pad clock frequency (LVDS). More... | |
uint32_t | CLOCK_GetIpFreq (clock_ip_name_t name) |
Gets the clock frequency for a specific IP module. More... | |
uint32_t | CLOCK_GetRtdSysClkFreq (uint32_t config, cgc_sys_clk_t type) |
Gets the CGC system clock frequency in RTD. More... | |
Variables | |
volatile uint32_t | g_xtal0Freq |
External XTAL (SYSOSC) clock frequency. More... | |
volatile uint32_t | g_xtal32Freq |
External XTAL32/EXTAL32 clock frequency. More... | |
volatile uint32_t | g_lvdsFreq |
External LVDS pad clock frequency. More... | |
volatile uint32_t | g_mclkFreq [4] |
External MCLK pad clock frequency. More... | |
volatile uint32_t | g_rxBclkFreq [8] |
External RX_BCLK pad clock frequency. More... | |
volatile uint32_t | g_txBclkFreq [8] |
External TX_BCLK pad clock frequency. More... | |
volatile uint32_t | g_spdifRxFreq |
Recovered SPDIF_RX clock frequency. More... | |
Driver version | |
#define | FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) |
CLOCK driver version 2.0.5. More... | |
MCU System Clock. | |
uint32_t | CLOCK_GetCm33SysClkFreq (cgc_sys_clk_t type) |
Gets the CGC CM33 system clock frequency. More... | |
static void | CLOCK_SetCm33SysClkConfig (cgc_rtd_sys_clk_config_t *config) |
Sets the system clock configuration for CM33 domain. More... | |
uint32_t | CLOCK_GetFusionDspSysClkFreq (cgc_sys_clk_t type) |
Gets the CGC Fusion DSP system clock frequency. More... | |
static void | CLOCK_SetFusionSysClkConfig (const cgc_rtd_sys_clk_config_t *config) |
Sets the system clock configuration for FusionF1 DSP domain. More... | |
static void | CLOCK_GetCm33SysClkConfig (cgc_rtd_sys_clk_config_t *config) |
Gets the system clock configuration for CM33 domain. More... | |
static void | CLOCK_GetFusionDspSysClkConfig (cgc_rtd_sys_clk_config_t *config) |
Gets the system clock configuration for FusionF1 DSP domain. More... | |
static void | CLOCK_SetRtdClkOutConfig (clock_rtd_clkout_src_t setting, uint8_t div, bool enable) |
Sets the clock out configuration in RTD. More... | |
static void | CLOCK_SetRtcClkOutConfig (uint8_t div) |
Sets the RTC_CLOCKOUT configuration. More... | |
uint32_t | CLOCK_GetXbarBusClkFreq (void) |
Gets the CGC XBAR bus clock frequency in AD. More... | |
uint32_t | CLOCK_GetHifiDspSysClkFreq (cgc_sys_clk_t type) |
Gets the CGC HIFI DSP system clock frequency in LPAV. More... | |
static void | CLOCK_SetHifiDspSysClkConfig (const cgc_hifi_sys_clk_config_t *config) |
Sets the system clock configuration for HIFI4 DSP domain. More... | |
static void | CLOCK_GetHifiDspSysClkConfig (cgc_hifi_sys_clk_config_t *config) |
Gets the system clock configuration for HIFI4 DSP domain. More... | |
uint32_t | CLOCK_GetLpavSysClkFreq (cgc_sys_clk_t type) |
Gets the CGC NIC LPAV system clock frequency in LPAV. More... | |
static void | CLOCK_SetLpavSysClkConfig (const cgc_lpav_sys_clk_config_t *config) |
Sets the system clock configuration for NIC LPAV domain. More... | |
static void | CLOCK_GetLpavSysClkConfig (cgc_lpav_sys_clk_config_t *config) |
Gets the system clock configuration for NIC LPAV domain. More... | |
uint32_t | CLOCK_GetDdrClkFreq (void) |
Gets the CGC DDR clock frequency in LPAV. More... | |
static void | CLOCK_SetLpavClkOutConfig (clock_lpav_clkout_src_t setting, uint8_t div, bool enable) |
Sets the clock out configuration in LPAV. More... | |
CGC System OSC Clock. | |
status_t | CLOCK_InitSysOsc (const cgc_sosc_config_t *config) |
Initializes the CGC system OSC. More... | |
status_t | CLOCK_DeinitSysOsc (void) |
De-initializes the CGC system OSC. More... | |
void | CLOCK_SetRtdSysOscAsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider in RTD. More... | |
void | CLOCK_SetAdSysOscAsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider in AD. More... | |
void | CLOCK_SetLpavSysOscAsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider in LPAV. More... | |
uint32_t | CLOCK_GetSysOscFreq (void) |
Gets the CGC system OSC clock frequency (SYSOSC). More... | |
uint32_t | CLOCK_GetRtdSysOscAsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the system OSC in RTD. More... | |
uint32_t | CLOCK_GetAdSysOscAsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the system OSC in AD. More... | |
uint32_t | CLOCK_GetLpavSysOscAsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the system OSC in LPAV. More... | |
static bool | CLOCK_IsSysOscErr (void) |
Checks whether the system OSC clock error occurs. More... | |
static void | CLOCK_ClearSysOscErr (void) |
Clears the system OSC clock error. | |
static void | CLOCK_SetSysOscMonitorMode (cgc_sosc_monitor_mode_t mode) |
Sets the system OSC monitor mode. More... | |
static bool | CLOCK_IsSysOscSelected (void) |
Checks whether the system OSC clock is used as clock source. More... | |
static bool | CLOCK_IsSysOscValid (void) |
Checks whether the system OSC clock is valid. More... | |
CGC FRO Clock. | |
status_t | CLOCK_InitFro (const cgc_fro_config_t *config) |
Initializes the CGC FRO clock. More... | |
status_t | CLOCK_DeinitFro (void) |
De-initializes the CGC FRO. More... | |
void | CLOCK_SetRtdFroAsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider in RTD. More... | |
void | CLOCK_SetAdFroAsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider in AD. More... | |
void | CLOCK_SetLpavFroAsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider in LPAV. More... | |
void | CLOCK_EnableFroTuning (bool enable) |
Enable/Disable FRO tuning. More... | |
uint32_t | CLOCK_GetFroFreq (void) |
Gets the CGC FRO clock frequency. More... | |
uint32_t | CLOCK_GetRtdFroAsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the FRO in RTD. More... | |
uint32_t | CLOCK_GetAdFroAsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the FRO in AD. More... | |
uint32_t | CLOCK_GetLpavFroAsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the FRO in LPAV. More... | |
static bool | CLOCK_IsFroSelected (void) |
Checks whether the FRO clock is used as clock source. More... | |
static bool | CLOCK_IsFroValid (void) |
Checks whether the FRO clock is valid. More... | |
CGC LPOSC Clock. | |
status_t | CLOCK_InitLposc (const cgc_lposc_config_t *config) |
Initializes the CGC LPOSC clock. More... | |
status_t | CLOCK_DeinitLposc (void) |
De-initializes the CGC LPOSC. More... | |
static bool | CLOCK_IsLpOscValid (void) |
Checks whether the LPOSC clock is valid. More... | |
uint32_t | CLOCK_GetLpOscFreq (void) |
Gets the CGC LPOSC clock frequency. More... | |
CGC RTCOSC Clock. | |
uint32_t | CLOCK_GetRtcOscFreq (void) |
Gets the CGC RTC OSC clock frequency. More... | |
static bool | CLOCK_IsRtcOscErr (void) |
Checks whether the RTC OSC clock error occurs. More... | |
static void | CLOCK_ClearRtcOscErr (void) |
Clears the RTC OSC clock error. | |
void | CLOCK_SetRtcOscMonitorMode (cgc_rosc_monitor_mode_t mode) |
Sets the RTC OSC monitor mode. More... | |
static bool | CLOCK_IsRtcOscSelected (void) |
Checks whether the RTCOSC clock is used as clock source. More... | |
static bool | CLOCK_IsRtcOscValid (void) |
Checks whether the RTC OSC clock is valid. More... | |
CGC PLL0 Clock. | |
status_t | CLOCK_InitPll0 (const cgc_pll0_config_t *config) |
Initializes the CGC PLL0. More... | |
status_t | CLOCK_DeinitPll0 (void) |
De-initializes the CGC PLL0. More... | |
void | CLOCK_SetPll0AsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider. More... | |
uint32_t | CLOCK_GetPll0Freq (void) |
Gets the CGC PLL0 clock frequency. More... | |
uint32_t | CLOCK_GetPll0AsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the PLL0. More... | |
uint32_t | CLOCK_GetPll0PfdFreq (cgc_pll_pfd_clkout_t pfdClkout) |
Gets the CGC PLL0 PFD clock frequency. More... | |
void | CLOCK_EnablePll0PfdClkout (cgc_pll_pfd_clkout_t pfdClkout, uint8_t fracValue) |
Enables the CGC PLL0 Fractional Divide (PFD) clock out with configurations. More... | |
static void | CLOCK_DisablePll0PfdClkout (cgc_pll_pfd_clkout_t pfdClkout) |
Disables the CGC PLL0 Fractional Divide (PFD) clock out. | |
static void | CLOCK_SetPll0LockTime (uint16_t lockTime) |
Sets the CGC PLL0 lock time. More... | |
static bool | CLOCK_IsPll0Selected (void) |
Checks whether the PLL0 clock is used as clock source. More... | |
static bool | CLOCK_IsPll0Valid (void) |
Checks whether the PLL0 clock is valid. More... | |
CGC PLL1 Clock. | |
status_t | CLOCK_InitPll1 (const cgc_pll1_config_t *config) |
Initializes the CGC PLL1. More... | |
status_t | CLOCK_DeinitPll1 (void) |
De-initializes the CGC PLL1. More... | |
void | CLOCK_SetPll1AsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider. More... | |
uint32_t | CLOCK_GetPll1Freq (void) |
Gets the CGC PLL1 clock frequency. More... | |
uint32_t | CLOCK_GetPll1AsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the PLL1. More... | |
uint32_t | CLOCK_GetPll1PfdFreq (cgc_pll_pfd_clkout_t pfdClkout) |
Gets the CGC PLL1 PFD clock frequency. More... | |
void | CLOCK_EnablePll1PfdClkout (cgc_pll_pfd_clkout_t pfdClkout, uint8_t fracValue) |
Enables the CGC PLL1 Fractional Divide (PFD) clock out with configurations. More... | |
static void | CLOCK_DisablePll1PfdClkout (cgc_pll_pfd_clkout_t pfdClkout) |
Disables the CGC PLL1 Fractional Divide (PFD) clock out. | |
static void | CLOCK_EnablePll1SpectrumModulation (uint16_t step, uint16_t stop) |
Enables the CGC PLL1 spread spectrum modulation feature with configurations. More... | |
static void | CLOCK_DisablePll1SpectrumModulation (void) |
Disables the CGC PLL1 spread spectrum modulation. | |
static void | CLOCK_SetPll1LockTime (uint16_t lockTime) |
Sets the CGC PLL1 lock time. More... | |
static bool | CLOCK_IsPll1Selected (void) |
Checks whether the PLL1 clock is used as clock source. More... | |
static bool | CLOCK_IsPll1Valid (void) |
Checks whether the PLL1 clock is valid. More... | |
CGC PLL3 Clock. | |
uint32_t | CLOCK_GetPll3Freq (void) |
Gets the CGC PLL3 clock frequency. More... | |
uint32_t | CLOCK_GetPll3AsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the PLL3. More... | |
uint32_t | CLOCK_GetPll3PfdFreq (cgc_pll_pfd_clkout_t pfdClkout) |
Gets the CGC PLL3 PFD clock frequency. More... | |
CGC PLL4 Clock. | |
status_t | CLOCK_InitPll4 (const cgc_pll4_config_t *config) |
Initializes the CGC PLL4. More... | |
status_t | CLOCK_DeinitPll4 (void) |
De-initializes the CGC PLL4. More... | |
void | CLOCK_SetPll4AsyncClkDiv (cgc_async_clk_t asyncClk, uint8_t divider) |
Set the asynchronous clock divider. More... | |
uint32_t | CLOCK_GetPll4Freq (void) |
Gets the CGC PLL4 clock frequency. More... | |
uint32_t | CLOCK_GetPll4AsyncFreq (cgc_async_clk_t type) |
Gets the CGC asynchronous clock frequency from the PLL4. More... | |
uint32_t | CLOCK_GetPll4PfdFreq (cgc_pll_pfd_clkout_t pfdClkout) |
Gets the CGC PLL4 PFD clock frequency. More... | |
void | CLOCK_EnablePll4PfdClkout (cgc_pll_pfd_clkout_t pfdClkout, uint8_t fracValue) |
Enables the CGC PLL4 Fractional Divide (PFD) clock out with configurations. More... | |
static void | CLOCK_DisablePll4PfdClkout (cgc_pll_pfd_clkout_t pfdClkout) |
Disables the CGC PLL4 Fractional Divide (PFD) clock out. | |
static void | CLOCK_EnablePll4SpectrumModulation (uint16_t step, uint16_t stop) |
Enables the CGC PLL4 spread spectrum modulation feature with configurations. More... | |
static void | CLOCK_SetPll4LockTime (uint16_t lockTime) |
Sets the CGC PLL4 lock time. More... | |
static bool | CLOCK_IsPll4Selected (void) |
Checks whether the PLL4 clock is used as clock source. More... | |
static bool | CLOCK_IsPll4Valid (void) |
Checks whether the PLL4 clock is valid. More... | |
External clock frequency | |
static void | CLOCK_SetXtal0Freq (uint32_t freq) |
Sets the XTAL0 frequency based on board settings. More... | |
static void | CLOCK_SetXtal32Freq (uint32_t freq) |
Sets the XTAL32 frequency based on board settings. More... | |
static void | CLOCK_SetLvdsFreq (uint32_t freq) |
Sets the LVDS pad frequency based on board settings. More... | |
static void | CLOCK_SetMclkFreq (uint32_t index, uint32_t freq) |
Sets the MCLK pad frequency based on Audio settings. More... | |
static void | CLOCK_SetRxBclkFreq (uint32_t instance, uint32_t freq) |
Sets the RX_BCLK pad frequency based on Audio settings. More... | |
static void | CLOCK_SetTxBclkFreq (uint32_t instance, uint32_t freq) |
Sets the TX_BCLK pad frequency based on Audio settings. More... | |
static void | CLOCK_SetSpdifRxFreq (uint32_t freq) |
Sets the SPDIF_RX frequency based on Audio settings. More... | |
Get peripheral frequency | |
uint32_t | CLOCK_GetWdogClkFreq (uint32_t instance) |
Gets the WDOG clock frequency in RTD and LPAV. More... | |
uint32_t | CLOCK_GetFlexspiClkFreq (uint32_t instance) |
Gets the FlexSPI clock frequency in RTD. More... | |
uint32_t | CLOCK_GetLpitClkFreq (void) |
Gets the LPIT clock frequency in RTD. More... | |
uint32_t | CLOCK_GetFlexioClkFreq (void) |
Gets the FlexIO clock frequency in RTD. More... | |
uint32_t | CLOCK_GetI3cClkFreq (uint32_t instance) |
Gets the I3C clock frequency in RTD and LPAV. More... | |
uint32_t | CLOCK_GetLpspiClkFreq (uint32_t instance) |
Gets the LPSPI clock frequency in RTD. More... | |
uint32_t | CLOCK_GetAdcClkFreq (uint32_t instance) |
Gets the ADC clock frequency. More... | |
uint32_t | CLOCK_GetDacClkFreq (uint32_t instance) |
Gets the DAC clock frequency. More... | |
uint32_t | CLOCK_GetTpiuClkFreq (void) |
Gets the TPIU clock frequency. More... | |
uint32_t | CLOCK_GetSwoClkFreq (void) |
Gets the SWO clock frequency. More... | |
uint32_t | CLOCK_GetTpmClkFreq (uint32_t instance) |
Gets the TPM clock frequency. More... | |
uint32_t | CLOCK_GetLpi2cClkFreq (uint32_t instance) |
Gets the LPI2C clock frequency in RTD. More... | |
uint32_t | CLOCK_GetLpuartClkFreq (uint32_t instance) |
Gets the LPUART clock frequency in RTD. More... | |
uint32_t | CLOCK_GetFlexcanClkFreq (void) |
Gets the FlexCAN clock frequency. More... | |
uint32_t | CLOCK_GetCsiClkFreq (void) |
Gets the CSI clock frequency. More... | |
uint32_t | CLOCK_GetDsiClkFreq (void) |
Gets the DSI clock frequency. More... | |
uint32_t | CLOCK_GetEpdcClkFreq (void) |
Gets the EPDC clock frequency. More... | |
uint32_t | CLOCK_GetGpu2dClkFreq (void) |
Gets the GPU2D clock frequency. More... | |
uint32_t | CLOCK_GetGpu3dClkFreq (void) |
Gets the GPU3D clock frequency. More... | |
uint32_t | CLOCK_GetDcnanoClkFreq (void) |
Gets the DC Nano clock frequency. More... | |
uint32_t | CLOCK_GetCsiUiClkFreq (void) |
Gets the CSI clk_ui clock frequency. More... | |
uint32_t | CLOCK_GetCsiEscClkFreq (void) |
Gets the CSI clk_esc clock frequency. More... | |
uint32_t | CLOCK_GetRtdAudClkFreq (void) |
Gets the audio clock frequency in RTD. More... | |
uint32_t | CLOCK_GetAdAudClkFreq (void) |
Gets the audio clock frequency in AD. More... | |
uint32_t | CLOCK_GetLpavAudClkFreq (void) |
Gets the audio clock frequency in LPAV. More... | |
uint32_t | CLOCK_GetSaiFreq (uint32_t instance) |
Gets the SAI clock frequency. More... | |
uint32_t | CLOCK_GetSpdifFreq (void) |
Gets the SPDIF clock frequency. More... | |
uint32_t | CLOCK_GetMqsFreq (uint32_t instance) |
Gets the MQS clock frequency. More... | |
uint32_t | CLOCK_GetMicfilFreq (void) |
Gets the EMICFIL clock frequency. More... | |
uint32_t | CLOCK_GetMrtFreq (void) |
Gets the MRT clock frequency. More... | |
struct _cgc_rtd_sys_clk_config |
Data Fields | |
uint32_t | divSlow: 6 |
Slow clock divider, selected division is the value of the field + 1. | |
uint32_t | __pad0__: 1 |
Reserved. More... | |
uint32_t | divBus: 6 |
Bus clock divider, selected division is the value of the field + 1. More... | |
uint32_t | __pad1__: 8 |
Reserved. More... | |
uint32_t | divCore: 6 |
Core/Platform clock divider, selected division is the value of the field + 1. More... | |
uint32_t | switchFin: 1 |
1: Clock is running. More... | |
uint32_t | src: 3 |
System clock source, see cgc_rtd_sys_clk_src_t. More... | |
uint32_t | locked: 1 |
Clock register locked. More... | |
uint32_t _cgc_rtd_sys_clk_config::__pad0__ |
uint32_t _cgc_rtd_sys_clk_config::divBus |
uint32_t _cgc_rtd_sys_clk_config::__pad1__ |
uint32_t _cgc_rtd_sys_clk_config::divCore |
uint32_t _cgc_rtd_sys_clk_config::switchFin |
0: Clock is not running.
uint32_t _cgc_rtd_sys_clk_config::src |
uint32_t _cgc_rtd_sys_clk_config::locked |
struct _cgc_hifi_sys_clk_config |
Data Fields | |
uint32_t | __pad0__: 14 |
Reserved. More... | |
uint32_t | divPlat: 6 |
Platform clock divider, selected division is the value of the field + 1. More... | |
uint32_t | __pad1__: 1 |
Reserved. More... | |
uint32_t | divCore: 6 |
Core clock divider, selected division is the value of the field + 1. More... | |
uint32_t | switchFin: 1 |
1: Clock is running. More... | |
uint32_t | src: 3 |
System clock source, see cgc_hifi_sys_clk_src_t. More... | |
uint32_t | locked: 1 |
Clock register locked. More... | |
uint32_t _cgc_hifi_sys_clk_config::__pad0__ |
uint32_t _cgc_hifi_sys_clk_config::divPlat |
uint32_t _cgc_hifi_sys_clk_config::__pad1__ |
uint32_t _cgc_hifi_sys_clk_config::divCore |
uint32_t _cgc_hifi_sys_clk_config::switchFin |
0: Clock is not running.
uint32_t _cgc_hifi_sys_clk_config::src |
uint32_t _cgc_hifi_sys_clk_config::locked |
struct _cgc_lpav_sys_clk_config |
Data Fields | |
uint32_t | __pad0__: 7 |
Reserved. More... | |
uint32_t | divBus: 6 |
Platform clock divider, selected division is the value of the field + 1. More... | |
uint32_t | __pad1__: 1 |
Reserved. More... | |
uint32_t | divAhb: 6 |
Platform clock divider, selected division is the value of the field + 1. More... | |
uint32_t | __pad2__: 1 |
Reserved. More... | |
uint32_t | divAxi: 6 |
Core clock divider, selected division is the value of the field + 1. More... | |
uint32_t | switchFin: 1 |
1: Clock is running. More... | |
uint32_t | src: 2 |
System clock source, see cgc_lpav_sys_clk_src_t. More... | |
uint32_t | __pad3__: 1 |
Reserved. More... | |
uint32_t | locked: 1 |
Clock register locked. More... | |
uint32_t _cgc_lpav_sys_clk_config::__pad0__ |
uint32_t _cgc_lpav_sys_clk_config::divBus |
uint32_t _cgc_lpav_sys_clk_config::__pad1__ |
uint32_t _cgc_lpav_sys_clk_config::divAhb |
uint32_t _cgc_lpav_sys_clk_config::__pad2__ |
uint32_t _cgc_lpav_sys_clk_config::divAxi |
uint32_t _cgc_lpav_sys_clk_config::switchFin |
0: Clock is not running.
uint32_t _cgc_lpav_sys_clk_config::src |
uint32_t _cgc_lpav_sys_clk_config::__pad3__ |
uint32_t _cgc_lpav_sys_clk_config::locked |
struct _cgc_ddr_sys_clk_config |
Data Fields | |
uint32_t | __pad0__: 21 |
Reserved. More... | |
uint32_t | divDdr: 6 |
DDR clock divider, selected division is the value of the field + 1. More... | |
uint32_t | switchFin: 1 |
1: Clock is running. More... | |
uint32_t | src: 3 |
System clock source, see cgc_lpav_sys_clk_src_t. More... | |
uint32_t | locked: 1 |
Clock register locked. More... | |
uint32_t _cgc_ddr_sys_clk_config::__pad0__ |
uint32_t _cgc_ddr_sys_clk_config::divDdr |
uint32_t _cgc_ddr_sys_clk_config::switchFin |
0: Clock is not running.
uint32_t _cgc_ddr_sys_clk_config::src |
uint32_t _cgc_ddr_sys_clk_config::locked |
struct _cgc_sosc_config |
Data Fields | |
uint32_t | freq |
System OSC frequency. More... | |
cgc_sosc_monitor_mode_t | monitorMode |
Clock monitor mode selected. More... | |
uint8_t | enableMode |
Enable mode, OR'ed value of _cgc_sosc_enable_mode. More... | |
cgc_sosc_mode_t | workMode |
OSC work mode. More... | |
uint32_t _cgc_sosc_config::freq |
cgc_sosc_monitor_mode_t _cgc_sosc_config::monitorMode |
uint8_t _cgc_sosc_config::enableMode |
cgc_sosc_mode_t _cgc_sosc_config::workMode |
struct _cgc_fro_config |
Data Fields | |
uint32_t | enableMode |
Enable mode, OR'ed value of _cgc_fro_enable_mode. More... | |
uint32_t _cgc_fro_config::enableMode |
struct _cgc_lposc_config |
Data Fields | |
uint32_t | enableMode |
Enable mode, OR'ed value of _cgc_lposc_enable_mode. More... | |
uint32_t _cgc_lposc_config::enableMode |
struct _cgc_pll0_config |
Data Fields | |
uint8_t | enableMode |
Enable mode, OR'ed value of _cgc_pll_enable_mode. | |
uint8_t | div1 |
PLLDIV_VCO divider value. More... | |
uint8_t | pfd1Div |
PLLDIV_PFD_0 DIV1 divider value. More... | |
uint8_t | pfd2Div |
PLLDIV_PFD_0 DIV2 divider value. More... | |
cgc_pll_src_t | src |
Clock source. More... | |
cgc_pll0_mult_t | mult |
PLL multiplier. More... | |
uint8_t _cgc_pll0_config::div1 |
Disabled when div1 == 0.
uint8_t _cgc_pll0_config::pfd1Div |
Disabled when pfd1Div == 0.
uint8_t _cgc_pll0_config::pfd2Div |
Disabled when pfd2Div == 0.
cgc_pll_src_t _cgc_pll0_config::src |
cgc_pll0_mult_t _cgc_pll0_config::mult |
struct _cgc_rosc_config |
Data Fields | |
cgc_rosc_monitor_mode_t | monitorMode |
Clock monitor mode selected. More... | |
cgc_rosc_monitor_mode_t _cgc_rosc_config::monitorMode |
struct _cgc_pll1_config |
Data Fields | |
uint8_t | enableMode |
Enable mode, OR'ed value of _cgc_pll_enable_mode. | |
uint8_t | div1 |
PLLDIV_VCO divider value. More... | |
uint8_t | pfd1Div |
PLLDIV_PFD_0 DIV1 divider value. More... | |
uint8_t | pfd2Div |
PLLDIV_PFD_0 DIV2 divider value. More... | |
cgc_pll_src_t | src |
Clock source. More... | |
cgc_pll1_mult_t | mult |
PLL1 multiplier. More... | |
uint32_t | num: 30 |
30-bit numerator of the PLL1 Fractional-Loop divider. More... | |
uint32_t | denom: 30 |
30-bit denominator of the PLL1 Fractional-Loop divider. More... | |
uint8_t _cgc_pll1_config::div1 |
Disabled when div1 == 0.
uint8_t _cgc_pll1_config::pfd1Div |
Disabled when pfd1Div == 0.
uint8_t _cgc_pll1_config::pfd2Div |
Disabled when pfd2Div == 0.
cgc_pll_src_t _cgc_pll1_config::src |
cgc_pll1_mult_t _cgc_pll1_config::mult |
uint32_t _cgc_pll1_config::num |
uint32_t _cgc_pll1_config::denom |
struct _cgc_pll4_config |
Data Fields | |
uint8_t | enableMode |
Enable mode, OR'ed value of _cgc_pll_enable_mode. | |
uint8_t | div1 |
PLLDIV_VCO divider value. More... | |
uint8_t | pfd0Div1 |
PLLDIV_PFD_0 DIV1 divider value. More... | |
uint8_t | pfd0Div2 |
PLLDIV_PFD_0 DIV2 divider value. More... | |
uint8_t | pfd1Div1 |
PLLDIV_PFD_0 DIV3 divider value. More... | |
uint8_t | pfd1Div2 |
PLLDIV_PFD_0 DIV4 divider value. More... | |
uint8_t | pfd2Div1 |
PLLDIV_PFD_1 DIV1 divider value. More... | |
uint8_t | pfd2Div2 |
PLLDIV_PFD_1 DIV2 divider value. More... | |
uint8_t | pfd3Div1 |
PLLDIV_PFD_2 DIV3 divider value. More... | |
uint8_t | pfd3Div2 |
PLLDIV_PFD_2 DIV4 divider value. More... | |
cgc_pll_src_t | src |
Clock source. More... | |
cgc_pll4_mult_t | mult |
PLL4 multiplier. More... | |
uint32_t | num: 30 |
30-bit numerator of the PLL4 Fractional-Loop divider. More... | |
uint32_t | denom: 30 |
30-bit denominator of the PLL4 Fractional-Loop divider. More... | |
uint8_t _cgc_pll4_config::div1 |
Disabled when div1 == 0.
uint8_t _cgc_pll4_config::pfd0Div1 |
Disabled when pfd0Div1 == 0.
uint8_t _cgc_pll4_config::pfd0Div2 |
Disabled when pfd0Div2 == 0.
uint8_t _cgc_pll4_config::pfd1Div1 |
Disabled when pfd1Div1 == 0.
uint8_t _cgc_pll4_config::pfd1Div2 |
Disabled when pfd1Div2 == 0.
uint8_t _cgc_pll4_config::pfd2Div1 |
Disabled when pfd2Div1 == 0.
uint8_t _cgc_pll4_config::pfd2Div2 |
Disabled when pfd2Div2 == 0.
uint8_t _cgc_pll4_config::pfd3Div1 |
Disabled when pfd3Div1 == 0.
uint8_t _cgc_pll4_config::pfd3Div2 |
Disabled when pfd3Div2 == 0.
cgc_pll_src_t _cgc_pll4_config::src |
cgc_pll4_mult_t _cgc_pll4_config::mult |
uint32_t _cgc_pll4_config::num |
uint32_t _cgc_pll4_config::denom |
#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.
#define FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) |
#define PCC_PCS_VAL | ( | reg | ) | (((reg)&PCC_CLKCFG_PCS_MASK) >> PCC_CLKCFG_PCS_SHIFT) |
#define RGPIO_CLOCKS |
#define SAI_CLOCKS |
#define PCTL_CLOCKS |
#define LPI2C_CLOCKS |
#define I3C_CLOCKS |
#define FLEXIO_CLOCKS |
#define FLEXCAN_CLOCKS |
#define PDM_CLOCKS |
#define LCDIF_CLOCKS |
#define MIPI_DSI_HOST_CLOCKS |
#define EDMA_CLOCKS |
#define EDMA_CHAN_CLOCKS |
#define LPUART_CLOCKS |
#define DAC_CLOCKS |
#define LPTMR_CLOCKS |
#define LPADC_CLOCKS |
#define LPSPI_CLOCKS |
#define TPM_CLOCKS |
#define LPIT_CLOCKS |
#define CMP_CLOCKS |
#define WDOG_CLOCKS |
Clock ip name array for WDOG.
#define SEMA42_CLOCKS |
#define TPIU_CLOCKS |
#define FLEXSPI_CLOCKS |
#define MRT_CLOCKS |
#define BBNSM_CLOCKS |
#define PXP_CLOCKS |
#define EPDC_CLOCKS |
typedef enum _clock_name clock_name_t |
typedef enum _clock_ip_name clock_ip_name_t |
[31:2] is defined as the corresponding register address. [ 1:1] is used as indicator of existing of PCS. [ 0:0] is used as indicator of existing of PCD/FRAC.
typedef enum _cgc_sosc_mode cgc_sosc_mode_t |
enum _clock_name |
enum _clock_ip_src |
enum _clock_lptmr_src |
enum _clock_ip_name |
[31:2] is defined as the corresponding register address. [ 1:1] is used as indicator of existing of PCS. [ 0:0] is used as indicator of existing of PCD/FRAC.
enum _cgc_sys_clk |
enum _cgc_rtd_sys_clk_src |
enum _cgc_nic_sys_clk_src |
enum _cgc_ddr_sys_clk_src |
enum _cgc_async_clk |
enum _cgc_sosc_mode |
enum _cgc_fro_enable_mode |
enum _cgc_pll_src |
enum _cgc_pll_enable_mode |
enum _cgc_pll_pfd_clkout |
enum _cgc_pll0_mult |
enum _cgc_pll1_mult |
enum _cgc_pll4_mult |
enum _cgc_rtd_audclk_src |
enum _cgc_ad_audclk_src |
enum _cgc_lpav_audclk_src |
|
inlinestatic |
name | Which clock to enable, see clock_ip_name_t. |
|
inlinestatic |
name | Which clock to disable, see clock_ip_name_t. |
|
inlinestatic |
name | Which peripheral to check, see clock_ip_name_t. |
void CLOCK_SetIpSrc | ( | clock_ip_name_t | name, |
clock_ip_src_t | src | ||
) |
Set the clock source for specific IP, not all modules need to set the clock source, should only use this function for the modules need source setting.
name | Which peripheral to check, see clock_ip_name_t. |
src | Clock source to set. |
void CLOCK_SetIpSrcDiv | ( | clock_ip_name_t | name, |
clock_ip_src_t | src, | ||
uint8_t | divValue, | ||
uint8_t | fracValue | ||
) |
Set the clock source and divider for specific IP, not all modules need to set the clock source and divider, should only use this function for the modules need source and divider setting.
Divider output clock = Divider input clock x [(fracValue+1)/(divValue+1)]).
name | Which peripheral to check, see clock_ip_name_t. |
src | Clock source to set. |
divValue | The divider value. |
fracValue | The fraction multiply value. |
|
inlinestatic |
NOTE: The audio clock pin frequency is decided by SAI, but clock driver cannot depend on SAI driver to get its pin frequencies, user need to explicitly set the MCLK/BCLK frequencies if other modules use the AUD_CLK0 source and need to get correct frequency.
src | Clock source to set. |
|
inlinestatic |
NOTE: The audio clock pin frequency is decided by SAI, but clock driver cannot depend on SAI driver to get its pin frequencies, user need to explicitly set the MCLK/BCLK frequencies if other modules use the AUD_CLK1 source and need to get correct frequency.
src | Clock source to set. |
|
inlinestatic |
NOTE: The audio clock pin frequency is decided by SAI, but clock driver cannot depend on SAI driver to get its pin frequencies, user need to explicitly set the MCLK/BCLK frequencies if other modules use the AUD_CLK2 source and need to get correct frequency.
src | Clock source to set. |
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.
clockName | Clock names defined in clock_name_t |
uint32_t CLOCK_GetCm33CorePlatClkFreq | ( | void | ) |
uint32_t CLOCK_GetCm33BusClkFreq | ( | void | ) |
uint32_t CLOCK_GetCm33SlowClkFreq | ( | void | ) |
uint32_t CLOCK_GetFusionDspCorePlatClkFreq | ( | void | ) |
uint32_t CLOCK_GetFusionDspBusClkFreq | ( | void | ) |
uint32_t CLOCK_GetFusionDspSlowClkFreq | ( | void | ) |
uint32_t CLOCK_GetLvdsClkFreq | ( | void | ) |
uint32_t CLOCK_GetIpFreq | ( | clock_ip_name_t | name | ) |
This function gets the IP module clock frequency. It is only used for the IP modules which could select clock source by CLOCK_SetIpSrc().
name | Which peripheral to get, see clock_ip_name_t. |
uint32_t CLOCK_GetCm33SysClkFreq | ( | cgc_sys_clk_t | type | ) |
This function gets the CGC CM33 system clock frequency. These clocks are used for core, platform, bus and slow clock domains.
type | Which type of clock to get. |
|
inlinestatic |
This function sets the system clock configuration for CM33 domain.
config | Pointer to the configuration. |
uint32_t CLOCK_GetFusionDspSysClkFreq | ( | cgc_sys_clk_t | type | ) |
This function gets the CGC Fusion DSP system clock frequency. These clocks are used for core, platform, bus and slow clock domains.
type | Which type of clock to get. |
|
inlinestatic |
This function sets the system clock configuration for FusionF1 DSP domain.
config | Pointer to the configuration. |
|
inlinestatic |
This function gets the system configuration for CM33 domain.
config | Pointer to the configuration. |
|
inlinestatic |
This function gets the system configuration for FusionF1 DSP domain.
config | Pointer to the configuration. |
|
inlinestatic |
This function sets the clock out configuration.
setting | The selection to set. |
div | The divider to set (div > 0). |
enable | Enable clock out. |
|
inlinestatic |
This function sets the RTC_CLOCKOUT configuration.
div | The divider to set (div > 0). |
uint32_t CLOCK_GetXbarBusClkFreq | ( | void | ) |
This function gets the CGC XBAR bus clock frequency.
uint32_t CLOCK_GetHifiDspSysClkFreq | ( | cgc_sys_clk_t | type | ) |
This function gets the CGC HIFI DSP system clock frequency. These clocks are used for core, platform domains.
type | Which type of clock to get. |
|
inlinestatic |
This function sets the system clock configuration for HIFI4 DSP domain.
config | Pointer to the configuration. |
|
inlinestatic |
This function gets the system configuration for HIFI4 DSP domain.
config | Pointer to the configuration. |
uint32_t CLOCK_GetLpavSysClkFreq | ( | cgc_sys_clk_t | type | ) |
This function gets the CGC NIC LPAV system clock frequency. These clocks are used for AXI, AHB, Bus domains.
type | Which type of clock to get. |
|
inlinestatic |
This function sets the system clock configuration for NIC LPAV domain.
config | Pointer to the configuration. |
|
inlinestatic |
This function gets the system configuration for NIC LPAV domain.
config | Pointer to the configuration. |
uint32_t CLOCK_GetDdrClkFreq | ( | void | ) |
This function gets the CGC DDR clock frequency.
|
inlinestatic |
This function sets the clock out configuration.
setting | The selection to set. |
div | The divider to set (div > 0). |
enable | Enable clock out. |
status_t CLOCK_InitSysOsc | ( | const cgc_sosc_config_t * | config | ) |
This function enables the CGC system OSC clock according to the configuration.
config | Pointer to the configuration structure. |
kStatus_Success | System OSC is initialized. |
kStatus_CGC_Busy | System OSC has been enabled and is used by the system clock. |
kStatus_ReadOnly | System OSC control register is locked. |
status_t CLOCK_DeinitSysOsc | ( | void | ) |
This function disables the CGC system OSC clock.
kStatus_Success | System OSC is deinitialized. |
kStatus_CGC_Busy | System OSC is used by the system clock. |
kStatus_ReadOnly | System OSC control register is locked. |
void CLOCK_SetRtdSysOscAsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
void CLOCK_SetAdSysOscAsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
void CLOCK_SetLpavSysOscAsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
uint32_t CLOCK_GetSysOscFreq | ( | void | ) |
uint32_t CLOCK_GetRtdSysOscAsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetAdSysOscAsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetLpavSysOscAsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
|
inlinestatic |
|
inlinestatic |
This function sets the system OSC monitor mode. The mode can be disabled, it can generate an interrupt when the error is disabled, or reset when the error is detected.
mode | Monitor mode to set. |
|
inlinestatic |
|
inlinestatic |
status_t CLOCK_InitFro | ( | const cgc_fro_config_t * | config | ) |
This function initializes the CGC FRO clock according to the configuration.
config | Pointer to the configuration structure. |
kStatus_Success | FRO is initialized. |
kStatus_CGC_Busy | FRO has been enabled and is used by system clock. |
kStatus_ReadOnly | FRO control register is locked. |
status_t CLOCK_DeinitFro | ( | void | ) |
This function deinitializes the CGC FRO.
kStatus_Success | FRO is deinitialized. |
kStatus_CGC_Busy | FRO is used by system clock. |
kStatus_ReadOnly | FRO control register is locked. |
void CLOCK_SetRtdFroAsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
void CLOCK_SetAdFroAsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
void CLOCK_SetLpavFroAsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
void CLOCK_EnableFroTuning | ( | bool | enable | ) |
On enable, the function will wait until FRO is close to the target frequency.
uint32_t CLOCK_GetFroFreq | ( | void | ) |
uint32_t CLOCK_GetRtdFroAsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetAdFroAsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetLpavFroAsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
|
inlinestatic |
|
inlinestatic |
status_t CLOCK_InitLposc | ( | const cgc_lposc_config_t * | config | ) |
This function initializes the CGC LPOSC clock according to the configuration.
config | Pointer to the configuration structure. |
kStatus_Success | LPOSC is initialized. |
kStatus_ReadOnly | FRO control register is locked. |
status_t CLOCK_DeinitLposc | ( | void | ) |
This function deinitializes the CGC LPOSC.
kStatus_Success | LPOSC is deinitialized. |
kStatus_ReadOnly | LPOSC control register is locked. |
|
inlinestatic |
uint32_t CLOCK_GetLpOscFreq | ( | void | ) |
uint32_t CLOCK_GetRtcOscFreq | ( | void | ) |
|
inlinestatic |
void CLOCK_SetRtcOscMonitorMode | ( | cgc_rosc_monitor_mode_t | mode | ) |
This function sets the RTC OSC monitor mode. The mode can be disabled. It can generate an interrupt when the error is disabled, or reset when the error is detected.
mode | Monitor mode to set. |
|
inlinestatic |
|
inlinestatic |
status_t CLOCK_InitPll0 | ( | const cgc_pll0_config_t * | config | ) |
This function enables the CGC PLL0 clock according to the configuration. The PLL0 can use the OSC or FRO as the clock source. Ensure that the source clock is valid before calling this function.
Example code for initializing PLL0 clock output:
config | Pointer to the configuration structure. |
kStatus_Success | PLL0 is initialized. |
kStatus_CGC_Busy | PLL0 has been enabled and is used by the system clock. |
kStatus_ReadOnly | PLL0 control register is locked. |
status_t CLOCK_DeinitPll0 | ( | void | ) |
This function disables the CGC PLL0.
kStatus_Success | PLL0 is deinitialized. |
kStatus_CGC_Busy | PLL0 is used by the system clock. |
kStatus_ReadOnly | PLL0 control register is locked. |
void CLOCK_SetPll0AsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
uint32_t CLOCK_GetPll0Freq | ( | void | ) |
uint32_t CLOCK_GetPll0AsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetPll0PfdFreq | ( | cgc_pll_pfd_clkout_t | pfdClkout | ) |
pfdClkout | The selected PFD clock out. See "cgc_pll_pfd_clkout_t". |
void CLOCK_EnablePll0PfdClkout | ( | cgc_pll_pfd_clkout_t | pfdClkout, |
uint8_t | fracValue | ||
) |
PLL Frequency = Fref * MULT PFD Clock Frequency = PLL output frequency * 18/frac value
pfdClkout | PLL0 PFD clock out select. |
fracValue | Fractional Divider value. Recommended to be kept between 12-35 for all PFDs. |
|
inlinestatic |
lockTime | Reference clocks to count before PLL0 is considered locked and valid. |
|
inlinestatic |
|
inlinestatic |
status_t CLOCK_InitPll1 | ( | const cgc_pll1_config_t * | config | ) |
This function enables the CGC PLL1 clock according to the configuration. The PLL1 can use the system OSC or FRO as the clock source. Ensure that the source clock is valid before calling this function.
Example code for initializing PLL1 clock output:
config | Pointer to the configuration structure. |
kStatus_Success | PLL1 is initialized. |
kStatus_CGC_Busy | PLL1 has been enabled and is used by the system clock. |
kStatus_ReadOnly | PLL1 control register is locked. |
status_t CLOCK_DeinitPll1 | ( | void | ) |
This function disables the CGC PLL1.
kStatus_Success | PLL1 is deinitialized. |
kStatus_CGC_Busy | PLL1 is used by the system clock. |
kStatus_ReadOnly | PLL1 control register is locked. |
void CLOCK_SetPll1AsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
uint32_t CLOCK_GetPll1Freq | ( | void | ) |
uint32_t CLOCK_GetPll1AsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetPll1PfdFreq | ( | cgc_pll_pfd_clkout_t | pfdClkout | ) |
pfdClkout | The selected PFD clocks out. See "cgc_pll_pfd_clkout_t". |
void CLOCK_EnablePll1PfdClkout | ( | cgc_pll_pfd_clkout_t | pfdClkout, |
uint8_t | fracValue | ||
) |
PLL1 Frequency = Fref * (MULT + NUM/DENOM) PFD Clock Frequency = PLL output frequency * 18/frac value
Example code for configuring PLL1 as PLL1 PFD clock output:
pfdClkout | PLL1 PFD clock out select. |
fracValue | Fractional Divider value. Recommended to be kept between 12-35 for all PFDs. |
|
inlinestatic |
This function sets the CGC PLL1 spread spectrum modulation configurations. STOP and STEP together control the modulation depth (maximum frequency change) and modulation frequency.
Modulation Depth = (STOP/MFD)*Fref where MFD is the DENOM field value in DENOM register. Modulation Frequency = (STEP/(2*STOP))*Fref.
step | PLL1 Spread Spectrum STEP. |
stop | PLL1 Spread Spectrum STOP. |
|
inlinestatic |
lockTime | Reference clocks to count before PLL1 is considered locked and valid. |
|
inlinestatic |
|
inlinestatic |
uint32_t CLOCK_GetPll3Freq | ( | void | ) |
uint32_t CLOCK_GetPll3AsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetPll3PfdFreq | ( | cgc_pll_pfd_clkout_t | pfdClkout | ) |
pfdClkout | The selected PFD clock out. See "cgc_pll_pfd_clkout_t". |
status_t CLOCK_InitPll4 | ( | const cgc_pll4_config_t * | config | ) |
This function enables the CGC PLL4 clock according to the configuration. The PLL4 can use the OSC or FRO as the clock source. Ensure that the source clock is valid before calling this function.
Example code for initializing PLL4 clock output:
config | Pointer to the configuration structure. |
kStatus_Success | PLL4 is initialized. |
kStatus_CGC_Busy | PLL4 has been enabled and is used by the system clock. |
kStatus_ReadOnly | PLL4 control register is locked. |
status_t CLOCK_DeinitPll4 | ( | void | ) |
This function disables the CGC PLL4.
kStatus_Success | PLL4 is deinitialized. |
kStatus_CGC_Busy | PLL4 is used by the system clock. |
kStatus_ReadOnly | PLL4 control register is locked. |
void CLOCK_SetPll4AsyncClkDiv | ( | cgc_async_clk_t | asyncClk, |
uint8_t | divider | ||
) |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. Disabled when divider == 0. |
uint32_t CLOCK_GetPll4Freq | ( | void | ) |
uint32_t CLOCK_GetPll4AsyncFreq | ( | cgc_async_clk_t | type | ) |
type | The asynchronous clock type. |
uint32_t CLOCK_GetPll4PfdFreq | ( | cgc_pll_pfd_clkout_t | pfdClkout | ) |
pfdClkout | The selected PFD clock out. See "cgc_pll_pfd_clkout_t". |
void CLOCK_EnablePll4PfdClkout | ( | cgc_pll_pfd_clkout_t | pfdClkout, |
uint8_t | fracValue | ||
) |
PLL Frequency = Fref * MULT PFD Clock Frequency = PLL output frequency * 18/frac value
pfdClkout | PLL4 PFD clock out select. |
fracValue | Fractional Divider value. Recommended to be kept between 12-35 for all PFDs. |
|
inlinestatic |
This function sets the CGC PLL4 spread spectrum modulation configurations. STOP and STEP together control the modulation depth (maximum frequency change) and modulation frequency.
Modulation Depth = (STOP/MFD)*Fref where MFD is the DENOM field value in DENOM register. Modulation Frequency = (STEP/(2*STOP))*Fref.
step | PLL4 Spread Spectrum STEP. |
stop | PLL4 Spread Spectrum STOP. |
|
inlinestatic |
lockTime | Reference clocks to count before PLL4 is considered locked and valid. |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
freq | The XTAL0/EXTAL0 input clock frequency in Hz. |
|
inlinestatic |
freq | The XTAL32/EXTAL32 input clock frequency in Hz. |
|
inlinestatic |
freq | The LVDS pad input clock frequency in Hz. |
|
inlinestatic |
index | The MCLK index. |
freq | The MCLK pad input clock frequency in Hz. |
|
inlinestatic |
instance | The SAI instance to contribute to this RX_BCLK pad. |
freq | The RX_BCLK pad input clock frequency in Hz. |
|
inlinestatic |
instance | The SAI instance to contribute to this TX_BCLK pad. |
freq | The TX_BCLK pad input clock frequency in Hz. |
|
inlinestatic |
freq | The SPDIF_RX input clock frequency in Hz. |
uint32_t CLOCK_GetWdogClkFreq | ( | uint32_t | instance | ) |
instance | The WDOG instance (0-2,5). |
uint32_t CLOCK_GetFlexspiClkFreq | ( | uint32_t | instance | ) |
instance | The FlexSPI instance (0-1). |
uint32_t CLOCK_GetLpitClkFreq | ( | void | ) |
uint32_t CLOCK_GetFlexioClkFreq | ( | void | ) |
uint32_t CLOCK_GetI3cClkFreq | ( | uint32_t | instance | ) |
instance | The I3C instance (0-1). |
uint32_t CLOCK_GetLpspiClkFreq | ( | uint32_t | instance | ) |
instance | The LPSPI instance (0-3). |
uint32_t CLOCK_GetAdcClkFreq | ( | uint32_t | instance | ) |
instance | The ADC instance (0-1). |
uint32_t CLOCK_GetDacClkFreq | ( | uint32_t | instance | ) |
instance | The DAC instance (0-1). |
uint32_t CLOCK_GetTpiuClkFreq | ( | void | ) |
uint32_t CLOCK_GetSwoClkFreq | ( | void | ) |
uint32_t CLOCK_GetTpmClkFreq | ( | uint32_t | instance | ) |
instance | The TPM instance (0-8). |
uint32_t CLOCK_GetLpi2cClkFreq | ( | uint32_t | instance | ) |
instance | The LPI2C instance (0-3). |
uint32_t CLOCK_GetLpuartClkFreq | ( | uint32_t | instance | ) |
instance | The LPUART instance (0-3). |
uint32_t CLOCK_GetFlexcanClkFreq | ( | void | ) |
uint32_t CLOCK_GetCsiClkFreq | ( | void | ) |
uint32_t CLOCK_GetDsiClkFreq | ( | void | ) |
uint32_t CLOCK_GetEpdcClkFreq | ( | void | ) |
uint32_t CLOCK_GetGpu2dClkFreq | ( | void | ) |
uint32_t CLOCK_GetGpu3dClkFreq | ( | void | ) |
uint32_t CLOCK_GetDcnanoClkFreq | ( | void | ) |
uint32_t CLOCK_GetCsiUiClkFreq | ( | void | ) |
uint32_t CLOCK_GetCsiEscClkFreq | ( | void | ) |
uint32_t CLOCK_GetRtdAudClkFreq | ( | void | ) |
uint32_t CLOCK_GetAdAudClkFreq | ( | void | ) |
uint32_t CLOCK_GetLpavAudClkFreq | ( | void | ) |
uint32_t CLOCK_GetSaiFreq | ( | uint32_t | instance | ) |
instance | The SAI instance (0-7). |
uint32_t CLOCK_GetSpdifFreq | ( | void | ) |
uint32_t CLOCK_GetMqsFreq | ( | uint32_t | instance | ) |
instance | The MQS instance (0-1). |
uint32_t CLOCK_GetMicfilFreq | ( | void | ) |
uint32_t CLOCK_GetMrtFreq | ( | void | ) |
uint32_t CLOCK_GetRtdSysClkFreq | ( | uint32_t | config, |
cgc_sys_clk_t | type | ||
) |
This function gets the CGC system clock frequency. These clocks are used for core, platform, bus and slow clock domains.
config | Config value from CGC register. |
type | Which type of clock to get. |
volatile uint32_t g_xtal0Freq |
The XTAL (SYSOSC) clock frequency in Hz. When the clock is set up, use the function CLOCK_SetXtalFreq to set the value in the clock driver. For example, if XTAL is 24 MHz:
This is important for the multicore platforms where only one core needs to set up the OSC/SYSOSC using CLOCK_InitSysOsc. All other cores need to call the CLOCK_SetXtalFreq to get a valid clock frequency.
volatile uint32_t g_xtal32Freq |
The XTAL32/EXTAL32 clock frequency in Hz. When the clock is set up, use the function CLOCK_SetXtal32Freq to set the value in the clock driver.
This is important for the multicore platforms where only one core needs to set up the clock. All other cores need to call the CLOCK_SetXtal32Freq to get a valid clock frequency.
volatile uint32_t g_lvdsFreq |
The LVDS pad clock frequency in Hz. When the clock is set up, use the function CLOCK_SetLvdsFreq to set the value in the clock driver.
volatile uint32_t g_mclkFreq[4] |
The MCLK pad clock frequency in Hz. When the clock is set up, use the function CLOCK_SetMclkFreq to set the value in the clock driver.
volatile uint32_t g_rxBclkFreq[8] |
The RX_BCLK pad clock frequency in Hz. When the clock is set up, use the function CLOCK_SetRxBclkFreq to set the value in the clock driver.
volatile uint32_t g_txBclkFreq[8] |
The TX_BCLK pad clock frequency in Hz. When the clock is set up, use the function CLOCK_SetTxBclkFreq to set the value in the clock driver.
volatile uint32_t g_spdifRxFreq |
The SPDIF_RX clock frequency in Hz. When the clock is sampled, use the function CLOCK_SetSpdifRxFreq to set the value in the clock driver.