APM:Libraries
Macros | Functions | Variables
stopwatch.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEMCR_TRCENA   0x01000000
 
#define DEMCR   (*((volatile uint32_t *)0xE000EDFC))
 
#define DWT_CTRL   (*(volatile uint32_t *)0xe0001000)
 
#define CYCCNTENA   (1<<0)
 
#define DWT_CYCCNT   ((volatile uint32_t *)0xE0001004)
 
#define CPU_CYCLES   *DWT_CYCCNT
 

Functions

void stopwatch_init (void)
 
void stopwatch_delay_us (uint32_t us)
 
static void stopwatch_reset (void)
 
static uint32_t stopwatch_getticks ()
 

Variables

uint32_t us_ticks
 

Macro Definition Documentation

◆ CPU_CYCLES

#define CPU_CYCLES   *DWT_CYCCNT

Definition at line 19 of file stopwatch.h.

Referenced by stopwatch_getticks().

◆ CYCCNTENA

#define CYCCNTENA   (1<<0)

Definition at line 17 of file stopwatch.h.

Referenced by stopwatch_init(), and stopwatch_reset().

◆ DEMCR

#define DEMCR   (*((volatile uint32_t *)0xE000EDFC))

Definition at line 14 of file stopwatch.h.

Referenced by stopwatch_init(), and stopwatch_reset().

◆ DEMCR_TRCENA

#define DEMCR_TRCENA   0x01000000

Definition at line 11 of file stopwatch.h.

Referenced by stopwatch_init(), and stopwatch_reset().

◆ DWT_CTRL

#define DWT_CTRL   (*(volatile uint32_t *)0xe0001000)

Definition at line 16 of file stopwatch.h.

Referenced by stopwatch_init(), and stopwatch_reset().

◆ DWT_CYCCNT

#define DWT_CYCCNT   ((volatile uint32_t *)0xE0001004)

Definition at line 18 of file stopwatch.h.

Referenced by stopwatch_reset().

Function Documentation

◆ stopwatch_delay_us()

void stopwatch_delay_us ( uint32_t  us)

Definition at line 25 of file stopwatch.c.

Here is the call graph for this function:

◆ stopwatch_getticks()

static uint32_t stopwatch_getticks ( )
inlinestatic

Definition at line 33 of file stopwatch.h.

Referenced by F4Light::Scheduler::_delay_us_ny(), Soft_I2C::bus_reset(), dispatch_adv_brk(), dispatch_adv_cc(), dispatch_adv_trg_com(), dispatch_adv_up(), dispatch_general(), dispatch_general_h(), dispatch_handler(), exti_serv(), i2c_bus_reset(), stopwatch_delay_us(), Soft_I2C::tick(), usart_rx_irq(), and usart_tx_irq().

Here is the caller graph for this function:

◆ stopwatch_init()

void stopwatch_init ( void  )

Definition at line 12 of file stopwatch.c.

Referenced by init().

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

◆ stopwatch_reset()

static void stopwatch_reset ( void  )
inlinestatic

Definition at line 24 of file stopwatch.h.

Referenced by stopwatch_init().

Here is the caller graph for this function:

Variable Documentation

◆ us_ticks

uint32_t us_ticks

Definition at line 10 of file stopwatch.c.