MSPM0G1X0X_G3X0X Driver Library  1.10.00.05
Macros | Functions
M0P System Tick Timer (SysTick)

Macros

#define DL_SYSTICK_config(x)   SysTick_Config(x)
 Redirects DL_SYSTICK_config to CMSIS standard SysTick_Config.
 

Functions

__STATIC_INLINE void DL_SYSTICK_init (uint32_t period)
 Initializes the System Tick Timer (SysTick) More...
 
__STATIC_INLINE void DL_SYSTICK_setPeriod (uint32_t period)
 Set the period for the SysTick. More...
 
__STATIC_INLINE void DL_SYSTICK_resetValue (void)
 Reset the current value of the SysTick. More...
 
__STATIC_INLINE uint32_t DL_SYSTICK_getPeriod (void)
 Get the period for the SysTick. More...
 
__STATIC_INLINE uint32_t DL_SYSTICK_getValue (void)
 Get the current value of SysTick counter. More...
 
__STATIC_INLINE void DL_SYSTICK_enableInterrupt (void)
 Enable the SysTick interrupt.
 
__STATIC_INLINE void DL_SYSTICK_disableInterrupt (void)
 Disable the SysTick interrupt.
 
__STATIC_INLINE void DL_SYSTICK_enable (void)
 Enable the SysTick, starts counting once enabled. More...
 
__STATIC_INLINE void DL_SYSTICK_disable (void)
 Disable the SysTick, stops counting once disabled.
 
__STATIC_INLINE bool DL_SYSTICK_isEnabled (void)
 Checks if the SysTick is enabled. More...
 

Detailed Description

Overview

SysTick is a simple timer that is part of the Cortex-M architecture. Its intended purpose is to provide a periodic interrupt for an RTOS, but it can be used for other simple timing purposes.


Function Documentation

§ DL_SYSTICK_init()

__STATIC_INLINE void DL_SYSTICK_init ( uint32_t  period)

Initializes the System Tick Timer (SysTick)

Initializes the System Tick Timer by configuring the desired period. Resets the counter so that, once enabled, the SysTick starts counting from 0. Does not start the timer or enable the interrupt.

Parameters
[in]periodThe period in ticks for the SysTick to fire. Value between 0x00000002 - 0x01000000.

§ DL_SYSTICK_setPeriod()

__STATIC_INLINE void DL_SYSTICK_setPeriod ( uint32_t  period)

Set the period for the SysTick.

Calling this function does not cause the SysTick counter to reload immediately. If you want to change the period and reset the counter use the DL_SYSTICK_init function or DL_SYSTICK_resetValue.

Parameters
[in]periodThe period in ticks for the SysTick to fire. Value between 0x00000002 - 0x01000000.

§ DL_SYSTICK_resetValue()

__STATIC_INLINE void DL_SYSTICK_resetValue ( void  )

Reset the current value of the SysTick.

Resets the current value of the SysTick back to 0, essentially resetting the period.

§ DL_SYSTICK_getPeriod()

__STATIC_INLINE uint32_t DL_SYSTICK_getPeriod ( void  )

Get the period for the SysTick.

Returns
The period in ticks for the SysTick to fire
Return values
Valuebetween 0x00000002 - 0x01000000.

§ DL_SYSTICK_getValue()

__STATIC_INLINE uint32_t DL_SYSTICK_getValue ( void  )

Get the current value of SysTick counter.

Returns
The current value of the counter in ticks
Return values
Valuebetween 0x00000000 - 0x00FFFFFF.

§ DL_SYSTICK_enable()

__STATIC_INLINE void DL_SYSTICK_enable ( void  )

Enable the SysTick, starts counting once enabled.

Once enabled, the SysTick will start counting from whatever value it was disabled with. To ensure a full period, use DL_SYSTICK_init or DL_SYSTICK_resetValue before enabling.

§ DL_SYSTICK_isEnabled()

__STATIC_INLINE bool DL_SYSTICK_isEnabled ( void  )

Checks if the SysTick is enabled.

Returns
Returns the enabled status of the SysTick
Return values
trueThe SysTick is enabled and counting
falseThe SysTick is disabled and not counting
© Copyright 1995-2023, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale