diff --git a/doc/nrf-bm/api/api.rst b/doc/nrf-bm/api/api.rst index e7fd6138eb..9f55375d1e 100644 --- a/doc/nrf-bm/api/api.rst +++ b/doc/nrf-bm/api/api.rst @@ -51,6 +51,8 @@ Bare Metal Buttons library :inner: :members: +.. _api_event_scheduler: + Bare Metal Event Scheduler library ================================== diff --git a/doc/nrf-bm/libraries/event_scheduler.rst b/doc/nrf-bm/libraries/event_scheduler.rst new file mode 100644 index 0000000000..046c06cee0 --- /dev/null +++ b/doc/nrf-bm/libraries/event_scheduler.rst @@ -0,0 +1,51 @@ +.. _lib_event_scheduler: + +Event Scheduler +############### + +.. contents:: + :local: + :depth: 2 + +The event scheduler is used for transferring execution from the interrupt context to the main context. + +Overview +******** + +In some applications, it is beneficial to defer the execution of certain interrupts, for example some SoftDevice interrupts, to the main application function. +This shortens the time spent in the interrupt service routine (ISR). +It also allows for lower priority events to be raised before the previous event is fully processed. + +The application must ensure that only events capable of being interleaved with other interrupt processes are deferred. + +Configuration +************* + +The library is enabled using the Kconfig system. +Set the :kconfig:option:`CONFIG_EVENT_SCHEDULER` Kconfig option to enable the library. + +Use the :kconfig:option:`CONFIG_EVENT_SCHEDULER_BUF_SIZE` Kconfig option to set the size of the event scheduler buffer that the events are copied into. + +Initialization +============== + +The library is initialized automatically on application startup. + +Usage +***** + +The SoftDevice event handler can call the :c:func:`event_scheduler_defer` function to schedule an event for later execution in the main thread. +To process these deferred events, call the :c:func:`event_scheduler_process` function regularly in the main application function. + +Dependencies +************ + +This library does not have any dependencies. + +API documentation +***************** + +| Header file: :file:`include/bm/event_scheduler.h` +| Source files: :file:`lib/event_scheduler/` + +:ref:`Event Scheduler library API reference ` diff --git a/doc/nrf-bm/release_notes/release_notes_changelog.rst b/doc/nrf-bm/release_notes/release_notes_changelog.rst index e45bfb731e..7e75f7b33b 100644 --- a/doc/nrf-bm/release_notes/release_notes_changelog.rst +++ b/doc/nrf-bm/release_notes/release_notes_changelog.rst @@ -108,4 +108,4 @@ No changes since the latest nRF Connect SDK Bare Metal release. Documentation ============= -No changes since the latest nRF Connect SDK Bare Metal release. +* Added documentation for the :ref:`lib_event_scheduler`.