PSoC 6 Peripheral Driver Library

General Description

Functions

void Cy_SysTick_Init (cy_en_systick_clock_source_t clockSource, uint32_t interval)
 Initializes the SysTick driver: More...
 
void Cy_SysTick_Enable (void)
 Enables the SysTick timer and its interrupt. More...
 
void Cy_SysTick_Disable (void)
 Disables the SysTick timer and its interrupt. More...
 
Cy_SysTick_Callback Cy_SysTick_SetCallback (uint32_t number, Cy_SysTick_Callback function)
 Sets the callback function to the specified callback number. More...
 
Cy_SysTick_Callback Cy_SysTick_GetCallback (uint32_t number)
 Gets the specified callback function address. More...
 
void Cy_SysTick_SetClockSource (cy_en_systick_clock_source_t clockSource)
 Sets the clock source for the SysTick counter. More...
 
cy_en_systick_clock_source_t Cy_SysTick_GetClockSource (void)
 Gets the clock source for the SysTick counter. More...
 
__STATIC_INLINE void Cy_SysTick_EnableInterrupt (void)
 Enables the SysTick interrupt. More...
 
__STATIC_INLINE void Cy_SysTick_DisableInterrupt (void)
 Disables the SysTick interrupt. More...
 
__STATIC_INLINE void Cy_SysTick_SetReload (uint32_t value)
 Sets the value the counter is set to on a startup and after it reaches zero. More...
 
__STATIC_INLINE uint32_t Cy_SysTick_GetReload (void)
 Gets the value the counter is set to on a startup and after it reaches zero. More...
 
__STATIC_INLINE uint32_t Cy_SysTick_GetValue (void)
 Gets the current SysTick counter value. More...
 
__STATIC_INLINE uint32_t Cy_SysTick_GetCountFlag (void)
 Gets the values of the count flag. More...
 
__STATIC_INLINE void Cy_SysTick_Clear (void)
 Clears the SysTick counter for a well-defined startup.
 

Function Documentation

◆ Cy_SysTick_Init()

void Cy_SysTick_Init ( cy_en_systick_clock_source_t  clockSource,
uint32_t  interval 
)

Initializes the SysTick driver:

Parameters
clockSourceThe SysTick clock source cy_en_systick_clock_source_t
intervalThe SysTick reload value.
Side Effects
Clears the SysTick count flag if it was set.

◆ Cy_SysTick_Enable()

void Cy_SysTick_Enable ( void  )

Enables the SysTick timer and its interrupt.

Side Effects
Clears the SysTick count flag if it was set

◆ Cy_SysTick_Disable()

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_SetCallback()

Cy_SysTick_Callback Cy_SysTick_SetCallback ( uint32_t  number,
Cy_SysTick_Callback  function 
)

Sets the callback function to the specified callback number.

Parameters
numberThe number of the callback function addresses to be set. The valid range is from 0 to CY_SYS_SYST_NUM_OF_CALLBACKS - 1.
functionThe pointer to the function that will be associated with the SysTick ISR for the specified number.
Returns
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.

◆ Cy_SysTick_GetCallback()

Cy_SysTick_Callback Cy_SysTick_GetCallback ( uint32_t  number)

Gets the specified callback function address.

Parameters
numberThe number of the callback function address to get. The valid range is from 0 to CY_SYS_SYST_NUM_OF_CALLBACKS - 1.
Returns
Returns the address of the specified callback function. The NULL is returned if the specified address in not initialized or incorrect parameter is specified.

◆ Cy_SysTick_SetClockSource()

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
clockSourcecy_en_systick_clock_source_t Clock source. For the PSoC 64 devices, 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.

◆ Cy_SysTick_GetClockSource()

cy_en_systick_clock_source_t Cy_SysTick_GetClockSource ( void  )

Gets the clock source for the SysTick counter.

Returns
cy_en_systick_clock_source_t Clock source

◆ Cy_SysTick_EnableInterrupt()

__STATIC_INLINE void Cy_SysTick_EnableInterrupt ( void  )

Enables the SysTick interrupt.

Side Effects
Clears the SysTick count flag if it was set

◆ Cy_SysTick_DisableInterrupt()

__STATIC_INLINE void Cy_SysTick_DisableInterrupt ( void  )

Disables the SysTick interrupt.

Side Effects
Clears the SysTick count flag if it was set

◆ Cy_SysTick_SetReload()

__STATIC_INLINE 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
valueThe valid range is [0x0-0x00FFFFFF]. The counter reset value.

◆ Cy_SysTick_GetReload()

__STATIC_INLINE uint32_t Cy_SysTick_GetReload ( void  )

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

Returns
The counter reset value.

◆ Cy_SysTick_GetValue()

__STATIC_INLINE uint32_t Cy_SysTick_GetValue ( void  )

Gets the current SysTick counter value.

Returns
The current SysTick counter value.

◆ Cy_SysTick_GetCountFlag()

__STATIC_INLINE 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.

Returns
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.