跳转到主要内容

DMA_Interface

touchgfx/hal/DMA.hpp

DMA_Interface provides basic functionality and structure for processing "blit" operations using DMA.

Inherited by: NoDMA

Public Functions

virtual voidaddToQueue(const BlitOp & op)
Inserts a BlitOp for processing.
virtual voidflush()
This function blocks until all DMA transfers in the queue have been completed.
boolgetAllowed() const
Gets whether a DMA operation is allowed to begin.
virtual BlitOperationsgetBlitCaps() =0
Gets the blit capabilities of this DMA.
virtual DMATypegetDMAType()
Function for obtaining the DMA type of the concrete DMA_Interface implementation.
virtual voidinitialize()
Perform initialization.
uint8_tisDmaQueueEmpty()
Query if the DMA queue is empty.
uint8_tisDmaQueueFull()
Query if the DMA queue is full.
boolisDMARunning()
Query if the DMA is running.
voidsetAllowed(bool allowed)
Sets whether or not a DMA operation is allowed to begin.
virtual voidsignalDMAInterrupt() =0
This function is called automatically by the framework when a DMA interrupt has been received.
virtual voidstart()
Signals that DMA transfers can start.
virtual ~DMA_Interface()
Finalizes an instance of the DMA_Interface class.

Protected Functions

virtual voiddisableAlpha()
Configures blit-op hardware for solid operation (no alpha-blending)
DMA_Interface(DMA_Queue & dmaQueue)
Constructs a DMA Interface object.
virtual voidenableAlpha(uint8_t alpha)
Configures blit-op hardware for alpha-blending.
virtual voidenableCopyWithTransparentPixels(uint8_t alpha)
Configures blit-op hardware for alpha-blending while simultaneously skipping transparent pixels.
virtual voidexecute()
Performs a queued blit-op.
virtual voidexecuteCompleted()
To be called when blit-op has been performed.
virtual voidseedExecution()
Called when elements are added to the DMA-queue.
virtual voidsetupDataCopy(const BlitOp & blitOp) =0
Configures blit-op hardware for a 2D copy as specified by blitOp.
virtual voidsetupDataFill(const BlitOp & blitOp) =0
Configures blit-op hardware for a 2D fill as specified by blitOp.
virtual voidwaitForFrameBufferSemaphore()
Waits until framebuffer semaphore is available (i.e.

Protected Attributes

boolisAllowed
true if DMA transfers are currently allowed.
boolisRunning
true if a DMA transfer is currently ongoing.
DMA_Queue &queue
Reference to the DMA queue.

Public Functions Documentation

addToQueue

virtual void addToQueue(const BlitOp &op)

Inserts a BlitOp for processing.

This also potentially starts the DMA controller, if not already running.

Parameters:
opThe operation to add.

flush

virtual void flush()

This function blocks until all DMA transfers in the queue have been completed.

Reimplemented by: touchgfx::NoDMA::flush

getAllowed

bool getAllowed()const

Gets whether a DMA operation is allowed to begin.

Used in single-buffering to avoid changing the framebuffer while display is being updated.

Returns:

true if DMA is allowed to start, false if not.

getBlitCaps

virtual BlitOperations getBlitCaps()=0

Gets the blit capabilities of this DMA.

Returns:

The blit operations supported by this DMA implementation.

Reimplemented by: touchgfx::NoDMA::getBlitCaps

getDMAType

virtual DMAType getDMAType()

Function for obtaining the DMA type of the concrete DMA_Interface implementation.

As default, will return DMA_TYPE_GENERIC type value.

Returns:

a DMAType value of the concrete DMA_Interface implementation.

initialize

virtual void initialize()

Perform initialization.

Does nothing in this base class.

isDmaQueueEmpty

uint8_t isDmaQueueEmpty()

Query if the DMA queue is empty.

Returns:

1 if DMA queue is empty, else 0.

isDmaQueueFull

uint8_t isDmaQueueFull()

Query if the DMA queue is full.

Returns:

1 if DMA queue is full, else 0.

isDMARunning

bool isDMARunning()

Query if the DMA is running.

Returns:

true if a DMA operation is currently in progress.

setAllowed

void setAllowed(boolallowed)

Sets whether or not a DMA operation is allowed to begin.

Used in single-buffering to avoid changing the framebuffer while display is being updated.

Parameters:
allowedtrue if DMA transfers are allowed.

signalDMAInterrupt

virtual void signalDMAInterrupt()=0

This function is called automatically by the framework when a DMA interrupt has been received.

This function is called automatically by the framework when a DMA interrupt has been received.

Reimplemented by: touchgfx::NoDMA::signalDMAInterrupt

start

virtual void start()

Signals that DMA transfers can start.

If any elements are in the queue, start it.

~DMA_Interface

virtual ~DMA_Interface()

Finalizes an instance of the DMA_Interface class.

Protected Functions Documentation

disableAlpha

virtual void disableAlpha()

Configures blit-op hardware for solid operation (no alpha-blending)

DMA_Interface

Constructs a DMA Interface object.

Parameters:
dmaQueueReference to the queue of DMA operations.

enableAlpha

virtual void enableAlpha(uint8_talpha)

Configures blit-op hardware for alpha-blending.

Parameters:
alphaThe alpha-blending value to apply.

enableCopyWithTransparentPixels

virtual void enableCopyWithTransparentPixels(uint8_talpha)

Configures blit-op hardware for alpha-blending while simultaneously skipping transparent pixels.

Parameters:
alphaThe alpha-blending value to apply.

execute

virtual void execute()

Performs a queued blit-op.

executeCompleted

virtual void executeCompleted()

To be called when blit-op has been performed.

seedExecution

virtual void seedExecution()

Called when elements are added to the DMA-queue.

Note

The framebuffer must be locked before this method returns if the DMA-queue is non- empty.

setupDataCopy

virtual void setupDataCopy(const BlitOp &blitOp)

Configures blit-op hardware for a 2D copy as specified by blitOp.

Parameters:
blitOpThe operation to execute.

Reimplemented by: touchgfx::NoDMA::setupDataCopy

setupDataFill

virtual void setupDataFill(const BlitOp &blitOp)

Configures blit-op hardware for a 2D fill as specified by blitOp.

Parameters:
blitOpThe operation to execute.

Reimplemented by: touchgfx::NoDMA::setupDataFill

waitForFrameBufferSemaphore

Waits until framebuffer semaphore is available (i.e.

neither DMA or application is accessing the framebuffer).

Protected Attributes Documentation

isAllowed

bool isAllowed

true if DMA transfers are currently allowed.

isRunning

bool isRunning

true if a DMA transfer is currently ongoing.

queue

DMA_Queue & queue

Reference to the DMA queue.