modm API documentation
modm::platform::Dac3Dma::Channel1< DmaChannel > Class Template Reference

#include <modm/platform/dac/dac_dma_3.hpp>

Public Types

enum  Mode {
  ExternalWithBuffer = 0, ExternalInternalWithBuffer = DAC_MCR_MODE1_0, ExternalWithoutBuffer = DAC_MCR_MODE1_1, Internal = DAC_MCR_MODE1_0 | DAC_MCR_MODE1_1,
  Mask = DAC_MCR_MODE1_0 | DAC_MCR_MODE1_1 | DAC_MCR_MODE1_2
}
 

Static Public Member Functions

static void enableDacChannel ()
 Enable the DAC channel.
 
static void disableDacChannel ()
 Disable the DAC channel.
 
static void setMode (Mode mode)
 Configure connection mode (internal, external, external with buffer)
 
static void setTriggerSource (uint8_t triggerSource)
 
static bool hasDmaUnderrun ()
 
static void configure (const void *data, size_t dataSize, DmaChannel::CircularMode circularMode, DmaChannel::Priority priority=DmaChannel::Priority::Medium)
 
static void setData (const void *data, size_t dataSize)
 
static void startDma ()
 
static void stopDma ()
 Stop DMA transfers.
 

Detailed Description

template<typename DmaChannel>
class modm::platform::Dac3Dma::Channel1< DmaChannel >

DAC output channel 1

Member Function Documentation

template<typename DmaChannel >
static void modm::platform::Dac3Dma::Channel1< DmaChannel >::configure ( const void *  data,
size_t  dataSize,
DmaChannel::CircularMode  circularMode,
DmaChannel::Priority  priority = DmaChannel::Priority::Medium 
)
static

Configure the DMA channel

Warning
this function must be called before enabling the DMA channel
Precondition
the DMA channel must be disabled to be reconfigured
Parameters
dataoutput data
dataSizenumber of DMA transfers to be performed
circularModeDMA circular mode setting
priorityDMA transfer priority
template<typename DmaChannel >
static bool modm::platform::Dac3Dma::Channel1< DmaChannel >::hasDmaUnderrun ( )
static

Returns true on DMA underrun

Warning
To reset the condition both the DAC channel and DMA channel have to be disabled and and the DMA channel must be reconfigured.
template<typename DmaChannel >
static void modm::platform::Dac3Dma::Channel1< DmaChannel >::setData ( const void *  data,
size_t  dataSize 
)
static

Set data to transfer

Precondition
the DMA channel must be disabled to call this function
Parameters
dataoutput data
dataSizenumber of DMA transfers to be performed
template<typename DmaChannel >
static void modm::platform::Dac3Dma::Channel1< DmaChannel >::setTriggerSource ( uint8_t  triggerSource)
static

Configure the external trigger source

If DMA is used the external trigger mode is always active

Parameters
triggerSourcetrigger source id, please refer to the reference manual
template<typename DmaChannel >
static void modm::platform::Dac3Dma::Channel1< DmaChannel >::startDma ( )
static

Start DMA transfers

Precondition
before starting the transfer the channel must be configured

The documentation for this class was generated from the following file: