PicoWAN SDK Documentation
|
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... | |
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.
uint64_t tick_get_count | ( | void | ) |
Gets the number of elapsed ticks since the device has been powered up.
uint64_t | The 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.
time | The deadline for the next scheduled event. |
lp_blocked | 0 if the the high latency mode is allowed, 1 otherwise. |
latency_t | The latency mode decided. |
void tick_init | ( | void | ) |
Initializes the system tick.