]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Add tosthreads support for Epic platform
authorliang_mike <liang_mike>
Mon, 11 Jan 2010 04:48:39 +0000 (04:48 +0000)
committerliang_mike <liang_mike>
Mon, 11 Jan 2010 04:48:39 +0000 (04:48 +0000)
support/make/threads.extra
tos/lib/tosthreads/platforms/epic/ActiveMessageC.nc [new file with mode: 0644]
tos/lib/tosthreads/platforms/epic/TelosSerialP.nc [new file with mode: 0644]

index 17adba170ea7342e7e39a0c9c8b0ea47a691f783..b39a734fa9889104abb236e10ecd43c12975cd7a 100644 (file)
@@ -77,6 +77,9 @@ THREADS_EYES_INCLUDE_DIRS = -I$(TOS_THREADS_DIR)/platforms/eyesIFX
 #Shimmer specific include directories
 THREADS_SHIMMER_INCLUDE_DIRS = -I$(TOS_THREADS_DIR)/platforms/shimmer
 
+#Epic specific include directories
+THREADS_EPIC_INCLUDE_DIRS = -I$(TOS_THREADS_DIR)/platforms/epic
+
 #Add CFLAGS for supported platforms
 ifneq ($(filter telos telosa telosb tmote,$(MAKECMDGOALS)),)
   CFLAGS += $(THREADS_MSP430_INCLUDE_DIRS)
@@ -89,6 +92,11 @@ ifneq ($(filter telos telosa telosb tmote,$(MAKECMDGOALS)),)
     CFLAGS += -DPLATFORM_TELOSB
   endif
 endif
+ifneq ($(filter epic,$(MAKECMDGOALS)),)
+  CFLAGS += $(THREADS_MSP430_INCLUDE_DIRS)
+  CFLAGS += $(THREADS_CC2420_INCLUDE_DIRS)
+  CFLAGS += $(THREADS_EPIC_INCLUDE_DIRS)
+endif
 ifneq ($(filter mica2,$(MAKECMDGOALS)),)
   CFLAGS += $(THREADS_ATM128_INCLUDE_DIRS)
   CFLAGS += $(THREADS_CC1000_INCLUDE_DIRS)
diff --git a/tos/lib/tosthreads/platforms/epic/ActiveMessageC.nc b/tos/lib/tosthreads/platforms/epic/ActiveMessageC.nc
new file mode 100644 (file)
index 0000000..816f8b6
--- /dev/null
@@ -0,0 +1,82 @@
+// $Id$
+
+/*
+ * "Copyright (c) 2004-2005 The Regents of the University  of California.  
+ * 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 UNIVERSITY OF CALIFORNIA 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 UNIVERSITY OF
+ * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * 
+ * THE UNIVERSITY OF CALIFORNIA 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 UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS."
+ *
+ * Copyright (c) 2004-2005 Intel Corporation
+ * All rights reserved.
+ *
+ * This file is distributed under the terms in the attached INTEL-LICENSE     
+ * file. If you do not find these files, copies can be found by writing to
+ * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA, 
+ * 94704.  Attention:  Intel License Inquiry.
+ */
+/*
+ *
+ * Authors:            Philip Levis
+ * Date last modified:  $Id$
+ *
+ */
+
+/**
+ *
+ * The Active Message layer on the Telos platform. This is a naming wrapper
+ * around the CC2420 Active Message layer.
+ *
+ * @author Philip Levis
+ * @version $Revision$ $Date$
+ */
+#include "Timer.h"
+
+configuration ActiveMessageC {
+  provides {
+    interface SplitControl;
+
+    interface AMSend[am_id_t id];
+    interface Receive[am_id_t id];
+    interface Receive as ReceiveDefault[am_id_t id];
+    interface Receive as Snoop[am_id_t id];
+    interface Receive as SnoopDefault[am_id_t id];
+
+    interface Packet;
+    interface AMPacket;
+    interface PacketAcknowledgements;
+    interface PacketTimeStamp<T32khz, uint32_t> as PacketTimeStamp32khz;
+    interface PacketTimeStamp<TMilli, uint32_t> as PacketTimeStampMilli;
+  }
+}
+implementation {
+  components CC2420ActiveMessageC as AM;
+
+  SplitControl = AM;
+  
+  AMSend       = AM;
+  Receive      = AM.Receive;
+  ReceiveDefault = AM.ReceiveDefault;
+  Snoop        = AM.Snoop;
+  SnoopDefault = AM.SnoopDefault;
+  Packet       = AM;
+  AMPacket     = AM;
+  PacketAcknowledgements = AM;
+
+  components CC2420PacketC;
+  PacketTimeStamp32khz = CC2420PacketC;
+  PacketTimeStampMilli = CC2420PacketC;
+}
diff --git a/tos/lib/tosthreads/platforms/epic/TelosSerialP.nc b/tos/lib/tosthreads/platforms/epic/TelosSerialP.nc
new file mode 100644 (file)
index 0000000..fcfc91d
--- /dev/null
@@ -0,0 +1,23 @@
+module TelosSerialP {
+  provides interface StdControl;
+  provides interface Msp430UartConfigure;
+  uses interface Resource;
+}
+implementation {
+  
+  msp430_uart_union_config_t msp430_uart_telos_config = { {ubr: UBR_1MHZ_57600, umctl: UMCTL_1MHZ_57600, ssel: 0x02, pena: 0, pev: 0, spb: 0, clen: 1, listen: 0, mm: 0, ckpl: 0, urxse: 0, urxeie: 1, urxwie: 0, utxe : 1, urxe : 1} };
+
+  command error_t StdControl.start(){
+    return call Resource.immediateRequest();
+  }
+  command error_t StdControl.stop(){
+    call Resource.release();
+    return SUCCESS;
+  }
+  event void Resource.granted(){}
+
+  async command msp430_uart_union_config_t* Msp430UartConfigure.getConfig() {
+    return &msp430_uart_telos_config;
+  }
+  
+}