]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/pins/HplMsp430GeneralIOP.nc
Merge over into the trunk.
[tinyos-2.x.git] / tos / chips / msp430 / pins / HplMsp430GeneralIOP.nc
index b683b74370ba196c4f5cb358eb1b37354e9b6e8a..b532f812fcd8ddb33bf5a29d50d84fb7a79e1b91 100644 (file)
@@ -48,7 +48,11 @@ implementation
   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); }
+  async command bool IO.isInput() { return (PORTxDIR & (0x01 << pin)) == 0; }
   async command void IO.makeOutput() { atomic PORTxDIR |= (0x01 << pin); }
+  async command bool IO.isOutput() { return (PORTxDIR & (0x01 << pin)) != 0; }
   async command void IO.selectModuleFunc() { atomic PORTxSEL |= (0x01 << pin); }
+  async command bool IO.isModuleFunc() { return (PORTxSEL & (0x01<<pin)) != 0; }
   async command void IO.selectIOFunc() { atomic PORTxSEL &= ~(0x01 << pin); }
+  async command bool IO.isIOFunc() { return (PORTxSEL & (0x01<<pin)) == 0; }
 }