X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=doc%2Ftxt%2Ftep109.txt;h=3945ffc6d427dd9ca644d9f0f6ae5f0f80295496;hb=e9bfab607e051bae6afb47b44892ce37541d1b44;hp=cfbc30ba220c2d418e2ea87c2b4ea16091043069;hpb=2d46ff21168a862eee6da8cd4af4a0eb6bde3334;p=tinyos-2.x.git diff --git a/doc/txt/tep109.txt b/doc/txt/tep109.txt index cfbc30ba..3945ffc6 100644 --- a/doc/txt/tep109.txt +++ b/doc/txt/tep109.txt @@ -5,12 +5,9 @@ Sensors and Sensor Boards :TEP: 109 :Group: Core Working Group :Type: Documentary -:Status: Draft +:Status: Final :TinyOS-Version: 2.x -:Author: David Gay, Phil Levis, Wei Hong, Joe Polastre, and Gilman Tolle - -:Draft-Created: 10-Jun-2006 -:Draft-Discuss: TinyOS Developer List +:Author: David Gay, Philip Levis, Wei Hong, Joe Polastre, and Gilman Tolle .. Note:: @@ -207,7 +204,8 @@ A sensor HAL component MAY need to provide: [TEP115]_. - A `Resource` interface for requesting access to the device and - possibly performing automated power management. + possibly performing automated power management, following + the conventions described in [TEP108]_ and [TEP115]_. - Any other interfaces needed to control the device, e.g., to read or write calibration coefficients. @@ -242,6 +240,41 @@ sensor board wishes to define any C types or constants, it SHOULD place these in a file named ``.h`` in the sensor board's directory. +A sensor board MAY contain components that override the default TinyOS +*demo sensors*. This allows the sensor board to easily be used with +TinyOS sample applications that use the demo sensors. If a sensor +board wishes to override the default demo sensor: + +* It MUST provide a generic component named ``DemoSensorC`` with the + following signature:: + + provides interface Read; + provides interface DeviceMetadata; + +* It MAY provide a generic component named ``DemoSensorNowC`` with the + following signature:: + + provides interface ReadNow; + provides interface DeviceMetadata; + + This component SHOULD sample the same sensor as ``DemoSensorC``. + +* It MAY provide a generic component named ``DemoSensorStreamC`` with the + following signature:: + + provides interface ReadStream; + provides interface DeviceMetadata; + + This component SHOULD sample the same sensor as ``DemoSensorC``. + +These components MUST be an alias for one of the sensor board's usual +sensors, though they change the precision of the sensor if necessary. +For instance, if ``DemoSensorC`` is an alias for a 20-bit sensor that +provides a ``Read`` interface, ``DemoSensorC`` would still +provide ``Read`` and would include code to reduce the +precision of the aliased sensor. + + 4.1 Compiler Interaction ------------------------ @@ -359,6 +392,7 @@ of the sensor device. ==================================================================== .. [TEP2] TEP 2: Hardware Abstraction Architecture +.. [TEP108] TEP 108: Resource Arbitration .. [TEP114] TEP 114: SIDs: Source and Sink Indepedent Drivers .. [TEP115] TEP 115: Power Management of Non-Virtualized Devices .. [TEP131] TEP 131: Creating a New Platform for TinyOS 2.x @@ -862,3 +896,41 @@ on top of the I2C or SPI bus would likely require fewer components. signal SplitControl.stopDone( SUCCESS ); } } + +4. MDA100 Sensor Board Directory Organization +--------------------------------------------- + +Here we show the organization of the sensor board directory for the +mica-family Xbow MDA100CA and MDA100CB sensor boards, which have +temperature and light sensors. It is found in +``tos/sensorboards/mda100``:: + + ./tos/sensorboards/mda100: + .sensor # Compiler configuration + ArbitratedPhotoDeviceP.nc # Light sensor support component + ArbitratedTempDeviceP.nc # Temperature sensor support component + DemoSensorC.nc # Override TinyOS's default sensor + PhotoC.nc # Light sensor HIL + PhotoImplP.nc # Light sensor support component + PhotoTempConfigC.nc # Shared support component + PhotoTempConfigP.nc # Shared support component + SharedAnalogDeviceC.nc # Shared support component + SharedAnalogDeviceP.nc # Shared support component + TempC.nc # Temperature Sensor HIL + ca/TempImplP.nc # Temperature sensor support component + # (MDA100CA board) + cb/TempImplP.nc # Temperature sensor support component + # (MDA100CB board) + mda100.h # Header file for mda100 + +This sensor board provides only a HIL (PhotoC and TempC components), and overrides the +TinyOS demo sensor (DemoSensorC). The demo sensor is an alias for PhotoC. + +The two forms of the mda100 differ only by the wiring of the +temperature sensor. The user has to specify which form of the sensor +board is in use by providing a ``-I%T/sensorboards/mda100/ca`` or +``-I%T/sensorboards/mda100/cb`` compiler option. + +This sensor board relies on a platform-provided ``MicaBusC`` component +that specifies how the mica-family sensor board bus is connected to +the microcontroller.