Semtech LoRaMAC timer compatibility definitions. More...

Detailed Description

Semtech LoRaMAC timer compatibility definitions.

Author
José Ignacio Alamos jiala.nosp@m.mos@.nosp@m.uc.cl
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr
Francisco Molina franc.nosp@m.isco.nosp@m..moli.nosp@m.na@i.nosp@m.nria..nosp@m.cl

Definition in file timer.h.

#include "ztimer.h"
#include "msg.h"
#include "semtech_loramac.h"
+ Include dependency graph for timer.h:

Go to the source code of this file.

Data Structures

struct  TimerEvent_s
 Timer object description. More...
 
typedef struct TimerEvent_s TimerEvent_t
 Timer object description.
 
typedef uint32_t TimerTime_t
 Timer time variable definition.
 
void TimerInit (TimerEvent_t *obj, void(*callback)(void))
 Initializes the timer object. More...
 
void TimerIrqHandler (void)
 Timer IRQ event handler.
 
void TimerStart (TimerEvent_t *obj)
 Starts and adds the timer object to the list of timer events. More...
 
void TimerStop (TimerEvent_t *obj)
 Stops and removes the timer object from the list of timer events. More...
 
void TimerReset (TimerEvent_t *obj)
 Resets the timer object. More...
 
void TimerSetValue (TimerEvent_t *obj, uint32_t value)
 Set timer new timeout value. More...
 
TimerTime_t TimerGetCurrentTime (void)
 Read the current time. More...
 
TimerTime_t TimerGetElapsedTime (TimerTime_t time)
 Return the time elapsed since a fix moment in Time. More...
 
TimerTime_t TimerGetFutureTime (TimerTime_t time)
 Return the time elapsed since a fix moment in time. More...
 
void TimerLowPowerHandler (void)
 Manages the entry into low power mode.
 

Function Documentation

◆ TimerGetCurrentTime()

TimerTime_t TimerGetCurrentTime ( void  )

Read the current time.

Returns
current time

◆ TimerGetElapsedTime()

TimerTime_t TimerGetElapsedTime ( TimerTime_t  time)

Return the time elapsed since a fix moment in Time.

Parameters
[in]timefix moment in Time
Returns
elapsed time

◆ TimerGetFutureTime()

TimerTime_t TimerGetFutureTime ( TimerTime_t  time)

Return the time elapsed since a fix moment in time.

Parameters
[in]timefix moment in the future
Returns
difference between now and future event

◆ TimerInit()

void TimerInit ( TimerEvent_t obj,
void(*)(void)  callback 
)

Initializes the timer object.

Remarks
TimerSetValue function must be called before starting the timer. this function initializes timestamp and reload value at 0.
Parameters
[in]objStructure containing the timer object parameters
[in]callbackFunction callback called at the end of the timeout

◆ TimerReset()

void TimerReset ( TimerEvent_t obj)

Resets the timer object.

Parameters
[in]objStructure containing the timer object parameters

◆ TimerSetValue()

void TimerSetValue ( TimerEvent_t obj,
uint32_t  value 
)

Set timer new timeout value.

Parameters
[in]objStructure containing the timer object parameters
[in]valueNew timer timeout value

◆ TimerStart()

void TimerStart ( TimerEvent_t obj)

Starts and adds the timer object to the list of timer events.

Parameters
[in]objStructure containing the timer object parameters

◆ TimerStop()

void TimerStop ( TimerEvent_t obj)

Stops and removes the timer object from the list of timer events.

Parameters
[in]objStructure containing the timer object parameters