/ src / timer / timer.h
timer.h
 1  #pragma once
 2  
 3  #ifdef __cplusplus
 4  extern "C" {
 5  #endif
 6  
 7  #include <stdint.h>
 8  #include "sdk_config.h"
 9  
10  #define TIMER_RTC_INSTANCE      2
11  #define TIMER_TICK_FREQUENCY    NRFX_RTC_DEFAULT_CONFIG_FREQUENCY
12  
13  void timer_initialize(void);
14  void timer_start(void);
15  void timer_stop(void);
16  uint32_t timer_get_ticks(void);
17  float timer_get_elapsed_seconds(void);
18  inline float timer_ticks_to_seconds(uint32_t ticks) { return (float)ticks / TIMER_TICK_FREQUENCY; }
19  
20  #ifdef __cplusplus
21  }
22  #endif