Poster of Linux kernelThe best gift for a Linux geek
<<A HREF="file:///usr/include/util/twi.h">util/twi.h</A>>: TWI bit mask definitions

<util/twi.h>: TWI bit mask definitions

Section: avr-libc (3) Updated: Thu Aug 12 2010
Local index Up
 

NAME

<util/twi.h>: TWI bit mask definitions -  

TWSR values


 Mnemonics: 
TW_MT_xxx - master transmitter
TW_MR_xxx - master receiver
TW_ST_xxx - slave transmitter
TW_SR_xxx - slave receiver
#define TW_START 0x08

#define TW_REP_START 0x10

#define TW_MT_SLA_ACK 0x18

#define TW_MT_SLA_NACK 0x20

#define TW_MT_DATA_ACK 0x28

#define TW_MT_DATA_NACK 0x30

#define TW_MT_ARB_LOST 0x38

#define TW_MR_ARB_LOST 0x38

#define TW_MR_SLA_ACK 0x40

#define TW_MR_SLA_NACK 0x48

#define TW_MR_DATA_ACK 0x50

#define TW_MR_DATA_NACK 0x58

#define TW_ST_SLA_ACK 0xA8

#define TW_ST_ARB_LOST_SLA_ACK 0xB0

#define TW_ST_DATA_ACK 0xB8

#define TW_ST_DATA_NACK 0xC0

#define TW_ST_LAST_DATA 0xC8

#define TW_SR_SLA_ACK 0x60

#define TW_SR_ARB_LOST_SLA_ACK 0x68

#define TW_SR_GCALL_ACK 0x70

#define TW_SR_ARB_LOST_GCALL_ACK 0x78

#define TW_SR_DATA_ACK 0x80

#define TW_SR_DATA_NACK 0x88

#define TW_SR_GCALL_DATA_ACK 0x90

#define TW_SR_GCALL_DATA_NACK 0x98

#define TW_SR_STOP 0xA0

#define TW_NO_INFO 0xF8

#define TW_BUS_ERROR 0x00

#define TW_STATUS_MASK

#define TW_STATUS (TWSR & TW_STATUS_MASK)
 

R/~W bit in SLA+R/W address field.


 
#define TW_READ 1

#define TW_WRITE 0
 

Detailed Description

 #include <util/twi.h> 

This header file contains bit mask definitions for use with the AVR TWI interface.  

Define Documentation

 

#define TW_BUS_ERROR 0x00illegal start or stop condition

 

#define TW_MR_ARB_LOST 0x38arbitration lost in SLA+R or NACK

 

#define TW_MR_DATA_ACK 0x50data received, ACK returned

 

#define TW_MR_DATA_NACK 0x58data received, NACK returned

 

#define TW_MR_SLA_ACK 0x40SLA+R transmitted, ACK received

 

#define TW_MR_SLA_NACK 0x48SLA+R transmitted, NACK received

 

#define TW_MT_ARB_LOST 0x38arbitration lost in SLA+W or data

 

#define TW_MT_DATA_ACK 0x28data transmitted, ACK received

 

#define TW_MT_DATA_NACK 0x30data transmitted, NACK received

 

#define TW_MT_SLA_ACK 0x18SLA+W transmitted, ACK received

 

#define TW_MT_SLA_NACK 0x20SLA+W transmitted, NACK received

 

#define TW_NO_INFO 0xF8no state information available

 

#define TW_READ 1SLA+R address

 

#define TW_REP_START 0x10repeated start condition transmitted

 

#define TW_SR_ARB_LOST_GCALL_ACK 0x78arbitration lost in SLA+RW, general call received, ACK returned

 

#define TW_SR_ARB_LOST_SLA_ACK 0x68arbitration lost in SLA+RW, SLA+W received, ACK returned

 

#define TW_SR_DATA_ACK 0x80data received, ACK returned

 

#define TW_SR_DATA_NACK 0x88data received, NACK returned

 

#define TW_SR_GCALL_ACK 0x70general call received, ACK returned

 

#define TW_SR_GCALL_DATA_ACK 0x90general call data received, ACK returned

 

#define TW_SR_GCALL_DATA_NACK 0x98general call data received, NACK returned

 

#define TW_SR_SLA_ACK 0x60SLA+W received, ACK returned

 

#define TW_SR_STOP 0xA0stop or repeated start condition received while selected

 

#define TW_ST_ARB_LOST_SLA_ACK 0xB0arbitration lost in SLA+RW, SLA+R received, ACK returned

 

#define TW_ST_DATA_ACK 0xB8data transmitted, ACK received

 

#define TW_ST_DATA_NACK 0xC0data transmitted, NACK received

 

#define TW_ST_LAST_DATA 0xC8last data byte transmitted, ACK received

 

#define TW_ST_SLA_ACK 0xA8SLA+R received, ACK returned

 

#define TW_START 0x08start condition transmitted

 

#define TW_STATUS (TWSR & TW_STATUS_MASK)TWSR, masked by TW_STATUS_MASK

 

#define TW_STATUS_MASKValue:

(_BV(TWS7)|_BV(TWS6)|_BV(TWS5)|_BV(TWS4)|                                _BV(TWS3))
The lower 3 bits of TWSR are reserved on the ATmega163. The 2 LSB carry the prescaler bits on the newer ATmegas.  

#define TW_WRITE 0SLA+W address

 

Author

Generated automatically by Doxygen for avr-libc from the source code.


 

Index

NAME
TWSR values
R/~W bit in SLA+R/W address field.
Detailed Description
Define Documentation
#define TW_BUS_ERROR 0x00illegal start or stop condition
#define TW_MR_ARB_LOST 0x38arbitration lost in SLA+R or NACK
#define TW_MR_DATA_ACK 0x50data received, ACK returned
#define TW_MR_DATA_NACK 0x58data received, NACK returned
#define TW_MR_SLA_ACK 0x40SLA+R transmitted, ACK received
#define TW_MR_SLA_NACK 0x48SLA+R transmitted, NACK received
#define TW_MT_ARB_LOST 0x38arbitration lost in SLA+W or data
#define TW_MT_DATA_ACK 0x28data transmitted, ACK received
#define TW_MT_DATA_NACK 0x30data transmitted, NACK received
#define TW_MT_SLA_ACK 0x18SLA+W transmitted, ACK received
#define TW_MT_SLA_NACK 0x20SLA+W transmitted, NACK received
#define TW_NO_INFO 0xF8no state information available
#define TW_READ 1SLA+R address
#define TW_REP_START 0x10repeated start condition transmitted
#define TW_SR_ARB_LOST_GCALL_ACK 0x78arbitration lost in SLA+RW, general call received, ACK returned
#define TW_SR_ARB_LOST_SLA_ACK 0x68arbitration lost in SLA+RW, SLA+W received, ACK returned
#define TW_SR_DATA_ACK 0x80data received, ACK returned
#define TW_SR_DATA_NACK 0x88data received, NACK returned
#define TW_SR_GCALL_ACK 0x70general call received, ACK returned
#define TW_SR_GCALL_DATA_ACK 0x90general call data received, ACK returned
#define TW_SR_GCALL_DATA_NACK 0x98general call data received, NACK returned
#define TW_SR_SLA_ACK 0x60SLA+W received, ACK returned
#define TW_SR_STOP 0xA0stop or repeated start condition received while selected
#define TW_ST_ARB_LOST_SLA_ACK 0xB0arbitration lost in SLA+RW, SLA+R received, ACK returned
#define TW_ST_DATA_ACK 0xB8data transmitted, ACK received
#define TW_ST_DATA_NACK 0xC0data transmitted, NACK received
#define TW_ST_LAST_DATA 0xC8last data byte transmitted, ACK received
#define TW_ST_SLA_ACK 0xA8SLA+R received, ACK returned
#define TW_START 0x08start condition transmitted
#define TW_STATUS (TWSR & TW_STATUS_MASK)TWSR, masked by TW_STATUS_MASK
#define TW_STATUS_MASKValue:
#define TW_WRITE 0SLA+W address
Author

This document was created by man2html, using the manual pages.
Time: 21:58:00 GMT, April 16, 2011