1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef I2C_PCF8584_H
14 #define I2C_PCF8584_H 1
15
16
17 #define I2C_PCF_PIN 0x80
18 #define I2C_PCF_ESO 0x40
19 #define I2C_PCF_ES1 0x20
20 #define I2C_PCF_ES2 0x10
21 #define I2C_PCF_ENI 0x08
22 #define I2C_PCF_STA 0x04
23 #define I2C_PCF_STO 0x02
24 #define I2C_PCF_ACK 0x01
25
26 #define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
27 #define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
28 #define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
29 #define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
30
31
32
33
34 #define I2C_PCF_INI 0x40
35 #define I2C_PCF_STS 0x20
36 #define I2C_PCF_BER 0x10
37 #define I2C_PCF_AD0 0x08
38 #define I2C_PCF_LRB 0x08
39 #define I2C_PCF_AAS 0x04
40 #define I2C_PCF_LAB 0x02
41 #define I2C_PCF_BB 0x01
42
43
44 #define I2C_PCF_CLK3 0x00
45 #define I2C_PCF_CLK443 0x10
46 #define I2C_PCF_CLK6 0x14
47 #define I2C_PCF_CLK 0x18
48 #define I2C_PCF_CLK12 0x1c
49
50
51 #define I2C_PCF_TRNS90 0x00
52 #define I2C_PCF_TRNS45 0x01
53 #define I2C_PCF_TRNS11 0x02
54 #define I2C_PCF_TRNS15 0x03
55
56
57
58
59
60
61 #define I2C_PCF_OWNADR 0
62 #define I2C_PCF_INTREG I2C_PCF_ES2
63 #define I2C_PCF_CLKREG I2C_PCF_ES1
64
65 #endif