STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches

SysTick timer. More...

Collaboration diagram for SysTick:

Data Structures

struct  SysTickRegisters_t
 SysTick register block. More...

Macros

#define SYSTICK_BASE   (0xE000E010UL)
 SysTick base address (System Control Space).
#define SYSTICK   ((SysTickRegisters_t *)SYSTICK_BASE)
 The SysTick instance.

Typedefs

typedef struct SysTickRegisters_t SysTickRegisters_t
 SysTick register block.

CTRL - control and status (0x00)

#define SYSTICK_CTRL_ENABLE_Pos   (0U)
 Bit 0.
#define SYSTICK_CTRL_ENABLE   ((uint32_t)1U << SYSTICK_CTRL_ENABLE_Pos)
  rw Counter enable.
#define SYSTICK_CTRL_TICKINT_Pos   (1U)
 Bit 1.
#define SYSTICK_CTRL_TICKINT   ((uint32_t)1U << SYSTICK_CTRL_TICKINT_Pos)
  rw Raise the SysTick exception when the counter reaches 0.
#define SYSTICK_CTRL_CLKSOURCE_Pos   (2U)
 Bit 2.
#define SYSTICK_CTRL_CLKSOURCE   ((uint32_t)1U << SYSTICK_CTRL_CLKSOURCE_Pos)
  rw Clock source: 1 = processor clock (HCLK), 0 = HCLK / 8.
#define SYSTICK_CTRL_COUNTFLAG_Pos   (16U)
 Bit 16.
#define SYSTICK_CTRL_COUNTFLAG   ((uint32_t)1U << SYSTICK_CTRL_COUNTFLAG_Pos)
  ro The counter reached 0 since the last read; reading clears it.

LOAD, VAL - reload and current value (0x04, 0x08)

#define SYSTICK_LOAD_RELOAD_Pos   (0U)
 Bits 23:0.
#define SYSTICK_LOAD_RELOAD_Msk   ((uint32_t)0xFFFFFFU << SYSTICK_LOAD_RELOAD_Pos)
  rw Reload value: the tick period is RELOAD + 1 clocks.
#define SYSTICK_VAL_CURRENT_Pos   (0U)
 Bits 23:0.
#define SYSTICK_VAL_CURRENT_Msk   ((uint32_t)0xFFFFFFU << SYSTICK_VAL_CURRENT_Pos)
  rw Current counter value.

CALIB - calibration (0x0C)

#define SYSTICK_CALIB_TENMS_Pos   (0U)
 Bits 23:0.
#define SYSTICK_CALIB_TENMS_Msk   ((uint32_t)0xFFFFFFU << SYSTICK_CALIB_TENMS_Pos)
  ro Reload value for 10 ms (0 if unknown).
#define SYSTICK_CALIB_SKEW_Pos   (30U)
 Bit 30.
#define SYSTICK_CALIB_SKEW   ((uint32_t)1U << SYSTICK_CALIB_SKEW_Pos)
  ro TENMS is not exactly 10 ms.
#define SYSTICK_CALIB_NOREF_Pos   (31U)
 Bit 31.
#define SYSTICK_CALIB_NOREF   ((uint32_t)1U << SYSTICK_CALIB_NOREF_Pos)
  ro No external reference clock.

Detailed Description

SysTick timer.

Macro Definition Documentation

◆ SYSTICK_BASE

#define SYSTICK_BASE   (0xE000E010UL)

SysTick base address (System Control Space).

Definition at line 15 of file systick_reg.h.

◆ SYSTICK

#define SYSTICK   ((SysTickRegisters_t *)SYSTICK_BASE)

The SysTick instance.

Definition at line 26 of file systick_reg.h.

◆ SYSTICK_CTRL_ENABLE_Pos

#define SYSTICK_CTRL_ENABLE_Pos   (0U)

Bit 0.

Definition at line 30 of file systick_reg.h.

◆ SYSTICK_CTRL_ENABLE

#define SYSTICK_CTRL_ENABLE   ((uint32_t)1U << SYSTICK_CTRL_ENABLE_Pos)

rw Counter enable.

Definition at line 32 of file systick_reg.h.

Referenced by systickInit().

◆ SYSTICK_CTRL_TICKINT_Pos

#define SYSTICK_CTRL_TICKINT_Pos   (1U)

Bit 1.

Definition at line 33 of file systick_reg.h.

◆ SYSTICK_CTRL_TICKINT

#define SYSTICK_CTRL_TICKINT   ((uint32_t)1U << SYSTICK_CTRL_TICKINT_Pos)

rw Raise the SysTick exception when the counter reaches 0.

Definition at line 35 of file systick_reg.h.

Referenced by systickInit().

◆ SYSTICK_CTRL_CLKSOURCE_Pos

#define SYSTICK_CTRL_CLKSOURCE_Pos   (2U)

Bit 2.

Definition at line 36 of file systick_reg.h.

◆ SYSTICK_CTRL_CLKSOURCE

#define SYSTICK_CTRL_CLKSOURCE   ((uint32_t)1U << SYSTICK_CTRL_CLKSOURCE_Pos)

rw Clock source: 1 = processor clock (HCLK), 0 = HCLK / 8.

Definition at line 38 of file systick_reg.h.

Referenced by systickInit().

◆ SYSTICK_CTRL_COUNTFLAG_Pos

#define SYSTICK_CTRL_COUNTFLAG_Pos   (16U)

Bit 16.

Definition at line 39 of file systick_reg.h.

◆ SYSTICK_CTRL_COUNTFLAG

#define SYSTICK_CTRL_COUNTFLAG   ((uint32_t)1U << SYSTICK_CTRL_COUNTFLAG_Pos)

ro The counter reached 0 since the last read; reading clears it.

Definition at line 41 of file systick_reg.h.

◆ SYSTICK_LOAD_RELOAD_Pos

#define SYSTICK_LOAD_RELOAD_Pos   (0U)

Bits 23:0.

Definition at line 46 of file systick_reg.h.

◆ SYSTICK_LOAD_RELOAD_Msk

#define SYSTICK_LOAD_RELOAD_Msk   ((uint32_t)0xFFFFFFU << SYSTICK_LOAD_RELOAD_Pos)

rw Reload value: the tick period is RELOAD + 1 clocks.

Definition at line 48 of file systick_reg.h.

Referenced by systickInit().

◆ SYSTICK_VAL_CURRENT_Pos

#define SYSTICK_VAL_CURRENT_Pos   (0U)

Bits 23:0.

Definition at line 49 of file systick_reg.h.

◆ SYSTICK_VAL_CURRENT_Msk

#define SYSTICK_VAL_CURRENT_Msk   ((uint32_t)0xFFFFFFU << SYSTICK_VAL_CURRENT_Pos)

rw Current counter value.

Definition at line 51 of file systick_reg.h.

◆ SYSTICK_CALIB_TENMS_Pos

#define SYSTICK_CALIB_TENMS_Pos   (0U)

Bits 23:0.

Definition at line 56 of file systick_reg.h.

◆ SYSTICK_CALIB_TENMS_Msk

#define SYSTICK_CALIB_TENMS_Msk   ((uint32_t)0xFFFFFFU << SYSTICK_CALIB_TENMS_Pos)

ro Reload value for 10 ms (0 if unknown).

Definition at line 58 of file systick_reg.h.

◆ SYSTICK_CALIB_SKEW_Pos

#define SYSTICK_CALIB_SKEW_Pos   (30U)

Bit 30.

Definition at line 59 of file systick_reg.h.

◆ SYSTICK_CALIB_SKEW

#define SYSTICK_CALIB_SKEW   ((uint32_t)1U << SYSTICK_CALIB_SKEW_Pos)

ro TENMS is not exactly 10 ms.

Definition at line 61 of file systick_reg.h.

◆ SYSTICK_CALIB_NOREF_Pos

#define SYSTICK_CALIB_NOREF_Pos   (31U)

Bit 31.

Definition at line 62 of file systick_reg.h.

◆ SYSTICK_CALIB_NOREF

#define SYSTICK_CALIB_NOREF   ((uint32_t)1U << SYSTICK_CALIB_NOREF_Pos)

ro No external reference clock.

Definition at line 64 of file systick_reg.h.