Skip to content

Commit 3907777

Browse files
committed
doc: review of timer library
to be squashed Signed-off-by: Bartosz Gentkowski <[email protected]>
1 parent 0ddcd65 commit 3907777

File tree

2 files changed

+21
-15
lines changed

2 files changed

+21
-15
lines changed

doc/nrf-bm/libraries/timer.rst

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
1-
.. _lib_timer:
1+
.. _lib_bm_timer:
22

3-
Timer Library
3+
Timer library
44
#############
55

66
.. contents::
77
:local:
88
:depth: 2
99

10-
Overview
11-
********
10+
The timer library allows the application to create multiple timer instances.
1211

13-
The timer library enables the application to create multiple timer instances.
14-
Start and stop requests, checking for time-outs, and invoking the user time-out handlers are performed in the GRTC interrupt handler.
12+
Functions such as starting and stopping timers, checking for timeouts, and invoking user-defined timeout handlers are all managed within the GRTC interrupt handler.
1513

1614
Configuration
1715
*************
1816

1917
The library is enabled and configured entirely using the Kconfig system.
2018
Set the :kconfig:option:`CONFIG_BM_TIMER` Kconfig option to enable the library.
2119

22-
You can set the timer IRQ priority by setting the :kconfig:option:`CONFIG_BM_TIMER_IRQ_PRIO` Kconfig option.
20+
You can adjust the timer IRQ priority using the :kconfig:option:`CONFIG_BM_TIMER_IRQ_PRIO` Kconfig option.
2321

2422
Initialization
2523
==============
2624

27-
A timer instance is initialized by calling the :c:func:`bm_timer_init` function, selecting the timer mode and providing the user callback for when the timer expires.
25+
To initialize a timer instance, call the :c:func:`bm_timer_init` function.
26+
Specify the timer mode and provide a user callback function that will be called when the timer expires.
27+
2828
The timer can be initialized in the following modes:
2929

30-
* :c:macro:`BM_TIMER_MODE_SINGLE_SHOT` - Expire only once when started.
31-
* :c:macro:`BM_TIMER_MODE_REPEATED` - Restart when expired until stopped.
30+
* :c:macro:`BM_TIMER_MODE_SINGLE_SHOT` - The timer expires only once after it is started.
31+
* :c:macro:`BM_TIMER_MODE_REPEATED` - The timer automatically restarts upon expiring until it is stopped.
3232

3333
Usage
3434
*****
3535

36-
After initialization, the timer is started by calling the :c:func:`bm_timer_start` function, providing the timeout and user provided context passed to the callback.
37-
The timeout is given in ticks.
38-
The library provides macros for providing the time in standard time units:
36+
After initialization, start the timer by calling the :c:func:`bm_timer_start` function, providing the timeout and user-provided context passed to the callback.
37+
The timeout is provided in ticks.
38+
39+
The library provides macros to convert standard time units to ticks:
3940

4041
* :c:macro:`BM_TIMER_US_TO_TICKS` - Converts microseconds to ticks.
4142
* :c:macro:`BM_TIMER_MS_TO_TICKS` - Converts milliseconds to ticks.
4243

43-
A timer is stopped by calling the :c:func:`bm_timer_stop` function.
44+
To stop a timer, call the :c:func:`bm_timer_stop` function.
45+
46+
Sample
47+
******
48+
49+
Usage of this library is demonstrated in the :ref:`timer_sample` sample.
4450

4551
Dependencies
4652
************

doc/nrf-bm/release_notes/release_notes_changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ No changes since the latest nRF Connect SDK Bare Metal release.
8181
Documentation
8282
=============
8383

84-
No changes since the latest nRF Connect SDK Bare Metal release.
84+
* Added documentation for the :ref:`lib_bm_timer`.

0 commit comments

Comments
 (0)