PSoC 6 Peripheral Driver Library
SysTick (ARM System Timer)

General Description

Provides vendor-specific SysTick API.

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

The SysTick timer is part of the CPU. The timer is a down counter with a 24-bit reload/tick value that is clocked by the FastClk/SlowClk. The timer has the capability to generate an interrupt when the set number of ticks expires and the counter is reloaded. This interrupt is available as part of the Nested Vectored Interrupt Controller (NVIC) for service by the CPU and can be used for general-purpose timing control in user code.

The timer is independent of the CPU (except for the clock), which is useful in applications requiring precise timing that do not have a dedicated timer/counter available for the job.

Configuration Considerations

The Cy_SysTick_Init() performs all required driver's initialization and enables the timer. The function accepts two parameters: clock source cy_en_systick_clock_source_t and the timer interval. You must ensure the selected clock source for SysTick is enabled. The callbacks can be registered/unregistered any time after Cy_SysTick_Init() by calling Cy_SysTick_SetCallback().

Changing the SysTick clock source and/or its frequency will change the interrupt interval and therefore Cy_SysTick_SetReload() should be called to compensate for this change.

More Information

Refer to the SysTick section of the ARM reference guide for complete details on the registers and their use. See also the "CPU Subsystem (CPUSS)" chapter of the device technical reference manual (TRM).

MISRA-C Compliance

MISRA Rule Rule Class (Required/Advisory) Rule Description Description of Deviation(s)
8.12 Required When an array is declared with external linkage, its size shall be stated explicitly or defined implicitly by initialization. The warning is related to the __ramVectors symbol defined in the assembly startup code. It's size is device-specific and unknown to the SysTick driver.


VersionChangesReason for Change
1.20. Updated Cy_SysTick_SetClockSource() for the PSoC 64 devices, so that passing any other value than CY_SYSTICK_CLOCK_SOURCE_CLK_CPU will not affect clock source and it will be as Cy_SysTick_GetClockSource() reports. Added PSoC 64 devices support.
Minor documentation updates. Documentation enhancement.
1.10.1 Updated include files. Improve pdl usability.
1.10 Flattened the organization of the driver source code into the single source directory and the single include directory. Driver library directory-structure simplification.
Added register access layer. Use register access macros instead of direct register access using dereferenced pointers. Makes register access device-independent, so that the PDL does not need to be recompiled for each supported part number.
1.0.1 Fixed a warning issued when the compilation of C++ source code was enabled.
1.0 Initial version

API Reference

 Data Structures