[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/handhelds/tos/interfaces PowerSupplyMonitor.h, NONE, 1.1 PowerSupplyMonitor.nc, NONE, 1.1

steve ayer ayer1 at users.sourceforge.net
Thu May 3 10:47:36 PDT 2007


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/tos/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv17632

Added Files:
	PowerSupplyMonitor.h PowerSupplyMonitor.nc 
Log Message:

interface for msp430 powersupplymonitor module, and supporting header
file


--- NEW FILE: PowerSupplyMonitor.h ---
/*
 * Copyright (c) 2007, Intel 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 Intel 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 COPYRIGHT OWNER OR 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.
 *
 * Author:  Steve Ayer
 *          March, 2007
 *
 * enum to set svs thresholds, presumably more meaningful than "vld_n"?
 */

// as in 1.9v, 2.1v, etc.
enum {
  OFF,
  ONE_9V =  VLD_1,    
  TWO_1V =  VLD_2,
  TWO_2V =  VLD_3,
  TWO_3V =  VLD_4,
  TWO_4V =  VLD_5,
  TWO_5V =  VLD_6,
  TWO_65V = VLD_7,
  TWO_8V =  VLD_8,
  TWO_9V =  VLD_9,
  THREE_05V = VLD_10,
  THREE_2V =  VLD_11,
  THREE_35V = VLD_12,
  THREE_5V =  VLD_13,
  THREE_7V =  VLD_14,
  EXTERNAL =  VLD_EXT
};

--- NEW FILE: PowerSupplyMonitor.nc ---
/*
 * Copyright (c) 2007, Intel 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 Intel 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 COPYRIGHT OWNER OR 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.
 *
 * Author:  Steve Ayer
 *          March, 2007
 *
 * simple interface to msp430 supply voltage supervisor register
 */

interface PowerSupplyMonitor{

  command void resetOnLowVoltage(bool reset);

  /* enum in PowerSupplyVoltage.h */
  command void setVoltageThreshold(uint8_t threshold);

  /* polling for low voltage condtion */
  command result_t setMonitorInterval(uint32_t interval_ms);

  command result_t stopVoltageMonitor();

  command result_t isSupplyMonitorEnabled();

  /* manual query */
  command result_t queryLowVoltageCondition();

  /* flag is immediately reset unless power problem is remedied */
  command void clearLowVoltageCondition();

  command result_t disable();

  /* triggered by polling mechanism */
  event result_t voltageThresholdReached(uint8_t t);
}



More information about the Tinyos-contrib-commits mailing list