-
Notifications
You must be signed in to change notification settings - Fork 0
/
xchg.h
81 lines (56 loc) · 1.24 KB
/
xchg.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
77
78
79
80
81
#ifndef _XCHG_H
#define _XCHG_H
#ifndef u8
#define u8 unsigned char
#endif
#ifndef s8
#define s8 char
#endif
#ifndef c8
#define c8 char
#endif
#ifndef u16
#define u16 unsigned short
#endif
#ifndef s16
#define s16 short
#endif
#ifndef u32
#define u32 unsigned long
#endif
#ifndef s32
#define s32 long
#endif
#ifndef u64
#define u64 unsigned long long
#endif
#ifndef bool
#define bool u8
#endif
#ifdef true
#define true 1
#endif
#ifdef false
#define false 0
#endif
/* íà âõîä, slave âêëþ÷àåòñÿ âõîäîì SS */
#define EXP_SS PB0
#define EXP_SS_PORT PORTB
#define EXP_SS_DIR PINB
/* íàïðàâëåíèå äëÿ slave - âõîä "SCLK" íà ïîðòå PB1 */
#define EXP_CLK PB1
#define EXP_CLK_PORT PORTB
#define EXP_CLK_DIR PINB
/* íàïðàâëåíèå äëÿ slave - âõîä äàííûõ MOSI íà ïîðòå PB2 */
#define EXP_MOSI PB2
#define EXP_MOSI_PORT PORTB
#define EXP_MOSI_DIR PINB
/* íàïðàâëåíèå äëÿ slave - âûõîä äàííûõ MISO íà ïîðòå PB3 */
#define EXP_MISO PB3
#define EXP_MISO_PORT PORTB
#define EXP_MISO_DIR DDRB
/* Âíåøíåå ïðåðûâàíèå */
#define EXP_IRQ PE7
#define EXP_IRQ_PORT PORTE
#define EXP_IRQ_DIR DDRE
#endif /* xchg.h */