Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

/projects/cubeos/src_current/hardware/tpu.h

Go to the documentation of this file.
00001 /*  src_experimental/hardware/tpu.h
00002     CubeOS Version 0.4.90 experimental
00003     Copyright (C) 1999,2000 Holger Kenn
00004 
00005     CubeOS is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or any later version.
00009 
00010     CubeOS is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015 */  
00016 /* tpu.h Motorola TPU register offset */
00017 #ifndef TPU_H
00018 
00019 #define TPU_H
00020 
00021 #include <config.h>
00022 
00023 #define TPU_ADDR(nr)  (TPU_BASE + nr)
00024 
00025 #define TPU_TPUMCR      TPU_ADDR(0x0)  /* TPU Module Configuration R. */
00026 #define TPU_TICR        TPU_ADDR(0x08) /* TPU Interrupt Configuration R. */
00027 #define TPU_CIER        TPU_ADDR(0x0a) /* Channel Interrupt Enable R. */
00028 #define TPU_CFSR        TPU_ADDR(0x0c) /* Channel Function Select Space*/
00029 #define TPU_CFSR0       TPU_ADDR(0x0c) /* Channel Function Select R. 0 */
00030 #define TPU_CFSR1       TPU_ADDR(0x0e) /* Channel Function Select R. 1 */
00031 #define TPU_CFSR2       TPU_ADDR(0x10) /* Channel Function Select R. 2 */
00032 #define TPU_CFSR3       TPU_ADDR(0x12) /* Channel Function Select R. 3 */
00033 #define TPU_HSQR        TPU_ADDR(0x14) /* Host Sequence Space */
00034 #define TPU_HSQR0       TPU_ADDR(0x14) /* Host Sequence R. 0 */
00035 #define TPU_HSQR1       TPU_ADDR(0x16) /* Host Sequence R. 1 */
00036 #define TPU_HSRR        TPU_ADDR(0x18) /* Host Service Request Space */
00037 #define TPU_HSRR0       TPU_ADDR(0x18) /* Host Service Request R. 0 */
00038 #define TPU_HSRR1       TPU_ADDR(0x1a) /* Host Service Request R. 1 */
00039 #define TPU_CPR         TPU_ADDR(0x1c) /* Channel Priority Space */
00040 #define TPU_CPR0        TPU_ADDR(0x1c) /* Channel Priority R. 0 */
00041 #define TPU_CPR1        TPU_ADDR(0x1e) /* Channel Priority R. 1 */
00042 #define TPU_CISR        TPU_ADDR(0x20) /* Channel Interrupt Status R. */
00043 #define TPU_PARAMETER   TPU_ADDR(0x100) /* TPU Parameter Space */
00044 
00045 
00046 #define setTPUMCR(val)  writeshort(TPU_TPUMCR,val)
00047 #define setTICR(val)    writeshort(TPU_TICR,val)
00048 #define setCIER(ch,val) writeshortpos(TPU_CIER,val,0x1,ch)
00049 #define setCFSR(ch,val) writeshortpos(TPU_CFSR + ((3-(ch/4))<<1),val,0xf,(ch&0x3)<<2)
00050 #define setHSQR(ch,val) writeshortpos(TPU_HSQR+((1-(ch/8))<<1),val,0x3,(ch&0x7)<<1)
00051 #define setHSRR(ch,val) writeshortpos(TPU_HSRR+((1-(ch/8))<<1),val,0x3,(ch&0x7)<<1)
00052 #define setCPR(ch,val)  writeshortpos(TPU_CPR+((1-(ch/8))<<1),val,0x3,(ch&0x7)<<1)
00053 #define clearCISR(ch)   writeshortpos(TPU_CISR,0x0,0x1,ch)
00054 #define setPAR(ch,nr,val) writeshort(TPU_PARAMETER+(ch*16)+(nr<<1),val)
00055 
00056 #define getTPUMCR()     readshort(TPU_TPUMCR)
00057 #define getTICR()       readshort(TPU_TICR)
00058 #define getCIER(ch)     readshortpos(TPU_CIER,0x1,ch)
00059 #define getCFSR(ch)     readshortpos(TPU_CFSR + ((3-(ch/4))<<1),0xf,(ch&0x3)<<2)
00060 #define getHSQR(ch)     readshortpos(TPU_HSQR+((1-(ch/8))<<1),0x3,(ch&0x7)<<1)
00061 #define getHSRR(ch)     readshortpos(TPU_HSRR+((1-(ch/8))<<1),0x3,(ch&0x7)<<1)
00062 #define getCPR(ch)      readshortpos(TPU_CPR+((1-(ch/8))<<1),0x3,(ch&0x7)<<1)
00063 #define getCISR(ch)     readshortpos(TPU_CISR,0x1,ch)
00064 #define getPAR(ch,nr)   readshort(TPU_PARAMETER+(ch*16)+(nr<<1))
00065 
00066 #define TPU_FKT_PPWA 0xf
00067 #define TPU_FKT_OC   0xe
00068 #define TPU_FKT_SM   0xd
00069 #define TPU_FKT_PSP  0xc
00070 #define TPU_FKT_PMA  0xb
00071 #define TPU_FKT_ITC  0xa
00072 #define TPU_FKT_PWM  0x9
00073 #define TPU_FKT_DIO  0x8
00074 #define TPU_FKT_SPWM 0x7
00075 #define TPU_FKT_QDEC 0x6
00076 
00077 #define TPU_QDEC_EDGE_TIME 0
00078 #define TPU_QDEC_POS_COUNT 1
00079 #define TPU_QDEC_TCR1_VAL 2
00080 #define TPU_QDEC_CHAN_PINSTATE 3
00081 #define TPU_QDEC_CORR_PINSTATE_ADDR 4
00082 #define TPU_QDEC_EDGE_TIME_LSB_ADDR 5
00083 
00084 #endif

Generated on Thu Feb 20 15:38:44 2003 for cubeOS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002