Skyward boardcore
Loading...
Searching...
No Matches
Boardcore::DMATransaction Struct Reference

This is the configuration struct for a DMA transaction. More...

#include <DMA.h>

Public Types

enum class  Direction : uint16_t { MEM_TO_MEM = DMA_SxCR_DIR_1 , MEM_TO_PER = DMA_SxCR_DIR_0 , PER_TO_MEM = 0 }
 
enum class  Priority : uint32_t { VERY_HIGH = DMA_SxCR_PL , HIGH = DMA_SxCR_PL_1 , MEDIUM = DMA_SxCR_PL_0 , LOW = 0 }
 
enum class  DataSize : uint8_t { BITS_8 = 0 , BITS_16 , BITS_32 }
 

Public Attributes

Direction direction = Direction::MEM_TO_MEM
 
Priority priority = Priority::LOW
 
DataSize srcSize = DataSize::BITS_32
 
DataSize dstSize = DataSize::BITS_32
 
volatile void * srcAddress = nullptr
 
volatile void * dstAddress = nullptr
 
volatile void * secondMemoryAddress = nullptr
 
uint16_t numberOfDataItems = 0
 
bool srcIncrement = false
 
bool dstIncrement = false
 
bool circularMode = false
 Enables circular buffer mode.
 
bool doubleBufferMode = false
 Enables double buffer mode.
 
bool enableTransferCompleteInterrupt = false
 
bool enableHalfTransferInterrupt = false
 
bool enableTransferErrorInterrupt = false
 
bool enableFifoErrorInterrupt = false
 
bool enableDirectModeErrorInterrupt = false
 

Detailed Description

This is the configuration struct for a DMA transaction.

Definition at line 41 of file DMA.h.

Member Enumeration Documentation

◆ DataSize

enum class Boardcore::DMATransaction::DataSize : uint8_t
strong
Enumerator
BITS_8 
BITS_16 
BITS_32 

Definition at line 68 of file DMA.h.

◆ Direction

enum class Boardcore::DMATransaction::Direction : uint16_t
strong
Enumerator
MEM_TO_MEM 
MEM_TO_PER 
PER_TO_MEM 

Definition at line 43 of file DMA.h.

◆ Priority

enum class Boardcore::DMATransaction::Priority : uint32_t
strong

Priority of the DMA transaction. When multiple streams from the same controller (DMA1 or DMA2) are requested, they are served following the priority order. If two requests have the same software priority level, the stream with the lower number takes priority over the stream with the higher number. For example, Stream 2 takes priority over Stream 4.

Enumerator
VERY_HIGH 
HIGH 
MEDIUM 
LOW 

Definition at line 60 of file DMA.h.

Member Data Documentation

◆ circularMode

bool Boardcore::DMATransaction::circularMode = false

Enables circular buffer mode.

Warning
Not available with memory to memory transfers.

Definition at line 90 of file DMA.h.

◆ direction

Direction Boardcore::DMATransaction::direction = Direction::MEM_TO_MEM

Definition at line 75 of file DMA.h.

◆ doubleBufferMode

bool Boardcore::DMATransaction::doubleBufferMode = false

Enables double buffer mode.

Warning
Automatically enables circular mode. Not available with memory to memory transfers.

Definition at line 97 of file DMA.h.

◆ dstAddress

volatile void* Boardcore::DMATransaction::dstAddress = nullptr

Definition at line 80 of file DMA.h.

◆ dstIncrement

bool Boardcore::DMATransaction::dstIncrement = false

Definition at line 84 of file DMA.h.

◆ dstSize

DataSize Boardcore::DMATransaction::dstSize = DataSize::BITS_32

Definition at line 78 of file DMA.h.

◆ enableDirectModeErrorInterrupt

bool Boardcore::DMATransaction::enableDirectModeErrorInterrupt = false

Direct mode is the default fifo operating mode.

Direct mode error can only be set in the peripheral-to-memory mode while operating in direct mode. This flag is set when a DMA request occurs while the previous data have not yet been fully transferred into the memory (because the memory bus was not granted). In this case, the flag indicates that 2 data items were be transferred successively to the same destination address, which could be an issue if the destination is not able to manage this situation.

Definition at line 143 of file DMA.h.

◆ enableFifoErrorInterrupt

bool Boardcore::DMATransaction::enableFifoErrorInterrupt = false

Fifo overrun/underrun condition.

In direct mode, the FIFO error flag can also be set under the following conditions:

  • In the peripheral-to-memory mode, the FIFO can be saturated (overrun) if the memory bus is not granted for several peripheral requests.
  • In the memory-to-peripheral mode, an underrun condition may occur if the memory bus has not been granted before a peripheral request occurs.

Definition at line 130 of file DMA.h.

◆ enableHalfTransferInterrupt

bool Boardcore::DMATransaction::enableHalfTransferInterrupt = false
Warning
After a full DMA transaction, cache invalidation is required to maintain data coherence. However, the half transfer mechanism does not allow the driver to handle cache invalidation internally, leaving the job to the user.

Definition at line 106 of file DMA.h.

◆ enableTransferCompleteInterrupt

bool Boardcore::DMATransaction::enableTransferCompleteInterrupt = false

Definition at line 98 of file DMA.h.

◆ enableTransferErrorInterrupt

bool Boardcore::DMATransaction::enableTransferErrorInterrupt = false

The transfer error interrupt flag is set when:

  • A bus error occurs during a DMA read or a write access.
  • A write access is requested by software on a memory address register in Double buffer mode whereas the stream is enabled and the current target memory is the one impacted by the write into the memory address register.

Definition at line 116 of file DMA.h.

◆ numberOfDataItems

uint16_t Boardcore::DMATransaction::numberOfDataItems = 0

Definition at line 82 of file DMA.h.

◆ priority

Priority Boardcore::DMATransaction::priority = Priority::LOW

Definition at line 76 of file DMA.h.

◆ secondMemoryAddress

volatile void* Boardcore::DMATransaction::secondMemoryAddress = nullptr

Definition at line 81 of file DMA.h.

◆ srcAddress

volatile void* Boardcore::DMATransaction::srcAddress = nullptr

Definition at line 79 of file DMA.h.

◆ srcIncrement

bool Boardcore::DMATransaction::srcIncrement = false

Definition at line 83 of file DMA.h.

◆ srcSize

DataSize Boardcore::DMATransaction::srcSize = DataSize::BITS_32

Definition at line 77 of file DMA.h.


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