semf
|
#include <stm32analogout.h>
Public Types | |
enum class | ErrorCode : uint8_t { Start_HalError = 0 , Start_HalBusy , Start_HalTimeout , Stop_HalError , Stop_HalBusy , Stop_HalTimeout , SetValue_HalError , SetValue_HalBusy , SetValue_HalTimeout , IsrError_Isr } |
enum class | Alignment : uint32_t { Align8bitRight = 0 , Align12bitLeft , Align12bitRight } |
Public Member Functions | |
Stm32AnalogOut (DAC_HandleTypeDef &hwHandle, uint32_t channel, Alignment alignment) | |
Constructor. More... | |
Stm32AnalogOut (const Stm32AnalogOut &other)=delete | |
virtual | ~Stm32AnalogOut ()=default |
void | start () const override |
Starts the hardware module (DAC) for writing DAC values to the output. Call setValue before. More... | |
void | stop () const override |
void | setValue (uint32_t value) override |
Writes value into hardware register. Call start to output the value. More... | |
void | isrError (DAC_HandleTypeDef &dac) |
Sending a error signal. More... | |
virtual void | start () const =0 |
Starts the hardware module (DAC) for writing DAC values to the output. Call setValue before. More... | |
virtual void | stop () const =0 |
virtual void | setValue (uint32_t value)=0 |
Writes value into hardware register. Call start to output the value. More... | |
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< Stm32AnalogOut > * | queue () |
Get the list with all analog outs. More... | |
static void | systemIsrError (DAC_HandleTypeDef &dac) |
System-wide interrupt service routine for dac error. More... | |
Additional Inherited Members | |
Public Attributes inherited from semf::AnalogOut | |
Signal< Error > | error |
Definition at line 23 of file stm32analogout.h.
|
strong |
Alignment settings support by the MCU.
Enumerator | |
---|---|
Align8bitRight | |
Align12bitLeft | |
Align12bitRight |
Definition at line 41 of file stm32analogout.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 | |
SetValue_HalError | |
SetValue_HalBusy | |
SetValue_HalTimeout | |
IsrError_Isr |
Definition at line 27 of file stm32analogout.h.
semf::Stm32AnalogOut::Stm32AnalogOut | ( | DAC_HandleTypeDef & | hwHandle, |
uint32_t | channel, | ||
Alignment | alignment | ||
) |
Constructor.
hwHandle | Reference to hardware handle. |
channel | Dma channel, please see STM documentation. Value is forwarded to the HAL drivers. |
alignment | Alignment setting for channel. |
Definition at line 15 of file stm32analogout.cpp.
|
explicitdelete |
|
virtualdefault |
void semf::Stm32AnalogOut::isrError | ( | DAC_HandleTypeDef & | dac | ) |
Sending a error
signal.
dac | Pointer to dac hardware handler. |
IsrError_Isr | If the AnalogIn-IRQ results in an error. |
Definition at line 110 of file stm32analogout.cpp.
|
static |
Get the list with all analog outs.
Definition at line 98 of file stm32analogout.cpp.
|
overridevirtual |
Writes value
into hardware register. Call start
to output the value.
value | Digital to analog value. |
Implements semf::AnalogOut.
Definition at line 73 of file stm32analogout.cpp.
|
overridevirtual |
Starts the hardware module (DAC) for writing DAC values to the output. Call setValue
before.
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. |
Implements semf::AnalogOut.
Definition at line 23 of file stm32analogout.cpp.
|
overridevirtual |
Stops the DAC 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::AnalogOut.
Definition at line 48 of file stm32analogout.cpp.
|
static |
System-wide interrupt service routine for dac error.
dac | Hardware handler. |
Definition at line 104 of file stm32analogout.cpp.