]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/platforms/mica/VoltageC.nc
Consistent voltage stuff for mica family based on code from
[tinyos-2.x.git] / tos / platforms / mica / VoltageC.nc
diff --git a/tos/platforms/mica/VoltageC.nc b/tos/platforms/mica/VoltageC.nc
new file mode 100644 (file)
index 0000000..f99b346
--- /dev/null
@@ -0,0 +1,21 @@
+/**\r
+ * Battery Voltage. The returned value represents the difference\r
+ * between the battery voltage and V_BG (1.23V). The formula to convert\r
+ * it to mV is: 1223 * 1024 / value.\r
+ *\r
+ * @author Razvan Musaloiu-E.\r
+ */\r
+\r
+generic configuration VoltageC()\r
+{\r
+  provides interface Read<uint16_t>;\r
+}\r
+\r
+implementation\r
+{\r
+  components new AdcReadClientC(), VoltageP;\r
+\r
+  Read = AdcReadClientC;\r
+\r
+  AdcReadClientC.Atm128AdcConfig -> VoltageP;\r
+}\r