modm API documentation
modm::platform::DmaController< ID >::Channel Class Reference

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

Classes

struct  RequestMapping
 

Static Public Member Functions

static void configure (DataTransferDirection direction, MemoryDataSize memoryDataSize, PeripheralDataSize peripheralDataSize, MemoryIncrementMode memoryIncrement, PeripheralIncrementMode peripheralIncrement, Priority priority=Priority::Medium, CircularMode circularMode=CircularMode::Disabled)
 
static void start ()
 
static void stop ()
 
static DataTransferDirection getDataTransferDirection ()
 
static void setMemoryAddress (uintptr_t address)
 
static void setPeripheralAddress (uintptr_t address)
 
static void setMemoryIncrementMode (bool increment)
 
static void setPeripheralIncrementMode (bool increment)
 
static void setDataLength (std::size_t length)
 
static void setTransferErrorIrqHandler (IrqHandler irqHandler)
 
static void setHalfTransferCompleteIrqHandler (IrqHandler irqHandler)
 
static void setTransferCompleteIrqHandler (IrqHandler irqHandler)
 
template<DmaBase::Request dmaRequest>
static void setPeripheralRequest ()
 
static void interruptHandler ()
 
static void enableInterruptVector (uint32_t priority=1)
 
static void disableInterruptVector ()
 
static void enableInterrupt (InterruptEnable_t irq)
 
static void disableInterrupt (InterruptEnable_t irq)
 

Detailed Description

template<uint32_t ID>
class modm::platform::DmaController< ID >::Channel

Class representing a DMA channel/stream

Member Function Documentation

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::configure ( DataTransferDirection  direction,
MemoryDataSize  memoryDataSize,
PeripheralDataSize  peripheralDataSize,
MemoryIncrementMode  memoryIncrement,
PeripheralIncrementMode  peripheralIncrement,
Priority  priority = Priority::Medium,
CircularMode  circularMode = CircularMode::Disabled 
)
inlinestatic

Configure the DMA channel

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

Parameters
[in]directionDirection of the DMA channel
[in]memoryDataSizeSize of data in memory (byte, halfword, word)
[in]peripheralDataSizeSize of data in peripheral (byte, halfword, word)
[in]memoryIncrementDefines whether the memory address is incremented after a transfer completed
[in]peripheralIncrementDefines whether the peripheral address is incremented after a transfer completed
[in]priorityPriority of the DMA channel
[in]circularModeTransfer data in circular mode?
template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::disableInterrupt ( InterruptEnable_t  irq)
inlinestatic

Disable the specified interrupt of the channel

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::disableInterruptVector ( )
inlinestatic

Disable the IRQ vector of the channel

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::enableInterrupt ( InterruptEnable_t  irq)
inlinestatic

Enable the specified interrupt of the channel

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::enableInterruptVector ( uint32_t  priority = 1)
inlinestatic

Enable the IRQ vector of the channel

Parameters
[in]priorityPriority of the IRQ
template<uint32_t ID>
static DataTransferDirection modm::platform::DmaController< ID >::Channel::getDataTransferDirection ( )
inlinestatic

Get the direction of the data transfer

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::interruptHandler ( )
inlinestatic

IRQ handler of the DMA channel

Reads the IRQ status and checks for error or transfer complete. In case of error the DMA channel will be disabled.

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::setDataLength ( std::size_t  length)
inlinestatic

Set the length of data to be transfered

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::setHalfTransferCompleteIrqHandler ( IrqHandler  irqHandler)
inlinestatic

Set the IRQ handler for half transfer complete

Called by the channels IRQ handler when the transfer is half complete.

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::setMemoryAddress ( uintptr_t  address)
inlinestatic

Set the memory address of the DMA channel

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

Enable/disable memory increment

When enabled, the memory 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<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::setPeripheralAddress ( uintptr_t  address)
inlinestatic

Set the peripheral address of the DMA channel

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

Enable/disable peripheral increment

When enabled, the peripheral 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<uint32_t ID>
template<DmaBase::Request dmaRequest>
static void modm::platform::DmaController< ID >::Channel::setPeripheralRequest ( )
inlinestatic

Set the peripheral that operates the channel

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::setTransferCompleteIrqHandler ( IrqHandler  irqHandler)
inlinestatic

Set the IRQ handler for transfer complete

Called by the channels IRQ handler when the transfer is complete.

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::setTransferErrorIrqHandler ( IrqHandler  irqHandler)
inlinestatic

Set the IRQ handler for transfer errors

The handler will be called from the channels IRQ handler function when the IRQ status indicates an error occured.

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::start ( )
inlinestatic

Start the transfer of the DMA channel

template<uint32_t ID>
static void modm::platform::DmaController< ID >::Channel::stop ( )
inlinestatic

Stop a DMA channel transfer


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