]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/pins/HplMsp430GeneralIORenP.nc
Add getOut() and getOutRaw() methods. get() and getRaw() work off PORTxIN.
[tinyos-2.x.git] / tos / chips / msp430 / pins / HplMsp430GeneralIORenP.nc
index 82cb01486c488326d9695e69f8b6aeca9f1ce83e..e799bcd627af8cab408d34c3543ee9ec5dcffc39 100644 (file)
@@ -55,6 +55,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 +69,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 void IO.isRen() { return PORTxREN = (0x01 << pin) != 0; }
 }