-
Notifications
You must be signed in to change notification settings - Fork 14
/
usitwislave_devices.h
103 lines (96 loc) · 2.64 KB
/
usitwislave_devices.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/* See LICENSE for Copyright etc. */
#if defined(__AVR_ATtiny2313__)
# define DDR_USI DDRB
# define PORT_USI PORTB
# define PIN_USI PINB
# define PORT_USI_SDA PB5
# define PORT_USI_SCL PB7
# define PIN_USI_SDA PINB5
# define PIN_USI_SCL PINB7
# define USI_OVERFLOW_VECTOR USI_OVERFLOW_vect
#endif
#if defined(__AVR_ATtiny24__) | \
defined(__AVR_ATtiny44__) | \
defined(__AVR_ATtiny84__)
# define DDR_USI DDRA
# define PORT_USI PORTA
# define PIN_USI PINA
# define PORT_USI_SDA PA6
# define PORT_USI_SCL PA4
# define PIN_USI_SDA PINA6
# define PIN_USI_SCL PINA4
# define USI_OVERFLOW_VECTOR USI_OVF_vect
#endif
#if defined(__AVR_ATtiny25__) | \
defined(__AVR_ATtiny45__) | \
defined(__AVR_ATtiny85__)
# define DDR_USI DDRB
# define PORT_USI PORTB
# define PIN_USI PINB
# define PORT_USI_SDA PB0
# define PORT_USI_SCL PB2
# define PIN_USI_SDA PINB0
# define PIN_USI_SCL PINB2
# define USI_OVERFLOW_VECTOR USI_OVF_vect
#endif
#if defined(__AVR_ATtiny26__)
# define DDR_USI DDRB
# define PORT_USI PORTB
# define PIN_USI PINB
# define PORT_USI_SDA PB0
# define PORT_USI_SCL PB2
# define PIN_USI_SDA PINB0
# define PIN_USI_SCL PINB2
# define USI_OVERFLOW_VECTOR USI_OVF_vect
#endif
#if defined(__AVR_ATtiny261__) | \
defined(__AVR_ATtiny261a__) | \
defined(__AVR_ATtiny461__) | \
defined(__AVR_ATtiny461a__) | \
defined(__AVR_ATtiny861__) | \
defined(__AVR_ATtiny861a__)
# if defined(USI_ON_PORT_A)
# define DDR_USI DDRA
# define PORT_USI PORTA
# define PIN_USI PINA
# define PORT_USI_SDA PA0
# define PORT_USI_SCL PA2
# define PIN_USI_SDA PINA0
# define PIN_USI_SCL PINA2
# else
# define DDR_USI DDRB
# define PORT_USI PORTB
# define PIN_USI PINB
# define PORT_USI_SDA PB0
# define PORT_USI_SCL PB2
# define PIN_USI_SDA PINB0
# define PIN_USI_SCL PINB2
# endif
# define USI_OVERFLOW_VECTOR USI_OVF_vect
#endif
#if defined(__AVR_ATmega165__) | \
defined(__AVR_ATmega325__) | \
defined(__AVR_ATmega3250__) | \
defined(__AVR_ATmega645__) | \
defined(__AVR_ATmega6450__) | \
defined(__AVR_ATmega329__) | \
defined(__AVR_ATmega3290__)
# define DDR_USI DDRE
# define PORT_USI PORTE
# define PIN_USI PINE
# define PORT_USI_SDA PE5
# define PORT_USI_SCL PE4
# define PIN_USI_SDA PINE5
# define PIN_USI_SCL PINE4
# define USI_OVERFLOW_VECTOR USI_OVERFLOW_vect
#endif
#if defined(__AVR_ATmega169__)
# define DDR_USI DDRE
# define PORT_USI PORTE
# define PIN_USI PINE
# define PORT_USI_SDA PE5
# define PORT_USI_SCL PE4
# define PIN_USI_SDA PINE5
# define PIN_USI_SCL PINE4
# define USI_OVERFLOW_VECTOR USI_OVERFLOW_vect
#endif