-
Notifications
You must be signed in to change notification settings - Fork 0
/
delays.h
executable file
·76 lines (67 loc) · 1.84 KB
/
delays.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#ifndef __DELAYS_H
#define __DELAYS_H
/* PIC 17Cxxx and 18Cxxx cycle-count delay routines.
*
* Functions:
* Delay1TCY()
* Delay10TCY() // 17Cxx only
* Delay10TCYx()
* Delay100TCYx()
* Delay1KTCYx()
* Delay10KTCYx()
*/
/* Delay of exactly 1 Tcy */
#define Delay1TCY() Nop()
#if __18CXX
#define PARAM_SCLASS auto
#else
#define PARAM_SCLASS static
#endif
/* Delay of exactly 10 Tcy */
#if __18CXX
#define Delay10TCY() Delay10TCYx(1)
#else /* 17CXX */
far void Delay10TCY(void);
#endif
/* Delay10TCYx
* Delay multiples of 10 Tcy
* Passing 0 (zero) results in a delay of 2560 cycles.
* The 18Cxxx version of this function supports the full range [0,255]
* The 17Cxxx version supports [2,255] and 0.
*/
#if __18CXX
void Delay10TCYx(PARAM_SCLASS unsigned char);
#else /* 17CXX */
far void Delay10TCYx(PARAM_SCLASS unsigned char);
#endif
/* Delay100TCYx
* Delay multiples of 100 Tcy
* Passing 0 (zero) results in a delay of 25,600 cycles.
* The full range of [0,255] is supported.
*/
#if __18CXX
void Delay100TCYx(PARAM_SCLASS unsigned char);
#else /* 17CXX */
far void Delay100TCYx(PARAM_SCLASS unsigned char);
#endif
/* Delay1KTCYx
* Delay multiples of 1000 Tcy
* Passing 0 (zero) results in a delay of 256,000 cycles.
* The full range of [0,255] is supported.
*/
#if __18CXX
void Delay1KTCYx(PARAM_SCLASS unsigned char);
#else /* 17CXX */
far void Delay1KTCYx(PARAM_SCLASS unsigned char);
#endif
/* Delay10KTCYx
* Delay multiples of 10,000 Tcy
* Passing 0 (zero) results in a delay of 2,560,000 cycles.
* The full range of [0,255] is supported.
*/
#if __18CXX
void Delay10KTCYx(PARAM_SCLASS unsigned char);
#else /* 17CXX */
far void Delay10KTCYx(PARAM_SCLASS unsigned char);
#endif
#endif