#include "distortos/chip/DmaChannelHandle.hpp"
DmaChannelHandle class can be used to access DmaChannel's functionality.
◆ Flags
◆ DmaChannelHandle()
constexpr distortos::chip::DmaChannelHandle::DmaChannelHandle |
( |
| ) |
|
|
inline |
◆ ~DmaChannelHandle()
distortos::chip::DmaChannelHandle::~DmaChannelHandle |
( |
| ) |
|
|
inline |
DmaChannelHandle's destructor.
- Precondition
- No driver is reserved with this handle.
◆ getTransactionsLeft()
size_t distortos::chip::DmaChannelHandle::getTransactionsLeft |
( |
| ) |
const |
|
inline |
- Precondition
- Driver is reserved with this handle.
- Returns
- number of transactions left
◆ release()
void distortos::chip::DmaChannelHandle::release |
( |
| ) |
|
|
inline |
Releases any associated low-level DMA channel driver.
- Precondition
- No transfer is in progress.
- Postcondition
- No driver is reserved with this handle.
◆ reserve()
Reserves low-level DMA channel driver for exclusive use via this handle.
- Precondition
- No driver is reserved with this handle.
-
request is valid.
- Parameters
-
[in] | channel | is a reference to low-level DMA channel driver which will be associated with this handle |
[in] | request | is the request identifier with which low-level DMA channel driver will be associated |
[in] | functor | is a reference to DmaChannelFunctor object that will be notified about transfer-related events |
- Returns
- 0 on success, error code otherwise:
◆ startTransfer()
void distortos::chip::DmaChannelHandle::startTransfer |
( |
const uintptr_t |
memoryAddress, |
|
|
const uintptr_t |
peripheralAddress, |
|
|
const size_t |
transactions, |
|
|
const Flags |
flags |
|
) |
| const |
|
inline |
Configures and starts asynchronous transfer.
This function returns immediately. When the transfer is physically finished (either expected number of transactions were executed or an error was detected), one of DmaChannelFunctor functions will be executed.
- Precondition
- Driver is reserved with this handle.
-
memoryAddress and peripheralAddress and transactions and flags are valid.
-
Memory data size multiplied by memory burst size is less than or equal to 16.
-
No transfer is in progress.
- Postcondition
- Transfer is in progress.
- Parameters
-
[in] | memoryAddress | is the memory address, must be divisible by configured memory data size multiplied by configured memory burst size |
[in] | peripheralAddress | is the peripheral address, must be divisible by peripheral data size multiplied by configured peripheral burst size |
[in] | transactions | is the number of transactions, [1; 65535] |
[in] | flags | are configuration flags |
◆ stopTransfer()
void distortos::chip::DmaChannelHandle::stopTransfer |
( |
| ) |
const |
|
inline |
Stops transfer.
This function should be used after previous asynchronous transfer is finished to restore DMA channel to proper state. It may also be used to stop any ongoing asynchronous transfer.
- Precondition
- Driver is reserved with this handle.
- Postcondition
- No transfer is in progress.
◆ channel_
DmaChannel* distortos::chip::DmaChannelHandle::channel_ |
|
private |
pointer to low-level DMA channel driver associated with this handle
The documentation for this class was generated from the following file: