[Tinyos-2-commits] CVS: tinyos-2.x/tos/chips/msp430/usart HplMsp430I2C0C.nc, NONE, 1.1.2.1 HplMsp430Usart0C.nc, 1.1.2.10, 1.1.2.11 HplMsp430Usart0P.nc, 1.1.2.10, 1.1.2.11 HplMsp430Usart1P.nc, 1.1.2.6, 1.1.2.7 Msp430I2C0P.nc, 1.1.2.3, 1.1.2.4 Msp430I2CP.nc, 1.1.2.5, 1.1.2.6 Msp430Usart0C.nc, 1.1.2.7, 1.1.2.8

Jonathan Hui jwhui at users.sourceforge.net
Thu Aug 31 07:59:57 PDT 2006


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

Modified Files:
      Tag: tinyos-2_0_devel-BRANCH
	HplMsp430Usart0C.nc HplMsp430Usart0P.nc HplMsp430Usart1P.nc 
	Msp430I2C0P.nc Msp430I2CP.nc Msp430Usart0C.nc 
Added Files:
      Tag: tinyos-2_0_devel-BRANCH
	HplMsp430I2C0C.nc 
Log Message:

Update USART1 implementation to match changes in interfaces.

Support msp430 chips that do not have I2C on USART0.



--- NEW FILE: HplMsp430I2C0C.nc ---

configuration HplMsp430I2C0C {
  
  provides interface HplMsp430I2C;
  
}

implementation {
  
  components HplMsp430I2C0P as HplI2CP;
  HplMsp430I2C = HplI2CP;
  
  components HplMsp430Usart0P as HplUsartP;
  HplUsartP.HplI2C -> HplI2CP;
  HplI2CP.HplUsart -> HplUsartP;
  
  components HplMsp430GeneralIOC as GIO;
  HplI2CP.SIMO -> GIO.SIMO0;
  HplI2CP.UCLK -> GIO.UCLK0;
  
}

Index: HplMsp430Usart0C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart0C.nc,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** HplMsp430Usart0C.nc	30 Aug 2006 17:15:55 -0000	1.1.2.10
--- HplMsp430Usart0C.nc	31 Aug 2006 14:59:54 -0000	1.1.2.11
***************
*** 65,75 ****
  
  configuration HplMsp430Usart0C {
! 
    provides interface AsyncStdControl;
    provides interface HplMsp430Usart;
    provides interface HplMsp430UsartInterrupts;
-   provides interface HplMsp430I2C;
    provides interface HplMsp430I2CInterrupts;
! 
  }
  
--- 65,74 ----
  
  configuration HplMsp430Usart0C {
!   
    provides interface AsyncStdControl;
    provides interface HplMsp430Usart;
    provides interface HplMsp430UsartInterrupts;
    provides interface HplMsp430I2CInterrupts;
!   
  }
  
***************
*** 82,90 ****
    HplMsp430I2CInterrupts = HplUsartP;
    
-   components HplMsp430I2C0P as HplI2CP;
-   HplMsp430I2C = HplI2CP;
-   HplUsartP.HplI2C -> HplI2CP;
-   HplI2CP.HplUsart -> HplUsartP;
-   
    components HplMsp430GeneralIOC as GIO;
    HplUsartP.SIMO -> GIO.SIMO0;
--- 81,84 ----
***************
*** 94,99 ****
    HplUsartP.UTXD -> GIO.UTXD0;
    
-   HplI2CP.SIMO -> GIO.SIMO0;
-   HplI2CP.UCLK -> GIO.UCLK0;
-   
  }
--- 88,90 ----

Index: HplMsp430Usart0P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart0P.nc,v
retrieving revision 1.1.2.10
retrieving revision 1.1.2.11
diff -C2 -d -r1.1.2.10 -r1.1.2.11
*** HplMsp430Usart0P.nc	30 Aug 2006 17:15:55 -0000	1.1.2.10
--- HplMsp430Usart0P.nc	31 Aug 2006 14:59:54 -0000	1.1.2.11
***************
*** 465,468 ****
--- 465,470 ----
  
    default async event void I2CInterrupts.fired() {}
+   default async command bool HplI2C.isI2C() { return FALSE; }
+   default async command void HplI2C.clearModeI2C() {}
    
  }

Index: HplMsp430Usart1P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/HplMsp430Usart1P.nc,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -C2 -d -r1.1.2.6 -r1.1.2.7
*** HplMsp430Usart1P.nc	3 Aug 2006 18:10:41 -0000	1.1.2.6
--- HplMsp430Usart1P.nc	31 Aug 2006 14:59:54 -0000	1.1.2.7
***************
*** 109,113 ****
    async command error_t AsyncStdControl.stop() {
      call Usart.disableSpi();
-     call Usart.disableI2C();
      call Usart.disableUart();
      return SUCCESS;
--- 109,112 ----
***************
*** 189,196 ****
    }
  
-   async command bool Usart.isI2C() {
-       return FALSE;
-   }
- 
    async command msp430_usartmode_t Usart.getMode() {
      if (call Usart.isUart())
--- 188,191 ----
***************
*** 202,207 ****
      else if (call Usart.isSpi())
        return USART_SPI;
-     else if (call Usart.isI2C())
-       return USART_I2C;
      else
        return USART_NONE;
--- 197,200 ----
***************
*** 265,277 ****
    }
  
-   async command void Usart.enableI2C() {
-     return;
-   }
- 
-   async command void Usart.disableI2C() {
-     return;
-  }
- 
- 
    void configSpi(msp430_spi_config_t* config) {
      msp430_uctl_t uctl = call Usart.getUctl();
--- 258,261 ----
***************
*** 297,301 ****
    async command void Usart.setModeSpi(msp430_spi_config_t* config) {
      call Usart.disableUart();
-     call Usart.disableI2C();
      atomic {
        call Usart.resetUsart(TRUE);
--- 281,284 ----
***************
*** 340,344 ****
  
      call Usart.disableSpi();
-     call Usart.disableI2C();
      call Usart.disableUart();
  
--- 323,326 ----
***************
*** 359,363 ****
  
      call Usart.disableSpi();
-     call Usart.disableI2C();
      call Usart.disableUart();
      
--- 341,344 ----
***************
*** 378,382 ****
  
      call Usart.disableSpi();
-     call Usart.disableI2C();
      call Usart.disableUart();
  
--- 359,362 ----
***************
*** 394,404 ****
    }
  
- 
-     // i2c enable bit is not set by default
-   async command void Usart.setModeI2C(msp430_i2c_config_t* config) {
-     return;
-   }
- 
- 
    async command bool Usart.isTxIntrPending(){
      if (IFG2 & UTXIFG1){
--- 374,377 ----

Index: Msp430I2C0P.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430I2C0P.nc,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -C2 -d -r1.1.2.3 -r1.1.2.4
*** Msp430I2C0P.nc	30 Aug 2006 17:15:55 -0000	1.1.2.3
--- Msp430I2C0P.nc	31 Aug 2006 14:59:54 -0000	1.1.2.4
***************
*** 57,62 ****
    I2CInterrupts = I2CP.I2CInterrupts;
    
!   components HplMsp430Usart0C as UsartC;
!   I2CP.HplI2C -> UsartC;
    
    components LedsC as Leds;
--- 57,62 ----
    I2CInterrupts = I2CP.I2CInterrupts;
    
!   components HplMsp430I2C0C as HplI2CC;
!   I2CP.HplI2C -> HplI2CC;
    
    components LedsC as Leds;

Index: Msp430I2CP.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Attic/Msp430I2CP.nc,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -C2 -d -r1.1.2.5 -r1.1.2.6
*** Msp430I2CP.nc	30 Aug 2006 17:28:41 -0000	1.1.2.5
--- Msp430I2CP.nc	31 Aug 2006 14:59:55 -0000	1.1.2.6
***************
*** 53,56 ****
--- 53,58 ----
  implementation {
    
+   MSP430REG_NORACE(I2CIE);
+   
    enum {
      TIMEOUT = 64,

Index: Msp430Usart0C.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/chips/msp430/usart/Msp430Usart0C.nc,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -C2 -d -r1.1.2.7 -r1.1.2.8
*** Msp430Usart0C.nc	30 Aug 2006 17:15:55 -0000	1.1.2.7
--- Msp430Usart0C.nc	31 Aug 2006 14:59:55 -0000	1.1.2.8
***************
*** 44,48 ****
    provides interface HplMsp430UsartInterrupts;
    provides interface HplMsp430I2CInterrupts;
!   
    uses interface ResourceConfigure;
    
--- 44,51 ----
    provides interface HplMsp430UsartInterrupts;
    provides interface HplMsp430I2CInterrupts;
! #ifdef __msp430_have_usart0_with_i2c
!   provides interface HplMsp430I2C;
! #endif  
! 
    uses interface ResourceConfigure;
    
***************
*** 63,68 ****
    HplMsp430I2CInterrupts = UsartShareP.I2CInterrupts[ CLIENT_ID ];
    
!   components HplMsp430Usart0C as UsartC;
!   HplMsp430Usart = UsartC;
! 
  }
--- 66,76 ----
    HplMsp430I2CInterrupts = UsartShareP.I2CInterrupts[ CLIENT_ID ];
    
!   components HplMsp430Usart0C as HplUsartC;
!   HplMsp430Usart = HplUsartC;
!   
! #ifdef __msp430_have_usart0_with_i2c
!   components HplMsp430I2C0C as HplI2CC;
!   HplMsp430I2C = HplI2CC;
! #endif
!   
  }



More information about the Tinyos-2-commits mailing list