semf
semf::AnalogOutDma Class Referenceabstract

Interface for using DAC (Digital to Analog Converter) hardware module in DMA (Direct Memory Access) mode. More...

#include <analogoutdma.h>

Inheritance diagram for semf::AnalogOutDma:
Inheritance graph
Collaboration diagram for semf::AnalogOutDma:
Collaboration graph

Public Member Functions

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 Attributes

Signal dataWritten
 
Signal< Errorerror
 

Detailed Description

Interface for using DAC (Digital to Analog Converter) hardware module in DMA (Direct Memory Access) mode.

dataWritten signal is emitted after data writing to output has finished.

Definition at line 24 of file analogoutdma.h.

Constructor & Destructor Documentation

◆ ~AnalogOutDma()

virtual semf::AnalogOutDma::~AnalogOutDma ( )
virtualdefault

Member Function Documentation

◆ setData()

virtual void semf::AnalogOutDma::setData ( const uint8_t  data[],
size_t  dataSize 
)
pure virtual

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.

Note
For using halfword DAC setting, use a uint16_t array, cast it to uint8_t* and double the size of the array. For using word DAC setting, use a uint32_t array, cast it to uint8_t* and multiple the size of the array by four.
Parameters
dataPointer to the digital to analog value array.
dataSizeByte size of the value array

Implemented in semf::Stm32AnalogOutDma.

◆ start()

virtual void semf::AnalogOutDma::start ( ) const
pure virtual

Starts the hardware module (DAC) for writing DAC values to the output.

Attention
Call setData() before. Otherwise will call error signal.

Implemented in semf::Stm32AnalogOutDma.

◆ stop()

virtual void semf::AnalogOutDma::stop ( ) const
pure virtual

Stops the DAC hardware.

Implemented in semf::Stm32AnalogOutDma.

Member Data Documentation

◆ dataWritten

Signal semf::AnalogOutDma::dataWritten

Signal is emitted after hardware write cycle is finished.

Definition at line 47 of file analogoutdma.h.

◆ error

Signal<Error> semf::AnalogOutDma::error

Signal is emitted after an hardware error occurred.

Definition at line 49 of file analogoutdma.h.