File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,8 @@ class AnalogIn {
93
93
*/
94
94
unsigned short read_u16 ();
95
95
96
- /* * Read the input voltage in volts. The output depends on the target board's
96
+ /* *
97
+ * Read the input voltage in volts. The output depends on the target board's
97
98
* ADC reference voltage (typically equal to supply voltage). The ADC reference voltage
98
99
* sets the maximum voltage the ADC can quantify (ie: Vin == Vref when ADC output == ADC_MAX_VALUE)
99
100
*
@@ -104,16 +105,23 @@ class AnalogIn {
104
105
float read_volts ();
105
106
106
107
/* *
107
- * Sets this ADC instance's reference voltage.
108
+ * Sets this AnalogIn instance's reference voltage.
108
109
*
109
110
* Defaults to the configurable MBED_CONF_DRIVERS_DEFAULT_ADC_VREF setting.
110
111
*
111
- * The ADC 's reference voltage is used to scale the output when calling AnalogIn::read_volts
112
+ * The AnalogIn 's reference voltage is used to scale the output when calling AnalogIn::read_volts
112
113
*
113
- * @param[in] vref New ADC reference voltage for this ADC instance.
114
+ * @param[in] vref New ADC reference voltage for this AnalogIn instance.
114
115
*/
115
116
void set_reference_voltage (float vref);
116
117
118
+ /* *
119
+ * Gets this AnalogIn instance's reference voltage.
120
+ *
121
+ * @returns A floating-point value representing this AnalogIn's reference voltage, measured in volts.
122
+ */
123
+ float get_reference_voltage (void );
124
+
117
125
/* * An operator shorthand for read()
118
126
*
119
127
* The float() operator can be used as a shorthand for read() to simplify common code sequences
Original file line number Diff line number Diff line change @@ -63,6 +63,10 @@ void AnalogIn::set_reference_voltage(float vref) {
63
63
this ->vref = vref;
64
64
}
65
65
66
+ float AnalogIn::get_reference_voltage (void ) {
67
+ return this ->vref ;
68
+ }
69
+
66
70
} // namespace mbed
67
71
68
72
#endif
You can’t perform that action at this time.
0 commit comments