Skip to content

Commit d7827dc

Browse files
doc: nrf-bm: lib: add event scheduler documentation
Add documentation for event scheduler. Signed-off-by: Eivind Jølsgard <[email protected]>
1 parent 3033a26 commit d7827dc

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

doc/nrf-bm/api/api.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Bare Metal Buttons library
5151
:inner:
5252
:members:
5353

54+
.. _api_event_scheduler:
55+
5456
Bare Metal Event Scheduler library
5557
==================================
5658

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.. _lib_event_scheduler:
2+
3+
Event Scheduler
4+
###############
5+
6+
.. contents::
7+
:local:
8+
:depth: 2
9+
10+
The event scheduler is used for transferring execution from the interrupt context to the main context.
11+
12+
Overview
13+
********
14+
15+
In some applications it is beneficial to defer the execution of certain interrupts, for example some SoftDevice interrupts, to the main application function.
16+
This shortens the time spent in the interrupt service routine (ISR) and allows for other (low priority) events to be raised before the previous event is fully processed.
17+
Note that the application must take care to only defer events that can be interleaved by the processing of other interrupts.
18+
19+
Configuration
20+
*************
21+
22+
The library is enabled using the Kconfig system.
23+
Set the :kconfig:option:`CONFIG_EVENT_SCHEDULER` Kconfig option to enable the library.
24+
25+
The size of the event scheduler buffer, that the events are copied into, is set using the :kconfig:option:`CONFIG_EVENT_SCHEDULER_BUF_SIZE` Kconfig option.
26+
27+
Initialization
28+
==============
29+
30+
The library is initialized automatically on application startup.
31+
32+
Usage
33+
*****
34+
35+
The SoftDevice event handler can call the :c:func:`event_scheduler_defer` function to schedule an event for execution in the main thread.
36+
The :c:func:`event_scheduler_process` function must be called regulary from the main function to process the deferred events.
37+
38+
Dependencies
39+
************
40+
41+
This library does not have any dependencies.
42+
43+
API documentation
44+
*****************
45+
46+
| Header file: :file:`include/event_scheduler.h`
47+
| Source files: :file:`lib/event_scheduler/`
48+
49+
:ref:`Event Scheduler library API reference <api_event_scheduler>`

0 commit comments

Comments
 (0)