[Tinyos-2-commits] CVS: tinyos-2.x/tos/platforms/eyesIFX/chips/msp430 Msp430Uart0C.nc, NONE, 1.1.2.1 Msp430Usart0C.nc, NONE, 1.1.2.1 Msp430UsartShare0P.nc, NONE, 1.1.2.1

Philipp Huppertz phihup at users.sourceforge.net
Tue Aug 15 06:54:09 PDT 2006


Update of /cvsroot/tinyos/tinyos-2.x/tos/platforms/eyesIFX/chips/msp430
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20443/tos/platforms/eyesIFX/chips/msp430

Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	Msp430Uart0C.nc Msp430Usart0C.nc Msp430UsartShare0P.nc 
Log Message:
- radio is now informed (via ResourceRequested) if another client wants the uart (usart) resource (for example the flash)
- needs to be tested more...

--- NEW FILE: Msp430Uart0C.nc ---
/**
 * Copyright (c) 2005-2006 Arched 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 Arched 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
 */

/**
 * An implementation of the UART on USART0 for the MSP430.
 * @author Vlado Handziski <handzisk at tkn.tu-berlin.de>
 * @author Jonathan Hui <jhui at archedrock.com>
 * @version $Revision: 1.1.2.1 $ $Date: 2006/08/15 13:54:07 $
 */

#include "msp430usart.h"

generic configuration Msp430Uart0C() {

  provides interface Resource;   provides interface ResourceRequested;
  provides interface SerialByteComm;
  provides interface Msp430UartControl as UartControl;

  uses interface Msp430UartConfigure;
}

implementation {

  enum {
    CLIENT_ID = unique( MSP430_UARTO_BUS ),
  };

  components Msp430Uart0P as UartP;
  Resource = UartP.Resource[ CLIENT_ID ];
  SerialByteComm = UartP.SerialByteComm;
  UartControl = UartP.UartControl[ CLIENT_ID ];
  Msp430UartConfigure = UartP.Msp430UartConfigure[ CLIENT_ID ];

  components new Msp430Usart0C() as UsartC;
  ResourceRequested = UsartC.ResourceRequested;
  UartP.ResourceConfigure[ CLIENT_ID ] <- UsartC.ResourceConfigure;
  UartP.UsartResource[ CLIENT_ID ] -> UsartC.Resource;
  UartP.UsartInterrupts -> UsartC.HplMsp430UsartInterrupts;

}

--- NEW FILE: Msp430Usart0C.nc ---
/**
 * Copyright (c) 2005-2006 Arched 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 Arched 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
 */

/**
 * Provides an interface for USART0 on the MSP430.
 *
 * @author Jonathan Hui <jhui at archedrock.com>
 * @version $Revision: 1.1.2.1 $ $Date: 2006/08/15 13:54:07 $
 */

generic configuration Msp430Usart0C() {

  provides interface Resource;
  provides interface ResourceRequested;  
  provides interface ArbiterInfo;
  provides interface HplMsp430Usart;
  provides interface HplMsp430UsartInterrupts;

  uses interface ResourceConfigure;
}

implementation {

  enum {
    CLIENT_ID = unique( MSP430_HPLUSART0_RESOURCE ),
  };

  components Msp430UsartShare0P as UsartShareP;

  Resource = UsartShareP.Resource[ CLIENT_ID ];
  ResourceRequested = UsartShareP.ResourceRequested[ CLIENT_ID ];
  ResourceConfigure = UsartShareP.ResourceConfigure[ CLIENT_ID ];
  ArbiterInfo = UsartShareP.ArbiterInfo;
  HplMsp430UsartInterrupts = UsartShareP.Interrupts[ CLIENT_ID ];

  components HplMsp430Usart0C as UsartC;
  HplMsp430Usart = UsartC;

}

--- NEW FILE: Msp430UsartShare0P.nc ---
/**
 * Copyright (c) 2005-2006 Arched 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 Arched 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
 */

/**
 * @author Jonathan Hui <jhui at archedrock.com>
 * @version $Revision: 1.1.2.1 $ $Date: 2006/08/15 13:54:07 $
 */

configuration Msp430UsartShare0P {

  provides interface HplMsp430UsartInterrupts as Interrupts[ uint8_t id ];
  provides interface Resource[ uint8_t id ];
  provides interface ResourceRequested[ uint8_t id ];
  provides interface ArbiterInfo;

  uses interface ResourceConfigure[ uint8_t id ];
}

implementation {

  components new Msp430UsartShareP() as UsartShareP;
  Interrupts = UsartShareP;
  UsartShareP.RawInterrupts -> UsartC;

  components new FcfsArbiterC( MSP430_HPLUSART0_RESOURCE ) as ArbiterC;
  Resource = ArbiterC;
  ResourceRequested = ArbiterC;
  ResourceConfigure = ArbiterC;
  ArbiterInfo = ArbiterC;
  UsartShareP.ArbiterInfo -> ArbiterC;
  
  components new AsyncStdControlDeferredPowerManagerC(1) as PowerManagerC;
  PowerManagerC.ResourceController -> ArbiterC;

  components HplMsp430Usart0C as UsartC;
  PowerManagerC.AsyncStdControl -> UsartC;
}



More information about the Tinyos-2-commits mailing list