Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
DMA (SF32LB specifics)

DMA (SF32LB specifics) More...

Data Structures

struct  sf32lb_dma_dt_spec
 SF32LB DMA DT spec. More...

Macros

#define SF32LB_DMA_DT_SPEC_GET(node_id)
 Initialize a sf32lb_dma_dt_spec structure from a DT node.
#define SF32LB_DMA_DT_SPEC_GET_BY_NAME(node_id, name)
 Initialize a sf32lb_dma_dt_spec structure from a DT node.
#define SF32LB_DMA_DT_INST_SPEC_GET(index)
 Initialize a sf32lb_dma_dt_spec structure from a DT instance.
#define SF32LB_DMA_DT_INST_SPEC_GET_BY_NAME(index, name)
 Initialize a sf32lb_dma_dt_spec structure from a DT instance.

Functions

static bool sf32lb_dma_is_ready_dt (const struct sf32lb_dma_dt_spec *spec)
 Check if the DMA controller is ready.
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.
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.
static int sf32lb_dma_start_dt (const struct sf32lb_dma_dt_spec *spec)
 Start a DMA transfer from a DT spec.
static int sf32lb_dma_stop_dt (const struct sf32lb_dma_dt_spec *spec)
 Stop a DMA transfer from a DT spec.
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.
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.

Detailed Description

DMA (SF32LB specifics)

Macro Definition Documentation

◆ SF32LB_DMA_DT_INST_SPEC_GET

#define SF32LB_DMA_DT_INST_SPEC_GET ( index)

#include <zephyr/drivers/dma/sf32lb.h>

Value:
#define DT_DRV_INST(inst)
Node identifier for an instance of a DT_DRV_COMPAT compatible.
Definition devicetree.h:4037
#define SF32LB_DMA_DT_SPEC_GET(node_id)
Initialize a sf32lb_dma_dt_spec structure from a DT node.
Definition sf32lb.h:41

Initialize a sf32lb_dma_dt_spec structure from a DT instance.

Parameters
indexDT instance index

◆ SF32LB_DMA_DT_INST_SPEC_GET_BY_NAME

#define SF32LB_DMA_DT_INST_SPEC_GET_BY_NAME ( index,
name )

#include <zephyr/drivers/dma/sf32lb.h>

Value:
#define SF32LB_DMA_DT_SPEC_GET_BY_NAME(node_id, name)
Initialize a sf32lb_dma_dt_spec structure from a DT node.
Definition sf32lb.h:54

Initialize a sf32lb_dma_dt_spec structure from a DT instance.

Parameters
indexDT instance index
nameDMA name

◆ SF32LB_DMA_DT_SPEC_GET

#define SF32LB_DMA_DT_SPEC_GET ( node_id)

#include <zephyr/drivers/dma/sf32lb.h>

Value:
{ \
.dev = DEVICE_DT_GET(DT_DMAS_CTLR(node_id)), \
.channel = DT_DMAS_CELL_BY_IDX(node_id, 0, channel), \
.request = DT_DMAS_CELL_BY_IDX(node_id, 0, request), \
.config = DT_DMAS_CELL_BY_IDX(node_id, 0, config), \
}
#define DEVICE_DT_GET(node_id)
Get a device reference from a devicetree node identifier.
Definition device.h:314
#define DT_DMAS_CTLR(node_id)
Equivalent to DT_DMAS_CTLR_BY_IDX(node_id, 0)
Definition dma.h:91
#define DT_DMAS_CELL_BY_IDX(node_id, idx, cell)
Get a DMA specifier's cell value at an index.
Definition dma.h:166

Initialize a sf32lb_dma_dt_spec structure from a DT node.

Parameters
node_idDT node identifier

◆ SF32LB_DMA_DT_SPEC_GET_BY_NAME

#define SF32LB_DMA_DT_SPEC_GET_BY_NAME ( node_id,
name )

#include <zephyr/drivers/dma/sf32lb.h>

Value:
{ \
.dev = DEVICE_DT_GET(DT_DMAS_CTLR_BY_NAME(node_id, name)), \
.channel = DT_DMAS_CELL_BY_NAME(node_id, name, channel), \
.request = DT_DMAS_CELL_BY_NAME(node_id, name, request), \
.config = DT_DMAS_CELL_BY_NAME(node_id, name, config), \
}
#define DT_DMAS_CELL_BY_NAME(node_id, name, cell)
Get a DMA specifier's cell value by name.
Definition dma.h:221
#define DT_DMAS_CTLR_BY_NAME(node_id, name)
Get the node identifier for the DMA controller from a dmas property by name.
Definition dma.h:81

Initialize a sf32lb_dma_dt_spec structure from a DT node.

Parameters
node_idDT node identifier

Function Documentation

◆ sf32lb_dma_config_dt()

int sf32lb_dma_config_dt ( const struct sf32lb_dma_dt_spec * spec,
struct dma_config * config )
inlinestatic

#include <zephyr/drivers/dma/sf32lb.h>

Configure a DMA channel from a DT spec.

Parameters
specSF32LB DMA DT spec
configDMA configuration
Return values
0If successful.
-ENOTSUPIf the configuration is not supported.
-errnoOther negative errno code failure (see dma_config()).

◆ sf32lb_dma_config_init_dt()

void sf32lb_dma_config_init_dt ( const struct sf32lb_dma_dt_spec * spec,
struct dma_config * config )
inlinestatic

#include <zephyr/drivers/dma/sf32lb.h>

Initialize a DMA configuration structure from a DT spec.

This function sets the following fields in the dma_config structure:

  • dma_slot
  • channel_priority
Parameters
specSF32LB DMA DT spec
[out]configDMA configuration

◆ sf32lb_dma_get_status_dt()

int sf32lb_dma_get_status_dt ( const struct sf32lb_dma_dt_spec * spec,
struct dma_status * status )
inlinestatic

#include <zephyr/drivers/dma/sf32lb.h>

Get the status of a DMA transfer from a DT spec.

Parameters
specSF32LB DMA DT spec
[out]statusStatus output
Return values
0If successful.
-errnoNegative errno code failure (see dma_get_status()).

◆ sf32lb_dma_is_ready_dt()

bool sf32lb_dma_is_ready_dt ( const struct sf32lb_dma_dt_spec * spec)
inlinestatic

#include <zephyr/drivers/dma/sf32lb.h>

Check if the DMA controller is ready.

Parameters
specSF32LB DMA DT spec
Returns
true If the DMA controller is ready.
false If the DMA controller is not ready.

◆ sf32lb_dma_reload_dt()

int sf32lb_dma_reload_dt ( const struct sf32lb_dma_dt_spec * spec,
uintptr_t src,
uintptr_t dst,
size_t size )
inlinestatic

#include <zephyr/drivers/dma/sf32lb.h>

Reload a DMA transfer from a DT spec.

Parameters
specSF32LB DMA DT spec
srcSource address
dstDestination address
sizeTransfer size
Return values
0If successful.
-errnoNegative errno code failure (see dma_reload()).

◆ sf32lb_dma_start_dt()

int sf32lb_dma_start_dt ( const struct sf32lb_dma_dt_spec * spec)
inlinestatic

#include <zephyr/drivers/dma/sf32lb.h>

Start a DMA transfer from a DT spec.

Parameters
specSF32LB DMA DT spec
Return values
0If successful.
-errnoNegative errno code failure (see dma_start()).

◆ sf32lb_dma_stop_dt()

int sf32lb_dma_stop_dt ( const struct sf32lb_dma_dt_spec * spec)
inlinestatic

#include <zephyr/drivers/dma/sf32lb.h>

Stop a DMA transfer from a DT spec.

Parameters
specSF32LB DMA DT spec
Return values
0If successful.
-errnoNegative errno code failure (see dma_stop()).