Mistake on this page?
Report an issue in GitHub or email us
LoRaWANTimer.h
1 /**
2  / _____) _ | |
3 ( (____ _____ ____ _| |_ _____ ____| |__
4  \____ \| ___ | (_ _) ___ |/ ___) _ \
5  _____) ) ____| | | || |_| ____( (___| | | |
6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
7  (C)2013 Semtech
8 
9 Description: Timer objects and scheduling management
10 
11 License: Revised BSD License, see LICENSE.TXT file include in the project
12 
13 Maintainer: Miguel Luis and Gregory Cristian
14 
15 
16 Copyright (c) 2017, Arm Limited and affiliates.
17 
18 SPDX-License-Identifier: BSD-3-Clause
19 */
20 
21 #ifndef MBED_LORAWAN_SYS_TIMER_H__
22 #define MBED_LORAWAN_SYS_TIMER_H__
23 
24 #include <stdint.h>
25 #include "events/EventQueue.h"
26 
28 
30 public:
33 
34  /** Activates the timer subsystem.
35  *
36  * Embeds EventQueue object to timer subsystem which is subsequently
37  * used to extract timer information.
38  *
39  * @param [in] queue Handle to EventQueue object
40  */
42 
43  /** Read the current time.
44  *
45  * @return time The current time.
46  */
48 
49  /** Return the time elapsed since a fixed moment in time.
50  *
51  * @param [in] saved_time The fixed moment in time.
52  * @return time The elapsed time.
53  */
55 
56  /** Initializes the timer object.
57  *
58  * @remark The TimerSetValue function must be called before starting the timer.
59  * This function initializes the time-stamp and reloads the value at 0.
60  *
61  * @param [in] obj The structure containing the timer object parameters.
62  * @param [in] callback The function callback called at the end of the timeout.
63  */
64  void init(timer_event_t &obj, mbed::Callback<void()> callback);
65 
66  /** Starts and adds the timer object to the list of timer events.
67  *
68  * @param [in] obj The structure containing the timer object parameters.
69  * @param [in] timeout The new timeout value.
70  */
71  void start(timer_event_t &obj, const uint32_t timeout);
72 
73  /** Stops and removes the timer object from the list of timer events.
74  *
75  * @param [in] obj The structure containing the timer object parameters.
76  */
77  void stop(timer_event_t &obj);
78 
79 private:
80  events::EventQueue *_queue;
81 };
82 
83 #endif // MBED_LORAWAN_SYS_TIMER_H__
EventQueue.
Definition: EventQueue.h:60
void activate_timer_subsystem(events::EventQueue *queue)
Activates the timer subsystem.
void stop(timer_event_t &obj)
Stops and removes the timer object from the list of timer events.
Timer object description.
uint32_t lorawan_time_t
Timer time variable definition.
/ _____) _ | | ( (____ _____ ____ _| |_ _____ ____| |__ ____ | ___ | (_ _) ___ |/ ___) _ \ _____) ) _...
Definition: LoRaWANTimer.h:29
lorawan_time_t get_elapsed_time(lorawan_time_t saved_time)
Return the time elapsed since a fixed moment in time.
Callback< R(ArgTs...)> callback(R(*func)(ArgTs...)=0)
Create a callback class with type inferred from the arguments.
Definition: Callback.h:709
void start(timer_event_t &obj, const uint32_t timeout)
Starts and adds the timer object to the list of timer events.
Contains common data structures used by Mbed-OS LoRaWAN mplementation.
void init(timer_event_t &obj, mbed::Callback< void()> callback)
Initializes the timer object.
lorawan_time_t get_current_time(void)
Read the current time.
Callback class based on template specialization.
Definition: Callback.h:39
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.