semf
semf::AnalogIn Class Referenceabstract

Interface for using ADC (Analog to Digital Conversion) hardware in interrupt mode. More...

#include <analogin.h>

Inheritance diagram for semf::AnalogIn:
Inheritance graph
Collaboration diagram for semf::AnalogIn:
Collaboration graph

Public Member Functions

virtual ~AnalogIn ()=default
 
virtual void start ()=0
 Starts the hardware module (ADC) for reading ADC values. After finishing analog to digital conversion, the dataAvailable signal will be emitted. More...
 
virtual uint32_t value ()=0
 Returns the last read value. More...
 
virtual void stop ()=0
 

Public Attributes

Signal dataAvailable
 
Signal< Errorerror
 

Detailed Description

Interface for using ADC (Analog to Digital Conversion) hardware in interrupt mode.

Inheriting class handles a hardware unit with one or more channels.

dataAvailble signal is emitted after every converted channel.

Definition at line 26 of file analogin.h.

Constructor & Destructor Documentation

◆ ~AnalogIn()

virtual semf::AnalogIn::~AnalogIn ( )
virtualdefault

Member Function Documentation

◆ start()

virtual void semf::AnalogIn::start ( )
pure virtual

Starts the hardware module (ADC) for reading ADC values. After finishing analog to digital conversion, the dataAvailable signal will be emitted.

Implemented in semf::Stm32AnalogIn.

◆ stop()

virtual void semf::AnalogIn::stop ( )
pure virtual

Stops the ADC hardware.

Implemented in semf::Stm32AnalogIn.

◆ value()

virtual uint32_t semf::AnalogIn::value ( )
pure virtual

Returns the last read value.

Note
This function should be called after receiving the dataAvailable signal.
Returns
analog value

Implemented in semf::Stm32AnalogIn.

Member Data Documentation

◆ dataAvailable

Signal semf::AnalogIn::dataAvailable

Signal is emitted after one channel is converted.

Definition at line 46 of file analogin.h.

◆ error

Signal<Error> semf::AnalogIn::error

Signal is emitted after an error occurred.

Definition at line 48 of file analogin.h.