summaryrefslogtreecommitdiffstats
path: root/mig_test/software/include/timer.h
blob: fa4875f41fa12af468dc4a4642eb390baa2be107 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * $HeadURL: https://svn.fzd.de/repo/concast/FWF_Projects/FWKE/hw_sp605/bsp_zpuahb/software/include/timer.h $
 * $Date$
 * $Author$
 * $Revision$
 */


#include "peripherie.h"

#ifndef TIMER_H
#define TIMER_H


////////////////////////////////////////
// timer functions


// wait for a given time in micro seconds
void usleep(uint32_t usec);

// wait for given time in milli seconds
void msleep(uint32_t msec);


// wait for given time in seconds
void sleep(uint32_t sec);


// deliver the milli seconds from timer 0.1
uint32_t msecs( void);

// deliver the seconds from timer 0.2
uint32_t seconds( void);

// deliver the time (in seconds and fraction) from timer
uint32_t get_time( void);

// just a loop
void wait( uint32_t value);


// initialisation for the timer
void timer_init( void);

#define TIMER_STOP      timer0->e[1].ctrl   &= ~TIMER_ENABLE;
#define TIMER_RUN       timer0->e[1].ctrl   |= TIMER_ENABLE;

#endif // TIMER_H
OpenPOWER on IntegriCloud