]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/chips/pxa27x/i2c/HalPXA27xI2CMasterC.nc
Merge devel code into the trunk.
[tinyos-2.x.git] / tos / chips / pxa27x / i2c / HalPXA27xI2CMasterC.nc
diff --git a/tos/chips/pxa27x/i2c/HalPXA27xI2CMasterC.nc b/tos/chips/pxa27x/i2c/HalPXA27xI2CMasterC.nc
new file mode 100644 (file)
index 0000000..73cf207
--- /dev/null
@@ -0,0 +1,62 @@
+/* $Id$ */\r
+/*\r
+ * Copyright (c) 2005 Arch Rock Corporation \r
+ * All rights reserved. \r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions are\r
+ * met:\r
+ *     Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ *     Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ *  \r
+ *   Neither the name of the Arch Rock Corporation nor the names of its\r
+ * contributors may be used to endorse or promote products derived from\r
+ * this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\r
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\r
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\r
+ * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE ARCHED\r
+ * ROCK OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\r
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\r
+ * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\r
+ * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\r
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE\r
+ * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\r
+ * DAMAGE.\r
+ */\r
+/**\r
+ * This Hal module implements the TinyOS 2.0 I2CPacket interface over\r
+ * the PXA27x I2C Hpl\r
+ *\r
+ * @author Phil Buonadonna\r
+ */\r
+\r
+#include <I2C.h>\r
+\r
+configuration HalPXA27xI2CMasterC\r
+{\r
+  provides interface I2CPacket<TI2CBasicAddr>;\r
+\r
+  uses interface HplPXA27xGPIOPin as I2CSCL;\r
+  uses interface HplPXA27xGPIOPin as I2CSDA;\r
+}\r
+\r
+implementation\r
+{\r
+  components HalPXA27xI2CMasterP;\r
+  components HplPXA27xI2CC;\r
+  components PlatformP;\r
+\r
+  I2CPacket = HalPXA27xI2CMasterP;\r
+\r
+  HalPXA27xI2CMasterP.Init <- PlatformP.InitL2;\r
+\r
+  HalPXA27xI2CMasterP.I2C -> HplPXA27xI2CC.I2C;\r
+\r
+  I2CSCL = HalPXA27xI2CMasterP.I2CSCL;\r
+  I2CSDA = HalPXA27xI2CMasterP.I2CSDA;\r
+}\r