Nano RGB LED mesh
Fork of nrf51-sdk by
source/nordic_sdk/components/libraries/app_timer_appsh/app_timer_appsh.h@46:298dbe432318, 2016-04-28 (annotated)
- Committer:
- Jackson_lv
- Date:
- Thu Apr 28 08:51:03 2016 +0000
- Revision:
- 46:298dbe432318
BLE Nano Mesh;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Jackson_lv | 46:298dbe432318 | 1 | /* Copyright (c) 2014 Nordic Semiconductor. All Rights Reserved. |
Jackson_lv | 46:298dbe432318 | 2 | * |
Jackson_lv | 46:298dbe432318 | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
Jackson_lv | 46:298dbe432318 | 4 | * Terms and conditions of usage are described in detail in NORDIC |
Jackson_lv | 46:298dbe432318 | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
Jackson_lv | 46:298dbe432318 | 6 | * |
Jackson_lv | 46:298dbe432318 | 7 | * Licensees are granted free, non-transferable use of the information. NO |
Jackson_lv | 46:298dbe432318 | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
Jackson_lv | 46:298dbe432318 | 9 | * the file. |
Jackson_lv | 46:298dbe432318 | 10 | * |
Jackson_lv | 46:298dbe432318 | 11 | */ |
Jackson_lv | 46:298dbe432318 | 12 | |
Jackson_lv | 46:298dbe432318 | 13 | #ifndef APP_TIMER_APPSH_H |
Jackson_lv | 46:298dbe432318 | 14 | #define APP_TIMER_APPSH_H |
Jackson_lv | 46:298dbe432318 | 15 | |
Jackson_lv | 46:298dbe432318 | 16 | #include "app_timer.h" |
Jackson_lv | 46:298dbe432318 | 17 | |
Jackson_lv | 46:298dbe432318 | 18 | #define APP_TIMER_SCHED_EVT_SIZE sizeof(app_timer_event_t) /**< Size of button events being passed through the scheduler (is to be used for computing the maximum size of scheduler events). */ |
Jackson_lv | 46:298dbe432318 | 19 | |
Jackson_lv | 46:298dbe432318 | 20 | /**@brief Macro for initializing the application timer module to use with app_scheduler. |
Jackson_lv | 46:298dbe432318 | 21 | * |
Jackson_lv | 46:298dbe432318 | 22 | * @param[in] PRESCALER Value of the RTC1 PRESCALER register. This will decide the |
Jackson_lv | 46:298dbe432318 | 23 | * timer tick rate. Set to 0 for no prescaling. |
Jackson_lv | 46:298dbe432318 | 24 | * @param[in] MAX_TIMERS Maximum number of timers that can be created at any given time. |
Jackson_lv | 46:298dbe432318 | 25 | * @param[in] OP_QUEUES_SIZE Size of queues holding timer operations that are pending execution. |
Jackson_lv | 46:298dbe432318 | 26 | * @param[in] USE_SCHEDULER TRUE if the application is using the app_scheduler, |
Jackson_lv | 46:298dbe432318 | 27 | * FALSE otherwise. |
Jackson_lv | 46:298dbe432318 | 28 | * |
Jackson_lv | 46:298dbe432318 | 29 | * @note Since this macro allocates a buffer, it must only be called once (it is OK to call it |
Jackson_lv | 46:298dbe432318 | 30 | * several times as long as it is from the same location, e.g. to do a reinitialization). |
Jackson_lv | 46:298dbe432318 | 31 | */ |
Jackson_lv | 46:298dbe432318 | 32 | #define APP_TIMER_APPSH_INIT(PRESCALER, MAX_TIMERS, OP_QUEUES_SIZE, USE_SCHEDULER) \ |
Jackson_lv | 46:298dbe432318 | 33 | APP_TIMER_INIT(PRESCALER, MAX_TIMERS, OP_QUEUES_SIZE, \ |
Jackson_lv | 46:298dbe432318 | 34 | (USE_SCHEDULER) ? app_timer_evt_schedule : NULL) |
Jackson_lv | 46:298dbe432318 | 35 | |
Jackson_lv | 46:298dbe432318 | 36 | typedef struct |
Jackson_lv | 46:298dbe432318 | 37 | { |
Jackson_lv | 46:298dbe432318 | 38 | app_timer_timeout_handler_t timeout_handler; |
Jackson_lv | 46:298dbe432318 | 39 | void * p_context; |
Jackson_lv | 46:298dbe432318 | 40 | } app_timer_event_t; |
Jackson_lv | 46:298dbe432318 | 41 | |
Jackson_lv | 46:298dbe432318 | 42 | uint32_t app_timer_evt_schedule(app_timer_timeout_handler_t timeout_handler, |
Jackson_lv | 46:298dbe432318 | 43 | void * p_context); |
Jackson_lv | 46:298dbe432318 | 44 | #endif // APP_TIMER_APPSH_H |
Jackson_lv | 46:298dbe432318 | 45 |