pkg/semtech-loramac/include/semtech-loramac/timer.h

Semtech LoRaMAC timer compatibility definitions.

struct TimerEvent_s TimerEvent_t

Timer object description.

uint32_t TimerTime_t

Timer time variable definition.

void TimerInit(pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerEvent_t * obj, void(*)(void) callback)

Initializes the timer object.

Parameters

obj:Structure containing the timer object parameters
callback:Function callback called at the end of the timeout

void TimerIrqHandler(void)

Timer IRQ event handler.

void TimerStart(pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerEvent_t * obj)

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

Parameters

obj:Structure containing the timer object parameters

void TimerStop(pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerEvent_t * obj)

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

Parameters

obj:Structure containing the timer object parameters

void TimerReset(pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerEvent_t * obj)

Resets the timer object.

Parameters

obj:Structure containing the timer object parameters

void TimerSetValue(pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerEvent_t * obj, uint32_t value)

Set timer new timeout value.

Parameters

obj:Structure containing the timer object parameters
value:New timer timeout value

pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerTime_t TimerGetCurrentTime(void)

Read the current time.

Return values

  • current time
pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerTime_t TimerGetElapsedTime(pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerTime_t time)

Return the time elapsed since a fix moment in Time.

Parameters

time:fix moment in Time

Return values

  • elapsed time
pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerTime_t TimerGetFutureTime(pkg/semtech-loramac/include/semtech-loramac/timer.h::TimerTime_t time)

Return the time elapsed since a fix moment in time.

Parameters

time:fix moment in the future

Return values

  • difference between now and future event
void TimerLowPowerHandler(void)

Manages the entry into low power mode.

struct TimerEvent_s

Timer object description.

uint32_t timeout

Timer timeout in us.

uint8_t running

Check if timer is running.

xtimer.h::xtimer_t dev

xtimer instance attached to this LoRaMAC timer

msg_t msg

message attacher to this LoRaMAC timer

void(* cb()

callback to call when timer timeout