--- /dev/null
+# SHIMMER - platform includes
+# Konrad Lorincz 5/14/08
+#
+# Includes that should take precedence come first. Platforms come before
+# chips because they may override files. These must be specified as
+# @includes instead of -I's to @opts, otherwise the %T won't be processed
+# by ncc.
+
+push( @includes, qw(
+
+ %T/platforms/shimmer
+ %T/platforms/shimmer/chips/cc2420
+ %T/chips/cc2420
+ %T/chips/cc2420/alarm
+ %T/chips/cc2420/control
+ %T/chips/cc2420/csma
+ %T/chips/cc2420/interfaces
+ %T/chips/cc2420/link
+ %T/chips/cc2420/lowpan
+ %T/chips/cc2420/lpl
+ %T/chips/cc2420/packet
+ %T/chips/cc2420/receive
+ %T/chips/cc2420/spi
+ %T/chips/cc2420/transmit
+ %T/chips/cc2420/unique
+ %T/chips/msp430
+ %T/chips/msp430/adc12
+ %T/chips/msp430/dma
+ %T/chips/msp430/pins
+ %T/chips/msp430/timer
+ %T/chips/msp430/usart
+ %T/chips/msp430/sensors
+ %T/lib/timer
+ %T/lib/serial
+ %T/lib/adc
+ %T/lib/power
+ ) );
+
+@opts = qw(
+
+ -gcc=msp430-gcc
+ -mmcu=msp430x1611
+ -fnesc-target=msp430
+ -fnesc-no-debug
+);
+
+push @opts, "-fnesc-scheduler=TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask" if !$with_scheduler_flag;
+push @opts, "-mingw-gcc" if $cygwin;
--- /dev/null
+// $Id$
+
+/* tab:4
+ * "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 SHIMER platform. This is a naming wrapper
+ * around the CC2420 Active Message layer.
+ *
+ * @author Konrad Lorincz
+ */
+
+configuration ActiveMessageC {
+ provides {
+ interface SplitControl;
+
+ interface AMSend[uint8_t id];
+ interface Receive[uint8_t id];
+ interface Receive as Snoop[uint8_t id];
+
+ interface Packet;
+ interface AMPacket;
+ interface PacketAcknowledgements;
+ }
+}
+implementation {
+ components CC2420ActiveMessageC as AM;
+
+ SplitControl = AM;
+
+ AMSend = AM;
+ Receive = AM.Receive;
+ Snoop = AM.Snoop;
+ Packet = AM;
+ AMPacket = AM;
+ PacketAcknowledgements = AM;
+}
--- /dev/null
+/*
+ * Copyright (c) 2005-2006 Arch Rock Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ * - Neither the name of the Arch Rock Corporation nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE
+ */
+
+/**
+ * DemoSensorC is a generic sensor device that provides a 16-bit
+ * value. The platform author chooses which sensor actually sits
+ * behind DemoSensorC, and though it's probably Voltage, Light, or
+ * Temperature, there are no guarantees.
+ *
+ * This particular DemoSensorC on the telosb platform provides a
+ * voltage reading, using VoltageC.
+ *
+ * To convert from ADC counts to actual voltage, divide this reading
+ * by 4096 and multiply by 3.
+ *
+ * @author Gilman Tolle <gtolle@archrock.com>
+ * @version $Revision$ $Date$
+ *
+ */
+
+generic configuration DemoSensorC()
+{
+ provides interface Read<uint16_t>;
+}
+implementation
+{
+ components new VoltageC() as DemoSensor;
+ Read = DemoSensor;
+}
--- /dev/null
+/*
+ * Copyright (c) 2007, Technische Universitaet Berlin
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * - Neither the name of the Technische Universität Berlin nor the names
+ * of its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id$
+ *
+ */
+
+ /**
+ * @author Vlado Handziski <handzisk@tkn.tu-berlind.de>
+ */
+
+configuration MoteClockC
+{
+ provides interface Init as MoteClockInit;
+}
+implementation
+
+{
+ components Msp430ClockC;
+
+ MoteClockInit = Msp430ClockC.Init;
+}
--- /dev/null
+module MotePlatformC {
+ provides interface Init;
+}
+implementation {
+ command error_t Init.init() {
+ //LEDS
+ TOSH_SET_RED_LED_PIN();
+ TOSH_SET_GREEN_LED_PIN();
+ TOSH_SET_YELLOW_LED_PIN();
+ TOSH_MAKE_RED_LED_OUTPUT();
+ TOSH_MAKE_GREEN_LED_OUTPUT();
+ TOSH_MAKE_YELLOW_LED_OUTPUT();
+
+ //RADIO PINS
+ //CC2420 pins
+ TOSH_MAKE_SOMI0_INPUT();
+ TOSH_MAKE_SIMO0_INPUT();
+ TOSH_MAKE_UCLK0_INPUT();
+ TOSH_MAKE_SOMI1_INPUT();
+ TOSH_MAKE_SIMO1_INPUT();
+ TOSH_MAKE_UCLK1_INPUT();
+ TOSH_SET_RADIO_RESET_PIN();
+ TOSH_MAKE_RADIO_RESET_OUTPUT();
+ TOSH_CLR_RADIO_VREF_PIN();
+ TOSH_MAKE_RADIO_VREF_OUTPUT();
+ TOSH_SET_RADIO_CSN_PIN();
+ TOSH_MAKE_RADIO_CSN_OUTPUT();
+ TOSH_MAKE_RADIO_FIFOP_INPUT();
+ TOSH_MAKE_RADIO_SFD_INPUT();
+
+ TOSH_MAKE_RADIO_1V8_EN_OUTPUT();
+ TOSH_SEL_RADIO_1V8_EN_IOFUNC();
+ TOSH_CLR_RADIO_1V8_EN_PIN();
+
+ TOSH_MAKE_CSN_OUTPUT();
+ TOSH_SEL_CSN_IOFUNC();
+ TOSH_SET_CSN_PIN();
+
+
+ //UART PINS
+ TOSH_MAKE_UTXD0_INPUT();
+ TOSH_MAKE_URXD0_INPUT();
+ TOSH_MAKE_UTXD1_INPUT();
+ TOSH_MAKE_URXD1_INPUT();
+
+ return SUCCESS;
+ }
+}
--- /dev/null
+//$Id$
+
+/* "Copyright (c) 2000-2003 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."
+ */
+
+/**
+ * MSP430Timer32khzMapC presents as paramaterized interfaces all of
+ * the 32khz hardware timers on the MSP430 that are available for
+ * compile time allocation by "new Alarm32khz16C()", "new
+ * AlarmMilli32C()", and so on.
+ *
+ * Platforms based on the MSP430 are * encouraged to copy in and
+ * override this file, presenting only the * hardware timers that are
+ * available for allocation on that platform.
+ *
+ * @author Cory Sharp <cssharp@eecs.berkeley.edu>
+ * @version $Revision$ $Date$
+ */
+
+configuration Msp430Timer32khzMapC
+{
+ provides interface Msp430Timer[ uint8_t id ];
+ provides interface Msp430TimerControl[ uint8_t id ];
+ provides interface Msp430Compare[ uint8_t id ];
+}
+implementation
+{
+ components Msp430TimerC;
+
+ Msp430Timer[0] = Msp430TimerC.TimerB;
+ Msp430TimerControl[0] = Msp430TimerC.ControlB0;
+ Msp430Compare[0] = Msp430TimerC.CompareB0;
+
+ // Timer pin B1 is used by the CC2420 radio's SFD pin
+ // this is the only difference between the default 32khz map
+ // and the map on telos
+
+ Msp430Timer[1] = Msp430TimerC.TimerB;
+ Msp430TimerControl[1] = Msp430TimerC.ControlB2;
+ Msp430Compare[1] = Msp430TimerC.CompareB2;
+
+ Msp430Timer[2] = Msp430TimerC.TimerB;
+ Msp430TimerControl[2] = Msp430TimerC.ControlB3;
+ Msp430Compare[2] = Msp430TimerC.CompareB3;
+
+ Msp430Timer[3] = Msp430TimerC.TimerB;
+ Msp430TimerControl[3] = Msp430TimerC.ControlB4;
+ Msp430Compare[3] = Msp430TimerC.CompareB4;
+
+ Msp430Timer[4] = Msp430TimerC.TimerB;
+ Msp430TimerControl[4] = Msp430TimerC.ControlB5;
+ Msp430Compare[4] = Msp430TimerC.CompareB5;
+
+ Msp430Timer[5] = Msp430TimerC.TimerB;
+ Msp430TimerControl[5] = Msp430TimerC.ControlB6;
+ Msp430Compare[5] = Msp430TimerC.CompareB6;
+}
+
--- /dev/null
+/* "Copyright (c) 2000-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."
+ */
+
+/**
+ * @author Joe Polastre and Cory Sharp
+ * @version $Revision$ $Date$
+ */
+#include "hardware.h"
+
+configuration PlatformC
+{
+ provides interface Init;
+}
+implementation
+{
+ components PlatformP, MotePlatformC, MoteClockC;
+
+ Init = PlatformP;
+ PlatformP.MoteClockInit -> MoteClockC;
+ PlatformP.MoteInit -> MotePlatformC;
+}
--- /dev/null
+// $Id$
+
+/* "Copyright (c) 2000-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."
+ */
+
+/**
+ * @author Joe Polastre
+ * @version $Revision$ $Date$
+ */
+#include "hardware.h"
+
+configuration PlatformLedsC {
+ provides interface GeneralIO as Led0;
+ provides interface GeneralIO as Led1;
+ provides interface GeneralIO as Led2;
+ uses interface Init;
+}
+implementation
+{
+ components
+ HplMsp430GeneralIOC as GeneralIOC
+ , new Msp430GpioC() as Led0Impl
+ , new Msp430GpioC() as Led1Impl
+ , new Msp430GpioC() as Led2Impl
+ ;
+ components PlatformP;
+
+ Init = PlatformP.LedsInit;
+
+ Led0 = Led0Impl;
+ Led0Impl -> GeneralIOC.Port40;
+
+ Led1 = Led1Impl;
+ Led1Impl -> GeneralIOC.Port41;
+
+ Led2 = Led2Impl;
+ Led2Impl -> GeneralIOC.Port42;
+
+}
+
--- /dev/null
+#include "hardware.h"
+
+module PlatformP{
+ provides interface Init;
+ uses interface Init as MoteClockInit;
+ uses interface Init as MoteInit;
+ uses interface Init as LedsInit;
+}
+implementation {
+ command error_t Init.init() {
+ call MoteClockInit.init();
+ call MoteInit.init();
+ call LedsInit.init();
+ return SUCCESS;
+ }
+
+ default command error_t LedsInit.init() { return SUCCESS; }
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2008
+ * The President and Fellows of Harvard College.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/**
+ * Ported to the SHIMMER platform: uses Uart0 instead of Uart1 (telos).
+ *
+ * @author Konrad Lorincz
+ * @date May 14, 2008
+ */
+
+configuration PlatformSerialC
+{
+ provides interface StdControl;
+ provides interface UartStream;
+ provides interface UartByte;
+}
+implementation
+{
+ components new Msp430Uart0C() as UartC;
+ UartStream = UartC;
+ UartByte = UartC;
+
+ components ShimmerSerialP;
+ StdControl = ShimmerSerialP;
+ ShimmerSerialP.Msp430UartConfigure <- UartC.Msp430UartConfigure;
+ ShimmerSerialP.Resource -> UartC.Resource;
+}
--- /dev/null
+*** SHIMMER - TinyOS 2.x platform support ***\r
+=============================================\r
+Konrad Lorincz\r
+May 6, 2008\r
+\r
+This directory contains tinyos 2.x platform support for the Intel\r
+SHIMMER mote. Please use the mailing list given below to post\r
+questions and comments.\r
+\r
+\r
+Usage\r
+-----\r
+You can compile and install applications for the SHIMMER platform just\r
+like with any standard platform, "make shimmer install ..." (Note:\r
+you must have a shimmer programming board).\r
+\r
+For example, to complie and install Blink, do the following:\r
+\r
+ $ cd $TOSROOT/apps/Blink\r
+ $ make shimmer install bsl,X\r
+\r
+where X is your serial port.\r
+\r
+You may also want to test the radio. Do this by compiling and\r
+installing "$TOSROOT/apps/RadioCountToLeds" on TWO shimmers (for\r
+sending and receiving radio messages).\r
+\r
+\r
+Support\r
+-------\r
+ - Official documentation\r
+ http://docs.tinyos.net/index.php/SHIMMER\r
+ - Mailing list (requires subscription to post)\r
+ https://www.eecs.harvard.edu/mailman/listinfo/shimmer-users\r
+\r
+\r
+Copyright\r
+---------\r
+/*\r
+ * Copyright (c) 2008\r
+ * The President and Fellows of Harvard College.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. Neither the name of the University nor the names of its contributors\r
+ * may be used to endorse or promote products derived from this software\r
+ * without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND\r
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
+ * SUCH DAMAGE.\r
+ */\r
+\r
--- /dev/null
+/*
+ * Copyright (c) 2008
+ * The President and Fellows of Harvard College.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+/**
+ * Ported to the SHIMMER platform: uses Uart0 instead of Uart1 (telos).
+ *
+ * @author Konrad Lorincz
+ * @date May 14, 2008
+ */
+module ShimmerSerialP
+{
+ provides interface StdControl;
+ provides interface Msp430UartConfigure;
+ uses interface Resource;
+}
+implementation
+{
+ msp430_uart_union_config_t msp430_uart_telos_config = { {ubr: UBR_1MHZ_115200, umctl: UMCTL_1MHZ_115200, 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;
+ }
+}
--- /dev/null
+/*
+ * Copyright (c) 2005-2006 Arch Rock Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ * - Neither the name of the Arch Rock Corporation nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE
+ */
+
+/**
+ * VoltageC is a common name for the Msp430InternalVoltageC voltage
+ * sensor available on the telosb platform.
+ *
+ * To convert from ADC counts to actual voltage, divide by 4096 and
+ * multiply by 3.
+ *
+ * @author Gilman Tolle <gtolle@archrock.com>
+ * @version $Revision$ $Date$
+ */
+
+generic configuration VoltageC() {
+ provides interface Read<uint16_t>;
+}
+implementation {
+ components new Msp430InternalVoltageC();
+ Read = Msp430InternalVoltageC.Read;
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2005-2006 Arch Rock Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ * - Neither the name of the Arch Rock Corporation nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE
+ */
+
+/**
+ * HPL implementation of 32khz alarms for the ChipCon CC2420 radio
+ * connected to a TI MSP430 processor.
+ *
+ * @author Jonathan Hui <jhui@archrock.com>
+ * @version $Revision$ $Date$
+ */
+
+generic configuration HplCC2420AlarmC() {
+
+ provides interface Init;
+ provides interface Alarm<T32khz,uint32_t> as Alarm32khz32;
+
+}
+
+implementation {
+
+ components new Alarm32khz32C();
+
+ Init = Alarm32khz32C;
+ Alarm32khz32 = Alarm32khz32C;
+
+}
--- /dev/null
+/*
+ * Copyright (c) 2005-2006 Arch Rock Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ * - Neither the name of the Arch Rock Corporation nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE
+ */
+
+/**
+ * HPL implementation of interrupts and captures for the ChipCon
+ * CC2420 radio connected to a TI MSP430 processor.
+ *
+ * @author Jonathan Hui <jhui@archrock.com>
+ * @version $Revision$ $Date$
+ */
+/**
+ * Ported to the SHIMMER platform.
+ *
+ * @author Konrad Lorincz
+ * @date May 14, 2008
+ */
+
+configuration HplCC2420InterruptsC {
+
+ provides interface GpioCapture as CaptureSFD;
+ provides interface GpioInterrupt as InterruptCCA;
+ provides interface GpioInterrupt as InterruptFIFOP;
+
+}
+
+implementation {
+
+ components HplMsp430GeneralIOC as GeneralIOC;
+ components Msp430TimerC;
+ components new GpioCaptureC() as CaptureSFDC;
+ CaptureSFDC.Msp430TimerControl -> Msp430TimerC.ControlA1;
+ CaptureSFDC.Msp430Capture -> Msp430TimerC.CaptureA1;
+ CaptureSFDC.GeneralIO -> GeneralIOC.Port12;
+
+ components HplMsp430InterruptC;
+ components new Msp430InterruptC() as InterruptCCAC;
+ components new Msp430InterruptC() as InterruptFIFOPC;
+ InterruptCCAC.HplInterrupt -> HplMsp430InterruptC.Port27;
+ InterruptFIFOPC.HplInterrupt -> HplMsp430InterruptC.Port26;
+
+ CaptureSFD = CaptureSFDC.Capture;
+ InterruptCCA = InterruptCCAC.Interrupt;
+ InterruptFIFOP = InterruptFIFOPC.Interrupt;
+}
--- /dev/null
+/*
+ * Copyright (c) 2005-2006 Arch Rock Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ * - Neither the name of the Arch Rock Corporation nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE
+ */
+
+/**
+ * HPL implementation of general-purpose I/O for the ChipCon CC2420
+ * radio connected to a TI MSP430 processor.
+ *
+ * @author Jonathan Hui <jhui@archrock.com>
+ * @version $Revision$ $Date$
+ */
+/**
+ * Ported to the SHIMMER platform.
+ *
+ * @author Konrad Lorincz
+ * @date May 14, 2008
+ */
+
+configuration HplCC2420PinsC {
+
+ provides interface GeneralIO as CCA;
+ provides interface GeneralIO as CSN;
+ provides interface GeneralIO as FIFO;
+ provides interface GeneralIO as FIFOP;
+ provides interface GeneralIO as RSTN;
+ provides interface GeneralIO as SFD;
+ provides interface GeneralIO as VREN;
+
+}
+
+implementation {
+
+ components HplMsp430GeneralIOC as GeneralIOC;
+ components new Msp430GpioC() as CCAM;
+ components new Msp430GpioC() as CSNM;
+ components new Msp430GpioC() as FIFOM;
+ components new Msp430GpioC() as FIFOPM;
+ components new Msp430GpioC() as RSTNM;
+ components new Msp430GpioC() as SFDM;
+ components new Msp430GpioC() as VRENM;
+
+ CCAM -> GeneralIOC.Port27;
+ CSNM -> GeneralIOC.Port54;
+ FIFOM -> GeneralIOC.Port10;
+ FIFOPM -> GeneralIOC.Port26;
+ RSTNM -> GeneralIOC.Port57;
+ SFDM -> GeneralIOC.Port50;
+ VRENM -> GeneralIOC.Port56;
+
+ CCA = CCAM;
+ CSN = CSNM;
+ FIFO = FIFOM;
+ FIFOP = FIFOPM;
+ RSTN = RSTNM;
+ SFD = SFDM;
+ VREN = VRENM;
+
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2005-2006 Arch Rock Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * - Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the
+ * distribution.
+ * - Neither the name of the Arch Rock Corporation nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * ARCHED ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE
+ */
+
+/**
+ * HPL implementation of the SPI bus for the ChipCon CC2420 radio
+ * connected to a TI MSP430 processor.
+ *
+ * @author Jonathan Hui <jhui@archrock.com>
+ * @version $Revision$ $Date$
+ */
+/**
+ * Ported to the SHIMMER platform.
+ *
+ * @author Konrad Lorincz
+ */
+
+generic configuration HplCC2420SpiC() {
+
+ provides interface Resource;
+ provides interface SpiByte;
+ provides interface SpiPacket;
+
+}
+
+implementation {
+
+ components new Msp430Spi1C() as SpiC;
+
+ Resource = SpiC;
+ SpiByte = SpiC;
+ SpiPacket = SpiC;
+
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2006, Intel Corporation
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * Neither the name of the Intel Corporation nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * @author Steven Ayer
+ * @date June 2006
+ */
+
+
+#ifndef _H_hardware_h
+#define _H_hardware_h
+
+#include "msp430hardware.h"
+
+#define SHIMMER 1
+
+// LEDs
+TOSH_ASSIGN_PIN(RED_LED, 4, 0);
+TOSH_ASSIGN_PIN(ORANGE_LED, 4, 1);
+TOSH_ASSIGN_PIN(YELLOW_LED, 4, 2);
+TOSH_ASSIGN_PIN(GREEN_LED, 4, 3);
+
+// CC2420 RADIO #defines
+TOSH_ASSIGN_PIN(RADIO_FIFO, 1, 0);
+TOSH_ASSIGN_PIN(RADIO_TIMED_SFD, 1, 2);
+TOSH_ASSIGN_PIN(RADIO_FIFOP, 2, 6);
+TOSH_ASSIGN_PIN(RADIO_CCA, 2, 7);
+
+TOSH_ASSIGN_PIN(RADIO_1V8_EN, 4, 7);
+TOSH_ASSIGN_PIN(RADIO_VREF, 5, 6); // unused in shimmer
+TOSH_ASSIGN_PIN(SW_BT_PWR_N, 5, 6); // " " "
+TOSH_ASSIGN_PIN(SW_SD_PWR_N, 5, 6); // " " "
+
+TOSH_ASSIGN_PIN(RADIO_SFD, 5, 0);
+TOSH_ASSIGN_PIN(RADIO_SIMO1, 5, 1);
+TOSH_ASSIGN_PIN(RADIO_SOMI1, 5, 2);
+TOSH_ASSIGN_PIN(RADIO_CSN, 5, 4);
+TOSH_ASSIGN_PIN(CSN, 5, 4);
+TOSH_ASSIGN_PIN(RADIO_RESET, 5, 7);
+
+
+// Don't think these are needed
+TOSH_ASSIGN_PIN(CC_FIFOP, 2, 6);
+TOSH_ASSIGN_PIN(CC_FIFO, 1, 0);
+TOSH_ASSIGN_PIN(CC_SFD, 1, 2);
+TOSH_ASSIGN_PIN(CC_VREN, 5, 6);
+TOSH_ASSIGN_PIN(CC_RSTN, 5, 7);
+
+// BT pins
+TOSH_ASSIGN_PIN(BT_PIO, 1, 5);
+TOSH_ASSIGN_PIN(BT_RTS, 1, 6);
+TOSH_ASSIGN_PIN(BT_CTS, 1, 7);
+TOSH_ASSIGN_PIN(BT_TXD, 3, 6);
+TOSH_ASSIGN_PIN(BT_RXD, 3, 7);
+TOSH_ASSIGN_PIN(BT_RESET, 5, 5);
+
+//BSL Pins
+TOSH_ASSIGN_PIN(PROG_OUT, 1, 1);
+TOSH_ASSIGN_PIN(PROG_IN, 2, 2);
+
+// SD uart chip-select
+TOSH_ASSIGN_PIN(SD_CS_N, 3, 0);
+
+// ADC
+TOSH_ASSIGN_PIN(ADC0, 6, 5);
+TOSH_ASSIGN_PIN(ADC1, 6, 4);
+TOSH_ASSIGN_PIN(ADC2, 6, 3);
+
+// ADC lines on the testpoints
+TOSH_ASSIGN_PIN(ADC_0, 6, 0);
+TOSH_ASSIGN_PIN(ADC_1, 6, 1);
+TOSH_ASSIGN_PIN(ADC_2, 6, 2);
+TOSH_ASSIGN_PIN(ADC_6, 6, 6);
+TOSH_ASSIGN_PIN(ADC_7, 6, 7);
+
+TOSH_ASSIGN_PIN(ADC_ACCELZ, 6, 3);
+TOSH_ASSIGN_PIN(ADC_ACCELY, 6, 4);
+TOSH_ASSIGN_PIN(ADC_ACCELX, 6, 5);
+
+TOSH_ASSIGN_PIN(DAC0_AN, 6, 6);
+TOSH_ASSIGN_PIN(DAC1_AN, 6, 7);
+
+
+// UART pins
+// SPI1 attached to bt, cc2420
+TOSH_ASSIGN_PIN(UCLK1, 5, 3);
+TOSH_ASSIGN_PIN(SOMI1, 5, 2);
+TOSH_ASSIGN_PIN(SIMO1, 5, 1);
+
+// used as GPIOs
+TOSH_ASSIGN_PIN(UCLK0, 3, 3);
+TOSH_ASSIGN_PIN(SOMI0, 3, 2);
+TOSH_ASSIGN_PIN(SIMO0, 3, 1);
+
+// connected to UART (0 and 1)
+TOSH_ASSIGN_PIN(UTXD0, 3, 4);
+TOSH_ASSIGN_PIN(URXD0, 3, 5);
+TOSH_ASSIGN_PIN(UTXD1, 3, 6);
+TOSH_ASSIGN_PIN(URXD1, 3, 7);
+
+// GIO pins
+TOSH_ASSIGN_PIN(SER0_RTS, 1, 3);
+TOSH_ASSIGN_PIN(SER0_CTS, 1, 4);
+
+TOSH_ASSIGN_PIN(ROSC, 2, 5);
+
+TOSH_ASSIGN_PIN(GIO0, 2, 0);
+TOSH_ASSIGN_PIN(GIO1, 2, 1);
+
+
+// 1-Wire
+TOSH_ASSIGN_PIN(ONEWIRE_PWR, 2, 3);
+TOSH_ASSIGN_PIN(ONEWIRE, 2, 4);
+
+// ACCEL
+TOSH_ASSIGN_PIN(ACCEL_SEL0, 4, 4);
+TOSH_ASSIGN_PIN(ACCEL_SEL1, 4, 5);
+TOSH_ASSIGN_PIN(ACCEL_SLEEP_N, 4, 6);
+
+void TOSH_SET_PIN_DIRECTIONS(void)
+{
+ //LEDS
+ TOSH_MAKE_RED_LED_OUTPUT();
+ TOSH_MAKE_YELLOW_LED_OUTPUT();
+ TOSH_MAKE_ORANGE_LED_OUTPUT();
+ TOSH_MAKE_GREEN_LED_OUTPUT();
+ TOSH_SEL_RED_LED_IOFUNC();
+ TOSH_SEL_YELLOW_LED_IOFUNC();
+ TOSH_SEL_ORANGE_LED_IOFUNC();
+ TOSH_SEL_GREEN_LED_IOFUNC();
+
+ //RADIO PINS
+ //CC2420 pins
+ TOSH_MAKE_RADIO_CSN_OUTPUT();
+ TOSH_SEL_RADIO_CSN_IOFUNC();
+ TOSH_SET_RADIO_CSN_PIN();
+
+ TOSH_MAKE_CSN_OUTPUT();
+ TOSH_SEL_CSN_IOFUNC();
+ TOSH_SET_CSN_PIN();
+
+ // should be reset_n
+ TOSH_MAKE_RADIO_RESET_OUTPUT();
+ TOSH_SEL_RADIO_RESET_IOFUNC();
+ TOSH_CLR_RADIO_RESET_PIN();
+
+ TOSH_MAKE_RADIO_1V8_EN_OUTPUT();
+ TOSH_SEL_RADIO_1V8_EN_IOFUNC();
+ TOSH_CLR_RADIO_1V8_EN_PIN();
+
+ TOSH_MAKE_RADIO_CCA_INPUT();
+ TOSH_MAKE_RADIO_FIFO_INPUT();
+ TOSH_MAKE_RADIO_FIFOP_INPUT();
+ TOSH_MAKE_RADIO_SFD_INPUT();
+ TOSH_SEL_RADIO_CCA_IOFUNC();
+ TOSH_SEL_RADIO_FIFO_IOFUNC();
+ TOSH_SEL_RADIO_FIFOP_IOFUNC();
+ TOSH_SEL_RADIO_SFD_IOFUNC();
+
+ TOSH_MAKE_ONEWIRE_PWR_OUTPUT();
+ TOSH_SET_ONEWIRE_PWR_PIN();
+
+ TOSH_SEL_SD_CS_N_IOFUNC();
+ TOSH_MAKE_SD_CS_N_OUTPUT();
+ TOSH_SET_SD_CS_N_PIN();
+
+ // BT PINS
+ TOSH_MAKE_BT_RESET_OUTPUT();
+ TOSH_SEL_BT_RESET_IOFUNC();
+ TOSH_CLR_BT_RESET_PIN(); // mitsumi module disabled by clr
+
+ TOSH_MAKE_BT_RTS_INPUT();
+ TOSH_SEL_BT_RTS_IOFUNC();
+
+ TOSH_MAKE_BT_PIO_OUTPUT();
+ TOSH_SEL_BT_PIO_IOFUNC();
+
+ TOSH_MAKE_BT_CTS_OUTPUT();
+ TOSH_SEL_BT_CTS_IOFUNC();
+
+ TOSH_MAKE_BT_TXD_OUTPUT();
+ TOSH_SEL_BT_TXD_MODFUNC();
+
+ TOSH_MAKE_BT_RXD_INPUT();
+ TOSH_SEL_BT_RXD_MODFUNC();
+
+ // BSL Prog Pins tristate em
+ TOSH_MAKE_PROG_IN_OUTPUT();
+ TOSH_MAKE_PROG_OUT_OUTPUT();
+ TOSH_SEL_PROG_IN_IOFUNC();
+ TOSH_SEL_PROG_OUT_IOFUNC();
+
+
+ // ADC lines
+ TOSH_MAKE_ADC_0_OUTPUT();
+ TOSH_MAKE_ADC_1_OUTPUT();
+ TOSH_MAKE_ADC_2_OUTPUT();
+ TOSH_MAKE_ADC_6_OUTPUT();
+ TOSH_MAKE_ADC_7_OUTPUT();
+
+ TOSH_SEL_ADC_0_IOFUNC();
+ TOSH_SEL_ADC_1_IOFUNC();
+ TOSH_SEL_ADC_2_IOFUNC();
+ TOSH_SEL_ADC_6_IOFUNC();
+ TOSH_SEL_ADC_7_IOFUNC();
+
+ TOSH_MAKE_ADC_ACCELZ_INPUT();
+ TOSH_MAKE_ADC_ACCELY_INPUT();
+ TOSH_MAKE_ADC_ACCELX_INPUT();
+ TOSH_SEL_ADC_ACCELZ_MODFUNC();
+ TOSH_SEL_ADC_ACCELY_MODFUNC();
+ TOSH_SEL_ADC_ACCELX_MODFUNC();
+
+ TOSH_SEL_ROSC_IOFUNC();
+ TOSH_MAKE_ROSC_INPUT();
+
+ // DAC lines
+ // Default is not to use DAC mode. Please define pin usage if you want to use them
+
+ // UART pins
+ // These declarations are to allow the UART module to work since it's using the names.
+ // The UART module will set them to the right direction when initialized
+
+ // ftdi/gio pins. Unused for now so we do not set directionality or function
+
+
+ // 1-wire function
+ TOSH_MAKE_ONEWIRE_PWR_OUTPUT();
+ TOSH_SEL_ONEWIRE_PWR_IOFUNC();
+ TOSH_SEL_ONEWIRE_IOFUNC();
+
+ // Accelerometer pin definitions
+ TOSH_SEL_ACCEL_SEL0_IOFUNC();
+ TOSH_SEL_ACCEL_SEL1_IOFUNC();
+ TOSH_SEL_ACCEL_SLEEP_N_IOFUNC();
+
+ TOSH_MAKE_ACCEL_SEL0_OUTPUT();
+ TOSH_MAKE_ACCEL_SEL1_OUTPUT();
+ TOSH_MAKE_ACCEL_SLEEP_N_OUTPUT();
+
+ /*
+ * unless the accel_sel0 pin is cleared,
+ * a severe quiescent power hit occurs on the msp430
+ * we go from 3.7 ua to 65.1 ua when asleep!
+ */
+ TOSH_CLR_ACCEL_SEL0_PIN();
+ TOSH_CLR_ACCEL_SEL1_PIN();
+ TOSH_CLR_ACCEL_SLEEP_N_PIN();
+
+
+ // idle expansion header pins
+ TOSH_MAKE_SER0_CTS_OUTPUT();
+ TOSH_SEL_SER0_CTS_IOFUNC();
+ TOSH_MAKE_SER0_RTS_OUTPUT();
+ TOSH_SEL_SER0_RTS_IOFUNC();
+ TOSH_MAKE_GIO0_OUTPUT();
+ TOSH_SEL_GIO0_IOFUNC();
+ TOSH_MAKE_GIO1_OUTPUT();
+ TOSH_SEL_GIO1_IOFUNC();
+ TOSH_MAKE_UTXD0_OUTPUT();
+ TOSH_SEL_UTXD0_IOFUNC();
+ TOSH_MAKE_URXD0_OUTPUT();
+ TOSH_SEL_URXD0_IOFUNC();
+ TOSH_MAKE_RADIO_VREF_OUTPUT();
+ TOSH_SEL_RADIO_VREF_IOFUNC();
+
+}
+
+#endif // _H_hardware_h
+
--- /dev/null
+/* $Id$
+ * "Copyright (c) 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) 2002-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.
+ */
+
+/**
+ * Defining the platform-independently named packet structures to be the
+ * chip-specific CC1000 packet structures.
+ *
+ * @author Philip Levis
+ * @version $Revision$ $Date$
+ */
+
+
+#ifndef PLATFORM_MESSAGE_H
+#define PLATFORM_MESSAGE_H
+
+#include <CC2420.h>
+#include <Serial.h>
+
+typedef union message_header {
+ cc2420_header_t cc2420;
+ serial_header_t serial;
+} message_header_t;
+
+typedef union TOSRadioFooter {
+ cc2420_footer_t cc2420;
+} message_footer_t;
+
+typedef union TOSRadioMetadata {
+ cc2420_metadata_t cc2420;
+ serial_metadata_t serial;
+} message_metadata_t;
+
+#endif