144 if (scgConfig != NULL)
330 if (frequency != NULL)
435 if (frequency != NULL)
531 if (frequency != NULL)
584 uint32_t frequency = 0;
589 if (((uint32_t)fracValue) <= ((uint32_t)divValue))
613 frequency = frequency / (((uint32_t)divValue)+1U);
614 frequency = frequency * (((uint32_t)fracValue)+1U);
686 }
while ((timeout > 0U) && (config.
src != to_clk->
src));
708 if (sim_clkout_config.
enable)
710 switch (sim_clkout_config.
source)
743 frequency /= (((uint32_t)sim_clkout_config.
divider) + 1U);
830 if (sircConfig == NULL)
833 sircCfg = &sircDefaultConfig;
837 sircCfg = sircConfig;
879 if (fircConfig == NULL)
882 fircCfg = &fircDefaultConfig;
886 fircCfg = fircConfig;
928 if (soscConfig == NULL)
931 soscCfg = &soscDefaultConfig;
935 soscCfg = soscConfig;
976 if (spllConfig == NULL)
979 spllCfg = &spllDefaultConfig;
983 spllCfg = spllConfig;
1098 nextSysClockConfig = NULL;
1152 sysClockConfig.
src = nextSysClockConfig->
src;
1162 sysClockConfig.
src = nextSysClockConfig->
src;
status_t SCG_HAL_InitSirc(SCG_Type *base, const scg_sirc_config_t *config)
Initialize SCG slow IRC clock.
static void SIM_HAL_SetDmaClockGate(SIM_Type *base, bool enable)
Set the DMA Clock Gate from the Platform Clock Gating Control Register.
uint32_t SIM_HAL_GetLpo1KFreq(const SIM_Type *base)
Get SIM LPO 1KHz clock frequency (LPO_1K_CLOCK).
static status_t CLOCK_SYS_GetSimClockFreq(clock_names_t clockName, uint32_t *frequency)
void SCG_HAL_GetSystemClockConfig(const SCG_Type *base, scg_system_clock_mode_t mode, scg_system_clock_config_t *config)
Get the system clock configuration for specified mode.
status_t SCG_HAL_InitSysOsc(SCG_Type *base, scg_sosc_config_t const *config)
Initialize SCG system OSC.
static bool SIM_HAL_GetDmaClockGate(const SIM_Type *base)
Gets the DMA Clock Gate from the Platform Clock Gating Control Register.
sim_tclk_config_t tclkConfig
static void SIM_HAL_SetTClkFreq(SIM_Type *base, uint8_t index, uint32_t frequency)
Sets the TClk Frequency.
scg_system_clock_mode_t
SCG system clock modes. Implements scg_system_clock_mode_t_Class.
scg_rtc_config_t rtcConfig
status_t CLOCK_SYS_SetScgConfiguration(const scg_config_t *scgConfig)
Configures SCG module.
status_t SCG_HAL_DeinitFirc(SCG_Type *base)
De-initialize SCG fast IRC.
uint32_t SCG_HAL_GetRtcClkInFreq(SCG_Type *base)
Get SCG RTC CLKIN clock frequency.
void SCG_HAL_SetRtcClkInFreq(SCG_Type *base, uint32_t frequency)
Set SCG RTC CLKIN clock frequency.
status_t SCG_HAL_InitFirc(SCG_Type *base, const scg_firc_config_t *config)
Initialize SCG fast IRC clock.
uint32_t SCG_HAL_GetFircFreq(const SCG_Type *base)
Get SCG FIRC clock frequency.
SCG configure structure. Implements scg_config_t_Class.
scg_system_clock_config_t vccrConfig
static bool SIM_HAL_GetMpuClockGate(const SIM_Type *base)
Gets the MPU Clock Gating from the Platform Clock Gating Control Register.
sim_ftm_clk_sel_t SIM_HAL_GetFtmExternalClkPinMode(const SIM_Type *base, uint32_t instance)
Gets the FlexTimer x external clock pin select setting.
uint32_t g_TClkFreq[NUMBER_OF_TCLK_INPUTS]
void SIM_HAL_GetClkoutConfig(const SIM_Type *base, sim_clock_out_config_t *config)
Get the SIM CLKOUT clock configuration.
static peripheral_clock_divider_t PCC_HAL_GetDividerSel(const PCC_Type *const base, const clock_names_t clockName)
Gets the selection of the divider value for a specific peripheral.
SIM configure structure. Implements sim_clock_config_t_Class.
void SCG_HAL_GetSircDefaultConfig(scg_sirc_config_t *config)
Get the default slow IRC clock configuration.
uint32_t tclkFreq[NUMBER_OF_TCLK_INPUTS]
static sim_rtc_clk_sel_src_t SIM_HAL_GetRtcClkSrc(const SIM_Type *base)
Get the clock selection of RTCCLKSEL.
static status_t CLOCK_SYS_GetScgClockFreq(clock_names_t clockName, uint32_t *frequency)
static bool SIM_HAL_GetEimClockGate(const SIM_Type *base)
Gets the EIM Clock Gate from the Platform Clock Gating Control Register.
scg_firc_config_t fircConfig
static power_mode_stat_t SMC_HAL_GetPowerModeStatus(const SMC_Type *const baseAddr)
Gets the current power mode stat.
status_t SCG_HAL_DeinitSirc(SCG_Type *base)
De-initialize SCG slow IRC.
scg_sosc_config_t soscConfig
static void SIM_HAL_SetMpuClockGate(SIM_Type *base, bool enable)
Configure the MPU Clock Gating from the Platform Clock Gating Control Register.
static bool SIM_HAL_GetErmClockGate(const SIM_Type *base)
Gets the ERM Clock Gate from the Platform Clock Gating Control Register.
sim_trace_clock_config_t traceClockConfig
uint32_t SCG_HAL_GetSysOscAsyncFreq(const SCG_Type *base, scg_async_clock_type_t type)
Get SCG asynchronous clock frequency from system OSC.
void SCG_HAL_GetSysPllDefaultConfig(scg_spll_config_t *config)
Get the default system PLL configuration.
#define SPLL_STABILIZATION_TIMEOUT
uint32_t SCG_HAL_GetSircFreq(const SCG_Type *base)
Get SCG SIRC clock frequency.
uint32_t SIM_HAL_GetLpoFreq(const SIM_Type *base)
Get SIM LPO clock frequency (LPO_CLOCK).
uint32_t SCG_HAL_GetSysOscFreq(const SCG_Type *base)
Get SCG system OSC clock frequency (SYSOSC).
#define TMP_SIRC_CLK
Temporary system clock source configurations. Each line represents the SYS(CORE), BUS and SLOW(FLASH)...
#define NUMBER_OF_TCLK_INPUTS
SCG system PLL configuration. Implements scg_spll_config_t_Class.
SCG slow IRC clock configuration. Implements scg_sirc_config_t_Class.
SCG fast IRC clock configuration. Implements scg_firc_config_t_Class.
sim_plat_gate_config_t platGateConfig
status_t CLOCK_SYS_SetConfiguration(clock_manager_user_config_t const *config)
Set system clock configuration.
static status_t CLOCK_SYS_ConfigureSPLL(const scg_spll_config_t *spllConfig)
scg_clockout_config_t clockOutConfig
static scg_system_clock_mode_t CLOCK_SYS_GetCurrentRunMode(const SMC_Type *smc_base)
status_t CLOCK_SYS_GetFreq(clock_names_t clockName, uint32_t *frequency)
Gets the clock frequency for a specific clock name.
status_t SCG_HAL_DeinitSysPll(SCG_Type *base)
De-initialize SCG system PLL.
status_t SCG_HAL_SetSystemClockConfig(SCG_Type *base, scg_system_clock_mode_t mode, scg_system_clock_config_t const *config)
Set the system clock configuration in specified mode.
static void SIM_HAL_SetMscmClockGate(SIM_Type *base, bool enable)
Configure the MSCM Clock Gating from the Platform Clock Gating Control Register.
scg_spll_config_t spllConfig
scg_clockout_src_t source
#define SOSC_STABILIZATION_TIMEOUT
scg_clock_mode_config_t clockModeConfig
status_t
Status return codes. Common error codes will be a unified enumeration (C enum) that will contain all ...
scg_sirc_config_t sircConfig
pmc_lpo_clock_config_t lpoClockConfig
static bool PCC_HAL_GetClockMode(const PCC_Type *const base, const clock_names_t clockName)
Gets the clock gate control mode.
void SCG_HAL_GetFircDefaultConfig(scg_firc_config_t *config)
Get the default fast IRC clock configuration.
static status_t CLOCK_SYS_ConfigureFIRC(const scg_firc_config_t *fircConfig)
SCG system clock configuration. Implements scg_system_clock_config_t_Class.
uint32_t SCG_HAL_GetSysPllAsyncFreq(const SCG_Type *base, scg_async_clock_type_t type)
Get SCG asynchronous clock frequency from system PLL.
void CLOCK_SYS_SetSimConfiguration(const sim_clock_config_t *simClockConfig)
Configures SIM module.
sim_clock_config_t simConfig
scg_system_clock_div_t divCore
scg_system_clock_div_t divSlow
peripheral_clock_divider_t
PCC divider value select Implements peripheral_clock_divider_t_Class.
status_t SCG_HAL_InitSysPll(SCG_Type *base, scg_spll_config_t const *config)
Initialize SCG system PLL.
sim_clock_out_config_t clockOutConfig
status_t SCG_HAL_DeinitSysOsc(SCG_Type *base)
De-initialize SCG system OSC.
clock_names_t
Clock names.
scg_async_clock_type_t
SCG asynchronous clock type. Implements scg_async_clock_type_t_Class.
uint32_t SIM_HAL_GetLpo128KFreq(const SIM_Type *base)
Get SIM LPO 128KHz clock frequency (LPO_128K_CLOCK).
static status_t CLOCK_SYS_ConfigureModulesFromScg(const scg_config_t *scgConfig)
static status_t CLOCK_SYS_ConfigureTemporarySystemClock(void)
static void SIM_HAL_SetLpoClocks(SIM_Type *base, sim_lpo_clock_config_t setting)
Set the clock selection of LPOCLKSEL.
static uint32_t CLOCK_SYS_GetSimClkOutFreq(const SIM_Type *base)
static void SIM_HAL_SetErmClockGate(SIM_Type *base, bool enable)
Set the ERM Clock Gate from the Platform Clock Gating Control Register.
static void PMC_HAL_SetLpoTrimValue(PMC_Type *const baseAddr, const int8_t decimalValue)
Low Power Oscillator Trimming Value.
uint32_t SCG_HAL_GetSysPllFreq(const SCG_Type *base)
Get SCG system PLL clock frequency.
static peripheral_clock_source_t PCC_HAL_GetClockSourceSel(const PCC_Type *const base, const clock_names_t clockName)
Gets the selection of a clock source for a specific peripheral.
static status_t CLOCK_SYS_TransitionSystemClock(const scg_system_clock_config_t *to_clk)
uint32_t SCG_HAL_GetSircAsyncFreq(const SCG_Type *base, scg_async_clock_type_t type)
Get SCG asynchronous clock frequency from SIRC.
static status_t CLOCK_SYS_ConfigureSOSC(const scg_sosc_config_t *soscConfig)
static peripheral_clock_frac_t PCC_HAL_GetFracValueSel(const PCC_Type *const base, const clock_names_t clockName)
Gets the selection of the fractional value for a specific peripheral.
SIM ClockOut configuration. Implements sim_clock_out_config_t_Class.
static uint32_t SIM_HAL_GetTClkFreq(SIM_Type *base, uint8_t index)
Gets the TClk Frequency.
SCG system OSC configuration. Implements scg_sosc_config_t_Class.
static void SIM_HAL_SetEimClockGate(SIM_Type *base, bool enable)
Set the EIM Clock Gate from the Platform Clock Gating Control Register.
void SIM_HAL_InitTraceClock(SIM_Type *base, const sim_trace_clock_config_t *config)
Initialize SIM Debug Trace.
sim_lpo_clock_config_t lpoClockConfig
static status_t CLOCK_SYS_GetPccClockFreq(clock_names_t clockName, uint32_t *frequency)
static status_t CLOCK_SYS_ConfigureSIRC(const scg_sirc_config_t *sircConfig)
scg_system_clock_div_t
SCG system clock divider value. Implements scg_system_clock_div_t_Class.
void SCG_HAL_GetSysOscDefaultConfig(scg_sosc_config_t *config)
Get the default system OSC configuration.
scg_system_clock_config_t rccrConfig
#define TMP_SYSTEM_CLOCK_CONFIGS
scg_system_clock_src_t src
void CLOCK_SYS_SetPmcConfiguration(const pmc_config_t *pmcConfig)
Configures PMC module.
Clock configuration structure. Implements clock_manager_user_config_t_Class.
static uint32_t CLOCK_SYS_GetScgClkOutFreq(const SCG_Type *base)
#define FIRC_STABILIZATION_TIMEOUT
static uint32_t CLOCK_SYS_GetSimRtcClkFreq(const SIM_Type *base)
static scg_clockout_src_t SCG_HAL_GetClockoutSourceSel(const SCG_Type *base)
Get SCG ClockOut source select.
uint32_t SCG_HAL_GetFircAsyncFreq(const SCG_Type *base, scg_async_clock_type_t type)
Get SCG asynchronous clock frequency from FIRC.
void CLOCK_SYS_SetPccConfiguration(const pcc_config_t *peripheralClockConfig)
Configures PCC module.
static bool SIM_HAL_GetMscmClockGate(const SIM_Type *base)
Gets the MSCM Clock Gating from the Platform Clock Gating Control Register.
void PCC_HAL_SetPeripheralClockConfig(PCC_Type *const base, const pcc_config_t *const config)
Set the peripheral clock configuration.
uint32_t SIM_HAL_GetLpo32KFreq(const SIM_Type *base)
Get SIM LPO 32KHz clock frequency (LPO_32K_CLOCK).
void SIM_HAL_InitClkout(SIM_Type *base, const sim_clock_out_config_t *config)
Initialize SIM CLKOUT.
static void SCG_HAL_SetClockoutSourceSel(SCG_Type *base, scg_clockout_src_t source)
Set SCG ClockOut source select.
uint32_t SCG_HAL_GetSystemClockFreq(const SCG_Type *base, scg_system_clock_type_t type)
Get SCG system clock frequency.
scg_system_clock_config_t hccrConfig
static bool PMC_HAL_GetLpoMode(const PMC_Type *const baseAddr)
Gets the Low Power Oscillator status.
#define SIRC_STABILIZATION_TIMEOUT
peripheral_clock_frac_t
PCC fractional value select Implements peripheral_clock_frac_t_Class.
static void PMC_HAL_SetLpoMode(PMC_Type *const baseAddr, const bool enable)
Enables/Disables the Low Power Oscillator.
scg_system_clock_div_t divBus
static uint32_t CLOCK_SYS_GetPeripheralClock(clock_names_t clockName, scg_async_clock_type_t divider)
PCC configuration. Implements pcc_config_t_Class.