Nut/OS  4.10.3
API Reference
at91_twi.h
Go to the documentation of this file.
00001 #ifndef _ARCH_ARM_AT91_TWI_H_
00002 #define _ARCH_ARM_AT91_TWI_H_
00003 
00004 /*
00005  * Copyright (C) 2006 by egnite Software GmbH. All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00024  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  */
00035 
00057 
00060 #define TWI_CR_OFF              0x00000000      
00061 #define TWI_CR      (TWI_BASE + TWI_CR_OFF)     
00062 #define TWI_START               0x00000001      
00063 #define TWI_STOP                0x00000002      
00064 #define TWI_MSEN                0x00000004      
00065 #define TWI_MSDIS               0x00000008      
00066 #define TWI_SVEN                0x00000010      
00067 #define TWI_SVDIS               0x00000020      
00068 #define TWI_SWRST               0x00000080      
00070 
00071 
00073 #define TWI_MMR_OFF             0x00000004      
00074 #define TWI_MMR     (TWI_BASE + TWI_MMR_OFF)    
00075 #define TWI_IADRSZ              0x00000300      
00076 #define TWI_IADRSZ_NONE         0x00000000      
00077 #define TWI_IADRSZ_1BYTE        0x00000100      
00078 #define TWI_IADRSZ_2BYTE        0x00000200      
00079 #define TWI_IADRSZ_3BYTE        0x00000300      
00080 #define TWI_MREAD               0x00001000      
00081 #define TWI_DADR                0x007F0000      
00082 #define TWI_DADR_LSB                    16      
00084 
00085 
00087 #define TWI_SMR_OFF             0x00000008      
00088 #define TWI_SMR     (TWI_BASE + TWI_SMR_OFF)    
00089 #define TWI_SADR                0x007F0000      
00090 #define TWI_SADR_LSB                    16      
00092 
00093 
00095 #define TWI_IADRR_OFF           0x0000000C      
00096 #define TWI_IADRR   (TWI_BASE + TWI_IADRR_OFF)  
00097 #define TWI_IADR                0x00FFFFFF      
00098 #define TWI_IADR_LSB                    0       
00100 
00101 
00103 #define TWI_CWGR_OFF            0x00000010      
00104 #define TWI_CWGR    (TWI_BASE + TWI_CWGR_OFF)   
00105 #define TWI_CLDIV                0x000000FF     
00106 #define TWI_CLDIV_LSB                    0      
00107 #define TWI_CHDIV                0x0000FF00     
00108 #define TWI_CHDIV_LSB                    8      
00109 #define TWI_CKDIV                0x00070000     
00110 #define TWI_CKDIV_LSB                    16     
00112 
00113 
00115 #define TWI_SR_OFF              0x00000020      
00116 #define TWI_SR      (TWI_BASE + TWI_SR_OFF)     
00118 #define TWI_IER_OFF             0x00000024      
00119 #define TWI_IER     (TWI_BASE + TWI_IER_OFF)    
00121 #define TWI_IDR_OFF             0x00000028      
00122 #define TWI_IDR     (TWI_BASE + TWI_IDR_OFF)    
00124 #define TWI_IMR_OFF             0x0000002C      
00125 #define TWI_IMR     (TWI_BASE + TWI_IMR_OFF)    
00127 #define TWI_TXCOMP              0x00000001      
00128 #define TWI_RXRDY               0x00000002      
00129 #define TWI_TXRDY               0x00000004      
00130 #define TWI_SVREAD              0x00000008      
00131 #define TWI_SVACC               0x00000010      
00132 #define TWI_GACC                0x00000020      
00133 #define TWI_OVRE                0x00000040      
00134 #define TWI_NACK                0x00000100      
00135 #define TWI_ARBLST              0x00000200      
00136 #define TWI_SCLWS               0x00000400      
00137 #define TWI_EOSACC              0x00000800      
00139 
00140 
00142 #define TWI_RHR_OFF             0x00000030      
00143 #define TWI_RHR     (TWI_BASE + TWI_RHR_OFF)    
00145 
00146 
00148 #define TWI_THR_OFF             0x00000034      
00149 #define TWI_THR     (TWI_BASE + TWI_THR_OFF)    
00151 
00152 
00154 #endif                          /* _ARCH_ARM_AT91_TWI_H_ */