This header file contains bit mask definitions for use with the AVR TWI interface.
#define TW_BUS_ERROR 0x00 |
illegal start or stop condition
#define TW_MR_ARB_LOST 0x38 |
arbitration lost in SLA+R or NACK
#define TW_MR_DATA_ACK 0x50 |
data received, ACK returned
#define TW_MR_DATA_NACK 0x58 |
data received, NACK returned
#define TW_MR_SLA_ACK 0x40 |
SLA+R transmitted, ACK received
#define TW_MR_SLA_NACK 0x48 |
SLA+R transmitted, NACK received
#define TW_MT_ARB_LOST 0x38 |
arbitration lost in SLA+W or data
#define TW_MT_DATA_ACK 0x28 |
data transmitted, ACK received
#define TW_MT_DATA_NACK 0x30 |
data transmitted, NACK received
#define TW_MT_SLA_ACK 0x18 |
SLA+W transmitted, ACK received
#define TW_MT_SLA_NACK 0x20 |
SLA+W transmitted, NACK received
no state information available
#define TW_REP_START 0x10 |
repeated start condition transmitted
#define TW_SR_ARB_LOST_GCALL_ACK 0x78 |
arbitration lost in SLA+RW, general call received, ACK returned
#define TW_SR_ARB_LOST_SLA_ACK 0x68 |
arbitration lost in SLA+RW, SLA+W received, ACK returned
#define TW_SR_DATA_ACK 0x80 |
data received, ACK returned
#define TW_SR_DATA_NACK 0x88 |
data received, NACK returned
#define TW_SR_GCALL_ACK 0x70 |
general call received, ACK returned
#define TW_SR_GCALL_DATA_ACK 0x90 |
general call data received, ACK returned
#define TW_SR_GCALL_DATA_NACK 0x98 |
general call data received, NACK returned
#define TW_SR_SLA_ACK 0x60 |
SLA+W received, ACK returned
stop or repeated start condition received while selected
#define TW_ST_ARB_LOST_SLA_ACK 0xB0 |
arbitration lost in SLA+RW, SLA+R received, ACK returned
#define TW_ST_DATA_ACK 0xB8 |
data transmitted, ACK received
#define TW_ST_DATA_NACK 0xC0 |
data transmitted, NACK received
#define TW_ST_LAST_DATA 0xC8 |
last data byte transmitted, ACK received
#define TW_ST_SLA_ACK 0xA8 |
SLA+R received, ACK returned
start condition transmitted
TWSR, masked by TW_STATUS_MASK
Value:
#define _BV(bit)
Definition: sfr_defs.h:208
The lower 3 bits of TWSR are reserved on the ATmega163. The 2 LSB carry the prescaler bits on the newer ATmegas.