![]() |
S32 SDK
|
#include "device_registers.h"
#include "sim_hw_access.h"
#include "scg_hw_access.h"
#include "pcc_hw_access.h"
#include "pmc_hw_access.h"
#include "smc_hw_access.h"
#include "clock_manager.h"
#include <stddef.h>
Go to the source code of this file.
Macros | |
#define | SCG_SPLL_MULT_BASE 16U |
#define | SCG_SPLL_PREDIV_BASE 1U |
#define | SCG_SPLL_REF_MIN 8000000U |
#define | SCG_SPLL_REF_MAX 32000000U |
#define | LPO_128K_FREQUENCY 128000UL |
#define | LPO_32K_FREQUENCY 32000UL |
#define | LPO_1K_FREQUENCY 1000UL |
#define | HIGH_SPEED_RUNNING_MODE (1UL << 7U) |
#define | RUN_SPEED_RUNNING_MODE (1UL << 0U) |
#define | VLPR_SPEED_RUNNING_MODE (1UL << 2U) |
Enumerations | |
enum | scg_system_clock_type_t { SCG_SYSTEM_CLOCK_CORE, SCG_SYSTEM_CLOCK_BUS, SCG_SYSTEM_CLOCK_SLOW, SCG_SYSTEM_CLOCK_MAX } |
SCG system clock type. Implements scg_system_clock_type_t_Class. More... | |
enum | scg_async_clock_type_t { SCG_ASYNC_CLOCK_DIV1 = 0U, SCG_ASYNC_CLOCK_DIV2 = 1U, SCG_ASYNC_CLOCK_MAX = 2U } |
SCG asynchronous clock type. Implements scg_async_clock_type_t_Class. More... | |
enum | scg_system_clock_mode_t { SCG_SYSTEM_CLOCK_MODE_CURRENT = 0U, SCG_SYSTEM_CLOCK_MODE_RUN = 1U, SCG_SYSTEM_CLOCK_MODE_VLPR = 2U, SCG_SYSTEM_CLOCK_MODE_HSRUN = 3U, SCG_SYSTEM_CLOCK_MODE_NONE } |
SCG system clock modes. Implements scg_system_clock_mode_t_Class. More... | |
Variables | |
uint32_t | g_TClkFreq [NUMBER_OF_TCLK_INPUTS] |
uint32_t | g_RtcClkInFreq |
uint32_t | g_xtal0ClkFreq |
const uint16_t | clockNameMappings [] = PCC_CLOCK_NAME_MAPPINGS |
Clock name mappings Constant array storing the mappings between clock names and peripheral clock control indexes. If there is no peripheral clock control index for a clock name, then the corresponding value is PCC_INVALID_INDEX. More... | |
const uint8_t | peripheralFeaturesList [] = PERIPHERAL_FEATURES |
Peripheral features list Constant array storing the mappings between clock names of the peripherals and feature lists. More... | |
#define HIGH_SPEED_RUNNING_MODE (1UL << 7U) |
Definition at line 117 of file clock_S32K1xx.c.
#define LPO_128K_FREQUENCY 128000UL |
Definition at line 102 of file clock_S32K1xx.c.
#define LPO_1K_FREQUENCY 1000UL |
Definition at line 112 of file clock_S32K1xx.c.
#define LPO_32K_FREQUENCY 32000UL |
Definition at line 107 of file clock_S32K1xx.c.
#define RUN_SPEED_RUNNING_MODE (1UL << 0U) |
Definition at line 118 of file clock_S32K1xx.c.
#define SCG_SPLL_MULT_BASE 16U |
Definition at line 79 of file clock_S32K1xx.c.
#define SCG_SPLL_PREDIV_BASE 1U |
Definition at line 85 of file clock_S32K1xx.c.
#define SCG_SPLL_REF_MAX 32000000U |
Definition at line 97 of file clock_S32K1xx.c.
#define SCG_SPLL_REF_MIN 8000000U |
Definition at line 91 of file clock_S32K1xx.c.
#define VLPR_SPEED_RUNNING_MODE (1UL << 2U) |
Definition at line 119 of file clock_S32K1xx.c.
SCG asynchronous clock type. Implements scg_async_clock_type_t_Class.
Enumerator | |
---|---|
SCG_ASYNC_CLOCK_DIV1 |
Clock divider 1 |
SCG_ASYNC_CLOCK_DIV2 |
Clock divider 2 |
SCG_ASYNC_CLOCK_MAX |
Max value. |
Definition at line 149 of file clock_S32K1xx.c.
SCG system clock modes. Implements scg_system_clock_mode_t_Class.
Definition at line 160 of file clock_S32K1xx.c.
SCG system clock type. Implements scg_system_clock_type_t_Class.
Enumerator | |
---|---|
SCG_SYSTEM_CLOCK_CORE |
Core clock. |
SCG_SYSTEM_CLOCK_BUS |
BUS clock. |
SCG_SYSTEM_CLOCK_SLOW |
System slow clock. |
SCG_SYSTEM_CLOCK_MAX |
Max value. |
Definition at line 137 of file clock_S32K1xx.c.
void CLOCK_DRV_DisablePeripheralClock | ( | clock_names_t | clockName | ) |
Disables peripheral clock.
This function disables a peripheral clock.
[in] | clockName | Clock name of the configured peripheral clock |
Definition at line 2124 of file clock_S32K1xx.c.
void CLOCK_DRV_EnablePeripheralClock | ( | clock_names_t | clockName, |
const periph_clk_config_t * | periphClkConfig | ||
) |
Enables peripheral clock.
This function enables a peripheral clock according to the configuration. If no configuration is provided (periphClkConfig is null), then a default one is used
[in] | clockName | Clock name of the configured peripheral clock |
[in] | periphClkConfig | Pointer to the configuration structure. |
Definition at line 2045 of file clock_S32K1xx.c.
status_t CLOCK_DRV_SetFirc | ( | bool | enable, |
const firc_config_t * | fircConfig | ||
) |
This function enables or disables FIRC clock source.
When FIRC is enabled, the clock source is configured based on the provided configuration. All values from the previous configuration of FIRC clock are overwritten. If no configuration is provided, then a default one is used. When FIRC is disabled, no configuration is required.
[in] | enable | Enables or disables the clock source. |
[in] | fircConfig | Pointer to the configuration structure, this parameter is unused when FIRC is disabled and is optional when FIRC is enabled. |
Definition at line 2372 of file clock_S32K1xx.c.
status_t CLOCK_DRV_SetLpo | ( | bool | enable | ) |
This function enables or disables LPO clock source.
[in] | enabled | Enable command. |
Definition at line 2627 of file clock_S32K1xx.c.
status_t CLOCK_DRV_SetSirc | ( | bool | enable, |
const sirc_config_t * | sircConfig | ||
) |
This function enables or disables SIRC clock source.
When SIRC is enabled, the clock source is configured based on the provided configuration. All values from the previous configuration of SIRC clock are overwritten. If no configuration is provided, then a default one is used. When SIRC is disabled, no configuration is required.
[in] | enable | Enables or disables the clock source. |
[in] | sircConfig | Pointer to the configuration structure, this parameter is unused when SIRC is disabled and is optional when SIRC is enabled. |
Definition at line 2286 of file clock_S32K1xx.c.
status_t CLOCK_DRV_SetSosc | ( | bool | enable, |
const sosc_config_t * | soscConfig | ||
) |
This function enables or disables SOSC clock source.
When SOSC is enabled, the clock source is configured based on the provided configuration. All values from the previous configuration of SOSC clock are overwritten. If no configuration is provided, then a default one is used. When SOSC is disabled, no configuration is required.
[in] | enable | Enables or disables the clock source. |
[in] | soscConfig | Pointer to the configuration structure, this parameter is unused when SOSC is disabled and is optional when SOSC is enabled. |
Definition at line 2459 of file clock_S32K1xx.c.
status_t CLOCK_DRV_SetSpll | ( | bool | enable, |
const spll_config_t * | spllConfig | ||
) |
This function enables or disables SPLL clock source.
When SPLL is enabled, the clock source is configured based on the provided configuration. All values from the previous configuration of SPLL clock are overwritten. If no configuration is provided, then a default one is used. When SPLL is disabled, no configuration is required.
[in] | enable | Enables or disables the clock source. |
[in] | spllConfig | Pointer to the configuration structure, this parameter is unused when SPLL is disabled and is optional when SPLL is enabled. |
Definition at line 2551 of file clock_S32K1xx.c.
status_t CLOCK_DRV_SetSystemClock | ( | const pwr_modes_t * | mode, |
const sys_clk_config_t * | sysClkConfig | ||
) |
Configures the system clocks.
This function configures the system clocks (core, bus and flash clocks) in the specified power mode. If no power mode is specified (null parameter) then it is the current power mode.
[in] | mode | Pointer to power mode for which the configured system clocks apply |
[in] | sysClkConfig | Pointer to the system clocks configuration structure. |
Definition at line 2171 of file clock_S32K1xx.c.
|
static |
Definition at line 1149 of file clock_S32K1xx.c.
|
static |
Definition at line 1465 of file clock_S32K1xx.c.
|
static |
Definition at line 1076 of file clock_S32K1xx.c.
|
static |
Definition at line 1223 of file clock_S32K1xx.c.
|
static |
Definition at line 1325 of file clock_S32K1xx.c.
|
static |
Definition at line 1428 of file clock_S32K1xx.c.
|
static |
Definition at line 876 of file clock_S32K1xx.c.
|
static |
Definition at line 2018 of file clock_S32K1xx.c.
|
static |
Definition at line 1877 of file clock_S32K1xx.c.
|
static |
Definition at line 1931 of file clock_S32K1xx.c.
|
static |
Definition at line 709 of file clock_S32K1xx.c.
|
static |
Definition at line 831 of file clock_S32K1xx.c.
|
static |
Definition at line 1010 of file clock_S32K1xx.c.
|
static |
Definition at line 451 of file clock_S32K1xx.c.
|
static |
Definition at line 956 of file clock_S32K1xx.c.
|
static |
Definition at line 535 of file clock_S32K1xx.c.
|
static |
Definition at line 1044 of file clock_S32K1xx.c.
|
static |
Definition at line 1857 of file clock_S32K1xx.c.
|
static |
Definition at line 1731 of file clock_S32K1xx.c.
|
static |
Definition at line 1838 of file clock_S32K1xx.c.
|
static |
Definition at line 1901 of file clock_S32K1xx.c.
|
static |
Definition at line 1590 of file clock_S32K1xx.c.
void CLOCK_SYS_SetPccConfiguration | ( | const pcc_config_t * | peripheralClockConfig | ) |
Configures PCC module.
This function configures the PCC module according to the configuration.
[in] | peripheralClockConfig | Pointer to the configuration structure. |
Definition at line 334 of file clock_S32K1xx.c.
void CLOCK_SYS_SetPmcConfiguration | ( | const pmc_config_t * | pmcConfig | ) |
Configures PMC module.
This function configures the PMC module according to the configuration.
[in] | pmcConfig | Pointer to the configuration structure. |
Definition at line 430 of file clock_S32K1xx.c.
status_t CLOCK_SYS_SetScgConfiguration | ( | const scg_config_t * | scgConfig | ) |
Configures SCG module.
This function configures the SCG module according to the configuration.
[in] | scgConfig | Pointer to the configuration structure. |
Definition at line 274 of file clock_S32K1xx.c.
void CLOCK_SYS_SetSimConfiguration | ( | const sim_clock_config_t * | simClockConfig | ) |
Configures SIM module.
This function configures the SIM module according to the configuration.
[in] | simClockConfig | Pointer to the configuration structure. |
Definition at line 365 of file clock_S32K1xx.c.
|
static |
< Run mode.
< Very Low Power Run mode.
< High Speed Run mode.
< Run mode.
< Very Low Power Run mode.
< High Speed Run mode.
Definition at line 1641 of file clock_S32K1xx.c.
|
static |
Definition at line 909 of file clock_S32K1xx.c.
|
static |
Definition at line 1962 of file clock_S32K1xx.c.
const uint16_t clockNameMappings[] = PCC_CLOCK_NAME_MAPPINGS |
Clock name mappings Constant array storing the mappings between clock names and peripheral clock control indexes. If there is no peripheral clock control index for a clock name, then the corresponding value is PCC_INVALID_INDEX.
Definition at line 126 of file clock_S32K1xx.c.