PicoWAN SDK Documentation
Enumerations | Functions
tick.h File Reference

Tick driver. More...

#include <stdint.h>
#include <arch.h>

Go to the source code of this file.

Enumerations

enum  latency_t { NO_LATENCY, LOW_LATENCY, HIGH_LATENCY }
 

Functions

void tick_init (void)
 Initializes the system tick. More...
 
uint64_t tick_get_count (void)
 Gets the number of elapsed ticks since the device has been powered up. More...
 
latency_t tick_handle_next_wakeup (uint64_t time, uint8_t lp_blocked)
 Handles the next scheduled event. More...
 

Detailed Description

Tick driver.

Copyright (c) 2018, Archos S.A. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND AND EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ARCHOS S.A. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

uint64_t tick_get_count ( void  )

Gets the number of elapsed ticks since the device has been powered up.

Note
This function is used by the scheduler and should not be called anywhere else in normal conditions.
Return values
uint64_tThe number of elapsed ticks.
latency_t tick_handle_next_wakeup ( uint64_t  time,
uint8_t  lp_blocked 
)

Handles the next scheduled event.

This function decides in which latency mode the device must be put until the next scheduled event, and configures a timer to wake it up accordingly.

Note
This function is used by the scheduler and should not be called anywhere else in normal conditions.
Parameters
timeThe deadline for the next scheduled event.
lp_blocked0 if the the high latency mode is allowed, 1 otherwise.
Return values
latency_tThe latency mode decided.
void tick_init ( void  )

Initializes the system tick.

Note
This function is used by the scheduler and should not be called anywhere else in normal conditions.