Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
28 walter 1
#ifndef _TWI_SLAVE_H_
2
#define _TWI_SLAVE_H_
3
 
4
extern unsigned char I2C_IN;
5
 
6
extern void StartI2C(void);
7
 
8
#define TWI_BUS_ERR_1   0x00
9
#define TWI_BUS_ERR_2   0xF8
10
 
11
// Status Slave RX Mode
12
#define SR_SLA_ACK      0x60
13
#define SR_LOST_ACK     0x68
14
#define SR_GEN_CALL_ACK 0x70
15
#define GEN_LOST_ACK    0x78
16
#define SR_PREV_ACK     0x80
17
#define SR_PREV_NACK    0x88
18
#define GEN_PREV_ACK    0x90
19
#define GEN_PREV_NACK   0x98
20
#define STOP_CONDITION  0xA0
21
#define REPEATED_START  0xA0
22
 
23
// Status Slave TX mode
24
#define SW_SLA_ACK      0xA8
25
#define SW_LOST_ACK     0xB0
26
#define SW_DATA_ACK     0xB8
27
#define SW_DATA_NACK    0xC0
28
#define SW_LAST_ACK     0xC8
29
 
30
#endif
31