RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Macros | Functions

Enhanced Direct Memory Access (eDMA). More...

#include <mpc55xx/edma.h>
#include <mpc55xx/mpc55xx.h>
#include <assert.h>
#include <bsp.h>
#include <bsp/fatal.h>
#include <bsp/irq.h>

Macros

#define EDMA_CHANNELS_PER_GROUP   32U
 
#define EDMA_GROUP_COUNT   ((EDMA_CHANNEL_COUNT + 31U) / 32U)
 
#define EDMA_GROUP_INDEX(channel)   ((channel) / EDMA_CHANNELS_PER_GROUP)
 
#define EDMA_GROUP_BIT(channel)   (1U << ((channel) % EDMA_CHANNELS_PER_GROUP))
 
#define EDMA_MODULE_INDEX(channel)   ((channel) / EDMA_CHANNELS_PER_MODULE)
 

Functions

void mpc55xx_edma_init (void)
 
rtems_status_code mpc55xx_edma_obtain_channel_by_tcd (volatile struct tcd_t *edma_tcd)
 Obtains an eDMA channel.
 
void mpc55xx_edma_release_channel_by_tcd (volatile struct tcd_t *edma_tcd)
 
rtems_status_code mpc55xx_edma_obtain_channel (edma_channel_context *ctx, unsigned irq_priority)
 Obtains an eDMA channel and registers the channel context.
 
void mpc55xx_edma_release_channel (edma_channel_context *ctx)
 
void mpc55xx_edma_copy (volatile struct tcd_t *edma_tcd, const struct tcd_t *source_tcd)
 Copies a source TCD to an eDMA TCD.
 
void mpc55xx_edma_copy_and_enable_hardware_requests (volatile struct tcd_t *edma_tcd, const struct tcd_t *source_tcd)
 Copies a source TCD to an eDMA TCD and enables hardware requests.
 
void mpc55xx_edma_sg_link (volatile struct tcd_t *edma_tcd, const struct tcd_t *source_tcd)
 

Detailed Description

Enhanced Direct Memory Access (eDMA).

Function Documentation

◆ mpc55xx_edma_copy()

void mpc55xx_edma_copy ( volatile struct tcd_t *  edma_tcd,
const struct tcd_t *  source_tcd 
)

Copies a source TCD to an eDMA TCD.

The DONE flag of the eDMA TCD is cleared before the actual copy operation. This enables the setting of channel link or scatter/gather options.

This function can be used to start the channel if the START flags is set in the source TCD.

◆ mpc55xx_edma_copy_and_enable_hardware_requests()

void mpc55xx_edma_copy_and_enable_hardware_requests ( volatile struct tcd_t *  edma_tcd,
const struct tcd_t *  source_tcd 
)

Copies a source TCD to an eDMA TCD and enables hardware requests.

The DONE flag of the eDMA TCD is cleared before the actual copy operation. This enables the setting of channel link or scatter/gather options.

◆ mpc55xx_edma_obtain_channel()

rtems_status_code mpc55xx_edma_obtain_channel ( edma_channel_context ctx,
unsigned  irq_priority 
)

Obtains an eDMA channel and registers the channel context.

The done handler of the channel context will be called

  • during minor or major loop completions if interrupts are enabled in the corresponding TCD, or
  • in case a channel error occurs.

An error status value not equal to zero indicates an error.

Return values
RTEMS_SUCCESSFULSuccessful operation.
RTEMS_RESOURCE_IN_USEThe channel is already in use.
RTEMS_IO_ERRORUnable to install interrupt handler for this channel.

◆ mpc55xx_edma_obtain_channel_by_tcd()

rtems_status_code mpc55xx_edma_obtain_channel_by_tcd ( volatile struct tcd_t *  edma_tcd)

Obtains an eDMA channel.

Return values
RTEMS_SUCCESSFULSuccessful operation.
RTEMS_RESOURCE_IN_USEThe channel is already in use.