[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/pxa27x/gpio
HalPXA27xGpioCapture.nc, NONE,
1.1.2.1 HalPXA27xGpioInterrupt.nc, NONE, 1.1.2.1 GeneralIOC.nc,
1.1.2.2, 1.1.2.3 HalPXA27xGeneralIOM.nc, 1.1.2.2, 1.1.2.3
Philip Buonadonna
philipb at users.sourceforge.net
Wed Jul 5 14:24:16 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/gpio
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv836
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
GeneralIOC.nc HalPXA27xGeneralIOM.nc
Added Files:
Tag: tinyos-2_0_devel-BRANCH
HalPXA27xGpioCapture.nc HalPXA27xGpioInterrupt.nc
Log Message:
Updates to bring pxa27x GPIO subsystem to spec
--- NEW FILE: HalPXA27xGpioCapture.nc ---
/*
* Copyright (c) 2005 Arched 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 Arched 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.
*/
/*
* Variant of the GpioCapture interface that provides a capture
* on 'BOTH'.
*
* @author Phil Buonadonna
*/
interface HalPXA27xGpioCapture {
/**
* Enable an edge based timer capture event.
*
* @return Whether the timer capture has been enabled.
*/
async command error_t captureRisingEdge();
async command error_t captureFallingEdge();
async command error_t captureBothEdge();
/**
* Fired when an edge interrupt occurs.
*
* @param val The value of the 32kHz timer.
*/
async event void captured(uint16_t time);
/**
* Disable further captures.
*/
async command void disable();
}
--- NEW FILE: HalPXA27xGpioInterrupt.nc ---
/*
* Copyright (c) 2005 Arched 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 Arched 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.
*/
/*
* Variant of the standard GpioInterrupt interface that provides a
* 'BOTH' trigger.
*
* @author Phil Buonadonna
*
*/
interface HalPXA27xGpioInterrupt {
/**
* Enable an edge based interrupt. Calls to these functions are
* not cumulative: only the transition type of the last called
* function will be monitored for.
*
*
* @return SUCCESS if the interrupt has been enabled
*/
async command error_t enableRisingEdge();
async command error_t enableFallingEdge();
async command error_t enableBothEdge();
/**
* Diables an edge interrupt or capture interrupt
*
* @return SUCCESS if the interrupt has been disabled
*/
async command error_t disable();
/**
* Fired when an edge interrupt occurs.
*
* NOTE: Interrupts keep running until "disable()" is called
*/
async event void fired();
}
Index: GeneralIOC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/gpio/Attic/GeneralIOC.nc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** GeneralIOC.nc 7 Dec 2005 23:16:35 -0000 1.1.2.2
--- GeneralIOC.nc 5 Jul 2006 21:24:13 -0000 1.1.2.3
***************
*** 45,48 ****
--- 45,49 ----
provides {
interface GeneralIO[uint8_t pin];
+ interface HalPXA27xGpioInterrupt[uint8_t pin];
interface GpioInterrupt[uint8_t pin];
}
***************
*** 55,58 ****
--- 56,60 ----
GeneralIO = HalPXA27xGeneralIOM;
+ HalPXA27xGpioInterrupt = HalPXA27xGeneralIOM;
GpioInterrupt = HalPXA27xGeneralIOM;
Index: HalPXA27xGeneralIOM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/pxa27x/gpio/Attic/HalPXA27xGeneralIOM.nc,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -C2 -d -r1.1.2.2 -r1.1.2.3
*** HalPXA27xGeneralIOM.nc 7 Dec 2005 23:16:35 -0000 1.1.2.2
--- HalPXA27xGeneralIOM.nc 5 Jul 2006 21:24:13 -0000 1.1.2.3
***************
*** 43,46 ****
--- 43,47 ----
provides {
interface GeneralIO[uint8_t pin];
+ interface HalPXA27xGpioInterrupt[uint8_t pin];
interface GpioInterrupt[uint8_t pin];
}
***************
*** 90,94 ****
}
! async command error_t GpioInterrupt.enableRisingEdge[uint8_t pin]() {
atomic {
call HplPXA27xGPIOPin.setGRERbit[pin](TRUE);
--- 91,95 ----
}
! async command error_t HalPXA27xGpioInterrupt.enableRisingEdge[uint8_t pin]() {
atomic {
call HplPXA27xGPIOPin.setGRERbit[pin](TRUE);
***************
*** 98,102 ****
}
! async command error_t GpioInterrupt.enableFallingEdge[uint8_t pin]() {
atomic {
call HplPXA27xGPIOPin.setGRERbit[pin](FALSE);
--- 99,103 ----
}
! async command error_t HalPXA27xGpioInterrupt.enableFallingEdge[uint8_t pin]() {
atomic {
call HplPXA27xGPIOPin.setGRERbit[pin](FALSE);
***************
*** 106,110 ****
}
! async command error_t GpioInterrupt.disable[uint8_t pin]() {
atomic {
call HplPXA27xGPIOPin.setGRERbit[pin](FALSE);
--- 107,119 ----
}
! async command error_t HalPXA27xGpioInterrupt.enableBothEdge[uint8_t pin]() {
! atomic {
! call HplPXA27xGPIOPin.setGRERbit[pin](TRUE);
! call HplPXA27xGPIOPin.setGFERbit[pin](TRUE);
! }
! return SUCCESS;
! }
!
! async command error_t HalPXA27xGpioInterrupt.disable[uint8_t pin]() {
atomic {
call HplPXA27xGPIOPin.setGRERbit[pin](FALSE);
***************
*** 115,123 ****
--- 124,150 ----
}
+ async command error_t GpioInterrupt.enableRisingEdge[uint8_t pin]() {
+ return call HalPXA27xGpioInterrupt.enableRisingEdge[pin]();
+ }
+
+ async command error_t GpioInterrupt.enableFallingEdge[uint8_t pin]() {
+ return call HalPXA27xGpioInterrupt.enableFallingEdge[pin]();
+ }
+
+ async command error_t GpioInterrupt.disable[uint8_t pin]() {
+ return call HalPXA27xGpioInterrupt.disable[pin]();
+ }
+
async event void HplPXA27xGPIOPin.interruptGPIOPin[uint8_t pin]() {
call HplPXA27xGPIOPin.clearGEDRbit[pin]();
+ signal HalPXA27xGpioInterrupt.fired[pin]();
signal GpioInterrupt.fired[pin]();
return;
}
+
+
+ default async event void HalPXA27xGpioInterrupt.fired[uint8_t pin]() {
+ return;
+ }
default async event void GpioInterrupt.fired[uint8_t pin]() {
More information about the Tinyos-2-commits
mailing list