--- /dev/null
+/**\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
+module VoltageP\r
+{\r
+ provides interface Atm128AdcConfig;\r
+}\r
+implementation\r
+{\r
+ async command uint8_t Atm128AdcConfig.getChannel()\r
+ {\r
+ // select the 1.23V (V_BG). Reference: Table 97, page 244 from the Atmega128\r
+ return ATM128_ADC_SNGL_1_23;\r
+ }\r
+\r
+ async command uint8_t Atm128AdcConfig.getRefVoltage()\r
+ {\r
+ return ATM128_ADC_VREF_OFF;\r
+ }\r
+\r
+ async command uint8_t Atm128AdcConfig.getPrescaler()\r
+ {\r
+ return ATM128_ADC_PRESCALE;\r
+ }\r
+}\r