STM32 RTOS 0.2.3
Bare-metal preemptive RTOS for STM32F446RE
Loading...
Searching...
No Matches
systick.h File Reference

SysTick driver: the periodic tick timer. More...

#include "driver_status.h"
#include "systick_reg.h"
#include <stdint.h>
Include dependency graph for systick.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

DRIVER_MUST_CHECK DriverStatus_e systickInit (SysTickRegisters_t *systick, uint32_t core_hz, uint32_t tick_hz)
 Start SysTick at tick_hz from the processor clock, with its interrupt on.
void systickDeinit (SysTickRegisters_t *systick)
 Stop SysTick and zero CTRL, LOAD and VAL.

Detailed Description

SysTick driver: the periodic tick timer.

Programs the timer only: SysTick_Handler and any tick count belong to the kernel. SysTick counts down from LOAD to 0 and reloads, so the period is LOAD + 1 processor clocks: 2 at minimum and 2^24 at most.

if (nvicSetSystemHandlerPriority(SCB, SysTick_IRQn, 15U) != DRIVER_STATUS_OK) { ... }
if (systickInit(SYSTICK, BSP_HCLK_HZ, 1000U) != DRIVER_STATUS_OK) { ... } // 1 kHz tick
#define BSP_HCLK_HZ
HCLK (AHB /1): core, SysTick, GPIO.
Definition bsp.h:54
@ DRIVER_STATUS_OK
Succeeded.
DRIVER_MUST_CHECK DriverStatus_e nvicSetSystemHandlerPriority(ScbRegisters_t *scb, IRQn_e irqn, uint32_t priority)
Set a configurable system handler's priority (SCB SHPR1-3).
Definition nvic.c:182
#define SCB
The SCB instance.
Definition scb_reg.h:62
DRIVER_MUST_CHECK DriverStatus_e systickInit(SysTickRegisters_t *systick, uint32_t core_hz, uint32_t tick_hz)
Start SysTick at tick_hz from the processor clock, with its interrupt on.
Definition systick.c:12
#define SYSTICK
The SysTick instance.
Definition systick_reg.h:26

Definition in file systick.h.