semf
semf::Stm32AnalogInDma Class Reference

#include <stm32analogindma.h>

Inheritance diagram for semf::Stm32AnalogInDma:
Inheritance graph
Collaboration diagram for semf::Stm32AnalogInDma:
Collaboration graph

Public Types

enum class  ErrorCode : uint8_t {
  Start_HalError = 0 , Start_HalBusy , Start_HalTimeout , Stop_HalError ,
  Stop_HalBusy , Stop_HalTimeout , IsrError_Isr
}
 

Public Member Functions

 Stm32AnalogInDma (ADC_HandleTypeDef &hwHandle)
 Constructor. More...
 
 Stm32AnalogInDma (const Stm32AnalogInDma &other)=delete
 
virtual ~Stm32AnalogInDma ()=default
 
void start (uint8_t buffer[], size_t bufferSize) override
 Starts the hardware modules (ADC with DMA) for reading ADC values. More...
 
void stop () override
 
void isr (ADC_HandleTypeDef &adc)
 Interrupt service routine for adc conversion finished. More...
 
void isrError (ADC_HandleTypeDef &adc)
 Sending a error signal. More...
 
- Public Member Functions inherited from semf::AnalogInDma
virtual ~AnalogInDma ()=default
 
virtual void start (uint8_t buffer[], size_t bufferSize)=0
 Starts the hardware modules (ADC with DMA) for reading ADC values. More...
 
virtual void stop ()=0
 
- Public Member Functions inherited from semf::LinkedQueue< T >::Node
virtual ~Node ()=default
 
T * next () const
 Returns a pointer to the next element in a queue. More...
 
void setNext (T *next)
 Sets a pointer to the next element in a list. More...
 
bool isInQueue (LinkedQueue &queue)
 Returns if a node is part of this LinkedQueue. More...
 

Static Public Member Functions

static LinkedQueue< Stm32AnalogInDma > * queue ()
 Get the list with all analog ins. More...
 
static void systemIsr (ADC_HandleTypeDef &adc)
 System-wide interrupt service routine for adc conversion finished. More...
 
static void systemIsrError (ADC_HandleTypeDef &adc)
 System-wide interrupt service routine for adc error. More...
 

Additional Inherited Members

- Public Attributes inherited from semf::AnalogInDma
Signal dataAvailable
 
Signal< Errorerror
 

Detailed Description

Definition at line 20 of file stm32analogindma.h.

Member Enumeration Documentation

◆ ErrorCode

enum class semf::Stm32AnalogInDma::ErrorCode : uint8_t
strong

Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring).

Enumerator
Start_HalError 
Start_HalBusy 
Start_HalTimeout 
Stop_HalError 
Stop_HalBusy 
Stop_HalTimeout 
IsrError_Isr 

Definition at line 24 of file stm32analogindma.h.

Constructor & Destructor Documentation

◆ Stm32AnalogInDma() [1/2]

semf::Stm32AnalogInDma::Stm32AnalogInDma ( ADC_HandleTypeDef &  hwHandle)
explicit

Constructor.

Parameters
hwHandleadc hardware interface

Definition at line 17 of file stm32analogindma.cpp.

Here is the call graph for this function:

◆ Stm32AnalogInDma() [2/2]

semf::Stm32AnalogInDma::Stm32AnalogInDma ( const Stm32AnalogInDma other)
explicitdelete

◆ ~Stm32AnalogInDma()

virtual semf::Stm32AnalogInDma::~Stm32AnalogInDma ( )
virtualdefault

Member Function Documentation

◆ isr()

void semf::Stm32AnalogInDma::isr ( ADC_HandleTypeDef &  adc)

Interrupt service routine for adc conversion finished.

Parameters
adcHardware handler.

Definition at line 97 of file stm32analogindma.cpp.

◆ isrError()

void semf::Stm32AnalogInDma::isrError ( ADC_HandleTypeDef &  adc)

Sending a error signal.

Parameters
adcPointer to adc hardware handler.
Exceptions
IsrError_IsrIf the AnalogIn-IRQ results in an error.

Definition at line 106 of file stm32analogindma.cpp.

◆ queue()

LinkedQueue< Stm32AnalogInDma > * semf::Stm32AnalogInDma::queue ( )
static

Get the list with all analog ins.

Returns
The list with all analog ins.

Definition at line 79 of file stm32analogindma.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ start()

void semf::Stm32AnalogInDma::start ( uint8_t  buffer[],
size_t  bufferSize 
)
overridevirtual

Starts the hardware modules (ADC with DMA) for reading ADC values.

Parameters
bufferBuffer where the read data should be stored.
bufferSizeSize of buffer in bytes.
Exceptions
Start_HalErrorIf the ST-HAL stumbles upon an error.
Start_HalBusyIf the ST-HAL is busy.
Start_HalTimeoutIf the ST-HAL times out.

Implements semf::AnalogInDma.

Definition at line 23 of file stm32analogindma.cpp.

◆ stop()

void semf::Stm32AnalogInDma::stop ( )
overridevirtual

Stops the ADC hardware.

Exceptions
Stop_HalErrorIf the ST-HAL stumbles upon an error.
Stop_HalBusyIf the ST-HAL is busy.
Stop_HalTimeoutIf the ST-HAL times out.

Implements semf::AnalogInDma.

Definition at line 54 of file stm32analogindma.cpp.

◆ systemIsr()

void semf::Stm32AnalogInDma::systemIsr ( ADC_HandleTypeDef &  adc)
static

System-wide interrupt service routine for adc conversion finished.

Parameters
adcHardware handler.

Definition at line 85 of file stm32analogindma.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ systemIsrError()

void semf::Stm32AnalogInDma::systemIsrError ( ADC_HandleTypeDef &  adc)
static

System-wide interrupt service routine for adc error.

Parameters
adcHardware handler.

Definition at line 91 of file stm32analogindma.cpp.

Here is the call graph for this function:
Here is the caller graph for this function: