[Tinyos-beta-commits] CVS: tinyos-1.x/beta/platform/tsb Potentiometer.nc, NONE, 1.1 TSBInterrupt.nc, NONE, 1.1 AccelDriverC.nc, 1.1, 1.2 AccelDriverM.nc, 1.1, 1.2 sensorboard.h, 1.1, 1.2 AccelInterrupt.nc, 1.1, NONE

Joe Polastre jpolastre at users.sourceforge.net
Thu Mar 10 20:23:56 PST 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/platform/tsb
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17290

Modified Files:
	AccelDriverC.nc AccelDriverM.nc sensorboard.h 
Added Files:
	Potentiometer.nc TSBInterrupt.nc 
Removed Files:
	AccelInterrupt.nc 
Log Message:
updates to the interfaces to apply more generally to sensors on the tsb
AccelInterrupt now becomes TSBInterrupt so that it is shared across multiple
sensors.  Setting the accel interrupt threshold is now through interface
Potentiometer since it can be used with the other sensors as well 
that are under development.  


--- NEW FILE: Potentiometer.nc ---
// $Id: Potentiometer.nc,v 1.1 2005/03/11 04:23:54 jpolastre Exp $
/*
 * "Copyright (c) 2000-2005 The Regents of the University  of California.
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 *
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 */

/**
 * @author Joe Polastre
 * Revision:  $Revision: 1.1 $
 *
 */
interface Potentiometer {
  command result_t set(uint8_t value);
  event void setDone(uint8_t value, result_t result);
  command uint8_t get();
}

--- NEW FILE: TSBInterrupt.nc ---
// $Id: TSBInterrupt.nc,v 1.1 2005/03/11 04:23:54 jpolastre Exp $
/*
 * "Copyright (c) 2000-2005 The Regents of the University  of California.
 * All rights reserved.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation for any purpose, without fee, and without written agreement is
 * hereby granted, provided that the above copyright notice, the following
 * two paragraphs and the author appear in all copies of this software.
 *
 * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
 * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
 * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
 * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
 */

/**
 * @author Joe Polastre
 * Revision:  $Revision: 1.1 $
 *
 */
interface TSBInterrupt {
  async command result_t enable();
  async command result_t disable();

  async event void fired();
}

Index: AccelDriverC.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/tsb/AccelDriverC.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AccelDriverC.nc	22 Feb 2005 01:24:40 -0000	1.1
--- AccelDriverC.nc	11 Mar 2005 04:23:53 -0000	1.2
***************
*** 36,40 ****
      interface ADC as AccelX;
      interface ADC as AccelY;
!     interface AccelInterrupt;
    }
  }
--- 36,41 ----
      interface ADC as AccelX;
      interface ADC as AccelY;
!     interface TSBInterrupt as AccelInterrupt;
!     interface Potentiometer as AccelInterruptSettings;
    }
  }
***************
*** 49,52 ****
--- 50,54 ----
    AccelY = ADCC.ADC[TOS_ADC_ACCELY_PORT];
    AccelInterrupt = AccelDriverM;
+   AccelInterruptSettings = AccelDriverM;
  
    AccelDriverM.ADCStdControl -> ADCC;

Index: AccelDriverM.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/tsb/AccelDriverM.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** AccelDriverM.nc	22 Feb 2005 01:24:40 -0000	1.1
--- AccelDriverM.nc	11 Mar 2005 04:23:54 -0000	1.2
***************
*** 33,37 ****
    provides {
      interface SplitControl;
!     interface AccelInterrupt;
    }
    uses {
--- 33,38 ----
    provides {
      interface SplitControl;
!     interface TSBInterrupt as AccelInterrupt;
!     interface Potentiometer as AccelInterruptSettings;
    }
    uses {
***************
*** 167,171 ****
  
      if (_state == GAIN) {
!       signal AccelInterrupt.setDone(gain, _result);
      }
    }
--- 168,172 ----
  
      if (_state == GAIN) {
!       signal AccelInterruptSettings.setDone(gain, _result);
      }
    }
***************
*** 188,192 ****
    }
  
!   command result_t AccelInterrupt.set(uint8_t _gain) {
      uint8_t _state = OFF;
      atomic {
--- 189,193 ----
    }
  
!   command result_t AccelInterruptSettings.set(uint8_t _gain) {
      uint8_t _state = OFF;
      atomic {
***************
*** 203,209 ****
    }
  
!   default event void AccelInterrupt.setDone(uint8_t _gain, result_t _result) { }
  
!   command uint8_t AccelInterrupt.get() {
      return gain;
    }
--- 204,210 ----
    }
  
!   default event void AccelInterruptSettings.setDone(uint8_t _gain, result_t _result) { }
  
!   command uint8_t AccelInterruptSettings.get() {
      return gain;
    }

Index: sensorboard.h
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/beta/platform/tsb/sensorboard.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** sensorboard.h	22 Feb 2005 01:24:41 -0000	1.1
--- sensorboard.h	11 Mar 2005 04:23:54 -0000	1.2
***************
*** 10,12 ****
--- 10,15 ----
  TOSH_ASSIGN_PIN(ACCEL_INT, 2, 3);
  
+ // Microphone interrupt pin
+ TOSH_ASSIGN_PIN(MIC_INT, 2, 6);
+ 
  #endif

--- AccelInterrupt.nc DELETED ---



More information about the Tinyos-beta-commits mailing list