#include "distortos/chip/DmaChannel.hpp"
DmaChannel class is a low-level DMA channel driver for DMAv2 in STM32
◆ Flags
◆ DmaChannel()
DmaChannel's constructor.
- Parameters
-
[in] | dmaPeripheral | is a reference to raw DMA peripheral |
[in] | dmaChannelPeripheral | is a reference to raw DMA channel peripheral |
◆ ~DmaChannel()
distortos::chip::DmaChannel::~DmaChannel |
( |
| ) |
|
|
inline |
DmaChannel's destructor.
- Precondition
- Driver is not reserved.
◆ getTransactionsLeft()
size_t distortos::chip::DmaChannel::getTransactionsLeft |
( |
| ) |
const |
|
private |
- Returns
- number of transactions left
◆ interruptHandler()
void distortos::chip::DmaChannel::interruptHandler |
( |
| ) |
|
Interrupt handler.
- Note
- this must not be called by user code
- Precondition
- Driver is reserved.
◆ release()
void distortos::chip::DmaChannel::release |
( |
| ) |
|
|
private |
Releases low-level DMA channel driver.
- Precondition
- No transfer is in progress.
- Postcondition
- Driver is not reserved.
◆ reserve()
int distortos::chip::DmaChannel::reserve |
( |
uint8_t |
request, |
|
|
DmaChannelFunctor & |
functor |
|
) |
| |
|
private |
Reserves low-level DMA channel driver for exclusive use.
- Precondition
- request is valid.
- Parameters
-
[in] | request | is the request identifier with which this object 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:
- EBUSY - the driver is not released;
◆ startTransfer()
void distortos::chip::DmaChannel::startTransfer |
( |
uintptr_t |
memoryAddress, |
|
|
uintptr_t |
peripheralAddress, |
|
|
size_t |
transactions, |
|
|
Flags |
flags |
|
) |
| const |
|
private |
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.
-
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::DmaChannel::stopTransfer |
( |
| ) |
const |
|
private |
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.
- Postcondition
- No transfer is in progress.
◆ dmaChannelPeripheral_
reference to raw DMA channel peripheral
◆ dmaPeripheral_
reference to raw DMA peripheral
◆ functor_
◆ request_
uint8_t distortos::chip::DmaChannel::request_ |
|
private |
request identifier with which this object is associated
The documentation for this class was generated from the following files: