]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/msp430/usart/Msp430Spi0C.nc
Update to include paramaterization of the UartStream interface as well as push Resour...
[tinyos-2.x.git] / tos / chips / msp430 / usart / Msp430Spi0C.nc
index 882b6110a138ea1fb79c5d30663e6b75817b608d..fe87e86243aa9d809749af7b1ade80f502589921 100644 (file)
@@ -1,5 +1,5 @@
-/*
- * Copyright (c) 2005-2006 Arch Rock Corporation
+/**
+ * Copyright (c) 2005-2006 Arched Rock Corporation
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -11,7 +11,7 @@
  *   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
+ * - 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.
  *
  * transfers in software. To utilize the DMA, use Msp430SpiDma0P in
  * place of Msp430SpiNoDma0P.
  *
- * @author Jonathan Hui <jhui@archrock.com>
+ * @author Jonathan Hui <jhui@archedrock.com>
+ * @author Mark Hays
  * @version $Revision$ $Date$
  */
 
-#include "msp430UsartResource.h"
+#include "msp430usart.h"
 
 generic configuration Msp430Spi0C() {
-  
+
   provides interface Resource;
+  provides interface ResourceRequested;
   provides interface SpiByte;
   provides interface SpiPacket;
-  
+
+  uses interface Msp430SpiConfigure;
 }
 
 implementation {
-  
+
   enum {
     CLIENT_ID = unique( MSP430_SPIO_BUS ),
   };
-  
+
+#ifdef ENABLE_SPI0_DMA
+#warning "Enabling SPI DMA on USART0"
+  components Msp430SpiDma0P as SpiP;
+#else
   components Msp430SpiNoDma0P as SpiP;
+#endif
+
   Resource = SpiP.Resource[ CLIENT_ID ];
   SpiByte = SpiP.SpiByte;
   SpiPacket = SpiP.SpiPacket[ CLIENT_ID ];
+  Msp430SpiConfigure = SpiP.Msp430SpiConfigure[ CLIENT_ID ];
 
   components new Msp430Usart0C() as UsartC;
+  ResourceRequested = UsartC;
+  SpiP.ResourceConfigure[ CLIENT_ID ] <- UsartC.ResourceConfigure;
   SpiP.UsartResource[ CLIENT_ID ] -> UsartC.Resource;
   SpiP.UsartInterrupts -> UsartC.HplMsp430UsartInterrupts;
-  
+
 }