ArmSys Support
ArmsysApi  0.12.18

#include <BDma.h>

Public Types

enum  Dir { DirDeviceToMemory = 0, DirMemoryToDevice = 1, DirMemoryToMemory = 2 }
 
enum  DmaType { DmaTypeNormal, DmaTypeCircular, DmaTypeDouble }
 
enum  Size { Size8 = 0, Size16 = 1, Size32 = 2 }
 
enum  Burst { Burst1 = 0, Burst4 = 1, Burst8 = 2, Burst16 = 3 }
 
enum  Fifo {
  FifoNone, FifoQuarter, FifoHalf, FifoThreeQuarter,
  FifoFull
}
 
enum  Status { StatusNone = 0x0, StatusComplete = 0x01, StatusHalfComplete = 0x02, StatusError = 0x04 }
 

Public Member Functions

 BDma ()
 
BError init (BUInt8 controller, BUInt8 stream, BUInt8 channel)
 Initialise the device. More...
 
void setCompleteCallback (BDmaCompleteCallback callBack)
 
BError stop (Bool waitForCompletion=1)
 Stops the DMA and waits until it has stopped if wait is set. More...
 
BError config (Size memSize, Bool memInc, Size deviceSize, Bool deviceInc, DmaType dmaType, BUInt8 priority)
 
BError configFlow (Bool flowDevice, Burst memBurst, Burst deviceBurst, Fifo fifo)
 
BError doDma (Dir dir, void *fromAddress, void *toAddress, BUInt32 size)
 
void setNextBuffer (void *address)
 In double buffer mode set next buffer address. More...
 
BError wait (BTimeout timeoutUs=BTimeoutForever)
 Wait for completion. More...
 
BError waitStatus (BUInt8 &status, BTimeout timeoutUs=BTimeoutForever)
 Wait for completion. More...
 
BUInt32 numLeft ()
 The number of DMA items to transfer. More...
 
void interrupt ()
 
void printStatus ()
 
BUInt8 statusGet ()
 
void statusClear ()
 

Public Attributes

BUInt8 ocontroller
 
BUInt8 ochannel
 
BUInt8 ostream
 
Size otranSize
 
DmaType odmaType
 
BDmaCompleteCallback ocompleteCallback
 
DMA_TypeDef * odma
 
DMA_Stream_TypeDef * odmaStream
 
BSemaphore owait
 
BUInt8 ostatus
 
BUInt oerr
 Error flagged. More...
 

Member Enumeration Documentation

◆ Burst

Enumerator
Burst1 
Burst4 
Burst8 
Burst16 

◆ Dir

enum BDma::Dir
Enumerator
DirDeviceToMemory 
DirMemoryToDevice 
DirMemoryToMemory 

◆ DmaType

Enumerator
DmaTypeNormal 
DmaTypeCircular 
DmaTypeDouble 

◆ Fifo

enum BDma::Fifo
Enumerator
FifoNone 
FifoQuarter 
FifoHalf 
FifoThreeQuarter 
FifoFull 

◆ Size

enum BDma::Size
Enumerator
Size8 
Size16 
Size32 

◆ Status

Enumerator
StatusNone 
StatusComplete 
StatusHalfComplete 
StatusError 

Constructor & Destructor Documentation

◆ BDma()

BDma::BDma ( )

Member Function Documentation

◆ config()

BError BDma::config ( Size  memSize,
Bool  memInc,
Size  deviceSize,
Bool  deviceInc,
DmaType  dmaType,
BUInt8  priority 
)

◆ configFlow()

BError BDma::configFlow ( Bool  flowDevice,
Burst  memBurst,
Burst  deviceBurst,
Fifo  fifo 
)

◆ doDma()

BError BDma::doDma ( Dir  dir,
void *  fromAddress,
void *  toAddress,
BUInt32  size 
)

◆ init()

BError BDma::init ( BUInt8  controller,
BUInt8  stream,
BUInt8  channel 
)

Initialise the device.

◆ interrupt()

void BDma::interrupt ( )

◆ numLeft()

BUInt32 BDma::numLeft ( )

The number of DMA items to transfer.

◆ printStatus()

void BDma::printStatus ( )

◆ setCompleteCallback()

void BDma::setCompleteCallback ( BDmaCompleteCallback  callBack)

◆ setNextBuffer()

void BDma::setNextBuffer ( void *  address)

In double buffer mode set next buffer address.

◆ statusClear()

void BDma::statusClear ( )

◆ statusGet()

BUInt8 BDma::statusGet ( )

◆ stop()

BError BDma::stop ( Bool  waitForCompletion = 1)

Stops the DMA and waits until it has stopped if wait is set.

◆ wait()

BError BDma::wait ( BTimeout  timeoutUs = BTimeoutForever)

Wait for completion.

◆ waitStatus()

BError BDma::waitStatus ( BUInt8 status,
BTimeout  timeoutUs = BTimeoutForever 
)

Wait for completion.

Member Data Documentation

◆ ochannel

BUInt8 BDma::ochannel

◆ ocompleteCallback

BDmaCompleteCallback BDma::ocompleteCallback

◆ ocontroller

BUInt8 BDma::ocontroller

◆ odma

DMA_TypeDef* BDma::odma

◆ odmaStream

DMA_Stream_TypeDef* BDma::odmaStream

◆ odmaType

DmaType BDma::odmaType

◆ oerr

BUInt BDma::oerr

Error flagged.

◆ ostatus

BUInt8 BDma::ostatus

◆ ostream

BUInt8 BDma::ostream

◆ otranSize

Size BDma::otranSize

◆ owait

BSemaphore BDma::owait

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