]> git.zerfleddert.de Git - proxmark3-svn/blame - armsrc/ticks.h
syntax sugar
[proxmark3-svn] / armsrc / ticks.h
CommitLineData
22f4dca8 1//-----------------------------------------------------------------------------
2// Jonathan Westhues, Aug 2005
3// Iceman, Sept 2016
4//
5// This code is licensed to you under the terms of the GNU GPL, version 2 or,
6// at your option, any later version. See the LICENSE.txt file for the text of
7// the license.
8//-----------------------------------------------------------------------------
9// Timers, Clocks functions used in LF or Legic where you would need detailed time.
10//-----------------------------------------------------------------------------
11
12#ifndef __TICKS_H
13#define __TICKS_H
14
15#include <stddef.h>
16#include <stdint.h>
17#include "common.h"
18#include "apps.h"
19#include "proxmark3.h"
20
21#ifndef GET_TICKS
c649c433 22# define GET_TICKS (uint32_t)((AT91C_BASE_TC1->TC_CV << 16) | AT91C_BASE_TC0->TC_CV)
22f4dca8 23#endif
24
25void SpinDelay(int ms);
26void SpinDelayUs(int us);
27
28void StartTickCount(void);
29uint32_t RAMFUNC GetTickCount(void);
30
31void StartCountUS(void);
32uint32_t RAMFUNC GetCountUS(void);
33void ResetUSClock(void);
34void SpinDelayCountUs(uint32_t us);
35//uint32_t RAMFUNC GetDeltaCountUS(void);
36
37void StartCountSspClk();
38void ResetSspClk(void);
39uint32_t RAMFUNC GetCountSspClk();
40
41extern void StartTicks(void);
42extern void WaitTicks(uint32_t ticks);
43extern void WaitUS(uint16_t us);
44extern void WaitMS(uint16_t ms);
45extern void ResetTicks();
46extern void ResetTimer(AT91PS_TC timer);
d41efbf2 47extern void StopTicks(void);
22f4dca8 48#endif
Impressum, Datenschutz