]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/tmimsp/tmirws/chips/sht11/OpenDrainP.nc
tmimsp: clean up open drain for sht1x DATA
[tinyos-2.x.git] / tos / platforms / tmimsp / tmirws / chips / sht11 / OpenDrainP.nc
index 9cc2246297ebfbe6a30cf818dc0e5b0c8561c42a..4a8fa075e51ddd14df0402a1718fd0d1e577efc0 100644 (file)
  */
 
 /**
- * Implement an open drain output using a GeneralIO, represented as a
- * GeneralIO.  clr() puts the pin in input mode, simulating open drain and
- * therefore requiring a pull-up on the net.  set() puts the pin in output
- * mode and sinks current by outputting a logic zero.  By definition, the
- * pin wrapped by this component can only be used as an output.
+ * Provide an open drain output as a GeneralIO using a GeneralIO.  set() puts
+ * the pin in high impedance state by selecting the pin input mode.  clr() sets
+ * the pin to sink current to ground by selecting the pin output mode, logic
+ * zero.  Generally, an external pull-up resistor will be used with an open
+ * drain output.
  *
- * TODO: there could be a version of this component that uses the msp430's
- * built-in pull-up resistor...
+ * This pin can only be an open drain output and cannot be reconfigured.
  *
  * @author R. Steve McKown <rsmckown@gmail.com>
  */
@@ -81,17 +80,8 @@ implementation
   }
 
   async command void GeneralIO.makeInput() {}
-
   async command void GeneralIO.makeOutput() {}
-
-  async command bool GeneralIO.isInput()
-  {
-    return FALSE;
-  }
-
-  async command bool GeneralIO.isOutput()
-  {
-    return TRUE;
-  }
+  async command bool GeneralIO.isInput() { return FALSE; }
+  async command bool GeneralIO.isOutput() { return TRUE; }
 }