APM:Libraries
Functions | Variables
systick.h File Reference
#include <stm32f4xx.h>
#include <hal_types.h>
#include <hal.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

void emerg_delay (uint32_t)
 
void systick_init (uint32_t reload_val)
 Initialize and enable SysTick. More...
 
static void systick_enable ()
 
static void systick_disable ()
 
static uint64_t systick_uptime (void)
 Returns the system uptime, in milliseconds. More...
 
static uint32_t systick_get_count (void)
 Returns the current value of the SysTick counter. More...
 
static uint32_t systick_check_underflow (void)
 Check for underflow. More...
 
void systick_attach_callback (Handler callback)
 Attach a callback to be called from the SysTick exception handler. More...
 
void systick_detach_callback (Handler callback)
 
uint32_t systick_micros (void)
 
void SysTick_Handler (void)
 
void __attribute__ ((noreturn)) __error(uint32_t pc
 

Variables

volatile uint64_t systick_uptime_millis
 
voidFuncPtr boardEmergencyHandler
 
void uint32_t num
 
void uint32_t uint32_t lr
 
void uint32_t uint32_t uint32_t flag
 

Function Documentation

◆ __attribute__()

void __attribute__ ( (noreturn)  )

◆ emerg_delay()

void emerg_delay ( uint32_t  )

Definition at line 257 of file boards.cpp.

Referenced by __attribute__().

Here is the caller graph for this function:

◆ systick_attach_callback()

void systick_attach_callback ( Handler  callback)

Attach a callback to be called from the SysTick exception handler.

To detach a callback, call this function again with a null argument.

Definition at line 28 of file systick.c.

Referenced by systick_check_underflow().

Here is the caller graph for this function:

◆ systick_check_underflow()

static uint32_t systick_check_underflow ( void  )
inlinestatic

Check for underflow.

This function returns 1 if the SysTick timer has counted to 0 since the last time it was called. However, any reads of any part of the SysTick Control and Status Register SYSTICK_BASE->CSR will interfere with this functionality. See the ARM Cortex M3 Technical Reference Manual for more details (e.g. Table 8-3 in revision r1p1).

Definition at line 59 of file systick.h.

Here is the call graph for this function:

◆ systick_detach_callback()

void systick_detach_callback ( Handler  callback)

Definition at line 34 of file systick.c.

Referenced by systick_check_underflow().

Here is the caller graph for this function:

◆ systick_disable()

static void systick_disable ( )
inlinestatic

Clock the system timer with the core clock, but don't turn it on or enable interrupt.

Definition at line 39 of file systick.h.

◆ systick_enable()

static void systick_enable ( )
inlinestatic

Clock the system timer with the core clock and turn it on; interrupt every 1 ms, for systick_timer_millis.

Definition at line 33 of file systick.h.

Referenced by systick_init().

Here is the caller graph for this function:

◆ systick_get_count()

static uint32_t systick_get_count ( void  )
inlinestatic

Returns the current value of the SysTick counter.

Definition at line 48 of file systick.h.

◆ SysTick_Handler()

void SysTick_Handler ( void  )

Definition at line 63 of file systick.c.

Referenced by systick_check_underflow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ systick_init()

void systick_init ( uint32_t  reload_val)

Initialize and enable SysTick.

Clocks the system timer with the core clock, turns it on, and enables interrupts.

Parameters
reload_valAppropriate reload counter to tick every 1 ms.

Definition at line 50 of file systick.c.

Referenced by init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ systick_micros()

uint32_t systick_micros ( void  )

Referenced by systick_check_underflow().

Here is the caller graph for this function:

◆ systick_uptime()

static uint64_t systick_uptime ( void  )
inlinestatic

Returns the system uptime, in milliseconds.

Definition at line 44 of file systick.h.

Referenced by F4Light::Scheduler::_millis(), F4Light::Scheduler::_millis64(), F4Light::PPM_parser::_process_dsm_pulse(), F4Light::PPM_parser::_process_ppmsum_pulse(), F4Light::PPM_parser::_process_sbus_pulse(), Soft_I2C::bus_reset(), i2c_bus_reset(), F4Light::DSM_parser::init(), millis(), pwmIRQHandler(), and F4Light::RCInput::read().

Here is the caller graph for this function:

Variable Documentation

◆ boardEmergencyHandler

voidFuncPtr boardEmergencyHandler

◆ flag

void uint32_t uint32_t uint32_t flag

◆ lr

void uint32_t uint32_t lr

Definition at line 80 of file systick.h.

Referenced by __cxa_pure_virtual(), SystemCoreClockUpdate(), and systemInit().

◆ num

void uint32_t num

◆ systick_uptime_millis

volatile uint64_t systick_uptime_millis

System elapsed time, in milliseconds

Referenced by SysTick_Handler(), systick_init(), and systick_uptime().