semf
|
Stm32 driver for using a anologIn channel. More...
#include <stm32analogin.h>
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 | |
Stm32AnalogIn (ADC_HandleTypeDef &hwHandle) | |
Constructor. More... | |
Stm32AnalogIn (const Stm32AnalogIn &other)=delete | |
virtual | ~Stm32AnalogIn ()=default |
virtual void | start () |
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 () |
Returns the last read value. 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::AnalogIn | |
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 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< Stm32AnalogIn > * | 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::AnalogIn | |
Signal | dataAvailable |
Signal< Error > | error |
Stm32 driver for using a anologIn channel.
start()
function inside the dataAvailable
slot. In case continuous conversions are desired, you have to configure the ADC accordingly. Definition at line 25 of file stm32analogin.h.
|
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 29 of file stm32analogin.h.
|
explicit |
Constructor.
hwHandle | adc hardware interface |
Definition at line 16 of file stm32analogin.cpp.
|
explicitdelete |
|
virtualdefault |
void semf::Stm32AnalogIn::isr | ( | ADC_HandleTypeDef & | adc | ) |
Interrupt service routine for adc conversion finished.
adc | Hardware handler. |
Definition at line 97 of file stm32analogin.cpp.
void semf::Stm32AnalogIn::isrError | ( | ADC_HandleTypeDef & | adc | ) |
Sending a error
signal.
adc | Pointer to adc hardware handler. |
IsrError_Isr | If the AnalogIn-IRQ results in an error. |
Definition at line 106 of file stm32analogin.cpp.
|
static |
Get the list with all analog ins.
Definition at line 79 of file stm32analogin.cpp.
|
virtual |
Starts the hardware module (ADC) for reading ADC values. After finishing analog to digital conversion, the dataAvailable
signal will be emitted.
Start_HalError | If the ST-HAL stumbles upon an error. |
Start_HalBusy | If the ST-HAL is busy. |
Start_HalTimeout | If the ST-HAL times out. |
dataAvailable
slot. Implements semf::AnalogIn.
Definition at line 22 of file stm32analogin.cpp.
|
overridevirtual |
Stops the ADC hardware.
Stop_HalError | If the ST-HAL stumbles upon an error. |
Stop_HalBusy | If the ST-HAL is busy. |
Stop_HalTimeout | If the ST-HAL times out. |
Implements semf::AnalogIn.
Definition at line 54 of file stm32analogin.cpp.
|
static |
System-wide interrupt service routine for adc conversion finished.
adc | Hardware handler. |
Definition at line 85 of file stm32analogin.cpp.
|
static |
System-wide interrupt service routine for adc error.
adc | Hardware handler. |
Definition at line 91 of file stm32analogin.cpp.
|
virtual |
Returns the last read value.
dataAvailable
signal. Implements semf::AnalogIn.
Definition at line 47 of file stm32analogin.cpp.