[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/msp430/usart Msp430UartControl.nc, NONE, 1.1.2.1 HplMsp430Usart.nc, 1.1.2.4.4.1, 1.1.2.4.4.2 HplMsp430Usart0C.nc, 1.1.2.5.4.1, 1.1.2.5.4.2 HplMsp430Usart0P.nc, 1.1.2.5.4.1, 1.1.2.5.4.2 HplMsp430Usart1C.nc, 1.1.2.6.4.1, 1.1.2.6.4.2 HplMsp430Usart1P.nc, 1.1.2.4.4.1, 1.1.2.4.4.2 HplMsp430UsartInterrupts.nc, 1.1.2.1.4.1, 1.1.2.1.4.2 Msp430Spi0C.nc, 1.1.2.7.4.1, 1.1.2.7.4.2 Msp430Spi1C.nc, 1.1.2.1, 1.1.2.2 Msp430SpiConfigure.nc, 1.1.2.1, 1.1.2.2 Msp430SpiDmaP.nc, 1.1.2.1.4.1, 1.1.2.1.4.2 Msp430SpiNoDmaP.nc, 1.1.2.1.4.1, 1.1.2.1.4.2 Msp430Uart0C.nc, 1.1.2.1, 1.1.2.2 Msp430Uart0P.nc, 1.1.2.1, 1.1.2.2 Msp430Uart1C.nc, 1.1.2.7.4.1, 1.1.2.7.4.2 Msp430Uart1P.nc, 1.1.2.1, 1.1.2.2 Msp430UartConfigure.nc, 1.1.2.1, 1.1.2.2 Msp430UartP.nc, 1.1.2.7.4.1, 1.1.2.7.4.2

Vlado Handziski vlahan at users.sourceforge.net
Thu Jul 13 13:38:24 PDT 2006


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

Modified Files:
      Tag: tos-2-msp430-usart-configure-candidate
	HplMsp430Usart.nc HplMsp430Usart0C.nc HplMsp430Usart0P.nc 
	HplMsp430Usart1C.nc HplMsp430Usart1P.nc 
	HplMsp430UsartInterrupts.nc Msp430Spi0C.nc Msp430Spi1C.nc 
	Msp430SpiConfigure.nc Msp430SpiDmaP.nc Msp430SpiNoDmaP.nc 
	Msp430Uart0C.nc Msp430Uart0P.nc Msp430Uart1C.nc 
	Msp430Uart1P.nc Msp430UartConfigure.nc Msp430UartP.nc 
Added Files:
      Tag: tos-2-msp430-usart-configure-candidate
	Msp430UartControl.nc 
Log Message:
TDA5250 update for the new Msp430UartControl/Configure interfaces

--- NEW FILE: Msp430UartControl.nc ---
/*
 * Copyright (c) 2004-2006, 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 Universitaet 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.
 */

/**
 * Interface used by Msp430Uart clients to control/configure the Uart.
 *
 * @author Philipp Huppertz (huppertz at tkn.tu-berlin.de)
 */
interface Msp430UartControl {

  /**
  * Sets the Uart to Rx mode.
  */
  async command void setModeRx();
  
  /**
  * Sets the Uart to Tx mode.
  */
  async command void setModeTx();
  
  /**
  * Sets the Uart to duplex mode.
  */
  async command void setModeDuplex();
  
}

Index: HplMsp430Usart.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart.nc,v
retrieving revision 1.1.2.4.4.1
retrieving revision 1.1.2.4.4.2
diff -C2 -d -r1.1.2.4.4.1 -r1.1.2.4.4.2
*** HplMsp430Usart.nc	15 Jun 2006 19:27:51 -0000	1.1.2.4.4.1
--- HplMsp430Usart.nc	13 Jul 2006 20:38:18 -0000	1.1.2.4.4.2
***************
*** 41,45 ****
   */
  
! #include "Msp430Usart.h"
  
  interface HplMsp430Usart {
--- 41,45 ----
   */
  
! #include "msp430usart.h"
  
  interface HplMsp430Usart {

Index: HplMsp430Usart0C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart0C.nc,v
retrieving revision 1.1.2.5.4.1
retrieving revision 1.1.2.5.4.2
diff -C2 -d -r1.1.2.5.4.1 -r1.1.2.5.4.2
*** HplMsp430Usart0C.nc	15 Jun 2006 19:27:51 -0000	1.1.2.5.4.1
--- HplMsp430Usart0C.nc	13 Jul 2006 20:38:18 -0000	1.1.2.5.4.2
***************
*** 62,66 ****
   */
  
! #include "Msp430Usart.h"
  
  configuration HplMsp430Usart0C {
--- 62,66 ----
   */
  
! #include "msp430usart.h"
  
  configuration HplMsp430Usart0C {

Index: HplMsp430Usart0P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart0P.nc,v
retrieving revision 1.1.2.5.4.1
retrieving revision 1.1.2.5.4.2
diff -C2 -d -r1.1.2.5.4.1 -r1.1.2.5.4.2
*** HplMsp430Usart0P.nc	15 Jun 2006 19:27:51 -0000	1.1.2.5.4.1
--- HplMsp430Usart0P.nc	13 Jul 2006 20:38:18 -0000	1.1.2.5.4.2
***************
*** 59,63 ****
   */
  
! #include "Msp430Usart.h"
  /**
   * Implementation of USART0 lowlevel functionality - stateless.
--- 59,63 ----
   */
  
! #include "msp430usart.h"
  /**
   * Implementation of USART0 lowlevel functionality - stateless.
***************
*** 351,368 ****
    }
  
-   void setUartModeCommon(msp430_uart_config_t config) {
-     call Usart.disableSpi();
-     call Usart.disableI2C();
-     atomic {
-       call Usart.resetUsart(TRUE);
-       configUart(config);
-       call Usart.enableUart();
-       call Usart.resetUsart(FALSE);
-       call Usart.clrIntr();
-       call Usart.disableIntr();
-     }
-     return;
-   }
- 
    async command void Usart.setModeUartTx(msp430_uart_config_t config) {
  
--- 351,354 ----
***************
*** 374,379 ****
        call UTXD.selectModuleFunc();
        call URXD.selectIOFunc();
      }
!     setUartModeCommon(config);
      return;
    }
--- 360,371 ----
        call UTXD.selectModuleFunc();
        call URXD.selectIOFunc();
+       call Usart.resetUsart(TRUE);
+       configUart(config);
+       call Usart.enableUartTx();
+       call Usart.resetUsart(FALSE);
+       call Usart.clrIntr();
+       call Usart.disableIntr();
      }
! 
      return;
    }
***************
*** 384,393 ****
      call Usart.disableI2C();
      call Usart.disableUart();
! 
      atomic {
        call UTXD.selectIOFunc();
        call URXD.selectModuleFunc();
      }
!     setUartModeCommon(config);
      return;
    }
--- 376,391 ----
      call Usart.disableI2C();
      call Usart.disableUart();
!     
      atomic {
        call UTXD.selectIOFunc();
        call URXD.selectModuleFunc();
+       call Usart.resetUsart(TRUE);
+       configUart(config);
+       call Usart.enableUartRx();
+       call Usart.resetUsart(FALSE);
+       call Usart.clrIntr();
+       call Usart.disableIntr();
      }
!     
      return;
    }
***************
*** 402,407 ****
        call UTXD.selectModuleFunc();
        call URXD.selectModuleFunc();
      }
!     setUartModeCommon(config);
      return;
    }
--- 400,411 ----
        call UTXD.selectModuleFunc();
        call URXD.selectModuleFunc();
+       call Usart.resetUsart(TRUE);
+       configUart(config);
+       call Usart.enableUart();
+       call Usart.resetUsart(FALSE);
+       call Usart.clrIntr();
+       call Usart.disableIntr();
      }
!     
      return;
    }

Index: HplMsp430Usart1C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart1C.nc,v
retrieving revision 1.1.2.6.4.1
retrieving revision 1.1.2.6.4.2
diff -C2 -d -r1.1.2.6.4.1 -r1.1.2.6.4.2
*** HplMsp430Usart1C.nc	15 Jun 2006 19:27:51 -0000	1.1.2.6.4.1
--- HplMsp430Usart1C.nc	13 Jul 2006 20:38:18 -0000	1.1.2.6.4.2
***************
*** 62,66 ****
   */
  
! #include "Msp430Usart.h"
  
  configuration HplMsp430Usart1C {
--- 62,66 ----
   */
  
! #include "msp430usart.h"
  
  configuration HplMsp430Usart1C {

Index: HplMsp430Usart1P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart1P.nc,v
retrieving revision 1.1.2.4.4.1
retrieving revision 1.1.2.4.4.2
diff -C2 -d -r1.1.2.4.4.1 -r1.1.2.4.4.2
*** HplMsp430Usart1P.nc	15 Jun 2006 19:27:51 -0000	1.1.2.4.4.1
--- HplMsp430Usart1P.nc	13 Jul 2006 20:38:18 -0000	1.1.2.4.4.2
***************
*** 59,63 ****
   */
  
! #include "Msp430Usart.h"
  /**
   * Implementation of USART1 lowlevel functionality - stateless.
--- 59,63 ----
   */
  
! #include "msp430usart.h"
  /**
   * Implementation of USART1 lowlevel functionality - stateless.
***************
*** 337,354 ****
    }
  
-   void setUartModeCommon(msp430_uart_config_t config) {
-     call Usart.disableSpi();
-     call Usart.disableI2C();
-     atomic {
-       call Usart.resetUsart(TRUE);
-       configUart(config);
-       call Usart.enableUart();
-       call Usart.resetUsart(FALSE);
-       call Usart.clrIntr();
-       call Usart.disableIntr();
-     }
-     return;
-   }
- 
    async command void Usart.setModeUartTx(msp430_uart_config_t config) {
  
--- 337,340 ----
***************
*** 360,365 ****
        call UTXD.selectModuleFunc();
        call URXD.selectIOFunc();
      }
-     setUartModeCommon(config);
      return;
    }
--- 346,356 ----
        call UTXD.selectModuleFunc();
        call URXD.selectIOFunc();
+       call Usart.resetUsart(TRUE);
+       configUart(config);
+       call Usart.enableUartTx();
+       call Usart.resetUsart(FALSE);
+       call Usart.clrIntr();
+       call Usart.disableIntr();
      }
      return;
    }
***************
*** 370,379 ****
      call Usart.disableI2C();
      call Usart.disableUart();
! 
      atomic {
        call UTXD.selectIOFunc();
        call URXD.selectModuleFunc();
      }
-     setUartModeCommon(config);
      return;
    }
--- 361,375 ----
      call Usart.disableI2C();
      call Usart.disableUart();
!     
      atomic {
        call UTXD.selectIOFunc();
        call URXD.selectModuleFunc();
+       call Usart.resetUsart(TRUE);
+       configUart(config);
+       call Usart.enableUartRx();
+       call Usart.resetUsart(FALSE);
+       call Usart.clrIntr();
+       call Usart.disableIntr();
      }
      return;
    }
***************
*** 388,393 ****
        call UTXD.selectModuleFunc();
        call URXD.selectModuleFunc();
      }
-     setUartModeCommon(config);
      return;
    }
--- 384,394 ----
        call UTXD.selectModuleFunc();
        call URXD.selectModuleFunc();
+       call Usart.resetUsart(TRUE);
+       configUart(config);
+       call Usart.enableUart();
+       call Usart.resetUsart(FALSE);
+       call Usart.clrIntr();
+       call Usart.disableIntr();
      }
      return;
    }

Index: HplMsp430UsartInterrupts.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430UsartInterrupts.nc,v
retrieving revision 1.1.2.1.4.1
retrieving revision 1.1.2.1.4.2
diff -C2 -d -r1.1.2.1.4.1 -r1.1.2.1.4.2
*** HplMsp430UsartInterrupts.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1.4.1
--- HplMsp430UsartInterrupts.nc	13 Jul 2006 20:38:18 -0000	1.1.2.1.4.2
***************
*** 39,43 ****
   */
   
! #include "Msp430Usart.h"
  
  interface HplMsp430UsartInterrupts {
--- 39,43 ----
   */
   
! #include "msp430usart.h"
  
  interface HplMsp430UsartInterrupts {

Index: Msp430Spi0C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430Spi0C.nc,v
retrieving revision 1.1.2.7.4.1
retrieving revision 1.1.2.7.4.2
diff -C2 -d -r1.1.2.7.4.1 -r1.1.2.7.4.2
*** Msp430Spi0C.nc	15 Jun 2006 19:27:51 -0000	1.1.2.7.4.1
--- Msp430Spi0C.nc	13 Jul 2006 20:38:18 -0000	1.1.2.7.4.2
***************
*** 40,44 ****
   */
  
! #include "Msp430Usart.h"
  
  generic configuration Msp430Spi0C() {
--- 40,44 ----
   */
  
! #include "msp430usart.h"
  
  generic configuration Msp430Spi0C() {

Index: Msp430Spi1C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430Spi1C.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Msp430Spi1C.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1
--- Msp430Spi1C.nc	13 Jul 2006 20:38:18 -0000	1.1.2.2
***************
*** 40,44 ****
   */
  
! #include "Msp430Usart.h"
  
  generic configuration Msp430Spi1C() {
--- 40,44 ----
   */
  
! #include "msp430usart.h"
  
  generic configuration Msp430Spi1C() {

Index: Msp430SpiConfigure.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430SpiConfigure.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Msp430SpiConfigure.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1
--- Msp430SpiConfigure.nc	13 Jul 2006 20:38:18 -0000	1.1.2.2
***************
*** 34,38 ****
   */
  
! #include "Msp430Usart.h"
  
  interface Msp430SpiConfigure {
--- 34,38 ----
   */
  
! #include "msp430usart.h"
  
  interface Msp430SpiConfigure {

Index: Msp430SpiDmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430SpiDmaP.nc,v
retrieving revision 1.1.2.1.4.1
retrieving revision 1.1.2.1.4.2
diff -C2 -d -r1.1.2.1.4.1 -r1.1.2.1.4.2
*** Msp430SpiDmaP.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1.4.1
--- Msp430SpiDmaP.nc	13 Jul 2006 20:38:18 -0000	1.1.2.1.4.2
***************
*** 92,95 ****
--- 92,96 ----
    }
  
+   default async command error_t UsartResource.isOwner[ uint8_t id ]() { return FAIL; }
    default async command error_t UsartResource.request[ uint8_t id ]() { return FAIL; }
    default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }

Index: Msp430SpiNoDmaP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430SpiNoDmaP.nc,v
retrieving revision 1.1.2.1.4.1
retrieving revision 1.1.2.1.4.2
diff -C2 -d -r1.1.2.1.4.1 -r1.1.2.1.4.2
*** Msp430SpiNoDmaP.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1.4.1
--- Msp430SpiNoDmaP.nc	13 Jul 2006 20:38:19 -0000	1.1.2.1.4.2
***************
*** 101,104 ****
--- 101,105 ----
    }
  
+   default async command error_t UsartResource.isOwner[ uint8_t id ]() { return FAIL; }
    default async command error_t UsartResource.request[ uint8_t id ]() { return FAIL; }
    default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }

Index: Msp430Uart0C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430Uart0C.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Msp430Uart0C.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1
--- Msp430Uart0C.nc	13 Jul 2006 20:38:21 -0000	1.1.2.2
***************
*** 37,41 ****
   */
  
! #include "Msp430Usart.h"
  
  generic configuration Msp430Uart0C() {
--- 37,41 ----
   */
  
! #include "msp430usart.h"
  
  generic configuration Msp430Uart0C() {
***************
*** 43,46 ****
--- 43,47 ----
    provides interface Resource;
    provides interface SerialByteComm;
+   provides interface Msp430UartControl as UartControl;
  
    uses interface Msp430UartConfigure;
***************
*** 50,54 ****
  
    enum {
!     CLIENT_ID = unique( MSP430_UART0_BUS ),
    };
  
--- 51,55 ----
  
    enum {
!     CLIENT_ID = unique( MSP430_UARTO_BUS ),
    };
  
***************
*** 56,59 ****
--- 57,61 ----
    Resource = UartP.Resource[ CLIENT_ID ];
    SerialByteComm = UartP.SerialByteComm;
+   UartControl = UartP.UartControl[ CLIENT_ID ];
    Msp430UartConfigure = UartP.Msp430UartConfigure[ CLIENT_ID ];
  

Index: Msp430Uart0P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430Uart0P.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Msp430Uart0P.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1
--- Msp430Uart0P.nc	13 Jul 2006 20:38:21 -0000	1.1.2.2
***************
*** 40,43 ****
--- 40,44 ----
    provides interface Resource[ uint8_t id ];
    provides interface ResourceConfigure[uint8_t id ];
+   provides interface Msp430UartControl as UartControl[ uint8_t id ];
    provides interface SerialByteComm;
  
***************
*** 54,57 ****
--- 55,59 ----
    ResourceConfigure = UartP.ResourceConfigure;
    Msp430UartConfigure = UartP.Msp430UartConfigure;
+   UartControl = UartP.UartControl;
    SerialByteComm = UartP.SerialByteComm;
    UsartResource = UartP.UsartResource;

Index: Msp430Uart1C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430Uart1C.nc,v
retrieving revision 1.1.2.7.4.1
retrieving revision 1.1.2.7.4.2
diff -C2 -d -r1.1.2.7.4.1 -r1.1.2.7.4.2
*** Msp430Uart1C.nc	15 Jun 2006 19:27:51 -0000	1.1.2.7.4.1
--- Msp430Uart1C.nc	13 Jul 2006 20:38:21 -0000	1.1.2.7.4.2
***************
*** 43,46 ****
--- 43,47 ----
    provides interface Resource;
    provides interface SerialByteComm;
+   provides interface Msp430UartControl as UartControl;
  
    uses interface Msp430UartConfigure;
***************
*** 56,59 ****
--- 57,61 ----
    Resource = UartP.Resource[ CLIENT_ID ];
    SerialByteComm = UartP.SerialByteComm;
+   UartControl = UartP.UartControl[ CLIENT_ID ];
    Msp430UartConfigure = UartP.Msp430UartConfigure[ CLIENT_ID ];
  

Index: Msp430Uart1P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430Uart1P.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Msp430Uart1P.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1
--- Msp430Uart1P.nc	13 Jul 2006 20:38:21 -0000	1.1.2.2
***************
*** 40,43 ****
--- 40,44 ----
    provides interface Resource[ uint8_t id ];
    provides interface ResourceConfigure[uint8_t id ];
+   provides interface Msp430UartControl as UartControl[ uint8_t id ];
    provides interface SerialByteComm;
  
***************
*** 54,57 ****
--- 55,59 ----
    ResourceConfigure = UartP.ResourceConfigure;
    Msp430UartConfigure = UartP.Msp430UartConfigure;
+   UartControl = UartP.UartControl;
    SerialByteComm = UartP.SerialByteComm;
    UsartResource = UartP.UsartResource;

Index: Msp430UartConfigure.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430UartConfigure.nc,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -C2 -d -r1.1.2.1 -r1.1.2.2
*** Msp430UartConfigure.nc	15 Jun 2006 19:27:51 -0000	1.1.2.1
--- Msp430UartConfigure.nc	13 Jul 2006 20:38:21 -0000	1.1.2.2
***************
*** 34,38 ****
   */
  
! #include "Msp430Usart.h"
  
  interface Msp430UartConfigure {
--- 34,38 ----
   */
  
! #include "msp430usart.h"
  
  interface Msp430UartConfigure {

Index: Msp430UartP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430UartP.nc,v
retrieving revision 1.1.2.7.4.1
retrieving revision 1.1.2.7.4.2
diff -C2 -d -r1.1.2.7.4.1 -r1.1.2.7.4.2
*** Msp430UartP.nc	15 Jun 2006 19:27:51 -0000	1.1.2.7.4.1
--- Msp430UartP.nc	13 Jul 2006 20:38:21 -0000	1.1.2.7.4.2
***************
*** 12,15 ****
--- 12,16 ----
    provides interface Resource[ uint8_t id ];
    provides interface ResourceConfigure[ uint8_t id ];
+   provides interface Msp430UartControl as UartControl[ uint8_t id ];
    provides interface SerialByteComm;
  
***************
*** 41,50 ****
  
    async command void ResourceConfigure.configure[ uint8_t id ]() {
!     call Usart.setModeUart(call Msp430UartConfigure.getConfig[id]());
!     call Usart.clrIntr();
!     call Usart.enableIntr();
    }
  
    async command void ResourceConfigure.unconfigure[ uint8_t id ]() {
    }
  
--- 42,50 ----
  
    async command void ResourceConfigure.configure[ uint8_t id ]() {
!     call UartControl.setModeDuplex[id]();
    }
  
    async command void ResourceConfigure.unconfigure[ uint8_t id ]() {
+     call Usart.disableIntr();
    }
  
***************
*** 53,56 ****
--- 53,74 ----
    }
  
+   async command void UartControl.setModeRx[ uint8_t id ]() {
+     call Usart.setModeUartRx(call Msp430UartConfigure.getConfig[id]());
+     call Usart.clrIntr();
+     call Usart.enableRxIntr();
+   }
+   
+   async command void UartControl.setModeTx[ uint8_t id ]() {
+     call Usart.setModeUartTx(call Msp430UartConfigure.getConfig[id]());
+     call Usart.clrIntr();
+     call Usart.enableTxIntr();
+   }
+   
+   async command void UartControl.setModeDuplex[ uint8_t id ]() {
+     call Usart.setModeUart(call Msp430UartConfigure.getConfig[id]());
+     call Usart.clrIntr();
+     call Usart.enableIntr();
+   }
+   
    async command error_t SerialByteComm.put( uint8_t data ) {
      call Usart.tx( data );
***************
*** 58,61 ****
--- 76,84 ----
    }
  
+ // FIXME: needs to be implemented SerialByteComm...
+ //   async command bool SerialByteComm.isTxDone() {
+ //     return call Usart.isTxEmpty();
+ //   }
+ 
    async event void UsartInterrupts.txDone() {
      signal SerialByteComm.putDone();
***************
*** 66,69 ****
--- 89,93 ----
    }
  
+   default async command error_t UsartResource.isOwner[ uint8_t id ]() { return FAIL; }
    default async command error_t UsartResource.request[ uint8_t id ]() { return FAIL; }
    default async command error_t UsartResource.immediateRequest[ uint8_t id ]() { return FAIL; }



More information about the Tinyos-2-commits mailing list