EDMA Manager


Detailed Description

This is the API for the EDMA manager.


Data Structures

struct  EDMA_requestDmaParams
 EDMAK ioctl input/output parameters. More...
struct  EDMA_releaseDmaParams
 EDMAK ioctl input parameters. More...

Defines

#define EDMA_VERSION   0x01100000U
#define EDMA_TCCANY   1001
 Values for dev_id parameter of EDMA_getResource().
#define EDMA_TCCSYMM   1005
#define EDMA_PARAMANY   1006
#define EDMA_PARAMFIXEDEXACT   1007
#define EDMA_PARAMFIXEDNOTEXACT   1008
#define EDMA_EDMAANY   1003
#define EDMA_QDMAANY   1004
#define EDMA_QDMA0   512
#define EDMA_QDMA1   EDMA_QDMA(1)
#define EDMA_QDMA2   EDMA_QDMA(2)
#define EDMA_QDMA3   EDMA_QDMA(3)
#define EDMA_QDMA4   EDMA_QDMA(4)
#define EDMA_QDMA5   EDMA_QDMA(5)
#define EDMA_QDMA6   EDMA_QDMA(6)
#define EDMA_QDMA7   EDMA_QDMA(7)
#define EDMA_QDMA(n)   (EDMA_QDMA0 + (n))
 macro used to translate from a QDMA channel # to the numerical range used by EDMA_getResource() & EDMA_freeResource() for representing a QDMA channel.
#define EDMA_QDMA2NUM(qdma)   (qdma - EDMA_QDMA0)
 macro to translate from EDMA_QDMA0 -> EDMA_QDMA7 namespace to actual QDMA number 0 -> 7.

Enumerations

enum  EDMA_commmands {
  EDMA_IOCREQUESTDMA = 1,
  EDMA_IOCRELEASEDMA,
  EDMA_IOCGETVERSION,
  EDMA_IOCGETBASEPHYSADDR,
  EDMA_IOCREGUSER
}
 EDMAK ioctl() commands. More...
enum  EDMA_Status {
  EDMA_OK = 0,
  EDMA_EFAIL,
  EDMA_ENOCHANNEL,
  EDMA_ENOINIT
}
 Status codes for EDMA API return values. More...

Functions

int EDMA_init (void)
 EDMA initialization API.
int EDMA_exit (void)
 EDMA finalization API.
EDMA_Status EDMA_mapBaseAddress (void **pvirtAddr)
 Returns user space virtual address of EDMA base registers.
EDMA_Status EDMA_getResource (int devId, int *tcc, int *channel, int *param, int nParams)
 Returns available logical channels.
EDMA_Status EDMA_freeResource (int lch, int nParams)
 Frees previously requested logical channel.
int EDMA_getVersion (void)
 Retrieve version from EDMA driver.
EDMA_Status EDMA_registerResource (int lch)
 Registers calling process as a user of lch.
EDMA_Status EDMA_unregister (int lch, int nParams)
 Unregisters calling process as a user of lch.


Define Documentation

#define EDMA_VERSION   0x01100000U

#define EDMA_TCCANY   1001

Values for dev_id parameter of EDMA_getResource().

#define EDMA_TCCSYMM   1005

#define EDMA_PARAMANY   1006

#define EDMA_PARAMFIXEDEXACT   1007

#define EDMA_PARAMFIXEDNOTEXACT   1008

#define EDMA_EDMAANY   1003

#define EDMA_QDMAANY   1004

#define EDMA_QDMA0   512

#define EDMA_QDMA1   EDMA_QDMA(1)

#define EDMA_QDMA2   EDMA_QDMA(2)

#define EDMA_QDMA3   EDMA_QDMA(3)

#define EDMA_QDMA4   EDMA_QDMA(4)

#define EDMA_QDMA5   EDMA_QDMA(5)

#define EDMA_QDMA6   EDMA_QDMA(6)

#define EDMA_QDMA7   EDMA_QDMA(7)

#define EDMA_QDMA (  )     (EDMA_QDMA0 + (n))

macro used to translate from a QDMA channel # to the numerical range used by EDMA_getResource() & EDMA_freeResource() for representing a QDMA channel.

See also:
EDMA_QDMA2NUM()

#define EDMA_QDMA2NUM ( qdma   )     (qdma - EDMA_QDMA0)

macro to translate from EDMA_QDMA0 -> EDMA_QDMA7 namespace to actual QDMA number 0 -> 7.

Remarks:
when requesting a QDMA channel from EDMA_getResource(), the returned channel # is not directly usable as a QDMA channel #. This macro translates from the "magic number" range to the actual QDMA channel # (0 -> 7).
See also:
EDMA_getResource()

EDMA_freeResource()

EMDA_QDMA()


Enumeration Type Documentation

enum EDMA_commmands

EDMAK ioctl() commands.

Enumerator:
EDMA_IOCREQUESTDMA 
EDMA_IOCRELEASEDMA 
EDMA_IOCGETVERSION 
EDMA_IOCGETBASEPHYSADDR 
EDMA_IOCREGUSER 

enum EDMA_Status

Status codes for EDMA API return values.

Enumerator:
EDMA_OK  OK
EDMA_EFAIL  general failure
EDMA_ENOCHANNEL  no channels available
EDMA_ENOINIT  EDMA_init() not called


Function Documentation

int EDMA_init ( void   ) 

EDMA initialization API.

int EDMA_exit ( void   ) 

EDMA finalization API.

EDMA_Status EDMA_mapBaseAddress ( void **  pvirtAddr  ) 

Returns user space virtual address of EDMA base registers.

Parameters:
pvirtAddr pointer to storage for virtual address.

EDMA_Status EDMA_getResource ( int  devId,
int *  tcc,
int *  channel,
int *  param,
int  nParams 
)

Returns available logical channels.

Parameters:
devId EDMA channel # or EDMA_QDMA(0 -> # QDMAs) or EDMA_EDMAANY or EDMA_QDMAANY or EDMA_PARAMANY.
tcc pointer to TCC #. Serves as input or output or both, depending on the type of resource requested (devId).
channel pointer to channel #. Serves as output parameter only (explicit channel # request has channel # in devId parameter).
param pointer to PaRAM #. Serves as input or output or both, depending on the type of resource requested (devId).
nParams number of consecutive PaRAMs to allocate, applies only when devId is EDMA_PARAMANY.
Remarks:
Fails if the requested resource(s) is not available.

The following information shows which function parameters are valid for all types of allocations: devId input parameters output parameters ----- ---------------- ----------------- EDMA # none channel, tcc, param*# EDMA_EDMAANY tcc channel, tcc, param* EDMA_QDMA# tcc channel, tcc, param EDMA_QDMAANY tcc channel, tcc, param EDMA_PARAMANY nParams channel, tcc, param* * channel and param are the same value # channel and tcc are the same value

See also:
EDMA_freeResource()

EDMA_registerResource()

EDMA_unregister()

EDMA_QDMA()

EDMA_QDMA2NUM()

EDMA_Status EDMA_freeResource ( int  lch,
int  nParams 
)

Frees previously requested logical channel.

Parameters:
lch channel number. EDMA channels range from 0 -> (# channels). PaRAM channels range from (# channels) -> (# PaRAMs). QDMA channels range from EDMA_QDMA(0 -> # QDMAs).
nParams number of consecutive PaRAMs to free, starting at lch, applies only when lch is a PaRAM identifier.
See also:
EDMA_getResource()

EDMA_registerResource()

EDMA_unregister()

EDMA_QDMA()

EDMA_QDMA2NUM()

int EDMA_getVersion ( void   ) 

Retrieve version from EDMA driver.

Returns:
Installed EDMA driver's version number.
Precondition:
Must have called EDMA_init()

EDMA_Status EDMA_registerResource ( int  lch  ) 

Registers calling process as a user of lch.

Parameters:
lch Resource (channel) # returned by EDMA_getResource().
Remarks:
Fails if the requested resource is not already allocated.

Each call by the same process adds the process to the registration list a separate time, so that each call must be matched by a corresponding EDMA_unregister() call.

See also:
EDMA_unregister()

EDMA_getResource()

EDMA_freeResource()

EDMA_Status EDMA_unregister ( int  lch,
int  nParams 
)

Unregisters calling process as a user of lch.

Parameters:
lch Resource (channel) # returned by EDMA_getResource().
nParams number of PaRAMs, if lch represents a set of PaRAMS.
Remarks:
Fails if the calling process is not already registered for lch.

A process must match each EDMA_registerResource() call with a call to EDMA_unregister().

See also:
EDMA_freeResource()

EDMA_getResource()

EDMA_registerResource()


Copyright 2009, Texas Instruments Incorporated