[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/pxa27x HplPXA27xInterruptCntl.nc, NONE, 1.1.2.1 HplPXA27xInterruptM.nc, 1.1.2.4, 1.1.2.5 pxa27x_registers.h, 1.1.2.7, 1.1.2.8

Philip Buonadonna philipb at users.sourceforge.net
Wed Jul 5 13:00:08 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv31009

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	HplPXA27xInterruptM.nc pxa27x_registers.h 
Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	HplPXA27xInterruptCntl.nc 
Log Message:
Updated pxa27x interrupt components to spec.


--- NEW FILE: HplPXA27xInterruptCntl.nc ---
// $Id: HplPXA27xInterruptCntl.nc,v 1.1.2.1 2006/07/05 20:00:05 philipb Exp $
/*
 * Copyright (c) 2005 Arch Rock Corporation 
 * All rights reserved. 
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *	Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *	Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 *  
 *   Neither the name of the Arch Rock Corporation nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED
 * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 */
/**
 * This interface provides access to the ICCR functionality of
 * the PXA27x interrupt controller.  
 * 
 * Refer to the PXA27x Developers Guide for more information.
 *
 * @author: Philip Buonadonna
 */

interface HplPXA27xInterruptCntl
{
   /**
    * Sets the ICCR DIM bit of the PXA27x interrupt controller
    * 
    * @param flag TRUE to set the DIM bit, FALSE to clear
    *
    */
   async command void setICCR_DIM(bool flag);

   /**
    * Gets the value of the ICCR DIM bit.
    *  
    * @return value TRUE if set, FALSE if clear.
    */
   async command bool getICCR_DIM();

}


Index: HplPXA27xInterruptM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/Attic/HplPXA27xInterruptM.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** HplPXA27xInterruptM.nc	7 Dec 2005 23:30:40 -0000	1.1.2.4
--- HplPXA27xInterruptM.nc	5 Jul 2006 20:00:05 -0000	1.1.2.5
***************
*** 50,54 ****
    provides {
      interface HplPXA27xInterrupt as PXA27xIrq[uint8_t id];
!     interface HplPXA27xInterrupt as PXA27xFiq[uint8_t id];
    }
  }
--- 50,54 ----
    provides {
      interface HplPXA27xInterrupt as PXA27xIrq[uint8_t id];
!     interface HplPXA27xInterruptCntl;
    }
  }
***************
*** 85,101 ****
    void hplarmv_fiq() __attribute__ ((interrupt ("FIQ"))) @C() @atomic_hwevent() {
  
-     uint32_t FIQPending;
- 
-     FIQPending = getICHP();   // Determine which interrupt to service
-     FIQPending &= 0xFF;  // Mask off the IRQ portion
- 
-     while (FIQPending & (1 << 15)) {
-       uint8_t PeripheralID = (FIQPending & 0x3f); // Get rid of the Valid bit
-       signal PXA27xFiq.fired[PeripheralID]();	  // Handler is responsible for clearing interrupt
-       FIQPending = getICHP();
-       FIQPending &= 0xFF;
-     }
- 
-     return;
    } 
  
--- 85,88 ----
***************
*** 216,242 ****
    }
  
!   async command error_t PXA27xFiq.allocate[uint8_t id]() 
!   {
!     return allocate(id, TRUE, TOSH_IRP_TABLE[id]);
!   }
  
!   async command void PXA27xFiq.enable[uint8_t id]()
!   {
!     enable(id);
      return;
-   }
  
-   async command void PXA27xFiq.disable[uint8_t id]()
-   {
-     disable(id);
-     return;
    }
  
!   default async event void PXA27xIrq.fired[uint8_t id]() 
!   {
!     return;
    }
  
!   default async event void PXA27xFiq.fired[uint8_t id]() 
    {
      return;
--- 203,229 ----
    }
  
!   async command void HplPXA27xInterruptCntl.setICCR_DIM(bool flag) {
  
!     if (flag) {
!       ICCR |= ICCR_DIM;
!     }
!     else {
!       ICCR = 0;
!     }
      return;
  
    }
  
!   async command bool HplPXA27xInterruptCntl.getICCR_DIM() {
!     bool result = FALSE;
! 
!     if (ICCR & ICCR_DIM) {
!       result = TRUE;
!     }
! 
!     return result;
    }
  
!   default async event void PXA27xIrq.fired[uint8_t id]() 
    {
      return;

Index: pxa27x_registers.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/Attic/pxa27x_registers.h,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** pxa27x_registers.h	27 Jan 2006 23:24:41 -0000	1.1.2.7
--- pxa27x_registers.h	5 Jul 2006 20:00:05 -0000	1.1.2.8
***************
*** 1193,1196 ****
--- 1193,1198 ----
  #define IPR_VALID	(1 << 31) 
  
+ #define ICCR_DIM	(1 << 0)
+ 
  // Interrupt Controller Shortcuts 
  // Argument _id is a peripheral ID number



More information about the Tinyos-2-commits mailing list