Lines Matching full:a
6 A :dfn:`timer` is a kernel object that measures the passage of time
7 using the kernel's system clock. When a timer's specified time limit
22 A timer has the following key properties:
24 * A **duration** specifying the time interval before the timer
25 expires for the first time. This is a ``k_timeout_t`` value that
28 * A **period** specifying the time interval between all timer
29 expirations after the first one, also a ``k_timeout_t``. It must be
30 non-negative. A period of ``K_NO_WAIT`` (i.e. zero) or
31 ``K_FOREVER`` means that the timer is a one shot timer that stops
32 after a single expiration. (For example then, if a timer is started
33 with a duration of 200 and a period of 75, it will first expire
38 If no expiry function is required a ``NULL`` function can be specified.
40 * A **stop function** that is executed if the timer is stopped prematurely
42 If no stop function is required a ``NULL`` function can be specified.
44 * A **status** value that indicates how many times the timer has expired
47 A timer must be initialized before it can be used. This specifies its
51 A timer is **started** by specifying a duration and a period.
62 When a running timer expires its status is incremented
64 If a thread is waiting on the timer, it is unblocked.
66 otherwise the timer restarts with a new duration equal to its period.
68 A running timer can be stopped in mid-countdown, if desired.
71 If a thread is waiting on the timer, it is unblocked.
72 Attempting to stop a non-running timer is permitted,
75 A running timer can be restarted in mid-countdown, if desired.
78 If a thread is waiting on the timer, it continues waiting.
80 A timer's status can be read directly at any time to determine how many times
82 Reading a timer's status resets its value to zero.
84 a value of zero indicates that the timer is stopped.
86 A thread may read a timer's status indirectly by **synchronizing**
94 Only a single user should examine the status of any given timer,
96 Similarly, only a single thread at a time should synchronize
97 with a given timer. ISRs are not permitted to synchronize with timers,
103 Defining a Timer
106 A timer is defined using a variable of type :c:struct:`k_timer`.
109 The following code defines and initializes a timer.
118 Alternatively, a timer can be defined and initialized at compile time
127 Using a Timer Expiry Function
130 The following code uses a timer to perform a non-trivial action on a periodic
132 the timer's expiry function submits a work item to the
160 The following code reads a timer's status directly to determine
187 The following code performs timer status synchronization to allow a thread
188 to do useful work while ensuring that a pair of protocol operations
214 between the two protocol operations, without using a timer.
219 Use a timer to initiate an asynchronous operation after a specified
222 Use a timer to determine whether or not a specified amount of time has
227 Use a timer to perform other work while carrying out operations
231 If a thread needs to measure the time required to perform an operation
233 directly, rather than using a timer.