Functions

group group_systick_functions

Functions

void Cy_SysTick_Init(cy_en_systick_clock_source_t clockSource, uint32_t interval)

Initializes the SysTick driver:

Side Effects

Clears the SysTick count flag if it was set.

Parameters

void Cy_SysTick_Enable(void)

Enables the SysTick timer and its interrupt.

Side Effects

Clears the SysTick count flag if it was set

void Cy_SysTick_Disable(void)

Disables the SysTick timer and its interrupt.

Side Effects

Clears the SysTick count flag if it was set

Cy_SysTick_Callback Cy_SysTick_SetCallback(uint32_t number, Cy_SysTick_Callback function)

Sets the callback function to the specified callback number.

Return

Returns the address of the previous callback function. The NULL is returned if the specified address in not set or incorrect parameter is specified.

Side Effects

The registered callback functions will be executed in the interrupt.

Parameters
  • number: The number of the callback function addresses to be set. The valid range is from 0 to CY_SYS_SYST_NUM_OF_CALLBACKS - 1.

  • function: The pointer to the function that will be associated with the SysTick ISR for the specified number.

Cy_SysTick_Callback Cy_SysTick_GetCallback(uint32_t number)

Gets the specified callback function address.

Return

Returns the address of the specified callback function. The NULL is returned if the specified address in not initialized or incorrect parameter is specified.

Parameters

void Cy_SysTick_SetClockSource(cy_en_systick_clock_source_t clockSource)

Sets the clock source for the SysTick counter.

Clears the SysTick count flag if it was set. If the clock source is not ready this function call will have no effect. After changing the clock source to the low frequency clock, the counter and reload register values will remain unchanged so the time to the interrupt will be significantly longer and vice versa.

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

Parameters

cy_en_systick_clock_source_t Cy_SysTick_GetClockSource(void)

Gets the clock source for the SysTick counter.

Return

cy_en_systick_clock_source_t Clock source

void Cy_NsSysTick_Enable(void)

Enables the Non-Secure SysTick timer and its interrupt.

note

This macro is available for devices having M33SYSCPUSS IP.

Side Effects

Clears the SysTick count flag if it was set

void Cy_NsSysTick_Disable(void)

Disables the Non-Secure SysTick timer and its interrupt.

note

This macro is available for devices having M33SYSCPUSS IP.

Side Effects

Clears the SysTick count flag if it was set

void Cy_SysTick_EnableInterrupt(void)

Enables the SysTick interrupt.

Side Effects

Clears the SysTick count flag if it was set

void Cy_SysTick_DisableInterrupt(void)

Disables the SysTick interrupt.

Side Effects

Clears the SysTick count flag if it was set

void Cy_SysTick_SetReload(uint32_t value)

Sets the value the counter is set to on a startup and after it reaches zero.

This function does not change or reset the current sysTick counter value, so it should be cleared using the Cy_SysTick_Clear() API.

Parameters
  • value: The valid range is [0x0-0x00FFFFFF]. The counter reset value.

uint32_t Cy_SysTick_GetReload(void)

Gets the value the counter is set to on a startup and after it reaches zero.

Return

The counter reset value.

uint32_t Cy_SysTick_GetValue(void)

Gets the current SysTick counter value.

Return

The current SysTick counter value.

void Cy_SysTick_Clear(void)

Clears the SysTick counter for a well-defined startup.

uint32_t Cy_SysTick_GetCountFlag(void)

Gets the values of the count flag.

The count flag is set once the SysTick counter reaches zero. The flag is cleared on read.

note

Applicable only in Polling mode. If the SysTick interrupt is enabled, the count flag will be cleared automatically on interrupt event.

Return

Returns a non-zero value if a flag is set; otherwise a zero is returned.

Side Effects

Clears the SysTick count flag if it was set.