nRF5 SDK v15.3.0
Macros
Application timer functionality configuration

Macros

#define APP_TIMER_ENABLED
 Enabling app_timer module. More...
 
#define APP_TIMER_CONFIG_RTC_FREQUENCY
 Configure RTC prescaler. More...
 
#define APP_TIMER_CONFIG_IRQ_PRIORITY
 Interrupt priority. More...
 
#define APP_TIMER_CONFIG_OP_QUEUE_SIZE
 Capacity of timer requests queue. More...
 
#define APP_TIMER_CONFIG_USE_SCHEDULER
 Enable scheduling app_timer events to app_scheduler. More...
 
#define APP_TIMER_KEEPS_RTC_ACTIVE
 Enable RTC always on. More...
 
#define APP_TIMER_SAFE_WINDOW_MS
 Maximum possible latency (in milliseconds) of handling app_timer event. More...
 
#define APP_TIMER_WITH_PROFILER
 Enable app_timer profiling. More...
 
#define APP_TIMER_CONFIG_SWI_NUMBER
 Configure SWI instance used. More...
 

Detailed Description

Macro Definition Documentation

#define APP_TIMER_CONFIG_IRQ_PRIORITY

Interrupt priority.

Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice

Following options are available:

  • 0 - 0 (highest)
  • 1 - 1
  • 2 - 2
  • 3 - 3
  • 4 - 4 (Applicable devices only)
  • 5 - 5 (Applicable devices only)
  • 6 - 6 (Applicable devices only)
  • 7 - 7 (Applicable devices only)
Note
This is an NRF_CONFIG macro.
#define APP_TIMER_CONFIG_OP_QUEUE_SIZE

Capacity of timer requests queue.

Size of the queue depends on how many timers are used in the system, how often timers are started and overall system latency. If queue size is too small app_timer calls will fail.

Note
This is an NRF_CONFIG macro.
#define APP_TIMER_CONFIG_RTC_FREQUENCY

Configure RTC prescaler.

Following options are available:

  • 0 - 32768 Hz
  • 1 - 16384 Hz
  • 3 - 8192 Hz
  • 7 - 4096 Hz
  • 15 - 2048 Hz
  • 31 - 1024 Hz
Note
This is an NRF_CONFIG macro.
#define APP_TIMER_CONFIG_SWI_NUMBER

Configure SWI instance used.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_TIMER_CONFIG_USE_SCHEDULER

Enable scheduling app_timer events to app_scheduler.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_TIMER_ENABLED

Enabling app_timer module.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_TIMER_KEEPS_RTC_ACTIVE

Enable RTC always on.

If option is enabled RTC is kept running even if there is no active timers. This option can be used when app_timer is used for timestamping.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.
#define APP_TIMER_SAFE_WINDOW_MS

Maximum possible latency (in milliseconds) of handling app_timer event.

Maximum possible timeout that can be set is reduced by safe window. Example: RTC frequency 16384 Hz, maximum possible timeout 1024 seconds - APP_TIMER_SAFE_WINDOW_MS. Since RTC is not stopped when processor is halted in debugging session, this value must cover it if debugging is needed. It is possible to halt processor for APP_TIMER_SAFE_WINDOW_MS without corrupting app_timer behavior.

Note
This is an NRF_CONFIG macro.
#define APP_TIMER_WITH_PROFILER

Enable app_timer profiling.

Set to 1 to activate.

Note
This is an NRF_CONFIG macro.

Documentation feedback | Developer Zone | Subscribe | Updated