[Tinyos-beta-commits] CVS: tinyos-1.x/beta/platform/pxa27x Flash.nc, 1.3, 1.4 HPLClock.nc, 1.1, 1.2 HPLInitM.nc, 1.3, 1.4 PXA27XClockM.nc, 1.2, 1.3 PXA27XDMAC.nc, 1.2, 1.3 PXA27XDMAChannel.nc, 1.3, 1.4 PXA27XDMAExtReq.nc, 1.1, 1.2 PXA27XDMAM.nc, 1.3, 1.4 PXA27XGPIOIntC.nc, 1.1, 1.2 PXA27XGPIOIntM.nc, 1.3, 1.4 PXA27XI2CM.nc, 1.2, 1.3 PXA27XInterruptM.nc, 1.4, 1.5 PXA27XPowerModes.h, 1.2, 1.3 PXA27XPowerModesM.nc, 1.2, 1.3 PXA27XUSBClientC.nc, 1.4, 1.5 PXA27XUSBClientM.nc, 1.10, 1.11 PXA27Xdynqueue.c, 1.4, 1.5 PXA27Xdynqueue.h, 1.2, 1.3 SimpleWDTM.nc, 1.1, 1.2 pxa27xhardware.h, 1.7, 1.8

Lama Nachman lnachman at users.sourceforge.net
Mon Oct 9 19:22:52 PDT 2006


Update of /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv13552

Modified Files:
	Flash.nc HPLClock.nc HPLInitM.nc PXA27XClockM.nc PXA27XDMAC.nc 
	PXA27XDMAChannel.nc PXA27XDMAExtReq.nc PXA27XDMAM.nc 
	PXA27XGPIOIntC.nc PXA27XGPIOIntM.nc PXA27XI2CM.nc 
	PXA27XInterruptM.nc PXA27XPowerModes.h PXA27XPowerModesM.nc 
	PXA27XUSBClientC.nc PXA27XUSBClientM.nc PXA27Xdynqueue.c 
	PXA27Xdynqueue.h SimpleWDTM.nc pxa27xhardware.h 
Log Message:
Pushed out new release OCT 2006


Index: Flash.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/Flash.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Flash.nc	2 Sep 2005 23:27:55 -0000	1.3
--- Flash.nc	10 Oct 2006 02:22:49 -0000	1.4
***************
*** 27,32 ****
     */
    command result_t erase(uint32_t addr);
- }
- 
- 
  
--- 27,44 ----
     */
    command result_t erase(uint32_t addr);
  
+   /**
+    * read
+    * 
+    * Reads data from the flash and copies to the buffer pointer passed as
+    * parameter. The starting address and the size of data required must
+    * be specified by the user.
+    *
+    * @param addr Flash address where the read starts.
+    * @param data Pointer to the buffer to which the data will be copied to.
+    * @param numBytes Number of bytes to read.
+    * 
+    * @return SUCCESS or FAIL
+    */
+   command result_t read(uint32_t addr, uint8_t* data, uint32_t numBytes);
+ }

Index: HPLClock.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/HPLClock.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** HPLClock.nc	13 Nov 2004 01:12:40 -0000	1.1
--- HPLClock.nc	10 Oct 2006 02:22:49 -0000	1.2
***************
*** 72,76 ****
    StdControl = PXA27XClockM;
  
!   PXA27XClockM.OSTIrq -> PXA27XInterruptM.PXA27XIrq[PPID_OST_4_11];
  
  }
--- 72,76 ----
    StdControl = PXA27XClockM;
  
!   PXA27XClockM.OSTIrq -> PXA27XInterruptM.PXA27XIrq[IID_OST_4_11];
  
  }

Index: HPLInitM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/HPLInitM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** HPLInitM.nc	8 Dec 2005 23:17:51 -0000	1.3
--- HPLInitM.nc	10 Oct 2006 02:22:49 -0000	1.4
***************
*** 87,91 ****
    
    command result_t init() {
!     CKEN = (CKEN22_MEMC | CKEN20_IMEM | CKEN15_PMI2C | CKEN9_OST);
      OSCC = (OSCC_OON);
      
--- 87,91 ----
    
    command result_t init() {
!     CKEN = (CKEN_CKEN22 | CKEN_CKEN20 | CKEN_CKEN15 | CKEN_CKEN9);
      OSCC = (OSCC_OON);
      

Index: PXA27XClockM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XClockM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PXA27XClockM.nc	8 Sep 2005 01:01:47 -0000	1.2
--- PXA27XClockM.nc	10 Oct 2006 02:22:49 -0000	1.3
***************
*** 170,174 ****
      
  #if USE_NEW_TIMER
!     //don't really want to do anything here.  For now, our low level clock will always be based on the LPO @ 1/32768th sec
      //all settings are determined in init/start
      call Clock.setInterval(interval);
--- 170,174 ----
      
  #if USE_NEW_TIMER
!     //don't really want to do anything here.  For now, our low level clock will always be based on the LPO @ 1ms
      //all settings are determined in init/start
      call Clock.setInterval(interval);
***************
*** 246,250 ****
   #if USE_NEW_TIMER
      //need to return 0 due to a check in the upper layer
!     return 0;
  #else
      uint32_t CntrVal;
--- 246,251 ----
   #if USE_NEW_TIMER
      //need to return 0 due to a check in the upper layer
!     return OSCR5;
!     //return 0;
  #else
      uint32_t CntrVal;
***************
*** 259,263 ****
  
    async command void Clock.setCounter(uint32_t n) {
! 
    }
  
--- 260,265 ----
  
    async command void Clock.setCounter(uint32_t n) {
!     OSCR5 = n;
!     return;
    }
  

Index: PXA27XDMAC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XDMAC.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PXA27XDMAC.nc	18 Aug 2005 23:07:13 -0000	1.2
--- PXA27XDMAC.nc	10 Oct 2006 02:22:49 -0000	1.3
***************
*** 47,51 ****
  {
    provides {
-     interface StdControl;
      interface PXA27XDMAChannel[uint8_t channel];
      //interface PXA27XDMAExtReq[uint8_t pin];
--- 47,50 ----
***************
*** 55,65 ****
  implementation
  {
!   components PXA27XDMAM, PXA27XHPLDMAM, PXA27XInterruptM;
  
!   StdControl = PXA27XDMAM;
    PXA27XDMAChannel = PXA27XDMAM;
!   //PXA27XDMAExtReq = PXA27XDMAM;
!   PXA27XDMAM.PXA27XHPLDMA -> PXA27XHPLDMAM;
!   PXA27XDMAM.Interrupt -> PXA27XInterruptM.PXA27XIrq[PPID_DMAC];
  
  }
--- 54,62 ----
  implementation
  {
!   components PXA27XDMAM, PXA27XInterruptM, Main;
  
!   Main.StdControl -> PXA27XDMAM.StdControl;
    PXA27XDMAChannel = PXA27XDMAM;
!   PXA27XDMAM.Interrupt -> PXA27XInterruptM.PXA27XIrq[IID_DMAC];
  
  }

Index: PXA27XDMAChannel.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XDMAChannel.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PXA27XDMAChannel.nc	6 Sep 2005 17:49:09 -0000	1.3
--- PXA27XDMAChannel.nc	10 Oct 2006 02:22:49 -0000	1.4
***************
*** 55,74 ****
    // descriptor-based or non-descriptor-based channel commands
   
    command result_t requestChannel(DMAPeripheralID_t peripheralID, 
  				  DMAPriority_t priority, bool permanent);
    event result_t requestChannelDone();
    command result_t returnChannel();
    
!   command result_t setSourceAddr(uint32_t val);
!   command result_t setTargetAddr(uint32_t val);
!   command result_t enableSourceAddrIncrement(bool enable);
!   command result_t enableTargetAddrIncrement(bool enable);
!   command result_t enableSourceFlowControl(bool enable);
!   command result_t enableTargetFlowControl(bool enable);
!   command result_t setMaxBurstSize(DMAMaxBurstSize_t size);
!   command result_t setTransferLength(uint16_t length);
!   command result_t setTransferWidth(DMATransferWidth_t width);
!   command result_t run(bool InterruptEn);
!   command result_t stop();
    async event void Interrupt();
  }
--- 55,219 ----
    // descriptor-based or non-descriptor-based channel commands
   
+ 
+ 
+   /*************************************************************************
+    * Management functions
+    ************************************************************************/
+ 
+   /**
+    * request a DMA Channel
+    *
+    * @param peripheralID:  identifier of the peripheral that is requesting channel
+    *                       See DMA.h for a valid list of peripheralID's
+    *
+    * @param priority:  OR'd list of acceptable priorities for this channel.  If 
+    *                   only 1 priority level is acceptable, only 1 should be given.
+    *		       If any priority is acceptable, all priorities should be OR'd
+    *
+    * @param permanent:  TRUE if the requesting component does not intend to ever
+    *                     give up the allocated channel
+    * @return SUCCESS always
+    */
    command result_t requestChannel(DMAPeripheralID_t peripheralID, 
  				  DMAPriority_t priority, bool permanent);
+  
+   
+   /**
+    * event informing the caller of requestChannel that a channel has been allocated
+    *
+    * @return SUCCESS always
+    */
    event result_t requestChannelDone();
+ 
+   /**
+    * return the channel that had previously been allocated
+    *
+    * @return SUCCESS if channel was allocated, FAIL if there was no channel 
+    *         already allocated
+    */
    command result_t returnChannel();
    
! 
!   /*************************************************************************
!    * Data Control/setup functions...see PXA27x developer's manual for specific
!    * definitions of the terms used
!    *
!    * -All of these functions may be called before a channel is allocated
!    * -Relevant info must be setup before run is called
!    *
!   ************************************************************************/
!   
!   /**
!    * set the source address of the DMA operation
!    *
!    * @param val: The address that will be the source 
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  async command result_t setSourceAddr(uint32_t val);
!   
!  
!    /**
!    * set the target address of the DMA operation
!    *
!    * @param val: The address that will be the target 
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  async command result_t setTargetAddr(uint32_t val);
!   
!    /**
!    * set whether the souce address should be incremented after each transfer of 
!    *  width bytes
!    *
!    * @param enable: TRUE if it should increment, FALSE if it should not
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  command result_t enableSourceAddrIncrement(bool enable);
!  
!    /**
!    * set whether the target address should be incremented after each transfer of 
!    *  width bytes
!    *
!    * @param enable: TRUE if it should increment, FALSE if it should not
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  command result_t enableTargetAddrIncrement(bool enable);
!  
!   /**
!    * set whether the source device controls the flow or not
!    *
!    * @param enable: TRUE if it should control, FALSE if it should not
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  command result_t enableSourceFlowControl(bool enable);
!  
!    /**
!    * set whether the target device controls the flow or not
!    *
!    * @param enable: TRUE if it should control, FALSE if it should not
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  command result_t enableTargetFlowControl(bool enable);
!   
!   /**
!    * set the max burst size allowable for this transfer.  This parameter needs to
!    * be set appropriately based on the peripheral's FIFO depth.
!    * 
!    *
!    * @param size: 8, 16, or 32 bytes encoded in a DMAMaxBurstSize_t
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  command result_t setMaxBurstSize(DMAMaxBurstSize_t size);
!  
!   /**
!    * set the transfer length of the DMA operation.  The underlying component is
!    * free to break up this length as it feels fit
!    *
!    * @param length: The length, in bytes, of the transaction 
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  async command result_t setTransferLength(uint16_t length);
!  
!   /**
!    * set the width, in bytes, of each transfer.
!    *
!    * @param width: 0, 1, 2, or 4 bytes encoded in a DMATransferWidth_t. Note that
!    * 0 has a special meaning. See the PXA27X developer's manual for details
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  command result_t setTransferWidth(DMATransferWidth_t width);
!  
!  
!   /**
!    * start the DMA transfer running.  All necessary parameters must have already
!    * been set
!    *
!    * @param InterruptEn:  TRUE if the interrupt event should be sent when the
!    * transfer has concluded
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  async command result_t run(bool InterruptEn);
!  
!   /**
!    * stop the DMA transfer prematurely
!    *
!    * @return FAIL if error, SUCCESS otherwise.
!    */
!  async command result_t stop();
!   
!   /**
!    * event that indicates that the transfer has finished
!    *
!    * @return SUCCESS
!    */
    async event void Interrupt();
  }


Index: PXA27XDMAM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XDMAM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PXA27XDMAM.nc	6 Sep 2005 17:49:09 -0000	1.3
--- PXA27XDMAM.nc	10 Oct 2006 02:22:49 -0000	1.4
***************
*** 54,58 ****
  
    uses {
-     interface PXA27XHPLDMA;
      interface PXA27XInterrupt as Interrupt;
    }
--- 54,57 ----
***************
*** 111,128 ****
    ChannelMapItem_t  mPriorityMap[32];
   
    command result_t StdControl.init(){
      
      int i;
!     atomic{
!       for(i=0; i<NUMDMACHANNELS; i++){
! 	mChannelArray[i].channelValid = FALSE;
        }
      }
!     call Interrupt.allocate();
      return SUCCESS;
    }
  
    command result_t StdControl.start(){
      call Interrupt.enable();
      return SUCCESS;
    }
--- 110,135 ----
    ChannelMapItem_t  mPriorityMap[32];
   
+   bool gInitialized = FALSE;
+     
    command result_t StdControl.init(){
      
      int i;
!     if(gInitialized == FALSE){
!       atomic{
! 	for(i=0; i<NUMDMACHANNELS; i++){
! 	  mChannelArray[i].channelValid = FALSE;
! 	}
        }
+       call Interrupt.allocate();
+       gInitialized = TRUE;
      }
!     
      return SUCCESS;
    }
  
    command result_t StdControl.start(){
+     
      call Interrupt.enable();
+     
      return SUCCESS;
    }
***************
*** 240,244 ****
    }
    
!   command result_t PXA27XDMAChannel.setSourceAddr[uint8_t channel](uint32_t val){
      atomic{
        mDescriptorArray[channel].DSADR = val;
--- 247,251 ----
    }
    
!   async command result_t PXA27XDMAChannel.setSourceAddr[uint8_t channel](uint32_t val){
      atomic{
        mDescriptorArray[channel].DSADR = val;
***************
*** 246,250 ****
      return SUCCESS;
    }
!   command result_t PXA27XDMAChannel.setTargetAddr[uint8_t channel](uint32_t val){
      atomic{
        mDescriptorArray[channel].DTADR = val;
--- 253,258 ----
      return SUCCESS;
    }
! 
!   async command result_t PXA27XDMAChannel.setTargetAddr[uint8_t channel](uint32_t val){
      atomic{
        mDescriptorArray[channel].DTADR = val;
***************
*** 252,255 ****
--- 260,264 ----
      return SUCCESS;
    }
+   
    command result_t PXA27XDMAChannel.enableSourceAddrIncrement[uint8_t channel](bool enable){
      atomic{
***************
*** 291,295 ****
    }
    
!   command result_t PXA27XDMAChannel.setTransferLength[uint8_t channel](uint16_t length){
      uint16_t currentLength;
      currentLength = (length<8192) ? length: 8190;
--- 300,304 ----
    }
    
!   async command result_t PXA27XDMAChannel.setTransferLength[uint8_t channel](uint16_t length){
      uint16_t currentLength;
      currentLength = (length<8192) ? length: 8190;
***************
*** 314,318 ****
      return FAIL;
    }
!   command result_t PXA27XDMAChannel.run[uint8_t channel](bool InterruptEn){
      uint8_t realChannel;
      uint32_t width;
--- 323,328 ----
      return FAIL;
    }
!   
!   async command result_t PXA27XDMAChannel.run[uint8_t channel](bool InterruptEn){
      uint8_t realChannel;
      uint32_t width;
***************
*** 322,350 ****
        width = (mDescriptorArray[channel].DCMD >> 14) & 0x3;
       
!       call PXA27XHPLDMA.mapChannel(realChannel, mChannelArray[channel].peripheralID);
        if(width){
! 	call PXA27XHPLDMA.setByteAlignment(realChannel,TRUE);
        }
        
!       call PXA27XHPLDMA.setDCSR(realChannel, DCSR_NODESCFETCH);
!       
  #if 0
        if(InterruptEn){
! 	call PXA27XHPLDMA.setDCMD(realChannel, mDescriptorArray[channel].DCMD | DCMD_ENDIRQEN);
        }
        else{
! 	call PXA27XHPLDMA.setDCMD(realChannel, mDescriptorArray[channel].DCMD);
        }
  #else
!       call PXA27XHPLDMA.setDCMD(realChannel, mDescriptorArray[channel].DCMD | DCMD_ENDIRQEN);
  #endif
        
!       call PXA27XHPLDMA.setDSADR(realChannel, mDescriptorArray[channel].DSADR);
!       call PXA27XHPLDMA.setDTADR(realChannel, mDescriptorArray[channel].DTADR);
!       call PXA27XHPLDMA.setDCSR(realChannel, DCSR_RUN | DCSR_NODESCFETCH);
      }
      return SUCCESS;
    }
!   command result_t PXA27XDMAChannel.stop[uint8_t channel](){
       return SUCCESS;
    }
--- 332,364 ----
        width = (mDescriptorArray[channel].DCMD >> 14) & 0x3;
       
!       DRCMR(mChannelArray[channel].peripheralID) = DRCMR_CHLNUM(realChannel) | DRCMR_MAPVLD;
        if(width){
! 	DALGN |= (1 << realChannel);
!       }
!       else{
! 	DALGN &= ~(1 << realChannel);
        }
        
!       DCSR(realChannel) = DCSR_NODESCFETCH;
  #if 0
        if(InterruptEn){
! 	DCMD(realChannel) = mDescriptorArray[channel].DCMD | DCMD_ENDIRQEN;
        }
        else{
! 	DCMD(realChannel) =  mDescriptorArray[channel].DCMD;
        }
  #else
!       DCMD(realChannel) = mDescriptorArray[channel].DCMD | DCMD_ENDIRQEN;
!       
  #endif
        
!       DSADR(realChannel) =  mDescriptorArray[channel].DSADR;
!       DTADR(realChannel) = mDescriptorArray[channel].DTADR;
!       DCSR(realChannel) =  DCSR_RUN | DCSR_NODESCFETCH;
      }
      return SUCCESS;
    }
! 
!   async command result_t PXA27XDMAChannel.stop[uint8_t channel](){
       return SUCCESS;
    }
***************
*** 374,386 ****
        uint32_t realChannel, virtualChannel,status, update;
        realChannel = 31 - _pxa27x_clzui(IntReg);
!       status = call PXA27XHPLDMA.getDCSR(realChannel);
        update = (status & 0xFFA00000) | DCSR_MASKRUN;
        
        if(status & DCSR_BUSERRINTR){
! 	update |= DCSR_BUSERRINTR;
        }
  
        if(status & DCSR_STARTINTR){
! 	update |= DCSR_STARTINTR;
        }
        
--- 388,412 ----
        uint32_t realChannel, virtualChannel,status, update;
        realChannel = 31 - _pxa27x_clzui(IntReg);
!       status = DCSR(realChannel);
        update = (status & 0xFFA00000) | DCSR_MASKRUN;
        
        if(status & DCSR_BUSERRINTR){
! 	DCSR(realChannel) = update | DCSR_BUSERRINTR;
        }
  
        if(status & DCSR_STARTINTR){
! 	DCSR(realChannel) = update | DCSR_STARTINTR;
!       }
!       
!       if(status & DCSR_STOPINTR){
! 	DCSR(realChannel) = update & DCSR_STOPIRQEN;
!       }
! 
!       if(status & DCSR_RASINTR){
! 	DCSR(realChannel) = update | DCSR_RASINTR;
!       }
!       
!       if(status & DCSR_EORINT){
! 	DCSR(realChannel) = update | DCSR_EORINT;
        }
        
***************
*** 388,392 ****
  	uint16_t currentLength;
  	
! 	update |= DCSR_ENDINTR;
  	//channel is done...need to do the inverse mapping from real channel to virtual channel..
  	
--- 414,419 ----
  	uint16_t currentLength;
  	
! 	//update |= DCSR_ENDINTR;
! 	DCSR(realChannel) = update | DCSR_ENDINTR;
  	//channel is done...need to do the inverse mapping from real channel to virtual channel..
  	
***************
*** 406,411 ****
  	    
  	    //go again!!!
! 	    call PXA27XHPLDMA.setDCMD(realChannel, mDescriptorArray[virtualChannel].DCMD | DCMD_ENDIRQEN);
! 	    call PXA27XHPLDMA.setDCSR(realChannel, DCSR_RUN | DCSR_NODESCFETCH);
  	  }
  	}
--- 433,438 ----
  	    
  	    //go again!!!
! 	    DCMD(realChannel) =  mDescriptorArray[virtualChannel].DCMD | DCMD_ENDIRQEN;
! 	    DCSR(realChannel) = DCSR_RUN | DCSR_NODESCFETCH;
  	  }
  	}
***************
*** 415,431 ****
  	
        }
-       
-       if(status & DCSR_STOPINTR){
- 	update &= ~(DCSR_STOPIRQEN);
-       }
- 
-       if(status & DCSR_RASINTR){
- 	update |= DCSR_RASINTR;
-       }
-       
-       if(status & DCSR_EORINT){
- 	update |= DCSR_EORINT;
-       }
-       call PXA27XHPLDMA.setDCSR(realChannel,update);
        IntReg &= ~(1 << realChannel);
      }
--- 442,445 ----

Index: PXA27XGPIOIntC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XGPIOIntC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** PXA27XGPIOIntC.nc	10 Mar 2005 00:37:27 -0000	1.1
--- PXA27XGPIOIntC.nc	10 Oct 2006 02:22:49 -0000	1.2
***************
*** 56,62 ****
    PXA27XGPIOInt = PXA27XGPIOIntM;
  
!   PXA27XGPIOIntM.GPIOIrq0 -> PXA27XInterruptM.PXA27XIrq[PPID_GPIO_0];
!   PXA27XGPIOIntM.GPIOIrq1 -> PXA27XInterruptM.PXA27XIrq[PPID_GPIO_1];
!   PXA27XGPIOIntM.GPIOIrq -> PXA27XInterruptM.PXA27XIrq[PPID_GPIO_X];
  
  }
--- 56,62 ----
    PXA27XGPIOInt = PXA27XGPIOIntM;
  
!   PXA27XGPIOIntM.GPIOIrq0 -> PXA27XInterruptM.PXA27XIrq[IID_GPIO_0];
!   PXA27XGPIOIntM.GPIOIrq1 -> PXA27XInterruptM.PXA27XIrq[IID_GPIO_1];
!   PXA27XGPIOIntM.GPIOIrq -> PXA27XInterruptM.PXA27XIrq[IID_GPIO_X];
  
  }

Index: PXA27XGPIOIntM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XGPIOIntM.nc,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PXA27XGPIOIntM.nc	21 Jun 2005 23:53:40 -0000	1.3
--- PXA27XGPIOIntM.nc	10 Oct 2006 02:22:49 -0000	1.4
***************
*** 91,104 ****
        switch (mode) {
        case TOSH_RISING_EDGE:
! 	_GRER(pin) |= _GPIO_bit(pin);
! 	_GFER(pin) &= ~(_GPIO_bit(pin));
  	break;
        case TOSH_FALLING_EDGE:
! 	_GRER(pin) &= ~(_GPIO_bit(pin));
! 	_GFER(pin) |= _GPIO_bit(pin);
  	break;
        case TOSH_BOTH_EDGE:
! 	_GRER(pin) |= _GPIO_bit(pin);	
! 	_GFER(pin) |= _GPIO_bit(pin);
  	break;
        default:
--- 91,104 ----
        switch (mode) {
        case TOSH_RISING_EDGE:
! 	GRER(pin) |= GPIO_BIT(pin);
! 	GFER(pin) &= ~(GPIO_BIT(pin));
  	break;
        case TOSH_FALLING_EDGE:
! 	GRER(pin) &= ~(GPIO_BIT(pin));
! 	GFER(pin) |= GPIO_BIT(pin);
  	break;
        case TOSH_BOTH_EDGE:
! 	GRER(pin) |= GPIO_BIT(pin);	
! 	GFER(pin) |= GPIO_BIT(pin);
  	break;
        default:
***************
*** 113,118 ****
    {
      if (pin < 121) {
!       _GRER(pin) &= ~(_GPIO_bit(pin));
!       _GFER(pin) &= ~(_GPIO_bit(pin));
      }
  
--- 113,118 ----
    {
      if (pin < 121) {
!       GRER(pin) &= ~(GPIO_BIT(pin));
!       GFER(pin) &= ~(GPIO_BIT(pin));
      }
  
***************
*** 123,127 ****
    {
      if (pin < 121) {
!       _GEDR(pin) = _GPIO_bit(pin);
      }
      
--- 123,127 ----
    {
      if (pin < 121) {
!       GEDR(pin) = GPIO_BIT(pin);
      }
      

Index: PXA27XI2CM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XI2CM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PXA27XI2CM.nc	20 Sep 2005 02:28:58 -0000	1.2
--- PXA27XI2CM.nc	10 Oct 2006 02:22:49 -0000	1.3
***************
*** 53,57 ****
   * @version 1.0, August 10, 2005
   */
! includes pxa27x_registers;
  
  module PXA27XI2CM
--- 53,57 ----
   * @version 1.0, August 10, 2005
   */
! includes pxa27x_registers_def;
  
  module PXA27XI2CM
***************
*** 93,98 ****
          // (1) - Configure the GPIO Alt functions and directions
          //  a) tha alt functions
!         _GPIO_setaltfn(117,1);
!         _GPIO_setaltfn(118,1);
  
          //  b) the directions
--- 93,98 ----
          // (1) - Configure the GPIO Alt functions and directions
          //  a) tha alt functions
!         GPIO_SET_ALT_FUNC(117,1, GPIO_OUT);
!         GPIO_SET_ALT_FUNC(118,1, GPIO_OUT);
  
          //  b) the directions
***************
*** 108,113 ****
  
          // (2) - Enablet the I2C clocks
!         CKEN |= CKEN14_I2C;    // enable I2C clock
!         CKEN |= CKEN15_PMI2C;  // Power Manager I2C Unit Clock Enable, this is necessary to 
                                 // enable ICR[IUE] 
      }
--- 108,113 ----
  
          // (2) - Enablet the I2C clocks
!         CKEN |= CKEN_CKEN14;    // enable I2C clock
!         CKEN |= CKEN_CKEN15;  // Power Manager I2C Unit Clock Enable, this is necessary to 
                                 // enable ICR[IUE] 
      }
***************
*** 296,303 ****
      command result_t I2C.sendStart() 
      {
!         atomic {
!             if (state != IDLE)
!                 return FAIL;
!         }
  
          if (post triggerEvent()) {
--- 296,301 ----
      command result_t I2C.sendStart() 
      {
!         if (state != IDLE)
!            return FAIL;
  
          if (post triggerEvent()) {
***************
*** 312,319 ****
      command result_t I2C.sendEnd() 
      {
!         atomic {
!             if (state != IDLE)
!                 return FAIL;
!         }
                         
          if (post triggerEvent()) {
--- 310,315 ----
      command result_t I2C.sendEnd() 
      {
!         if (state != IDLE)
!            return FAIL;
                         
          if (post triggerEvent()) {
***************
*** 327,334 ****
      command result_t I2C.read(bool ack) 
      {
!         atomic {
!             if (state != IDLE)
!                 return FAIL;
!         }
  
          // (1) - Do the read
--- 323,328 ----
      command result_t I2C.read(bool ack) 
      {
!         if (state != IDLE)
!            return FAIL;
  
          // (1) - Do the read
***************
*** 369,376 ****
      command result_t I2C.write(char data) 
      {
!         atomic {
!             if (state != IDLE)
!                 return FAIL;
!         }
  
          // (1) - Load the data in the IDBR register
--- 363,368 ----
      command result_t I2C.write(char data) 
      {
!         if (state != IDLE)
!            return FAIL;
  
          // (1) - Load the data in the IDBR register

Index: PXA27XInterruptM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XInterruptM.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PXA27XInterruptM.nc	2 Sep 2005 23:30:12 -0000	1.4
--- PXA27XInterruptM.nc	10 Oct 2006 02:22:49 -0000	1.5
***************
*** 143,147 ****
  
  	for(i = 0; i < usedPriorities; i++){
! 	  IPR(i) = (IPR_VALID | PriorityTable[i]);
  	  tmp = IPR(i);
  	}
--- 143,147 ----
  
  	for(i = 0; i < usedPriorities; i++){
! 	  IPR(i) = (IPR_VAL | PriorityTable[i]);
  	  tmp = IPR(i);
  	}
***************
*** 152,161 ****
  	  priority = usedPriorities;
  	  usedPriorities++;
! 	  IPR(priority) = (IPR_VALID | (id));
  	  tmp = IPR(priority);
  	}
  	if (level) {
! 	  _ICLR(id) |= _PPID_Bit(id);
! 	  tmp = _ICLR(id);
  	} 
  	
--- 152,161 ----
  	  priority = usedPriorities;
  	  usedPriorities++;
! 	  IPR(priority) = (IPR_VAL | (id));
  	  tmp = IPR(priority);
  	}
  	if (level) {
! 	  ICLR_REG(id) |= INTERRUPT_BIT(id);
! 	  tmp = ICLR_REG(id);
  	} 
  	
***************
*** 171,176 ****
      atomic {
        if (id < 34) {
! 	_ICMR(id) |= _PPID_Bit(id);
! 	tmp = _ICMR(id);
        }
      }
--- 171,176 ----
      atomic {
        if (id < 34) {
! 	ICMR_REG(id) |= INTERRUPT_BIT(id);
! 	tmp = ICMR_REG(id);
        }
      }
***************
*** 183,188 ****
      atomic {
        if (id < 34) {
! 	_ICMR(id) &= ~(_PPID_Bit(id));
! 	tmp = _ICMR(id);
        }
      }
--- 183,188 ----
      atomic {
        if (id < 34) {
! 	ICMR_REG(id) &= ~(INTERRUPT_BIT(id));
! 	tmp = ICMR_REG(id);
        }
      }

Index: PXA27XPowerModes.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XPowerModes.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PXA27XPowerModes.h	8 Dec 2005 23:17:51 -0000	1.2
--- PXA27XPowerModes.h	10 Oct 2006 02:22:49 -0000	1.3
***************
*** 69,73 ****
  #define PXA27XPOWERMODES_H
  
- // Power Modes
  #define DEEP_SLEEP_MODE 1
  #define SLEEP_MODE 2
--- 69,72 ----
***************
*** 77,84 ****
  #define NORAML_MODE 6
  
- // Wakeup sources
- #define WAKEUP_RTC	0x1
- #define WAKEUP_PMIC	0x2
- #define WAKEUP_RADIO	0x4
- 
  #endif //Power Modes
--- 76,78 ----

Index: PXA27XPowerModesM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XPowerModesM.nc,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PXA27XPowerModesM.nc	8 Dec 2005 23:17:51 -0000	1.2
--- PXA27XPowerModesM.nc	10 Oct 2006 02:22:49 -0000	1.3
***************
*** 99,108 ****
      PWER = PWER_WERTC | PWER_WE1;	// only enable wakeup from RTC
      PRER |= PRER_RE1;
!     PFER |= PFER_RE1;
  
  #if 0	// Radio
      PWER |= PWER_WE0;
      PRER |= PRER_RE0;
!     PFER |= PFER_RE0;
  #endif
  
--- 99,108 ----
      PWER = PWER_WERTC | PWER_WE1;	// only enable wakeup from RTC
      PRER |= PRER_RE1;
!     PFER |= PFER_FE1;
  
  #if 0	// Radio
      PWER |= PWER_WE0;
      PRER |= PRER_RE0;
!     PFER |= PFER_FE0;
  #endif
  

Index: PXA27XUSBClientC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XUSBClientC.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PXA27XUSBClientC.nc	2 Sep 2005 23:25:52 -0000	1.4
--- PXA27XUSBClientC.nc	10 Oct 2006 02:22:49 -0000	1.5
***************
*** 42,46 ****
    Control = PXA27XUSBClientM;
    
!   PXA27XUSBClientM.USBInterrupt -> PXA27XInterruptM.PXA27XIrq[PPID_USBC];
    PXA27XUSBClientM.USBAttached = PXA27XGPIOInt;
    PXA27XUSBClientM = UID;
--- 42,46 ----
    Control = PXA27XUSBClientM;
    
!   PXA27XUSBClientM.USBInterrupt -> PXA27XInterruptM.PXA27XIrq[IID_USBC];
    PXA27XUSBClientM.USBAttached = PXA27XGPIOInt;
    PXA27XUSBClientM = UID;

Index: PXA27XUSBClientM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27XUSBClientM.nc,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** PXA27XUSBClientM.nc	14 Jul 2006 19:10:17 -0000	1.10
--- PXA27XUSBClientM.nc	10 Oct 2006 02:22:49 -0000	1.11
***************
*** 172,176 ****
      
      atomic{
!       CKEN |= CKEN11_USBC;
        
        UDCICR1 |= _UDC_bit(INT_IRRS); //reset     
--- 172,176 ----
      
      atomic{
!       CKEN |= CKEN_CKEN11;
        
        UDCICR1 |= _UDC_bit(INT_IRRS); //reset     

Index: PXA27Xdynqueue.c
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27Xdynqueue.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PXA27Xdynqueue.c	2 Sep 2005 23:26:32 -0000	1.4
--- PXA27Xdynqueue.c	10 Oct 2006 02:22:49 -0000	1.5
***************
*** 1,6 ****
! /* 
!  * Author:		Josh Herbach
!  * Revision:	1.0
!  * Date:		09/02/2005
   */
  
--- 1,6 ----
! /* 
!  * Author:		Josh Herbach
!  * Revision:	1.0
!  * Date:		09/02/2005
   */
  
***************
*** 133,142 ****
  /*------------------------------------------------------------------*/
  
! void DynQueue_enqueue(DynQueue oDynQueue, const void *pvItem)
  /* Adds pvItem to oDynQueue.*/
  {
     //assert(oDynQueue != NULL);
  	if(oDynQueue == NULL)
! 		return;
  
     if (oDynQueue->iLength + oDynQueue->index == oDynQueue->iPhysLength)
--- 133,142 ----
  /*------------------------------------------------------------------*/
  
! int DynQueue_enqueue(DynQueue oDynQueue, const void *pvItem)
  /* Adds pvItem to oDynQueue.*/
  {
     //assert(oDynQueue != NULL);
  	if(oDynQueue == NULL)
! 	  return 0;
  
     if (oDynQueue->iLength + oDynQueue->index == oDynQueue->iPhysLength)
***************
*** 145,148 ****
--- 145,150 ----
     oDynQueue->ppvQueue[oDynQueue->index + oDynQueue->iLength] = pvItem;
     oDynQueue->iLength++;
+ 
+    return oDynQueue->iLength;
  }
  

Index: PXA27Xdynqueue.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/PXA27Xdynqueue.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** PXA27Xdynqueue.h	2 Sep 2005 23:26:32 -0000	1.2
--- PXA27Xdynqueue.h	10 Oct 2006 02:22:49 -0000	1.3
***************
*** 1,6 ****
! /* 
!   * Author:		Josh Herbach
!   * Revision:	1.0
!   * Date:		09/02/2005
    */
  
--- 1,6 ----
! /*
!   * Author:		Josh Herbach
!   * Revision:	1.0
!   * Date:		09/02/2005
    */
  
***************
*** 27,31 ****
  /* Dequeues the first element of oDynQueue.*/
  
! void DynQueue_enqueue(DynQueue oDynQueue, const void *pvItem);
  /* Adds pvItem to oDynQueue.*/
  
--- 27,31 ----
  /* Dequeues the first element of oDynQueue.*/
  
! int DynQueue_enqueue(DynQueue oDynQueue, const void *pvItem);
  /* Adds pvItem to oDynQueue.*/
  
***************
*** 36,39 ****
  /* Puts an item at the head of oDynQueue the queue.*/
  
! #endif
  
--- 36,39 ----
  /* Puts an item at the head of oDynQueue the queue.*/
  
! #endif //__PXA27Xdynqueue_H__
  

Index: SimpleWDTM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/SimpleWDTM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SimpleWDTM.nc	8 Dec 2005 23:17:51 -0000	1.1
--- SimpleWDTM.nc	10 Oct 2006 02:22:49 -0000	1.2
***************
*** 73,77 ****
  
    command result_t StdControl.start(){
!     call Timer.start(TIMER_REPEAT, 1500 * WDT_INTERVAL); // have margin
      call PXA27XWatchdog.enableWDT(3250 * WDT_INTERVAL);
      return SUCCESS;
--- 73,77 ----
  
    command result_t StdControl.start(){
!     call Timer.start(TIMER_REPEAT, WDT_INTERVAL>>2); // have margin
      call PXA27XWatchdog.enableWDT(3250 * WDT_INTERVAL);
      return SUCCESS;

Index: pxa27xhardware.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/pxa27x/pxa27xhardware.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pxa27xhardware.h	8 Dec 2005 23:17:51 -0000	1.7
--- pxa27xhardware.h	10 Oct 2006 02:22:50 -0000	1.8
***************
*** 76,94 ****
  
  #include "arm_defs.h"
! #include "pxa27x_registers.h"
  
  
  
  #define TOSH_ASSIGN_PIN(name, port, regbit) \
! static inline void TOSH_SET_##name##_PIN() {_GPSR(regbit) |= _GPIO_bit(regbit);} \
! static inline void TOSH_CLR_##name##_PIN() {_GPCR(regbit) |= _GPIO_bit(regbit);} \
! static inline char TOSH_READ_##name##_PIN() {return ((_GPLR(regbit) & _GPIO_bit(regbit)) != 0);} \
! static inline void TOSH_MAKE_##name##_OUTPUT() {_GPIO_setaltfn(regbit,0);_GPDR(regbit) |= _GPIO_bit(regbit);} \
! static inline void TOSH_MAKE_##name##_INPUT() {_GPIO_setaltfn(regbit,0);_GPDR(regbit) &= ~(_GPIO_bit(regbit));}
  
  #define TOSH_ASSIGN_OUTPUT_ONLY_PIN(name, port, regbit) \
! static inline void TOSH_SET_##name##_PIN() {_GPSR(regbit) |= _GPIO_bit(regbit);} \
! static inline void TOSH_CLR_##name##_PIN() {_GPCR(regbit) |= _GPIO_bit(regbit);} \
! static inline void TOSH_MAKE_##name##_OUTPUT() {_GPDR(regbit) |= _GPIO_bit(regbit);} 
  
  // We need slightly different defs than SIGNAL, INTERRUPT
--- 76,94 ----
  
  #include "arm_defs.h"
! #include "pxa27x_registers_def.h"
  
  
  
  #define TOSH_ASSIGN_PIN(name, port, regbit) \
! static inline void TOSH_SET_##name##_PIN() {GPSR(regbit) = GPIO_BIT(regbit);} \
! static inline void TOSH_CLR_##name##_PIN() {GPCR(regbit) = GPIO_BIT(regbit);} \
! static inline char TOSH_READ_##name##_PIN() {return ((GPLR(regbit) & GPIO_BIT(regbit)) != 0);} \
! static inline void TOSH_MAKE_##name##_OUTPUT() {GPIO_SET_ALT_FUNC(regbit,0,GPIO_OUT);GPDR(regbit) |= GPIO_BIT(regbit);} \
! static inline void TOSH_MAKE_##name##_INPUT() {GPIO_SET_ALT_FUNC(regbit,0,GPIO_IN);GPDR(regbit) &= ~(GPIO_BIT(regbit));}
  
  #define TOSH_ASSIGN_OUTPUT_ONLY_PIN(name, port, regbit) \
! static inline void TOSH_SET_##name##_PIN() {GPSR(regbit) = GPIO_BIT(regbit);} \
! static inline void TOSH_CLR_##name##_PIN() {GPCR(regbit) = GPIO_BIT(regbit);} \
! static inline void TOSH_MAKE_##name##_OUTPUT() {GPIO_SET_ALT_FUNC(regbit,0,GPIO_OUT);GPDR(regbit) |= GPIO_BIT(regbit);} 
  
  // We need slightly different defs than SIGNAL, INTERRUPT



More information about the Tinyos-beta-commits mailing list