modm API documentation
modm::platform::DmaController::Channel< ChannelID > Class Template Reference

Class representing a DMA channel/stream. More...

#include <modm/platform/dma/dma.hpp>

Static Public Member Functions

static void configure (TransferDataSize transferDataSize, bool readIncrement, bool writeIncrement)
 
static void start ()
 Start the transfer of the DMA channel.
 
static void stop ()
 Stop a DMA channel transfer.
 
static void setReadAddress (uintptr_t address)
 
static void setWriteAddress (uintptr_t address)
 
static void setReadIncrementMode (bool increment)
 
static void setWriteIncrementMode (bool increment)
 
static void setDataLength (std::size_t length)
 Set the length of data to be transfered (num transactions, not bytes)
 
template<Request dmaRequest>
static void setPeripheralRequest ()
 Set the peripheral that operates the channel.
 
static void enableInterrupt ()
 Enable the specified interrupt of the channel.
 
static void disableInterrupt ()
 Disable the specified interrupt of the channel.
 
static bool isBusy ()
 
static bool isCompleted ()
 
static void startWrite (const void *src, std::size_t count)
 
static void startRead (void *dst, std::size_t count)
 
template<class OtherChannel >
static void chainTo ()
 

Static Public Attributes

static constexpr DmaBase::Channel name = ChannelID
 
static constexpr uint32_t idx = uint32_t(ChannelID)
 
static constexpr uint32_t mask = (1u << idx)
 

Detailed Description

template<DmaBase::Channel ChannelID>
class modm::platform::DmaController::Channel< ChannelID >

Class representing a DMA channel/stream.

Member Function Documentation

template<DmaBase::Channel ChannelID>
static void modm::platform::DmaController::Channel< ChannelID >::configure ( TransferDataSize  transferDataSize,
bool  readIncrement,
bool  writeIncrement 
)
inlinestatic

Configure the DMA channel

Stops the DMA channel and writes the new values to its control register.

Parameters
[in]transferDataSizeSize of data in transfer (byte, halfword, word)
[in]readIncrementDefines whether the read address is incremented after a transfer completed
[in]writeIncrementDefines whether the write address is incremented after a transfer completed
template<DmaBase::Channel ChannelID>
static void modm::platform::DmaController::Channel< ChannelID >::setReadAddress ( uintptr_t  address)
inlinestatic

Set the read address of the DMA channel

Note
In Mem2Mem mode use this method to set the memory source address.
Parameters
[in]addressSource address
template<DmaBase::Channel ChannelID>
static void modm::platform::DmaController::Channel< ChannelID >::setReadIncrementMode ( bool  increment)
inlinestatic

Enable/disable read increment

When enabled, the read address is incremented by the size of the data (e.g. 1 for byte transfers, 4 for word transfers) after the transfer completed.

Parameters
[in]incrementEnable/disable
template<DmaBase::Channel ChannelID>
static void modm::platform::DmaController::Channel< ChannelID >::setWriteAddress ( uintptr_t  address)
inlinestatic

Set the write address of the DMA channel

Note
In Mem2Mem mode use this method to set the memory destination address.
Parameters
[in]addressDestination address
template<DmaBase::Channel ChannelID>
static void modm::platform::DmaController::Channel< ChannelID >::setWriteIncrementMode ( bool  increment)
inlinestatic

Enable/disable write increment

When enabled, the write address is incremented by the size of the data (e.g. 1 for byte transfers, 4 for word transfers) after the transfer completed.

Parameters
[in]incrementEnable/disable

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