Functions and constants for controlling EV3 timers. More...
#include <unistd.h>#include <sys/time.h>#include <signal.h>#include <string.h>#include <stdbool.h>#include "../include/ev3_constants.h"Go to the source code of this file.
Macros | |
| #define | ev3_timer_h |
Typedefs | |
| typedef void(* | TimerCallback )(int sig) |
Enumerations | |
| enum | TimerInterval { ti10ms, ti50ms, ti100ms, ti250ms, ti500ms, ti1sec } |
Functions | |
| unsigned long | TimerWait (unsigned long Time) |
| void | TimerReady (unsigned long Timer) |
| unsigned long | TimerMS (uint8_t timerId) |
| void | ClearTimerMS (uint8_t timerId) |
| unsigned long | TimerUS (uint8_t timerId) |
| void | ClearTimerUS (uint8_t timerId) |
| void | TimerInit (unsigned long interval_multiplier) |
| bool | AddTimerCallback (TimerInterval interval, TimerCallback callback) |
| unsigned long long | TimerGetUS () |
| unsigned long long | TimerGetMS () |
Functions and constants for controlling EV3 timers.
ev3_timer.h contains declarations for the EV3 C API timer functions.
License:
The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The Initial Developer of this code is John Hansen. Portions created by John Hansen are Copyright (C) 2009-2013 John Hansen. All Rights Reserved.
| #define ev3_timer_h |
| typedef void(* TimerCallback)(int sig) |
| enum TimerInterval |
| bool AddTimerCallback | ( | TimerInterval | interval, |
| TimerCallback | callback | ||
| ) |
Adds a callback that will be called every specified interval
| interval | |
| callback |
| void ClearTimerMS | ( | uint8_t | timerId | ) |
Clears the timer
| timerId | Id of the timer, between 0 and (NUM_MS_TIMERS - 1) |
| void ClearTimerUS | ( | uint8_t | timerId | ) |
Clears the timer
| timerId | Id of the timer, between 0 and (NUM_US_TIMERS - 1) |
| unsigned long long TimerGetMS | ( | ) |
| unsigned long long TimerGetUS | ( | ) |
| void TimerInit | ( | unsigned long | interval_multiplier | ) |
| unsigned long TimerMS | ( | uint8_t | timerId | ) |
Return the value of the timer
| timerId | Id of the timer, between 0 and (NUM_MS_TIMERS - 1) |
| void TimerReady | ( | unsigned long | Timer | ) |
Blocks until the time has elapsed
| Timer | time to wait for |
| unsigned long TimerUS | ( | uint8_t | timerId | ) |
Return the value of the timer
| timerId | Id of the timer, between 0 and (NUM_US_TIMERS - 1) |
| unsigned long TimerWait | ( | unsigned long | Time | ) |
Creates a new timer that will expire after the specified amount of time. Call TimerReady to wait for the times to elapse
| Time | in ms |
1.8.6