Subversion Repositories MK3Mag

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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