Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Realtek Bee DMA Macros

Macros for extracting DMA configuration from Devicetree. More...

Macros

#define BEE_DMA_CTLR(id, dir)
 Get the DMA controller device node identifier.
#define BEE_DMA_CHANNEL_CONFIG(id, dir)
 Get the raw configuration value from Devicetree.
#define BEE_DMA_CONFIG_DIRECTION(config)
 Extract DMA transfer direction.
#define BEE_DMA_CONFIG_SOURCE_ADDR_INC(config)
 Extract Source Address Increment mode.
#define BEE_DMA_CONFIG_DESTINATION_ADDR_INC(config)
 Extract Destination Address Increment mode.
#define BEE_DMA_CONFIG_SOURCE_DATA_SIZE(config)
 Extract Source Data Size in bytes.
#define BEE_DMA_CONFIG_DESTINATION_DATA_SIZE(config)
 Extract Destination Data Size in bytes.
#define BEE_DMA_CONFIG_SOURCE_MSIZE(config)
 Extract Source MSIZE.
#define BEE_DMA_CONFIG_DESTINATION_MSIZE(config)
 Extract Destination MSIZE.
#define BEE_DMA_CONFIG_PRIORITY(config)
 Extract Channel Priority.

Detailed Description

Macros for extracting DMA configuration from Devicetree.

Macro Definition Documentation

◆ BEE_DMA_CHANNEL_CONFIG

#define BEE_DMA_CHANNEL_CONFIG ( id,
dir )

#include <dma_bee.h>

Value:
DT_INST_DMAS_CELL_BY_NAME(id, dir, config)
#define DT_INST_DMAS_CELL_BY_NAME(inst, name, cell)
Get a DT_DRV_COMPAT instance's DMA specifier's cell value by name.
Definition dma.h:252

Get the raw configuration value from Devicetree.

Parameters
idThe instance identifier.
dirThe direction name (e.g., rx, tx).
Returns
The integer value of the 'config' cell.

◆ BEE_DMA_CONFIG_DESTINATION_ADDR_INC

#define BEE_DMA_CONFIG_DESTINATION_ADDR_INC ( config)

#include <dma_bee.h>

Value:
((config >> 4) & 0x3)

Extract Destination Address Increment mode.

Located at bits 4-5 of the config.

  • 0: Increment
  • 1: Decrement
  • 2: No Change
Parameters
configThe configuration value.
Returns
The destination address increment mode (0-3).

◆ BEE_DMA_CONFIG_DESTINATION_DATA_SIZE

#define BEE_DMA_CONFIG_DESTINATION_DATA_SIZE ( config)

#include <dma_bee.h>

Value:
(1 << ((config >> 8) & 0x3))

Extract Destination Data Size in bytes.

Located at bits 8-9 of the config.

  • 0 -> 1 byte
  • 1 -> 2 bytes
  • 2 -> 4 bytes
Parameters
configThe configuration value.
Returns
The data size in bytes (1, 2, or 4).

◆ BEE_DMA_CONFIG_DESTINATION_MSIZE

#define BEE_DMA_CONFIG_DESTINATION_MSIZE ( config)

#include <dma_bee.h>

Value:
((1 << (((config >> 13) & 0x7) + 1)) - (((config >> 13) & 0x7) == 0 ? 1 : 0))

Extract Destination MSIZE.

Located at bits 13-15 of the config. Maps the 3-bit index to the actual msize:

  • 0 -> msize
  • 1 -> msize 4
  • 2 -> msize 8
  • 3 -> msize 16
  • 4 -> msize 32
  • 5 -> msize 64
  • 6 -> msize 128
  • 7 -> msize 256
Parameters
configThe configuration value.
Returns
The burst size.

◆ BEE_DMA_CONFIG_DIRECTION

#define BEE_DMA_CONFIG_DIRECTION ( config)

#include <dma_bee.h>

Value:
((config >> 0) & 0x3)

Extract DMA transfer direction.

Located at bits 0-1 of the config.

  • 0: Memory to Memory
  • 1: Memory to Peripheral
  • 2: Peripheral to Memory
Parameters
configThe configuration value.
Returns
The direction code (0-3).

◆ BEE_DMA_CONFIG_PRIORITY

#define BEE_DMA_CONFIG_PRIORITY ( config)

#include <dma_bee.h>

Value:
((config >> 16) & 0x1f)

Extract Channel Priority.

Located at bits 16-20 of the config. Range: 0-9.

Parameters
configThe configuration value.
Returns
The priority level.

◆ BEE_DMA_CONFIG_SOURCE_ADDR_INC

#define BEE_DMA_CONFIG_SOURCE_ADDR_INC ( config)

#include <dma_bee.h>

Value:
((config >> 2) & 0x3)

Extract Source Address Increment mode.

Located at bits 2-3 of the config.

  • 0: Increment
  • 1: Decrement
  • 2: No Change
Parameters
configThe configuration value.
Returns
The source address increment mode (0-3).

◆ BEE_DMA_CONFIG_SOURCE_DATA_SIZE

#define BEE_DMA_CONFIG_SOURCE_DATA_SIZE ( config)

#include <dma_bee.h>

Value:
(1 << ((config >> 6) & 0x3))

Extract Source Data Size in bytes.

Located at bits 6-7 of the config.

  • 0 -> 1 byte
  • 1 -> 2 bytes
  • 2 -> 4 bytes
Parameters
configThe configuration value.
Returns
The data size in bytes (1, 2, or 4).

◆ BEE_DMA_CONFIG_SOURCE_MSIZE

#define BEE_DMA_CONFIG_SOURCE_MSIZE ( config)

#include <dma_bee.h>

Value:
((1 << (((config >> 10) & 0x7) + 1)) - (((config >> 10) & 0x7) == 0 ? 1 : 0))

Extract Source MSIZE.

Located at bits 10-12 of the config. Maps the 3-bit index to the actual msize:

  • 0 -> msize
  • 1 -> msize 4
  • 2 -> msize 8
  • 3 -> msize 16
  • 4 -> msize 32
  • 5 -> msize 64
  • 6 -> msize 128
  • 7 -> msize 256
Parameters
configThe configuration value.
Returns
The burst size.

◆ BEE_DMA_CTLR

#define BEE_DMA_CTLR ( id,
dir )

#include <dma_bee.h>

Value:
#define DT_INST_DMAS_CTLR_BY_NAME(inst, name)
Get the node identifier for the DMA controller from a DT_DRV_COMPAT instance's dmas property by name.
Definition dma.h:115

Get the DMA controller device node identifier.

Parameters
idThe instance identifier.
dirThe direction name (e.g., rx, tx).
Returns
The controller device identifier.