m_qadc64.h

Go to the documentation of this file.
00001 /**************************************************************************/
00002 /* FILE NAME: m_qadc64.h                      COPYRIGHT (c) MOTOROLA 2002 */
00003 /* VERSION:  1.5                                  All Rights Reserved     */
00004 /*                                                                        */
00005 //* DESCRIPTION:                                                          */
00006 /* This file defines all of the registers and bit fields on the QADC      */
00007 /* module and declares an instance of the QADC structure.                 */
00008 /*========================================================================*/
00009 /* AUTHOR: Jeff Loeliger                                                  */
00010 /* COMPILER: Diab Data        VERSION: 4.3f                               */
00011 /*                                                                        */
00012 /* HISTORY                                                                */
00013 /* REV      AUTHOR      DATE       DESCRIPTION OF CHANGE                  */
00014 /* ---   -----------  ---------    ---------------------                  */
00015 /* 0.1   J. Loeliger  06/Apr/98    Initial version of file.               */
00016 /* 0.2                20/Dec/98    Broke header file into modules.        */
00017 /* 1.0   J. Loeliger  12/Jan/99    Added three ways to create an instance */
00018 /*                                   of the module and added PACK.        */
00019 /* 1.1   J. Loeliger  22/Jan/99    Changed result and command buffers to  */
00020 /*                                   arrays.                              */
00021 /* 1.2   J. Loeliger  22/Jun/99    Added ifdef to support C++             */
00022 /* 1.3   J. Kobler    11/Jun/01    Added support for CodeWarrior Embedded */
00023 /*                                   PowerPc 5.0.                         */
00024 /* 1.4                19/Mar/03    Removed MWERK pragma, no longer needed */
00025 /* 1.5   G. Emerson   19/Apr/05    Updated QADCMCR and added an MPC561/3  */
00026 /*                                   specific version.                    */
00027 /* 1.6   Anil Kumar   3 Sep 2010 Following changes are done:             */
00028 /*                                  1. The CCW structure is chanegd to    */
00029 /*                                     support both Legacy and enhaced    */
00030 /*                                     mode of operation                  */
00031 /*                                  2. QADC64MCR reg structure chnaged as */
00032 /*                                     per MPC 563                        */
00033 /**************************************************************************/
00034 
00035 #ifndef _M_QADC64_H
00036 #define _M_QADC64_H
00037 
00038 #ifndef _M_COMMON_H
00039     #include "m_common.h"
00040 #endif 
00041 
00042 #ifdef  __cplusplus
00043     extern "C" {
00044 #endif
00045 
00046 /****************************************************************************/
00047 /*                              MODULE :QADC                                */
00048 /****************************************************************************/
00049 struct QADC64_tag {
00050 
00051     #ifndef _QADC64E
00052         union {
00053             VUINT16 R;
00054             struct {
00055                 VUINT16 STOP:1;
00056                 VUINT16 FRZ:1;
00057                 VUINT16:6;
00058                 VUINT16 SUPV:1;
00059                 VUINT16:7;
00060             } B;
00061         } QADC64MCR;
00062     #else
00063         #ifndef _MPC565_H_
00064             union {
00065                 VUINT16 R;
00066                 struct {
00067                     VUINT16 STOP:1;
00068                     VUINT16 FRZ:1;
00069                     VUINT16:4;
00070                     VUINT16 LOCK:1;
00071                     VUINT16 FLIP:1;
00072                     VUINT16 SUPV:1;
00073                     VUINT16:7;
00074                 } B;
00075             } QADC64MCR;
00076         #else
00077             #if 0
00078                 union {
00079                     VUINT16 R;
00080                     struct {
00081                         VUINT16 STOP:1;
00082                         VUINT16 FRZ:1;
00083                         VUINT16:6;
00084                         VUINT16 SUPV:1;
00085                         VUINT16:7;
00086                     } B;
00087                 } QADC64MCR;
00088             #else
00089                 /* This section added to match with MPC563 reg conf */
00090                 union {
00091                     VUINT16 R;
00092                     struct {
00093                         VUINT16 STOP:1;
00094                         VUINT16 FRZ:1;
00095                         VUINT16:4;
00096                         VUINT16 LOCK:1;
00097                         VUINT16 FLIP:1;
00098                         VUINT16 SUPV:1;
00099                         VUINT16:7;
00100                     } B;
00101                 } QADC64MCR;
00102             #endif
00103         #endif
00104     #endif
00105 
00106 
00107     union {
00108         VUINT16 R;
00109         VUINT16 B;
00110     } QADC64TEST;
00111 
00112     union {
00113         VUINT16 R;
00114         struct {
00115             VUINT16 IRL1:5;
00116             VUINT16 IRL2:5;
00117             VUINT16:6;
00118         } B;
00119     } QADC64INT;
00120 
00121     union {
00122         VUINT8 R;
00123         struct {
00124             VUINT8 PQA7:1;
00125             VUINT8 PQA6:1;
00126             VUINT8 PQA5:1;
00127             VUINT8 PQA4:1;
00128             VUINT8 PQA3:1;
00129             VUINT8 PQA2:1;
00130             VUINT8 PQA1:1;
00131             VUINT8 PQA0:1;
00132         } B;
00133     } PORTQA;
00134 
00135     union {
00136         VUINT8 R;
00137         struct {
00138             VUINT8 PQB7:1;
00139             VUINT8 PQB6:1;
00140             VUINT8 PQB5:1;
00141             VUINT8 PQB4:1;
00142             VUINT8 PQB3:1;
00143             VUINT8 PQB2:1;
00144             VUINT8 PQB1:1;
00145             VUINT8 PQB0:1;
00146         } B;
00147     } PORTQB;
00148 
00149     #ifndef  
00150         union {
00151             VUINT16 R;
00152             struct {
00153                 VUINT16 DDQA7:1;
00154                 VUINT16 DDQA6:1;
00155                 VUINT16 DDQA5:1;
00156                 VUINT16 DDQA4:1;
00157                 VUINT16 DDQA3:1;
00158                 VUINT16 DDQA2:1;
00159                 VUINT16 DDQA1:1;
00160                 VUINT16 DDQA0:1;
00161                 VUINT16:8;
00162             } B;
00163         } DDRQA;
00164 
00165         union {
00166             VUINT16 R;
00167             struct {
00168                 VUINT16 MUX:1;
00169                 VUINT16:2;
00170                 VUINT16 TRG:1;
00171                 VUINT16:3;
00172                 VUINT16 PSH:5;
00173                 VUINT16 PSA:1;
00174                 VUINT16 PSL:3;
00175             } B;
00176         } QACR0;
00177 
00178     #else
00179         #if 0 /* SVK:This needs for mpc563 QADC in enhanced mode:TBD */
00180             union {
00181                 VUINT16 R;
00182                 struct {
00183                     VUINT16 DDQA7:1;
00184                     VUINT16 DDQA6:1;
00185                     VUINT16 DDQA5:1;
00186                     VUINT16 DDQA4:1;
00187                     VUINT16 DDQA3:1;
00188                     VUINT16 DDQA2:1;
00189                     VUINT16 DDQA1:1;
00190                     VUINT16 DDQA0:1;
00191                     VUINT16 DDQB7:1;
00192                     VUINT16 DDQB6:1;
00193                     VUINT16 DDQB5:1;
00194                     VUINT16 DDQB4:1;
00195                     VUINT16 DDQB3:1;
00196                     VUINT16 DDQB2:1;
00197                     VUINT16 DDQB1:1;
00198                     VUINT16 DDQB0:1;
00199                 } B;
00200             } DDRQA;
00201 
00202            union {
00203                 VUINT16 R;
00204                 struct {
00205                     VUINT16 MUX:1;
00206                     VUINT16:2;
00207                     VUINT16 TRG:1;
00208                     VUINT16:5;
00209                     VUINT16 PRESCALER:7;
00210                } B;
00211             } QACR0;
00212         #else
00213             union {
00214                 VUINT16 R;
00215                 struct {
00216                     VUINT16 DDQA7:1;
00217                     VUINT16 DDQA6:1;
00218                     VUINT16 DDQA5:1;
00219                     VUINT16 DDQA4:1;
00220                     VUINT16 DDQA3:1;
00221                     VUINT16 DDQA2:1;
00222                     VUINT16 DDQA1:1;
00223                     VUINT16 DDQA0:1;
00224                     VUINT16:8;
00225                 } B;
00226             } DDRQA;
00227 
00228            union {
00229                 VUINT16 R;
00230                 struct {
00231                     VUINT16 EMUX:1;
00232                     VUINT16:2;
00233                     VUINT16 TRG:1;
00234                     VUINT16:3;
00235                     VUINT16 PSH:5;
00236                     VUINT16 PSA:1;
00237                     VUINT16 PSL:3;
00238                } B;
00239             } QACR0;
00240         #endif
00241     #endif
00242 
00243     union {
00244         VUINT16 R;
00245         struct {
00246             VUINT16 CIE1:1;
00247             VUINT16 PIE1:1;
00248             VUINT16 SSE1:1;
00249             VUINT16 MQ1:5;
00250             VUINT16:8;
00251         } B;
00252     } QACR1;
00253 
00254     union {
00255         VUINT16 R;
00256         struct {
00257             VUINT16 CIE2:1;
00258             VUINT16 PIE2:1;
00259             VUINT16 SSE2:1;
00260             VUINT16 MQ2:5;
00261             VUINT16 RESUME:1;
00262             VUINT16 BQ2:7;
00263         } B;
00264     } QACR2;
00265 
00266     union {
00267         VUINT16 R;
00268         struct {
00269             VUINT16 CF1:1;
00270             VUINT16 PF1:1;
00271             VUINT16 CF2:1;
00272             VUINT16 PF2:1;
00273             VUINT16 TOR1:1;
00274             VUINT16 TOR2:1;
00275             VUINT16 QS:4;
00276             VUINT16 CWP:6;
00277         } B;
00278     } QASR0;
00279 
00280     union {
00281         VUINT16 R;
00282         struct {
00283             VUINT16:2;
00284             VUINT16 CWPQ1:6;
00285             VUINT16:2;
00286             VUINT16 CWPQ2:6;
00287         } B;
00288     } QASR1;
00289 
00290     VUINT16 res19[246];
00291 
00292     /*Command Convertion Word Table */
00293     #ifndef _QADC64E
00294         union {
00295             VUINT16 R;
00296             struct {
00297                 VUINT16:6;
00298                 VUINT16 P:1;
00299                 VUINT16 BYP:1;
00300                 VUINT16 IST:2;
00301                 VUINT16 CHAN:6;
00302             } B;
00303         } CCW[64];
00304     #else
00305             union {
00306                 VUINT16 R;
00307                 struct {
00308                     VUINT16:6;
00309                     VUINT16 P:1;
00310                     VUINT16 BYP:1;
00311                     VUINT16 IST:2;
00312                     VUINT16 CHAN:6;
00313                 } B_Legacy;
00314                 struct {
00315                     VUINT16:6;
00316                     VUINT16 P:1;
00317                     VUINT16 REF:1;
00318                     VUINT16 IST:1;
00319                     VUINT16 CHAN:7;
00320                 } B_Enhanced;
00321             } CCW[64];
00322     #endif
00323 
00324     /*Result Word Table, Unsigned Right Justified */
00325     union {
00326         VUINT16 R;
00327         struct {
00328             VUINT16:6;
00329             VUINT16 RESULT:10;
00330         } B;
00331     } RJURR[64];
00332 
00333     /*Result Word Table, Signed Left Justified */
00334     union {
00335         VUINT16 R;
00336         struct {
00337             VUINT16 RESULT:10;
00338             VUINT16:6;
00339         } B;
00340     } LJSRR[64];
00341 
00342     /*Result Word Table, Unsigned Left Justified */
00343     union {
00344         VUINT16 R;
00345         struct {
00346             VUINT16 RESULT:10;
00347             VUINT16:6;
00348         } B;
00349     } LJURR[64];
00350 
00351 };
00352 
00353 #ifdef  __cplusplus
00354 }
00355 #endif
00356 
00357 #endif /* ifndef _M_QADC64_H  */
00358 
00359 /*********************************************************************
00360  *
00361  * Copyright:
00362  *  MOTOROLA, INC. All Rights Reserved.  
00363  *  You are hereby granted a copyright license to use, modify, and
00364  *  distribute the SOFTWARE so long as this entire notice is
00365  *  retained without alteration in any modified and/or redistributed
00366  *  versions, and that such modified versions are clearly identified
00367  *  as such. No licenses are granted by implication, estoppel or
00368  *  otherwise under any patents or trademarks of Motorola, Inc. This 
00369  *  software is provided on an "AS IS" basis and without warranty.
00370  *
00371  *  To the maximum extent permitted by applicable law, MOTOROLA 
00372  *  DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED, INCLUDING 
00373  *  IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR
00374  *  PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH REGARD TO THE 
00375  *  SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF) AND ANY 
00376  *  ACCOMPANYING WRITTEN MATERIALS.
00377  * 
00378  *  To the maximum extent permitted by applicable law, IN NO EVENT
00379  *  SHALL MOTOROLA BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING 
00380  *  WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS 
00381  *  INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY
00382  *  LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.   
00383  * 
00384  *  Motorola assumes no responsibility for the maintenance and support
00385  *  of this software
00386  ********************************************************************/
00387