semf
|
#include <stm32analogoutdma.h>
Public Types | |
enum class | ErrorCode : uint8_t { Start_DataInvalid = 0 , Start_HalError , Start_HalBusy , Start_HalTimeout , Stop_DataInvalid , Stop_HalError , Stop_HalBusy , Stop_HalTimeout , IsrError_Isr } |
enum class | Alignment : uint32_t { Align_8bitRight = 0 , Align_12bitLeft , Align_12bitRight } |
Public Member Functions | |
Stm32AnalogOutDma (DAC_HandleTypeDef &hwHandle, uint32_t channel, Alignment alignment) | |
Constructor. More... | |
Stm32AnalogOutDma (const Stm32AnalogOutDma &other)=delete | |
virtual | ~Stm32AnalogOutDma ()=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 | setData (const uint8_t data[], size_t dataSize) override |
Sets the pointer to the data memory location and its size for starting DAC later by start() function. to output them on the AnalogOutDma pin. More... | |
void | isrError (DAC_HandleTypeDef &dac) |
Sending a error signal. More... | |
void | isr (DAC_HandleTypeDef &dac) |
Sending a error signal. More... | |
Public Member Functions inherited from semf::AnalogOutDma | |
virtual | ~AnalogOutDma ()=default |
virtual void | start () const =0 |
Starts the hardware module (DAC) for writing DAC values to the output. More... | |
virtual void | stop () const =0 |
virtual void | setData (const uint8_t data[], size_t dataSize)=0 |
Sets the pointer to the data memory location and its size for starting DAC later by start() function. to output them on the AnalogOutDma pin. 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< Stm32AnalogOutDma > * | queue () |
Get the list with all analog outs. More... | |
static void | systemIsrError (DAC_HandleTypeDef &dac) |
System-wide interrupt service routine for dac error. More... | |
static void | systemIsr (DAC_HandleTypeDef &dac) |
System-wide interrupt service routine for dac conversion finished. More... | |
Additional Inherited Members | |
Public Attributes inherited from semf::AnalogOutDma | |
Signal | dataWritten |
Signal< Error > | error |
Definition at line 23 of file stm32analogoutdma.h.
|
strong |
Alignment settings support by the MCU.
Enumerator | |
---|---|
Align_8bitRight | |
Align_12bitLeft | |
Align_12bitRight |
Definition at line 40 of file stm32analogoutdma.h.
|
strong |
Error codes for this class. Error ID identify a unique error() / onError call (excluding transferring).
Enumerator | |
---|---|
Start_DataInvalid | |
Start_HalError | |
Start_HalBusy | |
Start_HalTimeout | |
Stop_DataInvalid | |
Stop_HalError | |
Stop_HalBusy | |
Stop_HalTimeout | |
IsrError_Isr |
Definition at line 27 of file stm32analogoutdma.h.
semf::Stm32AnalogOutDma::Stm32AnalogOutDma | ( | 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 stm32analogoutdma.cpp.
|
explicitdelete |
|
virtualdefault |
void semf::Stm32AnalogOutDma::isr | ( | 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 114 of file stm32analogoutdma.cpp.
void semf::Stm32AnalogOutDma::isrError | ( | DAC_HandleTypeDef & | dac | ) |
Sending a error
signal.
dac | Pointer to dac hardware handler. |
Definition at line 105 of file stm32analogoutdma.cpp.
|
static |
Get the list with all analog outs.
Definition at line 87 of file stm32analogoutdma.cpp.
|
overridevirtual |
Sets the pointer to the data memory location and its size for starting DAC later by start()
function. to output them on the AnalogOutDma
pin.
data | Pointer to the digital to analog value array. |
dataSize | Byte size of the value array |
Implements semf::AnalogOutDma.
Definition at line 80 of file stm32analogoutdma.cpp.
|
overridevirtual |
Starts the hardware module (DAC) for writing DAC values to the output. Call setValue
before.
Start_DataInvalid | If the data is invalid (nullptr or size = 0). |
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::AnalogOutDma.
Definition at line 23 of file stm32analogoutdma.cpp.
|
overridevirtual |
Stops the DAC hardware.
Stop_DataInvalid | If the data is invalid (nullptr or size = 0). |
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::AnalogOutDma.
Definition at line 55 of file stm32analogoutdma.cpp.
|
static |
System-wide interrupt service routine for dac conversion finished.
dac | Hardware handler. |
Definition at line 99 of file stm32analogoutdma.cpp.
|
static |
System-wide interrupt service routine for dac error.
dac | Hardware handler. |
Definition at line 93 of file stm32analogoutdma.cpp.