Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
sys_time_arch.h File Reference

STM32 timing functions. More...

#include "mcu_periph/sys_time.h"
#include <libopencm3/stm32/gpio.h>
#include <libopencm3/stm32/rcc.h>
#include <libopencm3/cm3/systick.h>
#include "std.h"
+ Include dependency graph for sys_time_arch.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static uint32_t get_sys_time_usec (void)
 Get the time in microseconds since startup. More...
 
static uint32_t get_sys_time_usec100 (void)
 Get the time in 100microseconds since startup. More...
 
static uint32_t get_sys_time_msec (void)
 Get the time in milliseconds since startup. More...
 
static void sys_time_usleep (uint32_t us)
 Busy wait in microseconds. More...
 

Detailed Description

STM32 timing functions.

Definition in file sys_time_arch.h.

Function Documentation

◆ get_sys_time_msec()

static uint32_t get_sys_time_msec ( void  )
inlinestatic

Get the time in milliseconds since startup.

Returns
milliseconds since startup as uint32_t

Definition at line 70 of file sys_time_arch.h.

References msec_of_cpu_ticks(), sys_time::nb_sec, and sys_time::nb_sec_rem.

+ Here is the call graph for this function:

◆ get_sys_time_usec()

static uint32_t get_sys_time_usec ( void  )
inlinestatic

Get the time in microseconds since startup.

WARNING: overflows after 70min!

Returns
microseconds since startup as uint32_t

Definition at line 47 of file sys_time_arch.h.

References sys_time::nb_sec, sys_time::nb_sec_rem, and usec_of_cpu_ticks().

+ Here is the call graph for this function:

◆ get_sys_time_usec100()

static uint32_t get_sys_time_usec100 ( void  )
inlinestatic

Get the time in 100microseconds since startup.

WARNING: overflows after 7000min!

Returns
100microseconds since startup as uint32_t

Definition at line 59 of file sys_time_arch.h.

References sys_time::nb_sec, sys_time::nb_sec_rem, and usec_of_cpu_ticks().

+ Here is the call graph for this function:

◆ sys_time_usleep()

static void sys_time_usleep ( uint32_t  us)
inlinestatic

Busy wait in microseconds.

max value is limited by the max number of cycle i.e 2^32 * usec_of_cpu_ticks(systick_get_reload())

Definition at line 83 of file sys_time_arch.h.

References cpu_ticks_of_usec(), and usec_of_cpu_ticks().

+ Here is the call graph for this function: