![]() |
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 | _scg_sys_clk_config |
SCG system clock configuration. More... | |
struct | _scg_sosc_config |
SCG system OSC configuration. More... | |
struct | _scg_sirc_config |
SCG slow IRC clock configuration. More... | |
struct | _scg_firc_trim_config |
SCG fast IRC clock trim configuration. More... | |
struct | _scg_firc_config_t |
SCG fast IRC clock configuration. More... | |
struct | _scg_lpfll_trim_config |
SCG LPFLL clock trim configuration. More... | |
struct | _scg_lpfll_config |
SCG low power FLL configuration. More... | |
Macros | |
#define | FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL 0 |
Configure whether driver controls clock. More... | |
#define | DMAMUX_CLOCKS |
Clock ip name array for DMAMUX. More... | |
#define | PORT_CLOCKS |
Clock ip name array for PORT. More... | |
#define | LPI2C_CLOCKS |
Clock ip name array for LPI2C. More... | |
#define | FLEXIO_CLOCKS |
Clock ip name array for FLEXIO. More... | |
#define | TSI_CLOCKS |
Clock ip name array for TSI. More... | |
#define | EDMA_CLOCKS |
Clock ip name array for EDMA. More... | |
#define | LPUART_CLOCKS |
Clock ip name array for LPUART. More... | |
#define | LPTMR_CLOCKS |
Clock ip name array for LPTMR. More... | |
#define | ADC12_CLOCKS |
Clock ip name array for ADC12. More... | |
#define | LPSPI_CLOCKS |
Clock ip name array for LPSPI. More... | |
#define | LPIT_CLOCKS |
Clock ip name array for LPIT. More... | |
#define | CRC_CLOCKS |
Clock ip name array for CRC. More... | |
#define | CMP_CLOCKS |
Clock ip name array for CMP. More... | |
#define | FLASH_CLOCKS |
Clock ip name array for FLASH. More... | |
#define | EWM_CLOCKS |
Clock ip name array for EWM. More... | |
#define | FTM_CLOCKS |
Clock ip name array for FLEXTMR. More... | |
#define | PWT_CLOCKS |
Clock ip name array for PWT. More... | |
#define | FLEXIOTRIG_CLOCKS |
Clock ip name array for FLEXIO_TRIG0/1 Aync clock. More... | |
#define | LPO_CLK_FREQ 128000U |
LPO clock frequency. | |
#define | CLOCK_GetOsc0ErClkFreq CLOCK_GetErClkFreq |
For compatible with other MCG platforms. 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_ip_name | clock_ip_name_t |
Peripheral clock name difinition used for clock gate, clock source and clock divider setting. More... | |
typedef enum _scg_sys_clk | scg_sys_clk_t |
SCG system clock type. | |
typedef enum _scg_sys_clk_src | scg_sys_clk_src_t |
SCG system clock source. | |
typedef enum _scg_sys_clk_div | scg_sys_clk_div_t |
SCG system clock divider value. | |
typedef struct _scg_sys_clk_config | scg_sys_clk_config_t |
SCG system clock configuration. | |
typedef enum _clock_clkout_src | clock_clkout_src_t |
SCG clock out configuration (CLKOUTSEL). | |
typedef enum _scg_async_clk | scg_async_clk_t |
SCG asynchronous clock type. | |
typedef enum scg_async_clk_div | scg_async_clk_div_t |
SCG asynchronous clock divider value. | |
typedef enum _scg_sosc_monitor_mode | scg_sosc_monitor_mode_t |
SCG system OSC monitor mode. | |
typedef enum _scg_sosc_mode | scg_sosc_mode_t |
OSC work mode. More... | |
typedef struct _scg_sosc_config | scg_sosc_config_t |
SCG system OSC configuration. | |
typedef enum _scg_sirc_range | scg_sirc_range_t |
SCG slow IRC clock frequency range. | |
typedef struct _scg_sirc_config | scg_sirc_config_t |
SCG slow IRC clock configuration. | |
typedef enum _scg_firc_trim_mode | scg_firc_trim_mode_t |
SCG fast IRC trim mode. | |
typedef enum _scg_firc_trim_div | scg_firc_trim_div_t |
SCG fast IRC trim predivided value for system OSC. | |
typedef enum _scg_firc_trim_src | scg_firc_trim_src_t |
SCG fast IRC trim source. | |
typedef struct _scg_firc_trim_config | scg_firc_trim_config_t |
SCG fast IRC clock trim configuration. | |
typedef enum _scg_firc_range | scg_firc_range_t |
SCG fast IRC clock frequency range. | |
typedef struct _scg_firc_config_t | scg_firc_config_t |
SCG fast IRC clock configuration. | |
typedef enum _scg_lpfll_range | scg_lpfll_range_t |
SCG LPFLL clock frequency range. | |
typedef enum _scg_lpfll_trim_mode | scg_lpfll_trim_mode_t |
SCG LPFLL trim mode. | |
typedef enum _scg_lpfll_trim_src | scg_lpfll_trim_src_t |
SCG LPFLL trim source. | |
typedef enum _scg_lpfll_lock_mode | scg_lpfll_lock_mode_t |
SCG LPFLL lock mode. | |
typedef struct _scg_lpfll_trim_config | scg_lpfll_trim_config_t |
SCG LPFLL clock trim configuration. | |
typedef struct _scg_lpfll_config | scg_lpfll_config_t |
SCG low power FLL configuration. | |
Functions | |
static void | CLOCK_EnableClock (clock_ip_name_t name) |
Enable the clock for specific IP. More... | |
static void | CLOCK_DisableClock (clock_ip_name_t name) |
Disable the clock for specific IP. More... | |
static void | CLOCK_SetIpSrc (clock_ip_name_t name, clock_ip_src_t src) |
Set the clock source for specific IP module. More... | |
static void | CLOCK_SetIpSrcDiv (clock_ip_name_t name, clock_ip_src_t src, uint16_t divValue, uint8_t fracValue) |
Set the clock source and divider for specific IP module. More... | |
uint32_t | CLOCK_GetFreq (clock_name_t clockName) |
Gets the clock frequency for a specific clock name. More... | |
uint32_t | CLOCK_GetCoreSysClkFreq (void) |
Get the core clock or system clock frequency. More... | |
uint32_t | CLOCK_GetBusClkFreq (void) |
Get the bus clock frequency. More... | |
uint32_t | CLOCK_GetFlashClkFreq (void) |
Get the flash clock frequency. More... | |
uint32_t | CLOCK_GetErClkFreq (void) |
Get the external reference clock frequency (ERCLK). More... | |
uint32_t | CLOCK_GetIpFreq (clock_ip_name_t name) |
Gets the clock frequency for a specific IP module. More... | |
Variables | |
volatile uint32_t | g_xtal0Freq |
External XTAL0 (OSC0/SYSOSC) clock frequency. More... | |
Driver version | |
#define | FSL_CLOCK_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
CLOCK driver version 2.0.0. More... | |
MCU System Clock. | |
uint32_t | CLOCK_GetSysClkFreq (scg_sys_clk_t type) |
Gets the SCG system clock frequency. More... | |
static void | CLOCK_SetVlprModeSysClkConfig (const scg_sys_clk_config_t *config) |
Sets the system clock configuration for VLPR mode. More... | |
static void | CLOCK_SetRunModeSysClkConfig (const scg_sys_clk_config_t *config) |
Sets the system clock configuration for RUN mode. More... | |
static void | CLOCK_GetCurSysClkConfig (scg_sys_clk_config_t *config) |
Gets the system clock configuration in the current power mode. More... | |
static void | CLOCK_SetClkOutSel (clock_clkout_src_t setting) |
Sets the clock out selection. More... | |
SCG System OSC Clock. | |
status_t | CLOCK_InitSysOsc (const scg_sosc_config_t *config) |
Initializes the SCG system OSC. More... | |
status_t | CLOCK_DeinitSysOsc (void) |
De-initializes the SCG system OSC. More... | |
static void | CLOCK_SetSysOscAsyncClkDiv (scg_async_clk_t asyncClk, scg_async_clk_div_t divider) |
Set the asynchronous clock divider. More... | |
uint32_t | CLOCK_GetSysOscFreq (void) |
Gets the SCG system OSC clock frequency (SYSOSC). More... | |
uint32_t | CLOCK_GetSysOscAsyncFreq (scg_async_clk_t type) |
Gets the SCG asynchronous clock frequency from the system OSC. 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 (scg_sosc_monitor_mode_t mode) |
Sets the system OSC monitor mode. More... | |
static bool | CLOCK_IsSysOscValid (void) |
Checks whether the system OSC clock is valid. More... | |
SCG Slow IRC Clock. | |
status_t | CLOCK_InitSirc (const scg_sirc_config_t *config) |
Initializes the SCG slow IRC clock. More... | |
status_t | CLOCK_DeinitSirc (void) |
De-initializes the SCG slow IRC. More... | |
static void | CLOCK_SetSircAsyncClkDiv (scg_async_clk_t asyncClk, scg_async_clk_div_t divider) |
Set the asynchronous clock divider. More... | |
uint32_t | CLOCK_GetSircFreq (void) |
Gets the SCG SIRC clock frequency. More... | |
uint32_t | CLOCK_GetSircAsyncFreq (scg_async_clk_t type) |
Gets the SCG asynchronous clock frequency from the SIRC. More... | |
static bool | CLOCK_IsSircValid (void) |
Checks whether the SIRC clock is valid. More... | |
SCG Fast IRC Clock. | |
status_t | CLOCK_InitFirc (const scg_firc_config_t *config) |
Initializes the SCG fast IRC clock. More... | |
status_t | CLOCK_DeinitFirc (void) |
De-initializes the SCG fast IRC. More... | |
static void | CLOCK_SetFircAsyncClkDiv (scg_async_clk_t asyncClk, scg_async_clk_div_t divider) |
Set the asynchronous clock divider. More... | |
uint32_t | CLOCK_GetFircFreq (void) |
Gets the SCG FIRC clock frequency. More... | |
uint32_t | CLOCK_GetFircAsyncFreq (scg_async_clk_t type) |
Gets the SCG asynchronous clock frequency from the FIRC. More... | |
static bool | CLOCK_IsFircValid (void) |
Checks whether the FIRC clock is valid. More... | |
SCG Low Power FLL Clock. | |
status_t | CLOCK_InitLpFll (const scg_lpfll_config_t *config) |
Initializes the SCG LPFLL clock. More... | |
status_t | CLOCK_DeinitLpFll (void) |
De-initializes the SCG LPFLL. More... | |
static void | CLOCK_SetLpFllAsyncClkDiv (scg_async_clk_t asyncClk, scg_async_clk_div_t divider) |
Set the asynchronous clock divider. More... | |
uint32_t | CLOCK_GetLpFllFreq (void) |
Gets the SCG LPFLL clock frequency. More... | |
uint32_t | CLOCK_GetLpFllAsyncFreq (scg_async_clk_t type) |
Gets the SCG asynchronous clock frequency from the LPFLL. More... | |
static bool | CLOCK_IsLpFllValid (void) |
Checks whether the LPFLL clock is valid. More... | |
External clock frequency | |
static void | CLOCK_SetXtal0Freq (uint32_t freq) |
Sets the XTAL0 frequency based on board settings. More... | |
struct _scg_sys_clk_config |
Data Fields | |
uint32_t | divSlow: 4 |
Slow clock divider, see scg_sys_clk_div_t. More... | |
uint32_t | __pad0__: 4 |
Reserved. More... | |
uint32_t | __pad1__: 4 |
Reserved. More... | |
uint32_t | __pad2__: 4 |
Reserved. More... | |
uint32_t | divCore: 4 |
Core clock divider, see scg_sys_clk_div_t. More... | |
uint32_t | __pad3__: 4 |
Reserved. More... | |
uint32_t | src: 4 |
System clock source, see scg_sys_clk_src_t. More... | |
uint32_t | __pad4__: 4 |
reserved. More... | |
uint32_t _scg_sys_clk_config::divSlow |
uint32_t _scg_sys_clk_config::__pad0__ |
uint32_t _scg_sys_clk_config::__pad1__ |
uint32_t _scg_sys_clk_config::__pad2__ |
uint32_t _scg_sys_clk_config::divCore |
uint32_t _scg_sys_clk_config::__pad3__ |
uint32_t _scg_sys_clk_config::src |
uint32_t _scg_sys_clk_config::__pad4__ |
struct _scg_sosc_config |
Data Fields | |
uint32_t | freq |
System OSC frequency. More... | |
scg_sosc_monitor_mode_t | monitorMode |
Clock monitor mode selected. More... | |
uint8_t | enableMode |
Enable mode, OR'ed value of _scg_sosc_enable_mode. More... | |
scg_async_clk_div_t | div2 |
SOSCDIV2 value. More... | |
scg_sosc_mode_t | workMode |
OSC work mode. More... | |
uint32_t _scg_sosc_config::freq |
scg_sosc_monitor_mode_t _scg_sosc_config::monitorMode |
uint8_t _scg_sosc_config::enableMode |
scg_async_clk_div_t _scg_sosc_config::div2 |
scg_sosc_mode_t _scg_sosc_config::workMode |
struct _scg_sirc_config |
Data Fields | |
uint32_t | enableMode |
Enable mode, OR'ed value of _scg_sirc_enable_mode. More... | |
scg_async_clk_div_t | div2 |
SIRCDIV2 value. More... | |
scg_sirc_range_t | range |
Slow IRC frequency range. More... | |
uint32_t _scg_sirc_config::enableMode |
scg_async_clk_div_t _scg_sirc_config::div2 |
scg_sirc_range_t _scg_sirc_config::range |
struct _scg_firc_trim_config |
Data Fields | |
scg_firc_trim_mode_t | trimMode |
FIRC trim mode. More... | |
scg_firc_trim_src_t | trimSrc |
Trim source. More... | |
scg_firc_trim_div_t | trimDiv |
Trim predivided value for the system OSC. More... | |
uint8_t | trimCoar |
Trim coarse value; Irrelevant if trimMode is kSCG_FircTrimUpdate. More... | |
uint8_t | trimFine |
Trim fine value; Irrelevant if trimMode is kSCG_FircTrimUpdate. More... | |
scg_firc_trim_mode_t _scg_firc_trim_config::trimMode |
scg_firc_trim_src_t _scg_firc_trim_config::trimSrc |
scg_firc_trim_div_t _scg_firc_trim_config::trimDiv |
uint8_t _scg_firc_trim_config::trimCoar |
uint8_t _scg_firc_trim_config::trimFine |
struct _scg_firc_config_t |
Data Fields | |
uint32_t | enableMode |
Enable mode, OR'ed value of _scg_firc_enable_mode. More... | |
scg_async_clk_div_t | div2 |
FIRCDIV2 value. More... | |
scg_firc_range_t | range |
Fast IRC frequency range. More... | |
const scg_firc_trim_config_t * | trimConfig |
Pointer to the FIRC trim configuration; set NULL to disable trim. More... | |
uint32_t _scg_firc_config_t::enableMode |
scg_async_clk_div_t _scg_firc_config_t::div2 |
scg_firc_range_t _scg_firc_config_t::range |
const scg_firc_trim_config_t* _scg_firc_config_t::trimConfig |
struct _scg_lpfll_trim_config |
Data Fields | |
scg_lpfll_trim_mode_t | trimMode |
Trim mode. More... | |
scg_lpfll_lock_mode_t | lockMode |
Lock mode; Irrelevant if the trimMode is kSCG_LpFllTrimNonUpdate. More... | |
scg_lpfll_trim_src_t | trimSrc |
Trim source. More... | |
uint8_t | trimDiv |
Trim predivideds value, which can be 0 ~ 31. More... | |
uint8_t | trimValue |
Trim value; Irrelevant if trimMode is the kSCG_LpFllTrimUpdate. More... | |
scg_lpfll_trim_mode_t _scg_lpfll_trim_config::trimMode |
scg_lpfll_lock_mode_t _scg_lpfll_trim_config::lockMode |
scg_lpfll_trim_src_t _scg_lpfll_trim_config::trimSrc |
uint8_t _scg_lpfll_trim_config::trimDiv |
[ Trim source frequency / (trimDiv + 1) ] must be 2 MHz or 32768 Hz.
uint8_t _scg_lpfll_trim_config::trimValue |
struct _scg_lpfll_config |
Data Fields | |
uint8_t | enableMode |
Enable mode, OR'ed value of _scg_lpfll_enable_mode. | |
scg_async_clk_div_t | div2 |
LPFLLDIV2 value. More... | |
scg_lpfll_range_t | range |
LPFLL frequency range. More... | |
const scg_lpfll_trim_config_t * | trimConfig |
Trim configuration; set NULL to disable trim. More... | |
scg_async_clk_div_t _scg_lpfll_config::div2 |
scg_lpfll_range_t _scg_lpfll_config::range |
const scg_lpfll_trim_config_t* _scg_lpfll_config::trimConfig |
#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, 0)) |
#define DMAMUX_CLOCKS |
#define PORT_CLOCKS |
#define LPI2C_CLOCKS |
#define FLEXIO_CLOCKS |
#define TSI_CLOCKS |
#define EDMA_CLOCKS |
#define LPUART_CLOCKS |
#define LPTMR_CLOCKS |
#define ADC12_CLOCKS |
#define LPSPI_CLOCKS |
#define LPIT_CLOCKS |
#define CRC_CLOCKS |
#define CMP_CLOCKS |
#define FLASH_CLOCKS |
#define EWM_CLOCKS |
#define FTM_CLOCKS |
#define PWT_CLOCKS |
#define FLEXIOTRIG_CLOCKS |
#define CLOCK_GetOsc0ErClkFreq CLOCK_GetErClkFreq |
typedef enum _clock_name clock_name_t |
typedef enum _clock_ip_name clock_ip_name_t |
It is defined as the corresponding register address.
typedef enum _scg_sosc_mode scg_sosc_mode_t |
enum _clock_name |
enum _clock_ip_src |
enum _clock_ip_name |
It is defined as the corresponding register address.
enum _scg_sys_clk |
enum _scg_sys_clk_src |
enum _scg_sys_clk_div |
enum _clock_clkout_src |
enum _scg_async_clk |
enum scg_async_clk_div |
enum _scg_sosc_mode |
anonymous enum |
enum _scg_sirc_range |
anonymous enum |
enum _scg_firc_trim_mode |
Enumerator | |
---|---|
kSCG_FircTrimNonUpdate |
FIRC trim enable but not enable trim value update. In this mode, the trim value is fixed to the initialized value which is defined by trimCoar and trimFine in configure structure scg_firc_trim_config_t. |
kSCG_FircTrimUpdate |
FIRC trim enable and trim value update enable. In this mode, the trim value is auto update. |
enum _scg_firc_trim_div |
enum _scg_firc_trim_src |
enum _scg_firc_range |
anonymous enum |
enum _scg_lpfll_range |
enum _scg_lpfll_trim_mode |
Enumerator | |
---|---|
kSCG_LpFllTrimNonUpdate |
LPFLL trim is enabled but the trim value update is not enabled. In this mode, the trim value is fixed to the initialized value, which is defined by the Member variable trimValue in the structure scg_lpfll_trim_config_t. |
kSCG_LpFllTrimUpdate |
FIRC trim is enabled and trim value update is enabled. In this mode, the trim value is automatically updated. |
enum _scg_lpfll_trim_src |
enum _scg_lpfll_lock_mode |
|
inlinestatic |
name | Which clock to enable, see clock_ip_name_t. |
|
inlinestatic |
name | Which clock to disable, see clock_ip_name_t. |
|
inlinestatic |
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. |
|
inlinestatic |
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. |
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_GetCoreSysClkFreq | ( | void | ) |
uint32_t CLOCK_GetBusClkFreq | ( | void | ) |
uint32_t CLOCK_GetFlashClkFreq | ( | void | ) |
uint32_t CLOCK_GetErClkFreq | ( | void | ) |
uint32_t CLOCK_GetIpFreq | ( | clock_ip_name_t | name | ) |
This function gets the IP module clock frequency based on PCC registers. It is only used for the IP modules which could select clock source by PCC[PCS].
name | Which peripheral to get, see clock_ip_name_t. |
uint32_t CLOCK_GetSysClkFreq | ( | scg_sys_clk_t | type | ) |
This function gets the SCG system clock frequency. These clocks are used for core, platform, external, and bus clock domains.
type | Which type of clock to get, core clock or slow clock. |
|
inlinestatic |
This function sets the system clock configuration for VLPR mode.
config | Pointer to the configuration. |
|
inlinestatic |
This function sets the system clock configuration for RUN mode.
config | Pointer to the configuration. |
|
inlinestatic |
This function gets the system configuration in the current power mode.
config | Pointer to the configuration. |
|
inlinestatic |
This function sets the clock out selection (CLKOUTSEL).
setting | The selection to set. |
status_t CLOCK_InitSysOsc | ( | const scg_sosc_config_t * | config | ) |
This function enables the SCG system OSC clock according to the configuration.
config | Pointer to the configuration structure. |
kStatus_Success | System OSC is initialized. |
kStatus_SCG_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 SCG system OSC clock.
kStatus_Success | System OSC is deinitialized. |
kStatus_SCG_Busy | System OSC is used by the system clock. |
kStatus_ReadOnly | System OSC control register is locked. |
|
inlinestatic |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. |
uint32_t CLOCK_GetSysOscFreq | ( | void | ) |
uint32_t CLOCK_GetSysOscAsyncFreq | ( | scg_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 |
status_t CLOCK_InitSirc | ( | const scg_sirc_config_t * | config | ) |
This function enables the SCG slow IRC clock according to the configuration.
config | Pointer to the configuration structure. |
kStatus_Success | SIRC is initialized. |
kStatus_SCG_Busy | SIRC has been enabled and is used by system clock. |
kStatus_ReadOnly | SIRC control register is locked. |
status_t CLOCK_DeinitSirc | ( | void | ) |
This function disables the SCG slow IRC.
kStatus_Success | SIRC is deinitialized. |
kStatus_SCG_Busy | SIRC is used by system clock. |
kStatus_ReadOnly | SIRC control register is locked. |
|
inlinestatic |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. |
uint32_t CLOCK_GetSircFreq | ( | void | ) |
uint32_t CLOCK_GetSircAsyncFreq | ( | scg_async_clk_t | type | ) |
type | The asynchronous clock type. |
|
inlinestatic |
status_t CLOCK_InitFirc | ( | const scg_firc_config_t * | config | ) |
This function enables the SCG fast IRC clock according to the configuration.
config | Pointer to the configuration structure. |
kStatus_Success | FIRC is initialized. |
kStatus_SCG_Busy | FIRC has been enabled and is used by the system clock. |
kStatus_ReadOnly | FIRC control register is locked. |
status_t CLOCK_DeinitFirc | ( | void | ) |
This function disables the SCG fast IRC.
kStatus_Success | FIRC is deinitialized. |
kStatus_SCG_Busy | FIRC is used by the system clock. |
kStatus_ReadOnly | FIRC control register is locked. |
|
inlinestatic |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. |
uint32_t CLOCK_GetFircFreq | ( | void | ) |
uint32_t CLOCK_GetFircAsyncFreq | ( | scg_async_clk_t | type | ) |
type | The asynchronous clock type. |
|
inlinestatic |
status_t CLOCK_InitLpFll | ( | const scg_lpfll_config_t * | config | ) |
This function enables the SCG LPFLL clock according to the configuration.
config | Pointer to the configuration structure. |
kStatus_Success | LPFLL is initialized. |
kStatus_SCG_Busy | LPFLL has been enabled and is used by the system clock. |
kStatus_ReadOnly | LPFLL control register is locked. |
status_t CLOCK_DeinitLpFll | ( | void | ) |
This function disables the SCG LPFLL.
kStatus_Success | LPFLL is deinitialized. |
kStatus_SCG_Busy | LPFLL is used by the system clock. |
kStatus_ReadOnly | LPFLL control register is locked. |
|
inlinestatic |
asyncClk | Which asynchronous clock to configure. |
divider | The divider value to set. |
uint32_t CLOCK_GetLpFllFreq | ( | void | ) |
uint32_t CLOCK_GetLpFllAsyncFreq | ( | scg_async_clk_t | type | ) |
type | The asynchronous clock type. |
|
inlinestatic |
|
inlinestatic |
freq | The XTAL0/EXTAL0 input clock frequency in Hz. |
volatile uint32_t g_xtal0Freq |
The XTAL0/EXTAL0 (OSC0/SYSOSC) clock frequency in Hz. When the clock is set up, use the function CLOCK_SetXtal0Freq to set the value in the clock driver. For example, if XTAL0 is 8 MHz:
This is important for the multicore platforms where only one core needs to set up the OSC0/SYSOSC using CLOCK_InitSysOsc. All other cores need to call the CLOCK_SetXtal0Freq to get a valid clock frequency.