Skyward boardcore
|
This class represents the actual DMA stream. It can be used to setup, start and stop DMA transactions. More...
#include <DMA.h>
Public Member Functions | |
void | setup (DMATransaction &transaction) |
Setup the stream with the given configuration. | |
void | enable () |
Activate the stream. As soon as the stream is enabled, it serves any DMA request from/to the peripheral connected to the stream. | |
void | disable () |
Stop the DMA transaction (if running). This is equivalent to killing the transaction: DO NOT expect to be able to restart the transaction from where it was interrupted. The work completed up to the call will still be valid. | |
void | waitForHalfTransfer () |
Wait for the half transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag. | |
void | waitForTransferComplete () |
Wait for the transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag. In case cache is used, this method invalidates the cache lines, so that the user can see the memory as is in ram. | |
bool | timedWaitForHalfTransfer (std::chrono::nanoseconds timeout_ns) |
Wait for the half transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag. | |
bool | timedWaitForTransferComplete (std::chrono::nanoseconds timeout_ns) |
Wait for the transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag. In case cache is used, this method invalidates the cache lines, so that the user can see the memory as is in ram. | |
void | setHalfTransferCallback (std::function< void()> callback) |
void | resetHalfTransferCallback () |
void | setTransferCompleteCallback (std::function< void()> callback) |
void | resetTransferCompleteCallback () |
void | setErrorCallback (std::function< void()> callback) |
void | resetErrorCallback () |
void | readFlags () |
Reads the current flags status. | |
bool | setNumberOfDataItems (const uint16_t nBytes) |
Set the number of bytes to be exchanged during a dma transaction. Useful in case you don't want to change the entire configuration. Use while the stream is not enabled. | |
void | setChannel (const DMADefs::Channel channel) |
Select the channel to be used by the stream during the transactions. | |
bool | getHalfTransferFlagStatus () |
Returns the last read status of the half transfer flag. | |
bool | getTransferCompleteFlagStatus () |
Returns the last read status of the transfer complete flag. | |
bool | getTransferErrorFlagStatus () |
Returns the last read status of the transfer error flag. | |
bool | getFifoErrorFlagStatus () |
Returns the last read status of the fifo error flag. | |
bool | getDirectModeErrorFlagStatus () |
Returns the last read status of the direct mode (default mode) error flag. | |
int | getCurrentBufferNumber () |
Returns the number of the buffer currently in use when in double buffer mode. | |
DMADefs::DMAStreamId | getStreamId () |
DMADefs::Channel | getCurrentChannel () |
void | clearHalfTransferFlag () |
void | clearTransferCompleteFlag () |
void | clearTransferErrorFlag () |
void | clearFifoErrorFlag () |
void | clearDirectModeErrorFlag () |
void | clearAllFlags () |
Clear all the flags for the selected stream in the DMA ISR register (LISR or HISR depending on the selected stream id). | |
DMAStream (const DMAStream &)=delete | |
DMAStream & | operator= (const DMAStream &)=delete |
DMAStream (DMAStream &&) noexcept=default | |
DMAStream & | operator= (DMAStream &&) noexcept=default |
This class represents the actual DMA stream. It can be used to setup, start and stop DMA transactions.
|
delete |
|
defaultnoexcept |
|
inline |
|
inline |
|
inline |
void Boardcore::DMAStream::disable | ( | ) |
Stop the DMA transaction (if running). This is equivalent to killing the transaction: DO NOT expect to be able to restart the transaction from where it was interrupted. The work completed up to the call will still be valid.
void Boardcore::DMAStream::enable | ( | ) |
int Boardcore::DMAStream::getCurrentBufferNumber | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void Boardcore::DMAStream::readFlags | ( | ) |
void Boardcore::DMAStream::resetTransferCompleteCallback | ( | ) |
void Boardcore::DMAStream::setChannel | ( | const DMADefs::Channel | channel | ) |
void Boardcore::DMAStream::setErrorCallback | ( | std::function< void()> | callback | ) |
void Boardcore::DMAStream::setHalfTransferCallback | ( | std::function< void()> | callback | ) |
bool Boardcore::DMAStream::setNumberOfDataItems | ( | const uint16_t | nBytes | ) |
void Boardcore::DMAStream::setTransferCompleteCallback | ( | std::function< void()> | callback | ) |
void Boardcore::DMAStream::setup | ( | DMATransaction & | transaction | ) |
bool Boardcore::DMAStream::timedWaitForHalfTransfer | ( | std::chrono::nanoseconds | timeout_ns | ) |
Wait for the half transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag.
timeout_ns | The maximum time that will be waited. |
bool Boardcore::DMAStream::timedWaitForTransferComplete | ( | std::chrono::nanoseconds | timeout_ns | ) |
Wait for the transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag. In case cache is used, this method invalidates the cache lines, so that the user can see the memory as is in ram.
timeout_ns | The maximum time that will be waited. |
void Boardcore::DMAStream::waitForHalfTransfer | ( | ) |
Wait for the half transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag.
void Boardcore::DMAStream::waitForTransferComplete | ( | ) |
Wait for the transfer complete signal. The caller waits for the corresponding interrupt, if enabled. Otherwise it goes to polling mode on the flag. In case cache is used, this method invalidates the cache lines, so that the user can see the memory as is in ram.