Main Page   Compound List   File List   Compound Members   File Members  

twi.h

Go to the documentation of this file.
00001 /*
00002    twi.h - definitions for TWI: Two-Wire Interface or Twi Was I2c(tm).
00003 
00004    Contributors:
00005      Created by Marek Michalkiewicz <marekm@linux.org.pl>
00006 
00007    THIS SOFTWARE IS NOT COPYRIGHTED
00008 
00009    This source code is offered for use in the public domain.  You may
00010    use, modify or distribute it freely.
00011 
00012    This code is distributed in the hope that it will be useful, but
00013    WITHOUT ANY WARRANTY.  ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
00014    DISCLAIMED.  This includes but is not limited to warranties of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017    Based on advance information Atmel datasheet Rev. 1142A-10/00 (ATmega163).
00018  */
00019 
00020 #ifndef _TWI_H_
00021 #define _TWI_H_ 1
00022 
00023 /* TWSR values (not bits) */
00024 /* Master */
00025 #define TW_START                0x08
00026 #define TW_REP_START            0x10
00027 /* Master Transmitter */
00028 #define TW_MT_SLA_ACK           0x18
00029 #define TW_MT_SLA_NACK          0x20
00030 #define TW_MT_DATA_ACK          0x28
00031 #define TW_MT_DATA_NACK         0x30
00032 #define TW_MT_ARB_LOST          0x38
00033 /* Master Receiver */
00034 #define TW_MR_ARB_LOST          0x38
00035 #define TW_MR_SLA_ACK           0x40
00036 #define TW_MR_SLA_NACK          0x48
00037 #define TW_MR_DATA_ACK          0x50
00038 #define TW_MR_DATA_NACK         0x58
00039 /* Slave Transmitter */
00040 #define TW_ST_SLA_ACK           0xA8
00041 #define TW_ST_ARB_LOST_SLA_ACK  0xB0
00042 #define TW_ST_DATA_ACK          0xB8
00043 #define TW_ST_DATA_NACK         0xC0
00044 #define TW_ST_LAST_DATA         0xC8
00045 /* Slave Receiver */
00046 #define TW_SR_SLA_ACK           0x60
00047 #define TW_SR_ARB_LOST_SLA_ACK  0x68
00048 #define TW_SR_GCALL_ACK         0x70
00049 #define TW_SR_ARB_LOST_GCALL_ACK 0x78
00050 #define TW_SR_DATA_ACK          0x80
00051 #define TW_SR_DATA_NACK         0x88
00052 #define TW_SR_GCALL_DATA_ACK    0x90
00053 #define TW_SR_GCALL_DATA_NACK   0x98
00054 #define TW_SR_STOP              0xA0
00055 /* Misc */
00056 #define TW_NO_INFO              0xF8
00057 #define TW_BUS_ERROR            0x00
00058 
00059 #endif  /* _TWI_H_ */

Generated at Fri Jul 19 14:55:42 2002 for avrgcc by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001