ts-7000
[Top] [All Lists]

[ts-7000] Re: Strange shifting variables

To:
Subject: [ts-7000] Re: Strange shifting variables
From: "berryma4" <>
Date: Tue, 01 Apr 2008 14:51:03 -0000

#define TS_OUTB_DPORT_A             (4)
#define TS_OUTB_DPORT_B             (0)
#define TS_DIOCR_DIRA               (20)
#define TS_DIOCR_DIRB               (16)

Thank you!


--- In  "Andy Mercier" <> wrote:
>
> Eric,
> 
> What are TS_OUTB_DPORT_A, TS_DIOCR_DIRA, TS_DIOCR_DIRB are defined as.
> 
> Please use the line(s) directly from the file that defines or declares
> them.
> 
> Thanks.
> 
> ----
> Andy
> 
> > It seems like I don't understand what I'm writing to.  
> >  preg->regOff = (TS_OUTB_DPORT_A)  //This doesn't work
> >  preg->regOff = (TS_OUTB_DPORT_A << 16)  //While this does
> > 
> > 
> > 
> > typedef struct Port Port;
> > 
> > 
> > /* Declare register info structure */
> > typedef struct Reg_struct
> > {
> >     volatile unsigned int isConn;
> >     volatile unsigned int cfgIdx;
> >     volatile unsigned int cfgOff;
> >     volatile unsigned int regOff;
> >     volatile unsigned int regNum;
> >     volatile unsigned int regDir;
> > } Reg;
> > 
> > static asynStatus create(void* ppvt,asynUser* pasynUser,const char*
> > drvInfo, const char** pptypeName,size_t* psize)
> > {
> >     int addr = -1;
> >     volatile Reg* preg = NULL;
> >     volatile Port* pport = (Port*)ppvt;
> > 
> >     switch( pport->type )
> >     {
> >     case TS_7200:
> > printf("XX0: 0x%x\n",preg->cfgOff);
> > printf("XX1: 0x%x\n",preg->regOff);
> > 
> >         if( addr < 1 ){
> >            preg->cfgOff = (TS_DIOCR_DIRA << 16);
> > printf("DirA: 0x%x 0x%x\n",preg->cfgOff,TS_DIOCR_DIRA);}
> > 
> >         else if( addr > 0 ){
> >            preg->cfgOff = TS_DIOCR_DIRB;
> > printf("DirB: 0x%x\n",preg->cfgOff);}
> > printf("AA0: 0x%x\n",preg->cfgOff);
> > 
> >         if( addr == 0 ){
> >             preg->regOff = (TS_OUTB_DPORT_A << 16);
> > printf("PortA: 0x%x 0x%x\n",preg->regOff,TS_OUTB_DPORT_A);}
> > 
> >         else if( addr == 1 ){
> >             preg->regOff = TS_OUTB_DPORT_B;
> > printf("PortB: 0x%x\n",preg->regOff);}
> > 
> >         else        {           
> > asynPrint(pasynUser,ASYN_TRACEIO_FILTER,"drvDio::create %s: invalid
> > register number %d\n",pport->name,addr);
> >             return( asynError );        }        
> > 
> > printf("AA1: 0x%x\n",preg->cfgOff);
> > printf("Break: 0x%x\n",preg->regOff);
> >         break;
> >     } // switch is done
> > 
> > printf("Done: 0x%x\n",preg->regOff);
> > 
> > 
> > output (with <<16):
> > 
> > XX0: 0x14
> > XX1: 0x4
> > DirA: 0x14 0x14
> > AA0: 0x14
> > PortA: 0x4 0x4
> > AA1: 0x14
> > Break: 0x4
> > Done: 0x4
> > 4
> > 4
> > preg->cfgOff
> > preg->regOff=4
> > 
> > 
> > output (without <<16):
> > XX0: 0x140000
> > XX1: 0x40000
> > DirA: 0x140000 0x14
> > AA0: 0x140000
> > PortA: 0x40000 0x4
> > AA1: 0x140000
> > Break: 0x40000
> > Done: 0x40000
> > 4
> > 4
> > preg->cfgOff=1310720
> > preg->regOff=262144
> > 
> > 
> > Thank you for any help!
> > Eric
> > 
> > 
> >
>



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU