Merge pull request #1331 from Guilhem7/master
[RRG-proxmark3.git] / armsrc / ticks.h
blobd26b05bbc21ad0ada2c18c6f49d55022d18862cd
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 //-----------------------------------------------------------------------------
12 #ifndef __TICKS_H
13 #define __TICKS_H
15 #include "common.h"
17 #ifndef GET_TICKS
18 #define GET_TICKS GetTicks()
19 #endif
21 void SpinDelay(int ms);
22 void SpinDelayUs(int us);
23 void SpinDelayUsPrecision(int us); // precision 0.6us , running for 43ms before
25 void StartTickCount(void);
26 uint32_t RAMFUNC GetTickCount(void);
27 uint32_t RAMFUNC GetTickCountDelta(uint32_t start_ticks);
29 void StartCountUS(void);
30 uint32_t RAMFUNC GetCountUS(void);
31 void ResetUSClock(void);
32 void SpinDelayCountUs(uint32_t us);
34 void StartCountSspClk(void);
35 void ResetSspClk(void);
36 uint32_t RAMFUNC GetCountSspClk(void);
37 uint32_t RAMFUNC GetCountSspClkDelta(uint32_t start);
39 void StartTicks(void);
40 uint32_t GetTicks(void);
41 void WaitTicks(uint32_t ticks);
42 void WaitUS(uint32_t us);
43 void WaitMS(uint32_t ms);
45 void StopTicks(void);
47 #endif