Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
Typedefs | Functions
timer.h File Reference

Header file for timer functionality. More...

#include "types.h"
#include <sys/time.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
#include <wiringPi.h>

Go to the source code of this file.

Typedefs

typedef int Timer
 

Functions

int OSWait (int n)
 Waits for 1 ms. More...
 
Timer OSAttachTimer (int scale, void(*fct)(void))
 adds a function to a 1kHz/scale timer, ie. executes every 1ms*scale usage: OSAttachTimer(<scale>, &<function>); More...
 
int OSDetachTimer (Timer handle)
 removes the Timer from the list More...
 
int OSSetTime (int hrs, int mins, int secs)
 sets the system time More...
 
int OSGetTime (int *hrs, int *mins, int *secs, int *ticks)
 Get system time (ticks in 1/100 sec) More...
 
int OSShowTime (void)
 prints the time on the command line More...
 
int OSGetCount (void)
 gives you the count in 1/100 sec since the system start More...
 

Detailed Description

Header file for timer functionality.

Author
Rhys Kessey

Function Documentation

Timer OSAttachTimer ( int  scale,
void(*)(void)  fct 
)

adds a function to a 1kHz/scale timer, ie. executes every 1ms*scale usage: OSAttachTimer(<scale>, &<function>);

Parameters
scalethe rate to run the function
fctthe function to run, note must return void and have no arguments
Returns
the Timer struct for the timer
int OSDetachTimer ( Timer  handle)

removes the Timer from the list

Parameters
handlethe timer to remove
Returns
0 always
int OSGetCount ( void  )

gives you the count in 1/100 sec since the system start

Returns
the count
int OSGetTime ( int *  hrs,
int *  mins,
int *  secs,
int *  ticks 
)

Get system time (ticks in 1/100 sec)

Parameters
hrsthe pointer to the hours integer
minsthe pointer to the mins integer
secsthe pointer to the secs integer
ticksthe pointer to the ticks integer
Returns
0 always
int OSSetTime ( int  hrs,
int  mins,
int  secs 
)

sets the system time

Parameters
hrsthe hours
minsthe mins
secsthe secs
Returns
0 always
int OSShowTime ( void  )

prints the time on the command line

Returns
0 always
int OSWait ( int  n)

Waits for 1 ms.

Parameters
nthe number of ms to wait for
Returns
0 always