@@ -72,13 +72,19 @@ class AnalogIn {
72
72
/* * Create an AnalogIn, connected to the specified pin
73
73
*
74
74
* @param pinmap reference to structure which holds static pinmap.
75
+ * @param vref (optional) Reference voltage of this AnalogIn instance (defaults to target.default-adc-vref).
76
+ *
77
+ * @note An input voltage at or above the given vref value will produce a 1.0 result when `read` is called
75
78
*/
76
79
AnalogIn (const PinMap &pinmap, float vref = MBED_CONF_TARGET_DEFAULT_ADC_VREF);
77
80
AnalogIn (const PinMap &&, float vref = MBED_CONF_TARGET_DEFAULT_ADC_VREF) = delete ; // prevent passing of temporary objects
78
81
79
82
/* * Create an AnalogIn, connected to the specified pin
80
83
*
81
84
* @param pin AnalogIn pin to connect to
85
+ * @param vref (optional) Reference voltage of this AnalogIn instance (defaults to target.default-adc-vref).
86
+ *
87
+ * @note An input voltage at or above the given vref value will produce a 1.0 result when `read` is called
82
88
*/
83
89
AnalogIn (PinName pin, float vref = MBED_CONF_TARGET_DEFAULT_ADC_VREF);
84
90
@@ -98,9 +104,11 @@ class AnalogIn {
98
104
/* *
99
105
* Read the input voltage in volts. The output depends on the target board's
100
106
* ADC reference voltage (typically equal to supply voltage). The ADC reference voltage
101
- * sets the maximum voltage the ADC can quantify (ie: Vin == Vref when ADC output == ADC_MAX_VALUE )
107
+ * sets the maximum voltage the ADC can quantify (ie: ADC output == ADC_MAX_VALUE when Vin == Vref )
102
108
*
103
- * The target's ADC reference voltage can be configured by overriding "target.adc_vref"
109
+ * The target's default ADC reference voltage is determined by the configuration
110
+ * option target.default-adc_vref. The reference voltage for a particular input
111
+ * can be manually specified by either the constructor or `AnalogIn::set_reference_voltage`.
104
112
*
105
113
* @returns A floating-point value representing the current input voltage, measured in volts.
106
114
*/
@@ -109,8 +117,6 @@ class AnalogIn {
109
117
/* *
110
118
* Sets this AnalogIn instance's reference voltage.
111
119
*
112
- * Defaults to the configurable MBED_CONF_TARGET_DEFAULT_ADC_VREF setting.
113
- *
114
120
* The AnalogIn's reference voltage is used to scale the output when calling AnalogIn::read_volts
115
121
*
116
122
* @param[in] vref New ADC reference voltage for this AnalogIn instance.
@@ -122,7 +128,7 @@ class AnalogIn {
122
128
*
123
129
* @returns A floating-point value representing this AnalogIn's reference voltage, measured in volts.
124
130
*/
125
- float get_reference_voltage (void ) ;
131
+ float get_reference_voltage () const ;
126
132
127
133
/* * An operator shorthand for read()
128
134
*
0 commit comments