at91_ssc.h

Go to the documentation of this file.
00001 
00041 /*
00042  * Copyright (C) 2006-2007 by egnite Software GmbH. All rights reserved.
00043  *
00044  * Redistribution and use in source and binary forms, with or without
00045  * modification, are permitted provided that the following conditions
00046  * are met:
00047  *
00048  * 1. Redistributions of source code must retain the above copyright
00049  *    notice, this list of conditions and the following disclaimer.
00050  * 2. Redistributions in binary form must reproduce the above copyright
00051  *    notice, this list of conditions and the following disclaimer in the
00052  *    documentation and/or other materials provided with the distribution.
00053  * 3. Neither the name of the copyright holders nor the names of
00054  *    contributors may be used to endorse or promote products derived
00055  *    from this software without specific prior written permission.
00056  *
00057  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00058  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00059  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00060  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00061  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00062  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00063  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00064  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00065  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00066  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00067  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00068  * SUCH DAMAGE.
00069  *
00070  * For additional information see http://www.ethernut.de/
00071  */
00072 
00073 #ifndef AT91_SSC_H
00074 #define AT91_SSC_H
00075 
00076 #include <io/at91sam7.h>
00077 
00081 /*\{*/
00082 #define SSC_CR_OFF                  0x00000000  
00083 
00084 #define SSC_RXEN                     0  
00085 #define SSC_RXDIS                    1  
00086 #define SSC_TXEN                     8  
00087 #define SSC_TXDIS                    9  
00088 #define SSC_SWRST                   15  
00089 /*\}*/
00090 
00094 /*\{*/
00095 #define SSC_CMR_OFF                 0x00000004  
00096 
00097 #define SSC_DIV_MASK                0x00000FFF  
00098 /*\}*/
00099 
00103 /*\{*/
00104 #define SSC_RCMR_OFF                0x00000010  
00105 #define SSC_TCMR_OFF                0x00000018  
00106 
00107 #define SSC_CKS_MASK                0x00000003  
00108 #define SSC_CKS_DIV                 0x00000000  
00109 #define SSC_CKS_CLK                 0x00000001  
00110 #define SSC_CKS_PIN                 0x00000002  
00111 #define SSC_CKO_MASK                0x0000001C  
00112 #define SSC_CKO_NONE                0x00000000  
00113 #define SSC_CKO_CONT                0x00000004  
00114 #define SSC_CKO_TRAN                0x00000008  
00115 #define SSC_CKI                              5  
00116 #define SSC_CKG_MASK                0x000000C0  
00117 #define SSC_CKG_NONE                0x00000000  
00118 #define SSC_CKG_FL                  0x00000040  
00119 #define SSC_CKG_FH                  0x00000080  
00120 #define SSC_START_MASK              0x00000F00  
00121 #define SSC_START_CONT              0x00000000  
00122 #define SSC_START_TX                0x00000100  
00123 #define SSC_START_RX                0x00000100  
00124 #define SSC_START_LOW_F             0x00000200  
00125 #define SSC_START_HIGH_F            0x00000300  
00126 #define SSC_START_FALL_F            0x00000400  
00127 #define SSC_START_RISE_F            0x00000500  
00128 #define SSC_START_LEVEL_F           0x00000600  
00129 #define SSC_START_EDGE_F            0x00000700  
00130 #define SSC_START_COMP0             0x00000800  
00131 #define SSC_STOP                            12  
00132 #define SSC_STTDLY_MASK             0x00FF0000  
00133 #define SSC_STTDLY_SHIFT                    16  
00134 #define SSC_PERIOD_MASK             0xFF000000  
00135 #define SSC_PERIOD_SHIFT                    24  
00136 /*\}*/
00137 
00141 /*\{*/
00142 #define SSC_RFMR_OFF                0x00000014  
00143 #define SSC_TFMR_OFF                0x0000001C  
00144 
00145 #define SSC_DATLEN_MASK             0x0000001F  
00146 #define SSC_LOOP                             5  
00147 #define SSC_DATDEF                           5  
00148 
00149 #define SSC_MSBF                             7  
00150 #define SSC_DATNB_MASK              0x00000F00  
00151 #define SSC_DATNB_SHIFT                      8  
00152 #define SSC_FSLEN_MASK              0x000F0000  
00153 #define SSC_FSLEN_SHIFT                     16  
00154 #define SSC_FSOS                    0x00700000  
00155 #define SSC_FSOS_NONE               0x00000000  
00156 #define SSC_FSOS_NEGATIVE           0x00100000  
00157 #define SSC_FSOS_POSITIVE           0x00200000  
00158 #define SSC_FSOS_LOW                0x00300000  
00159 #define SSC_FSOS_HIGH               0x00400000  
00160 #define SSC_FSOS_TOGGLE             0x00500000  
00161 #define SSC_FSDEN                           23  
00162 #define SSC_FSEDGE                          24  
00163 /*\}*/
00164 
00168 /*\{*/
00169 #define SSC_RHR_OFF                 0x00000020  
00170 /*\}*/
00171 
00175 /*\{*/
00176 #define SSC_THR_OFF                 0x00000024  
00177 /*\}*/
00178 
00182 /*\{*/
00183 #define SSC_RSHR_OFF                0x00000030  
00184 /*\}*/
00185 
00189 /*\{*/
00190 #define SSC_TSHR_OFF                0x00000034  
00191 /*\}*/
00192 
00196 /*\{*/
00197 #define SSC_RC0R_OFF                0x00000038  
00198 /*\}*/
00199 
00203 /*\{*/
00204 #define SSC_RC1R_OFF                0x0000003C  
00205 /*\}*/
00206 
00210 /*\{*/
00211 #define SSC_SR_OFF                  0x00000040  
00212 #define SSC_IER_OFF                 0x00000044  
00213 #define SSC_IDR_OFF                 0x00000048  
00214 #define SSC_IMR_OFF                 0x0000004C  
00215 
00216 #define SSC_TXRDY                            0  
00217 #define SSC_TXEMPTY                          1  
00218 #define SSC_ENDTX                            2  
00219 #define SSC_TXBUFE                           3  
00220 #define SSC_RXRDY                            4  
00221 #define SSC_OVRUN                            5  
00222 #define SSC_ENDRX                            6  
00223 #define SSC_RXBUFF                           7  
00224 #define SSC_CP0                              8  
00225 #define SSC_CP1                              9  
00226 #define SSC_TXSYN                           10  
00227 #define SSC_RXSYN                           11  
00228 #define SSC_TXENA                           16  
00229 #define SSC_RXENA                           17  
00230 
00231 
00232 #if defined(SSC_BASE)
00233     #define SSC_CR      (*((reg32_t *)(SSC_BASE + SSC_CR_OFF)))     
00234     #define SSC_CMR     (*((reg32_t *)(SSC_BASE + SSC_CMR_OFF)))    
00235     #define SSC_RCMR    (*((reg32_t *)(SSC_BASE + SSC_RCMR_OFF)))   
00236     #define SSC_TCMR    (*((reg32_t *)(SSC_BASE + SSC_TCMR_OFF)))   
00237     #define SSC_RFMR    (*((reg32_t *)(SSC_BASE + SSC_RFMR_OFF)))   
00238     #define SSC_TFMR    (*((reg32_t *)(SSC_BASE + SSC_TFMR_OFF)))   
00239     #define SSC_RHR     (*((reg32_t *)(SSC_BASE + SSC_RHR_OFF)))    
00240     #define SSC_THR     (*((reg32_t *)(SSC_BASE + SSC_THR_OFF)))    
00241     #define SSC_RSHR    (*((reg32_t *)(SSC_BASE + SSC_RSHR_OFF)))   
00242     #define SSC_TSHR    (*((reg32_t *)(SSC_BASE + SSC_TSHR_OFF)))   
00243     #define SSC_RC0R    (*((reg32_t *)(SSC_BASE + SSC_RC0R_OFF)))   
00244     #define SSC_RC1R    (*((reg32_t *)(SSC_BASE + SSC_RC1R_OFF)))   
00245     #define SSC_SR      (*((reg32_t *)(SSC_BASE + SSC_SR_OFF)))     
00246     #define SSC_IER     (*((reg32_t *)(SSC_BASE + SSC_IER_OFF)))    
00247     #define SSC_IDR     (*((reg32_t *)(SSC_BASE + SSC_IDR_OFF)))    
00248     #define SSC_IMR     (*((reg32_t *)(SSC_BASE + SSC_IMR_OFF)))    
00249     #if defined(SSC_HAS_PDC)
00250         #define SSC_RPR    (*((reg32_t *)(SSC_BASE + PERIPH_RPR_OFF)))  
00251         #define SSC_RCR    (*((reg32_t *)(SSC_BASE + PERIPH_RCR_OFF)))  
00252         #define SSC_TPR    (*((reg32_t *)(SSC_BASE + PERIPH_TPR_OFF)))  
00253         #define SSC_TCR    (*((reg32_t *)(SSC_BASE + PERIPH_TCR_OFF)))  
00254         #define SSC_RNPR   (*((reg32_t *)(SSC_BASE + PERIPH_RNPR_OFF))) 
00255         #define SSC_RNCR   (*((reg32_t *)(SSC_BASE + PERIPH_RNCR_OFF))) 
00256         #define SSC_TNPR   (*((reg32_t *)(SSC_BASE + PERIPH_TNPR_OFF))) 
00257         #define SSC_TNCR   (*((reg32_t *)(SSC_BASE + PERIPH_TNCR_OFF))) 
00258         #define SSC_PTCR   (*((reg32_t *)(SSC_BASE + PERIPH_PTCR_OFF))) 
00259         #define SSC_PTSR   (*((reg32_t *)(SSC_BASE + PERIPH_PTSR_OFF))) 
00260     #endif /* SSC_HAS_PDC */
00261 
00262 #endif /* SSC_BASE */
00263 
00264 
00265 #endif /* AT91_SSC_H */