46 #include <sys/clock.h> 48 #include "app_error.h" 50 #include "compiler_abstraction.h" 52 #define APP_TIMER_CLOCK_FREQ CLOCK_SECOND 53 #define APP_TIMER_MIN_TIMEOUT_TICKS 1 73 #define APP_TIMER_TICKS(MS, PRESCALER)\ 80 void app_timer_work_cb(
struct mwork_t *work);
87 #define APP_TIMER_DEF(timer_id) \ 88 static app_timer_t timer_id##_data = { \ 89 .work = MWORK_INIT(timer_id##_data.work, app_timer_work_cb), \ 90 .mode = (app_timer_mode_t) -1, \ 92 static const app_timer_id_t timer_id = &timer_id##_data 109 typedef struct app_timer_t
141 #define APP_TIMER_INIT(PRESCALER, OP_QUEUES_SIZE, SCHEDULER_FUNC) \ 144 uint32_t ERR_CODE = app_timer_init(SCHEDULER_FUNC); \ 145 APP_ERROR_CHECK(ERR_CODE); \ 250 uint32_t * p_ticks_diff);
252 #endif // APP_TIMER_H__ uint32_t app_timer_stop(app_timer_id_t timer_id)
Function for stopping the specified timer.
uint32_t app_timer_init(app_timer_evt_schedule_func_t evt_schedule_func)
Function for initializing the timer module.
Header file for the EVE millisecond-scale work scheduling.
uint32_t app_timer_create(app_timer_id_t const *p_timer_id, app_timer_mode_t mode, app_timer_timeout_handler_t timeout_handler)
Function for creating a timer instance.
app_timer_mode_t
Timer modes.
uint32_t app_timer_cnt_diff_compute(uint32_t ticks_to, uint32_t ticks_from, uint32_t *p_ticks_diff)
Function for computing the difference between two RTC1 counter values.
struct app_timer_t * app_timer_id_t
Timer ID type. Never declare a variable of this type, but use the macro APP_TIMER_DEF instead...
void(* app_timer_timeout_handler_t)(void *p_context)
Application time-out handler type.
uint32_t(* app_timer_evt_schedule_func_t)(app_timer_timeout_handler_t timeout_handler, void *p_context)
Type of function for passing events from the timer module to the scheduler.
uint32_t app_timer_start(app_timer_id_t timer_id, uint32_t timeout_ticks, void *p_context)
Function for starting a timer.
uint32_t app_timer_cnt_get(uint32_t *p_ticks)
Function for returning the current value of the RTC1 counter.
uint32_t app_timer_stop_all(void)
Function for stopping all running timers.