]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/cc1000/CC1000CsmaRadioC.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / chips / cc1000 / CC1000CsmaRadioC.nc
index b5a169c2147669d80227701612b588bbda942c74..a04333660cf7f9073c4a0bb6fe26bcc3a9a5b74c 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id$
+/*
  * "Copyright (c) 2000-2005 The Regents of the University  of California.  
  * All rights reserved.
  *
@@ -44,6 +44,7 @@
  *
  * @author Joe Polastre
  * @author David Gay
+ * @author Marco Langerwisch (Packet timestamping)
  */
 
 #include "CC1000Const.h"
@@ -55,13 +56,17 @@ configuration CC1000CsmaRadioC {
     interface Send;
     interface Receive;
 
-    interface Packet;    
+    interface Packet;
     interface CsmaControl;
     interface CsmaBackoff;
-    interface RadioTimeStamping;
     interface PacketAcknowledgements;
+    interface LinkPacketMetadata;
 
     interface LowPowerListening;
+
+    interface PacketTimeStamp<T32khz, uint32_t> as PacketTimeStamp32khz;
+    interface PacketTimeStamp<TMilli, uint32_t> as PacketTimeStampMilli;
+    interface PacketTimeSyncOffset;
   }
 }
 implementation {
@@ -85,8 +90,8 @@ implementation {
   CsmaControl = Csma;
   CsmaBackoff = Csma;
   LowPowerListening = Csma;
-  RadioTimeStamping = SendReceive;
   PacketAcknowledgements = SendReceive;
+  LinkPacketMetadata = SendReceive;
 
   Csma.CC1000Control -> Control;
   Csma.Random -> RandomC;
@@ -100,7 +105,8 @@ implementation {
   SendReceive.HplCC1000Spi -> Hpl;
   SendReceive.amAddress -> ActiveMessageAddressC;
   SendReceive.RssiRx -> Rssi.Rssi[unique(UQ_CC1000_RSSI)];
-  
+  SendReceive.CC1000Squelch -> Squelch;
+
   Csma.RssiNoiseFloor -> Rssi.Rssi[unique(UQ_CC1000_RSSI)];
   Csma.RssiCheckChannel -> Rssi.Rssi[unique(UQ_CC1000_RSSI)];
   Csma.RssiPulseCheck -> Rssi.Rssi[unique(UQ_CC1000_RSSI)];
@@ -108,6 +114,19 @@ implementation {
   Csma.BusyWait -> BusyWaitMicroC;
 
   Rssi.ActualRssi -> Hpl;
+  Rssi.Resource -> Hpl;
   Control.CC -> Hpl;
   Control.BusyWait -> BusyWaitMicroC;
+
+  PacketTimeStamp32khz = SendReceive;
+  PacketTimeStampMilli = SendReceive;
+  PacketTimeSyncOffset = SendReceive;
+
+  components Counter32khz32C, new CounterToLocalTimeC(T32khz);
+  CounterToLocalTimeC.Counter -> Counter32khz32C;
+  SendReceive.LocalTime32khz -> CounterToLocalTimeC;
+
+  //DummyTimer is introduced to compile apps that use no timers
+  components HilTimerMilliC, new TimerMilliC() as DummyTimer;
+  SendReceive.LocalTimeMilli -> HilTimerMilliC;
 }