]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/pins/HplMsp430GeneralIORenP.nc
Fix TMI copyright attributions
[tinyos-2.x.git] / tos / chips / msp430 / pins / HplMsp430GeneralIORenP.nc
index 82cb01486c488326d9695e69f8b6aeca9f1ce83e..bdfa7171be3c288cb15891f34a9718d71f6824ea 100644 (file)
@@ -1,4 +1,7 @@
 /*
+ * Copyright (c) 2000-2005 The Regents of the University of California.
+ * All rights reserved.
+ *
  * Copyright (c) 2008, Titanium Mirror, Inc.
  * All rights reserved.
  *
@@ -10,7 +13,7 @@
  * - 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 Technische Universität Berlin nor the names
+ * - Neither the name of the Titanium Mirror, Inc. nor the names
  *   of its contributors may be used to endorse or promote products derived
  *   from this software without specific prior written permission.
  *
  * (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 R. Steve McKown <smckown@gmail.com>
+
+/**
+ * Modified from the original HplMsp430GeneralIOP to provide resistor enable
+ * support available on some msp430 parts.
+ *
+ * @author R. Steve McKown <rsmckown@gmail.com>
  */
+
 #include "msp430regtypes.h"
 
 generic module HplMsp430GeneralIORenP(
@@ -55,6 +61,8 @@ implementation
   async command void IO.set() { atomic PORTx |= (0x01 << pin); }
   async command void IO.clr() { atomic PORTx &= ~(0x01 << pin); }
   async command void IO.toggle() { atomic PORTx ^= (0x01 << pin); }
+  async command uint8_t IO.getOutRaw() { return PORTx & (0x01 << pin); }
+  async command bool IO.getOut() { return (call IO.getOutRaw() != 0); }
   async command uint8_t IO.getRaw() { return PORTxIN & (0x01 << pin); }
   async command bool IO.get() { return (call IO.getRaw() != 0); }
   async command void IO.makeInput() { atomic PORTxDIR &= ~(0x01 << pin); }
@@ -67,4 +75,5 @@ implementation
   async command bool IO.isIOFunc() { return (PORTxSEL & (0x01<<pin)) == 0; }
   async command void IO.enableRen() { atomic PORTxREN |= (0x01 << pin); }
   async command void IO.disableRen() { atomic PORTxREN &= ~(0x01 << pin); }
+  async command bool IO.isRen() { return PORTxREN = (0x01 << pin) != 0; }
 }