[Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/shimmer .platform, NONE, 1.1 ActiveMessageC.nc, NONE, 1.1 DemoSensorC.nc, NONE, 1.1 MoteClockC.nc, NONE, 1.1 MotePlatformC.nc, NONE, 1.1 Msp430Timer32khzMapC.nc, NONE, 1.1 PlatformC.nc, NONE, 1.1 PlatformLedsC.nc, NONE, 1.1 PlatformP.nc, NONE, 1.1 PlatformSerialC.nc, NONE, 1.1 README.txt, NONE, 1.1 ShimmerSerialP.nc, NONE, 1.1 VoltageC.nc, NONE, 1.1 hardware.h, NONE, 1.1 platform.h, NONE, 1.1 platform_message.h, NONE, 1.1

Konrad Lorincz konradlorincz at users.sourceforge.net
Wed May 21 15:07:27 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tos/platforms/shimmer
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv957/shimmer

Added Files:
	.platform ActiveMessageC.nc DemoSensorC.nc MoteClockC.nc 
	MotePlatformC.nc Msp430Timer32khzMapC.nc PlatformC.nc 
	PlatformLedsC.nc PlatformP.nc PlatformSerialC.nc README.txt 
	ShimmerSerialP.nc VoltageC.nc hardware.h platform.h 
	platform_message.h 
Log Message:
Imported initial SHIMMER platform code.

--- NEW FILE: .platform ---
# 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;

--- NEW FILE: ActiveMessageC.nc ---
// $Id: ActiveMessageC.nc,v 1.1 2008/05/21 22:07:24 konradlorincz Exp $

/*									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: ActiveMessageC.nc,v 1.1 2008/05/21 22:07:24 konradlorincz Exp $
 *
 */
/**
 * 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;
}

--- NEW FILE: DemoSensorC.nc ---
/*
 * 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 at archrock.com>
 * @version $Revision: 1.1 $ $Date: 2008/05/21 22:07:24 $
 * 
 */

generic configuration DemoSensorC()
{
  provides interface Read<uint16_t>;
}
implementation
{
  components new VoltageC() as DemoSensor;
  Read = DemoSensor;
}

--- NEW FILE: MoteClockC.nc ---
/*
 * 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: MoteClockC.nc,v 1.1 2008/05/21 22:07:24 konradlorincz Exp $
 *
 */

 /**
 * @author Vlado Handziski <handzisk at tkn.tu-berlind.de>
 */
 
configuration MoteClockC
{
  provides interface Init as MoteClockInit;
}
implementation

{
  components Msp430ClockC;
  
  MoteClockInit = Msp430ClockC.Init;
}

--- NEW FILE: MotePlatformC.nc ---
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;
  }
}

--- NEW FILE: Msp430Timer32khzMapC.nc ---
//$Id: Msp430Timer32khzMapC.nc,v 1.1 2008/05/21 22:07:24 konradlorincz Exp $

/* "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 at eecs.berkeley.edu>
 * @version $Revision: 1.1 $ $Date: 2008/05/21 22:07:24 $
 */

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;
}


--- NEW FILE: PlatformC.nc ---
/* "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: 1.1 $ $Date: 2008/05/21 22:07:24 $
 */
#include "hardware.h"

configuration PlatformC
{
  provides interface Init;
}
implementation
{
  components PlatformP, MotePlatformC, MoteClockC;

  Init = PlatformP;
  PlatformP.MoteClockInit -> MoteClockC;
  PlatformP.MoteInit -> MotePlatformC;
}

--- NEW FILE: PlatformLedsC.nc ---
// $Id: PlatformLedsC.nc,v 1.1 2008/05/21 22:07:24 konradlorincz Exp $

/* "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: 1.1 $ $Date: 2008/05/21 22:07:24 $
 */
#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;

}


--- NEW FILE: PlatformP.nc ---
#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; }

}

--- NEW FILE: PlatformSerialC.nc ---
/*
 * 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;
}

--- NEW FILE: README.txt ---
*** SHIMMER - TinyOS 2.x platform support ***
=============================================
Konrad Lorincz
May 6, 2008

This directory contains tinyos 2.x platform support for the Intel
SHIMMER mote.  Please use the mailing list given below to post
questions and comments.


Usage
-----
You can compile and install applications for the SHIMMER platform just
like with any standard platform, "make shimmer install ..." (Note:
you must have a shimmer programming board).

For example, to complie and install Blink, do the following:

  $ cd $TOSROOT/apps/Blink
  $ make shimmer install bsl,X

where X is your serial port.

You may also want to test the radio.  Do this by compiling and
installing "$TOSROOT/apps/RadioCountToLeds" on TWO shimmers (for
sending and receiving radio messages).


Support
-------
  - Official documentation
    http://docs.tinyos.net/index.php/SHIMMER
  - Mailing list (requires subscription to post)
    https://www.eecs.harvard.edu/mailman/listinfo/shimmer-users


Copyright
---------
/*
 * 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.
 */


--- NEW FILE: ShimmerSerialP.nc ---
/*
 * 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;
    }
}

--- NEW FILE: VoltageC.nc ---
/*
 * 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 at archrock.com>
 * @version $Revision: 1.1 $ $Date: 2008/05/21 22:07:24 $
 */

generic configuration VoltageC() {
  provides interface Read<uint16_t>;
}
implementation {
  components new Msp430InternalVoltageC();
  Read = Msp430InternalVoltageC.Read;
}


--- NEW FILE: hardware.h ---
/*
 * 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


--- NEW FILE: platform.h ---

--- NEW FILE: platform_message.h ---
/* $Id: platform_message.h,v 1.1 2008/05/21 22:07:24 konradlorincz Exp $
 * "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: 1.1 $ $Date: 2008/05/21 22:07:24 $
 */


#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



More information about the Tinyos-2-commits mailing list