Class hal::adc
Analog to Digital Converter (ADC) hardware abstraction interface. More...
#include <adc.hpp>
Inherited by the following classes: hal::lpc40::adc, hal::mock::adc, hal::soft::adc_mux_pin, hal::soft::inert_adc
Classes
Type | Name |
---|---|
struct | read_t Result from reading the adc. |
Public Functions
Type | Name |
---|---|
result< read_t > | read () Sample the analog to digital converter and return the result. |
virtual | ~adc () = default |
Detailed Description
Use this interface for devices and peripherals that can convert analog voltage signals into a digital number.
ADC peripheral only know the proportion of a voltage signal relative to a Vss (negative reference) and a Vcc (positive reference) and thus cannot describe the voltage directly.
Public Functions Documentation
function read
Sample the analog to digital converter and return the result.
inline result< read_t > hal::adc::read ()
Returns:
result<read_t> - the sampled adc value
function ~adc
virtual hal::adc::~adc () = default
The documentation for this class was generated from the following file libraries/include/libhal/adc.hpp