]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - doc/txt/tep114.txt
Evceventm not command
[tinyos-2.x.git] / doc / txt / tep114.txt
index da4e68c7297535d656d606dad88290f9383403e3..407cb40d98d6a90fb109139ac7bd786530974928 100644 (file)
@@ -62,13 +62,13 @@ Additionally, not all sensors require ADC conversions from the MCU.
 Many sensors today are digital. To sample these sensors, the MCU sends
 a sample command and receives the corresponding data over a bus (e.g.,
 SPI, I2C). The latency involved, combined with possible Resource
-arbitration [_tep108], means that these bus operations are often
+arbitration [1]_, means that these bus operations are often
 synchronous code. In the command direction, this can force a task
 allocation to convert async to sync; in the event direction, the
 application has to deal with async code even though the event is, in
 practice, in a task.
 
-Finallly, the simplicity of the ADC interface has led many sensors to
+Finally, the simplicity of the ADC interface has led many sensors to
 introduce several new ones for calibration and control, such as
 ``Mic`` and ``MagSetting``. Because ADCs generally do not have error
 conditions, the ADC interface has no way to signal that a sample
@@ -137,6 +137,13 @@ If the ``result`` parameter of the ``Read.readDone`` and
 ``ReadWrite.readDone`` events is not SUCCESS, then the memory of the
 ``val`` parameter MUST be filled with zeroes.
 
+If the call to ``Read.read`` has returned SUCCESS, but the
+``Read.readDone`` event has not yet been signalled, then a subsequent
+call to ``Read.read`` MUST not return SUCCESS. This simple locking
+technique, as opposed to a more complex system in which multiple
+read/readDone pairs may be outstanding, is intended to reduce the
+complexity of code that is a client of a SID interface.
+
 Examples of sensors that would be suited to this class of interface
 include many basic sensors, such as photo, temp, voltage, and ADC
 readings.
@@ -190,30 +197,6 @@ those that generate multiple simultaneous readings for which
 passing by value is inefficient, such as a two-axis digital 
 accelerometer.
 
-3.3 Metadata and Shifting
---------------------------------------------------------------------
-
-Generally, simple types are made up of octets. However, sensor values
-often have levels of precision besides a multiple of 8. Any value
-contained in a simple type MUST be left shifted so that it covers as
-much of the type's range as possible. For example, if a 12-bit ADC
-reading is presented as a 16-bit Read interface::
-
-  component DemoSensorC {
-    provides interface Read<uint16_t>;
-  }
-
-then the 12-bit value MUST be shifted left so that its range is 0x0000
-- 0xfff0, rather than 0x0000 - 0x0fff. A device MAY specify the
-precision of one of its interfaces with the DeviceMetadata interface::
-
-  interface DeviceMetadata {
-    command uint8_t getSignificantBits();
-  }
-
-The name of the instance of DeviceMetadata SHOULD clearly indicate
-which interface it corresponds to.
-
 3.4 Single-Phase Scalar I/O
 --------------------------------------------------------------------
 
@@ -391,3 +374,8 @@ connect a sensor into a more general system.
 | email - david.e.gay@intel.com
 |
 
+6. Citations
+============================================================================
+
+.. [1] TEP 108: Resource Arbitration.
+