Interface for DMA controller drivers.
More...
|
| void | pbl_dma_complete (const struct pbl_dma_controller *ctrl, uint8_t channel, int status) |
| | Report the end of a channel's transfer, or of a period of a cyclic one, calling its callback.
|
| |
Interface for DMA controller drivers.
A driver embeds a struct pbl_dma_controller in its instance, sets it up with PBL_DMA_CONTROLLER_STATE_DEFINE() and PBL_DMA_CONTROLLER_INIT(), implements the struct pbl_dma_controller_ops the class calls, and reports transfer ends with pbl_dma_complete().
◆ pbl_dma_chan_state
| struct pbl_dma_chan_state |
Runtime state of a channel.
◆ pbl_dma_controller
| struct pbl_dma_controller |
◆ PBL_DMA_CONTROLLER_INIT
| #define PBL_DMA_CONTROLLER_INIT |
( |
|
sym, |
|
|
|
_name, |
|
|
|
_init, |
|
|
|
_parent, |
|
|
|
_ops |
|
) |
| |
Value: { \
.ops = (_ops), \
.chans = sym##_dma_chans, \
.num_channels = sizeof(sym##_dma_chans) / sizeof(sym##_dma_chans[0]), \
}
#define PBL_DEVICE_INIT_CLASS(sym, _name, _init, _parent, _cls)
Initializer for the struct pbl_device of device instance sym, in class _cls.
Definition device.h:153
Initializer for the struct pbl_dma_controller of controller sym.
- Parameters
-
| sym | Symbol of the controller instance, with its state defined by PBL_DMA_CONTROLLER_STATE_DEFINE(). |
| _name | Name. |
| _init | Device init function, or NULL. |
| _parent | Parent device, or NULL. |
| _ops | Driver operations. |
◆ PBL_DMA_CONTROLLER_STATE_DEFINE
| #define PBL_DMA_CONTROLLER_STATE_DEFINE |
( |
|
sym, |
|
|
|
_num_channels |
|
) |
| |
Value:
#define PBL_DEVICE_STATE_DEFINE(sym)
Define the runtime state of device instance sym.
Definition device.h:132
Runtime state of a channel.
Definition driver.h:50
Define the class state of DMA controller sym, for the driver's define macro.
- Parameters
-
| sym | Symbol of the controller instance. |
| _num_channels | Number of channels. |
◆ pbl_dma_complete()
| void pbl_dma_complete |
( |
const struct pbl_dma_controller * |
ctrl, |
|
|
uint8_t |
channel, |
|
|
int |
status |
|
) |
| |
Report the end of a channel's transfer, or of a period of a cyclic one, calling its callback.
Called by controller drivers from their interrupt handlers.
- Parameters
-
| ctrl | Controller. |
| channel | Channel. |
| status | 0 when the transfer completed, or a negative errno. |