]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/sensorboards/mts300/AccelConfigP.nc
Workaround the erase problems with AT45DB
[tinyos-2.x.git] / tos / sensorboards / mts300 / AccelConfigP.nc
index 6005babd16224bf14e73c2d248165e854668f092..d55464115c1dac10d5428359b6fda0fdac8c59ad 100644 (file)
@@ -1,44 +1,41 @@
-/* $Id$\r
- * Copyright (c) 2006 Intel Corporation\r
- * All rights reserved.\r
- *\r
- * This file is distributed under the terms in the attached INTEL-LICENSE\r
- * file. If you do not find these files, copies can be found by writing to\r
- * Intel Research Berkeley, 2150 Shattuck Avenue, Suite 1300, Berkeley, CA,\r
- * 94704.  Attention:  Intel License Inquiry.\r
- */\r
-/**\r
- * Internal component for basicsb photodiode. Arbitrates access to the photo\r
- * diode and automatically turns it on or off based on user requests.\r
- *\r
- * @author David Gay\r
- */\r
-\r
-#include "mts300.h"\r
-\r
-configuration AccelConfigP {\r
-  provides {\r
-    interface Init;\r
-    interface StdControl;\r
-\r
-    interface Atm128AdcConfig as ConfigX;\r
-    interface Atm128AdcConfig as ConfigY;\r
-    interface ResourceConfigure as ResourceX;\r
-    interface ResourceConfigure as ResourceY;\r
-  }\r
-}\r
-implementation {\r
-  components AccelP, MicaBusC;\r
-\r
-       Init = AccelP;\r
-       StdControl = AccelP;\r
-\r
-  ConfigX = AccelP.ConfigX;\r
-  ConfigY = AccelP.ConfigY;\r
-  ResourceX = AccelP.ResourceX;\r
-  ResourceY = AccelP.ResourceY;\r
-\r
-  AccelP.AccelPower -> MicaBusC.PW4;\r
-  AccelP.AccelAdcX -> MicaBusC.Adc3;\r
-  AccelP.AccelAdcY -> MicaBusC.Adc4;\r
-}\r
+/* $Id$
+ * Copyright (c) 2006 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.
+ */
+/**
+ * Internal component for basicsb photodiode. Arbitrates access to the photo
+ * diode and automatically turns it on or off based on user requests.
+ * 
+ * @author David Gay
+ */
+
+configuration AccelConfigP { 
+  provides {
+    interface Resource[uint8_t client];
+    interface Atm128AdcConfig as ConfigX;
+    interface Atm128AdcConfig as ConfigY;
+  }
+}
+implementation {
+  components AccelP, MicaBusC, new TimerMilliC() as WarmupTimer,
+    new RoundRobinArbiterC(UQ_ACCEL_RESOURCE) as Arbiter,
+    new SplitControlPowerManagerC() as PowerManager;
+
+  Resource = Arbiter;
+  ConfigX = AccelP.ConfigX;
+  ConfigY = AccelP.ConfigY;
+
+  PowerManager.ResourceDefaultOwner -> Arbiter;
+  PowerManager.ArbiterInfo -> Arbiter;
+  PowerManager.SplitControl -> AccelP;
+
+  AccelP.Timer -> WarmupTimer;
+  AccelP.AccelPin -> MicaBusC.PW4;
+  AccelP.AccelAdcX -> MicaBusC.Adc3;
+  AccelP.AccelAdcY -> MicaBusC.Adc4;
+}