Appiko
device_tick.h
1 
19 #ifndef CODEBASE_PERIPHERAL_MODULES_DEVICE_TICK_H_
20 #define CODEBASE_PERIPHERAL_MODULES_DEVICE_TICK_H_
21 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include "nrf.h"
39 
40 #if SYS_CFG_PRESENT == 1
41 #include "sys_config.h"
42 #endif
43 #ifndef MS_TIMER_USED_DEVICE_TICKS
44 #define MS_TIMER_USED_DEVICE_TICKS 0
45 #endif
46 
48 #define DEVICE_TICK_MSTIMER_DIV_FACTOR (1)
49 
53 typedef enum
54 {
59 
64 typedef struct {
65  uint32_t fast_mode_ticks;
66  uint32_t slow_mode_ticks;
69 
78 
84 
90 void device_tick_process(void);
91 
92 #endif /* CODEBASE_PERIPHERAL_MODULES_DEVICE_TICK_H_ */
93 
Fast mode.
Definition: device_tick.h:56
device_tick_mode mode
The number of LFCLK ticks for the slow mode.
Definition: device_tick.h:67
uint32_t slow_mode_ticks
The number of LFCLK ticks for the fast mode.
Definition: device_tick.h:66
device_tick_mode
The two different modes at which the device ticks, fast & slow.
Definition: device_tick.h:53
Stucture for passing the configuration for initializing the Device Tick module.
Definition: device_tick.h:64
void device_tick_init(device_tick_cfg *cfg)
Initializes and starts the Device tick module. Provides a next interval event immediately....
Definition: device_tick.c:52
Same as previous mode.
Definition: device_tick.h:57
void device_tick_process(void)
The function to be called whenever the SoC wakes up to see if more than half the time of the current ...
Definition: device_tick.c:89
void device_tick_switch_mode(device_tick_mode mode)
Switches from the fast to slow mode or vice versa.
Definition: device_tick.c:73
Slow mode.
Definition: device_tick.h:55