# SysClk (System Clock)¶

group group_sysclk

The System Clock (SysClk) driver contains the API for configuring system and peripheral clocks.

The functions and other declarations used in this driver are in cy_sysclk.h. You can include cy_pdl.h to get access to all functions and declarations in the PDL.

Firmware uses the API to configure, enable, or disable a clock.

The clock system includes a variety of resources that can vary per device, including:

• Internal clock sources such as internal oscillators

• External clock sources such as crystal oscillators or a signal on an I/O pin

• Generated clocks such as an FLL, a PLL, and peripheral clocks

Consult the Technical Reference Manual for your device for details of the clock system.

The PDL defines clock system capabilities in:

devices/include/<series>_config.h. (E.g. devices/include/psoc6_01_config.h). User-configurable clock speeds are defined in the file system_<series>.h.

As an illustration of the clocking system, the following diagram shows the PSoC 63 series clock tree. The actual tree may vary depending on the device series. Consult the Technical Reference Manual for your device for details.

The sysclk driver supports multiple peripheral clocks, as well as the fast clock, slow clock, backup domain clock, timer clock, and pump clock. The API for any given clock contains the functions to manage that clock. Functions for clock measurement and trimming are also provided.

Configuration Considerations

The availability of clock functions depend on the availability of the chip resources that support those functions. Consult the device TRM before attempting to use these functions. For PSoC 64 devices the clocks configurations are restricted and limited. Refer to the PRA driver, and the TRM and datasheet for details.

warning

On the diagram above, the yellow muxes are glitch-safe. All glitch-safe mux transitions take four cycles of the source clock. It is not allowed to turn off the source clock during that time.

PSoC 6 power modes limit the maximum clock frequency. Refer to the SysPm driver and the TRM for details.