17#ifndef MBED_ANALOGIN_H
18#define MBED_ANALOGIN_H
20#include "platform/platform.h"
22#if DEVICE_ANALOGIN || defined(DOXYGEN_ONLY)
24#include "hal/analogin_api.h"
25#include "platform/SingletonPtr.h"
26#include "rtos/Mutex.h"
79 AnalogIn(
const PinMap &pinmap,
float vref = MBED_CONF_TARGET_DEFAULT_ADC_VREF);
80 AnalogIn(
const PinMap &&,
float vref = MBED_CONF_TARGET_DEFAULT_ADC_VREF) =
delete;
89 AnalogIn(PinName pin,
float vref = MBED_CONF_TARGET_DEFAULT_ADC_VREF);
160#if !defined(DOXYGEN_ONLY)
166 virtual void unlock()
An analog input, used for reading the voltage on a pin.
void set_reference_voltage(float vref)
Sets this AnalogIn instance's reference voltage.
AnalogIn(const PinMap &pinmap, float vref=MBED_CONF_TARGET_DEFAULT_ADC_VREF)
Create an AnalogIn, connected to the specified pin.
unsigned short read_u16()
Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF].
float read()
Read the input voltage, represented as a float in the range [0.0, 1.0].
float read_voltage()
Read the input voltage in volts.
float get_reference_voltage() const
Gets this AnalogIn instance's reference voltage.
AnalogIn(PinName pin, float vref=MBED_CONF_TARGET_DEFAULT_ADC_VREF)
Create an AnalogIn, connected to the specified pin.
void analogin_free(analogin_t *obj)
Release the analogin peripheral.
struct analogin_s analogin_t
Analogin hal structure.
Utility class for creating and using a singleton.