Revision 891
Moved comments to headers. That was painful.
battery.h | ||
---|---|---|
38 | 38 |
#define _BATTERY_H_ |
39 | 39 |
|
40 | 40 |
/** |
41 |
* @addtogroup battery |
|
41 |
* @defgroup battery Battery |
|
42 |
* @brief Functions for reading battery voltage. |
|
43 |
* |
|
44 |
* Contains functions for checking the current |
|
45 |
* voltage of the battery. Include battery.h to |
|
46 |
* access these functions. |
|
47 |
* |
|
42 | 48 |
* @{ |
43 | 49 |
**/ |
44 | 50 |
|
... | ... | |
49 | 55 |
/** @brief Low battery voltage. ( < 6 V) **/ |
50 | 56 |
#define BATTERY_LOWV 152 |
51 | 57 |
|
52 |
/** @brief Read the battery voltage. **/ |
|
58 |
/** |
|
59 |
* @brief Read the battery voltage. |
|
60 |
* |
|
61 |
* Returns the voltage of the battery as an analog8 |
|
62 |
* reading. 128 is approximately 5 volts. analog_init |
|
63 |
* must be called before using this function. |
|
64 |
* |
|
65 |
* @return the voltage of the battery as an analog8 |
|
66 |
* reading |
|
67 |
* |
|
68 |
* @see analog_init, battery, analog8 |
|
69 |
**/ |
|
53 | 70 |
int battery8(void); |
54 |
/** @brief Read the battery voltage in deciVolts. **/ |
|
71 |
|
|
72 |
/** |
|
73 |
* @brief Read the battery voltage in deciVolts. |
|
74 |
* |
|
75 |
* Returns the voltage of the battery in deciVolts. |
|
76 |
* analog_init must be called before using this function. |
|
77 |
* |
|
78 |
* @return the voltage of the battery in deciVolts. |
|
79 |
* |
|
80 |
* @see analog_init, battery8 |
|
81 |
**/ |
|
55 | 82 |
int battery(void); |
56 |
/** @brief Check if the battery is low. **/ |
|
83 |
|
|
84 |
/** |
|
85 |
* @brief Check if the battery is low. |
|
86 |
* |
|
87 |
* Checks if the battery is low. analog_init must be called before |
|
88 |
* this function can be used. This function waits for several low |
|
89 |
* battery readings in a row to avoid false positives. |
|
90 |
* |
|
91 |
* @return 1 if the battery is low, 0 otherwise |
|
92 |
* |
|
93 |
* @see analog_init |
|
94 |
**/ |
|
57 | 95 |
char battery_low(void); |
58 |
/** @brief Get an average battery voltage reading. **/ |
|
96 |
|
|
97 |
/** |
|
98 |
* @brief Get an average battery voltage reading. |
|
99 |
* |
|
100 |
* Averages n_samples battery8 readings. This function may |
|
101 |
* take a while to complete, and is only made available |
|
102 |
* for convenience. analog_init must be called before this |
|
103 |
* function may be used. |
|
104 |
* |
|
105 |
* @param n_samples the number of times to sample the battery voltage |
|
106 |
* |
|
107 |
* @return the average reading for the battery voltage, where 128 |
|
108 |
* is approximately 5 Volts. |
|
109 |
* |
|
110 |
* @see analog_init, battery |
|
111 |
**/ |
|
59 | 112 |
int battery8_avg(int n_samples); |
60 | 113 |
|
61 | 114 |
/** @} **/ //end addtogroup |
Also available in: Unified diff