6#ifndef INCLUDE_ZEPHYR_DRIVERS_DMA_SF32LB_H_
7#define INCLUDE_ZEPHYR_DRIVERS_DMA_SF32LB_H_
41#define SF32LB_DMA_DT_SPEC_GET(node_id) \
43 .dev = DEVICE_DT_GET(DT_DMAS_CTLR(node_id)), \
44 .channel = DT_DMAS_CELL_BY_IDX(node_id, 0, channel), \
45 .request = DT_DMAS_CELL_BY_IDX(node_id, 0, request), \
46 .config = DT_DMAS_CELL_BY_IDX(node_id, 0, config), \
54#define SF32LB_DMA_DT_SPEC_GET_BY_NAME(node_id, name) \
56 .dev = DEVICE_DT_GET(DT_DMAS_CTLR_BY_NAME(node_id, name)), \
57 .channel = DT_DMAS_CELL_BY_NAME(node_id, name, channel), \
58 .request = DT_DMAS_CELL_BY_NAME(node_id, name, request), \
59 .config = DT_DMAS_CELL_BY_NAME(node_id, name, config), \
67#define SF32LB_DMA_DT_INST_SPEC_GET(index) SF32LB_DMA_DT_SPEC_GET(DT_DRV_INST(index))
75#define SF32LB_DMA_DT_INST_SPEC_GET_BY_NAME(index, name) \
76 SF32LB_DMA_DT_SPEC_GET_BY_NAME(DT_DRV_INST(index), name)
Main header file for DMA (Direct Memory Access) driver API.
bool device_is_ready(const struct device *dev)
Verify that a device is ready for use.
static int dma_get_status(const struct device *dev, uint32_t channel, struct dma_status *stat)
get current runtime status of DMA transfer
Definition dma.h:678
int dma_stop(const struct device *dev, uint32_t channel)
Stops the DMA transfer and disables the channel.
static int dma_reload(const struct device *dev, uint32_t channel, uint32_t src, uint32_t dst, size_t size)
Reload buffer(s) for a DMA channel.
Definition dma.h:421
static int dma_config(const struct device *dev, uint32_t channel, struct dma_config *config)
Configure individual channel for DMA transfer.
Definition dma.h:395
int dma_start(const struct device *dev, uint32_t channel)
Enables DMA channel and starts the transfer, the channel must be configured beforehand.
static void sf32lb_dma_config_init_dt(const struct sf32lb_dma_dt_spec *spec, struct dma_config *config)
Initialize a DMA configuration structure from a DT spec.
Definition sf32lb.h:101
static int sf32lb_dma_start_dt(const struct sf32lb_dma_dt_spec *spec)
Start a DMA transfer from a DT spec.
Definition sf32lb.h:132
static int sf32lb_dma_config_dt(const struct sf32lb_dma_dt_spec *spec, struct dma_config *config)
Configure a DMA channel from a DT spec.
Definition sf32lb.h:118
static bool sf32lb_dma_is_ready_dt(const struct sf32lb_dma_dt_spec *spec)
Check if the DMA controller is ready.
Definition sf32lb.h:86
static int sf32lb_dma_get_status_dt(const struct sf32lb_dma_dt_spec *spec, struct dma_status *status)
Get the status of a DMA transfer from a DT spec.
Definition sf32lb.h:176
static int sf32lb_dma_stop_dt(const struct sf32lb_dma_dt_spec *spec)
Stop a DMA transfer from a DT spec.
Definition sf32lb.h:145
static int sf32lb_dma_reload_dt(const struct sf32lb_dma_dt_spec *spec, uintptr_t src, uintptr_t dst, size_t size)
Reload a DMA transfer from a DT spec.
Definition sf32lb.h:161
#define SF32LB_DMA_PL_MSK
Definition sf32lb-dma-config.h:10
#define FIELD_GET(mask, value)
Definition silabs-pinctrl-siwx91x.h:14
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINTPTR_TYPE__ uintptr_t
Definition stdint.h:105
Runtime device structure (in ROM) per driver instance.
Definition device.h:510
const void * config
Address of device instance config information.
Definition device.h:514
DMA configuration structure.
Definition dma.h:196
DMA runtime status structure.
Definition dma.h:274
SF32LB DMA DT spec.
Definition sf32lb.h:25
const struct device * dev
DMA controller.
Definition sf32lb.h:27
uint8_t channel
DMA channel.
Definition sf32lb.h:29
uint8_t config
DMA configuration.
Definition sf32lb.h:33
uint8_t request
DMA request.
Definition sf32lb.h:31