X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=doc%2Fhtml%2Ftep109.html;h=2ff9e4383e7d515baa9f2146375c4e5dac782ff6;hb=843be811b125fd0bb60a470c2687dce7e8398471;hp=d353a66f19039496d826fbcae08daf131bf455a0;hpb=d56750cc1c9423ffd51150040b12d64b6d2cc0d0;p=tinyos-2.x.git diff --git a/doc/html/tep109.html b/doc/html/tep109.html index d353a66f..2ff9e438 100644 --- a/doc/html/tep109.html +++ b/doc/html/tep109.html @@ -3,7 +3,7 @@ - + Sensors and Sensor Boards +

Sensors and Sensor Boards

@@ -306,7 +302,6 @@ ul.auto-toc {
-

Note

This memo documents a part of TinyOS for the TinyOS Community, and @@ -314,15 +309,15 @@ requests discussion and suggestions for improvements. Distribution of this memo is unlimited. This memo is in full compliance with TEP 1.

-
-

Abstract

+
+

Abstract

This memo documents how sensor drivers are organized in TinyOS and how sets of sensor drivers are combined into sensor boards and sensor platforms, along with general principles followed by the components that provide access to sensors.

-
-

1. Principles

+
+

1. Principles

This section describes the basic organization principles for sensor drivers in TinyOS.

For background, a sensor can be attached to the microcontroller on a @@ -374,8 +369,8 @@ the driver MAY provide additional interfaces that would allow higher-level clients to obtain information needed to properly interpret the value.

-
-

2. Sensor HIL Components

+
+

2. Sensor HIL Components

A sensor HIL component MUST provide:

  • One or more SID interfaces [TEP114], for reading data.
  • @@ -467,8 +462,8 @@ implementation { }
-
-

3. Sensor HAL Components

+
+

3. Sensor HAL Components

Sensors with a richer interface than would be supported by the SID interfaces MAY provide a HAL component in addition to a HIL component.

@@ -497,8 +492,8 @@ implementation { }
-
-

4. Directory Organization Guidelines

+
+

4. Directory Organization Guidelines

Because the same physical sensor can be attached to TinyOS platforms in many different ways, the organization of sensor drivers SHOULD reflect the distinction between sensor and sensor interconnect.

@@ -567,8 +562,8 @@ code that will enter the core source tree. In general, sensor components can be placed anywhere as long as the nesC compiler receives enough -I directives to locate all of the necessary pieces.

-
-

5. Authors' Addresses

+
+

5. Authors' Addresses

David Gay
2150 Shattuck Ave, Suite 1300
@@ -611,8 +606,8 @@ receives enough -I directives to locate all of the necessary pieces
-
-

6. Citations

+
+

6. Citations

@@ -632,10 +627,10 @@ receives enough -I directives to locate all of the necessary pieces
-
-

Appendix A: Sensor Driver Examples

-
-

1. Analog ADC-Connected Sensor

+
+

Appendix A: Sensor Driver Examples

+
+

1. Analog ADC-Connected Sensor

The Analog sensor requires two components

  • a component to present the sensor itself (HamamatsuS1087ParC)
  • @@ -696,8 +691,8 @@ implementation { }
-
-

2. Binary Pin-Connected Sensor

+
+

2. Binary Pin-Connected Sensor

The Binary sensor gets a bit more complex, because it has three components:

    @@ -737,7 +732,7 @@ module UserButtonLogicP { provides interface DeviceMetadata; uses interface GeneralIO; - uses interface GpioInterrupt; + uses interface GpioInterrupt; } implementation { norace bool m_pinHigh; @@ -773,9 +768,9 @@ implementation { task void sendEvent() { bool pinHigh; pinHigh = m_pinHigh; - + signal Notify.notify( pinHigh ); - + if ( pinHigh ) { call GpioInterrupt.enableFallingEdge(); } else { @@ -809,8 +804,8 @@ implementation { }
-
-

3. Digital Bus-Connected Sensor

+
+

3. Digital Bus-Connected Sensor

The Digital sensor is the most complex out of the set, and includes six components:

    @@ -833,7 +828,7 @@ on top of the I2C or SPI bus would likely require fewer components.

     tos/platforms/telosa/chips/sht11/SensirionSht11C.nc
     
    -generic configuration SensirionSht11C() {  
    +generic configuration SensirionSht11C() {
       provides interface Read<uint16_t> as Temperature;
       provides interface DeviceMetadata as TemperatureDeviceMetadata;
       provides interface Read<uint16_t> as Humidity;
    @@ -866,7 +861,7 @@ generic module SensirionSht11ReaderP() {
       provides interface DeviceMetadata as TemperatureDeviceMetadata;
       provides interface Read<uint16_t> as Humidity;
       provides interface DeviceMetadata as HumidityDeviceMetadata;
    -  
    +
       uses interface Resource as TempResource;
       uses interface Resource as HumResource;
       uses interface SensirionSht11 as Sht11Temp;
    @@ -943,7 +938,7 @@ implementation {
       SensirionSht11LogicP.DATA -> HplSensirionSht11C.DATA;
       SensirionSht11LogicP.CLOCK -> HplSensirionSht11C.SCK;
       SensirionSht11LogicP.InterruptDATA -> HplSensirionSht11C.InterruptDATA;
    -  
    +
       components new TimerMilliC();
       SensirionSht11LogicP.Timer -> TimerMilliC;
     
    @@ -982,7 +977,7 @@ configuration HplSensirionSht11C {
     }
     implementation {
       components HplMsp430GeneralIOC;
    -  
    +
       components new Msp430GpioC() as DATAM;
       DATAM -> HplMsp430GeneralIOC.Port15;
       DATA = DATAM;
    @@ -1009,7 +1004,7 @@ implementation {
     
       components new FcfsArbiterC( "Sht11.Resource" ) as Arbiter;
       Resource = Arbiter;
    -  
    +
       components new SplitControlPowerManagerC();
       SplitControlPowerManagerC.SplitControl -> HplSensirionSht11P;
       SplitControlPowerManagerC.ArbiterInit -> Arbiter.Init;
    @@ -1036,7 +1031,7 @@ implementation {
         call Timer.startOneShot( 11 );
         return SUCCESS;
       }
    -  
    +
       event void Timer.fired() {
         signal SplitControl.startDone( SUCCESS );
       }