]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
sneak in eui-64 driver for epic. this is a tiny amount of code :)
authorsdhsdh <sdhsdh>
Tue, 23 Feb 2010 06:45:38 +0000 (06:45 +0000)
committersdhsdh <sdhsdh>
Tue, 23 Feb 2010 06:45:38 +0000 (06:45 +0000)
tos/platforms/epic/.platform
tos/platforms/epic/MotePlatformC.nc
tos/platforms/epic/chips/ds2411/CachedIeeeEui64C.nc [new file with mode: 0644]
tos/platforms/epic/chips/ds2411/LocalIeeeEui64C.nc [new file with mode: 0644]
tos/platforms/epic/chips/ds2411/PlatformIeeeEui64.h [new file with mode: 0644]

index ff94acc039b45708ad702b4094c26b560b88fce8..49ae20554e5be92a260d2b11c3b14bf8be1cd7c1 100644 (file)
@@ -11,6 +11,7 @@ push( @includes, qw(
 
   %T/platforms/epic
   %T/platforms/epic/chips/at45db
+  %T/platforms/epic/chips/ds2411
   %T/platforms/telosa
   %T/platforms/telosa/chips/cc2420
   %T/chips/cc2420
@@ -35,6 +36,7 @@ push( @includes, qw(
   %T/chips/msp430/usart
   %T/chips/msp430/sensors
   %T/chips/at45db
+  %T/chips/ds2401
   %T/lib/timer
   %T/lib/serial
   %T/lib/adc
index 5636b321bc3b84fdec4f4e0f4030e2b961a12fe2..43ea3fbe3afd77750b14d2d6f81c6d49db0ab49d 100644 (file)
@@ -1,5 +1,6 @@
 module MotePlatformC @safe() {
   provides interface Init;
+  uses interface Init as SubInit;
 }
 implementation {
 
@@ -40,6 +41,8 @@ implementation {
        // directions using the TOSH_SET/CLR macros
 
       }//atomic
-    return SUCCESS;
+    return call SubInit.init();
   }
+
+ default command error_t SubInit.init() { return SUCCESS; }
 }
diff --git a/tos/platforms/epic/chips/ds2411/CachedIeeeEui64C.nc b/tos/platforms/epic/chips/ds2411/CachedIeeeEui64C.nc
new file mode 100644 (file)
index 0000000..0a61b1e
--- /dev/null
@@ -0,0 +1,40 @@
+// $Id$
+/*
+ * Copyright (c) 2007, Vanderbilt University
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose, without fee, and without written agreement is
+ * hereby granted, provided that the above copyright notice, the following
+ * two paragraphs and the author appear in all copies of this software.
+ *
+ * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
+ * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Author: Janos Sallai
+ */
+
+/**
+ * Cache an EUI 64 at initialization time and return the cached value for
+ * subsequent queries.
+ */
+configuration CachedIeeeEui64C {
+  uses interface LocalIeeeEui64 as SubIeeeEui64;
+  provides interface LocalIeeeEui64;
+} implementation {
+  components CachedIeeeEui64P, MotePlatformC;
+
+  MotePlatformC.SubInit -> CachedIeeeEui64P.Init;
+
+  SubIeeeEui64 = CachedIeeeEui64P;
+  LocalIeeeEui64 = CachedIeeeEui64P;
+
+}
diff --git a/tos/platforms/epic/chips/ds2411/LocalIeeeEui64C.nc b/tos/platforms/epic/chips/ds2411/LocalIeeeEui64C.nc
new file mode 100644 (file)
index 0000000..cfee46f
--- /dev/null
@@ -0,0 +1,45 @@
+// $Id$
+/*
+ * Copyright (c) 2007, Vanderbilt University
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose, without fee, and without written agreement is
+ * hereby granted, provided that the above copyright notice, the following
+ * two paragraphs and the author appear in all copies of this software.
+ *
+ * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
+ * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Author: Janos Sallai
+ * Epic port by Stephen Dawson-Haggerty <stevedh@eecs.berkeley.edu>
+ */
+
+configuration LocalIeeeEui64C {
+  provides interface LocalIeeeEui64;
+} implementation {
+  components
+    OneWireMasterC as OneWireC,
+    HplDs2401C,
+    BusyWaitMicroC,
+    HplMsp430GeneralIOC, new Msp430GpioC(),
+    Ds2401ToIeeeEui64C,
+    CachedIeeeEui64C;
+
+  Msp430GpioC.HplGeneralIO -> HplMsp430GeneralIOC.Port24;
+  OneWireC.Pin -> Msp430GpioC;
+
+  OneWireC.BusyWaitMicro -> BusyWaitMicroC.BusyWait;
+  HplDs2401C.OneWire -> OneWireC;
+  Ds2401ToIeeeEui64C.Hpl -> HplDs2401C;
+  CachedIeeeEui64C.SubIeeeEui64 -> Ds2401ToIeeeEui64C;
+  LocalIeeeEui64 = CachedIeeeEui64C;
+}
diff --git a/tos/platforms/epic/chips/ds2411/PlatformIeeeEui64.h b/tos/platforms/epic/chips/ds2411/PlatformIeeeEui64.h
new file mode 100644 (file)
index 0000000..54f9849
--- /dev/null
@@ -0,0 +1,37 @@
+// $Id$
+/*
+ * Copyright (c) 2007, Vanderbilt University
+ * All rights reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose, without fee, and without written agreement is
+ * hereby granted, provided that the above copyright notice, the following
+ * two paragraphs and the author appear in all copies of this software.
+ *
+ * IN NO EVENT SHALL THE VANDERBILT UNIVERSITY BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
+ * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE VANDERBILT
+ * UNIVERSITY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THE VANDERBILT UNIVERSITY SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE VANDERBILT UNIVERSITY HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Author: Janos Sallai
+ * <stevedh@eecs.berkeley.edu> changes for Epic
+ */
+
+#ifndef PLATFORMIEEEEUI64_H
+#define PLATFORMIEEEEUI64_H
+enum {
+  IEEE_EUI64_COMPANY_ID_0 = 'U',
+  IEEE_EUI64_COMPANY_ID_1 = 'C',
+  IEEE_EUI64_COMPANY_ID_2 = 'B',
+  IEEE_EUI64_SERIAL_ID_0 = 'E',
+  IEEE_EUI64_SERIAL_ID_1 = 'P',
+};
+
+#endif // PLATFORMIEEEEUI64_H