Dmai

Common header file for all Dmai modules and applications. More...

Defines

#define Dmai_EINVAL   -5
#define Dmai_ENOMEM   -4
#define Dmai_EIO   -3
#define Dmai_ENOTIMPL   -2
#define Dmai_EFAIL   -1
#define Dmai_EOK   0
#define Dmai_EFLUSH   1
#define Dmai_EPRIME   2
#define Dmai_EFIRSTFIELD   3
#define Dmai_EBITERROR   4
#define Dmai_ETIMEOUT   5
#define Dmai_EEOF   6
#define Dmai_EAGAIN   7
#define Dmai_dbg0(fmt)   GT_0trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt)
 ***INTERNAL*** Debug message with 0 arguments
#define Dmai_dbg1(fmt, arg1)
 ***INTERNAL*** Debug message with 1 arguments
#define Dmai_dbg2(fmt, arg1, arg2)
 ***INTERNAL*** Debug message with 2 arguments
#define Dmai_dbg3(fmt, arg1, arg2, arg3)
 ***INTERNAL*** Debug message with 3 arguments
#define Dmai_dbg4(fmt, arg1, arg2, arg3, arg4)
 ***INTERNAL*** Debug message with 4 arguments
#define Dmai_dbg5(fmt, arg1, arg2, arg3, arg4, arg5)
 ***INTERNAL*** Debug message with 5 arguments
#define Dmai_dbg6(fmt, arg1, arg2, arg3, arg4, arg5, arg6)
 ***INTERNAL*** Debug message with 6 arguments
#define Dmai_err0(fmt)   GT_0trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt)
 ***INTERNAL*** Error message with 0 arguments
#define Dmai_err1(fmt, arg1)
 ***INTERNAL*** Error message with 1 arguments
#define Dmai_err2(fmt, arg1, arg2)
 ***INTERNAL*** Error message with 2 arguments
#define Dmai_err3(fmt, arg1, arg2, arg3)
 ***INTERNAL*** Error message with 3 arguments
#define Dmai_err4(fmt, arg1, arg2, arg3, arg4)
 ***INTERNAL*** Error message with 4 arguments
#define Dmai_err5(fmt, arg1, arg2, arg3, arg4, arg5)
 ***INTERNAL*** Error message with 5 arguments
#define Dmai_err6(fmt, arg1, arg2, arg3, arg4, arg5, arg6)
 ***INTERNAL*** Error message with 6 arguments
#define Dmai_clear(x)   memset (&(x), 0, sizeof (x))
 Utility macro for clearing structures.
#define Dmai_roundUp(val, rounding)
 Macro that can be used to round up 'val' to the closest multiple of the value passed in 'rounding'.
#define Dmai_gtname   "ti.sdo.dmai"
 ***INTERNAL*** Name of GT Mask used for DMAI.
#define Dmai_Bios_segid   0
 DSP/BIOS Segment ID from which to allocate all Dmai objects.

Enumerations

enum  Dmai_LogLevel {
  Dmai_LogLevel_Notset = -1,
  Dmai_LogLevel_None = 0,
  Dmai_LogLevel_ErrorsWarnings,
  Dmai_LogLevel_All
}
 Log Levels. More...

Functions

Int Dmai_setLogLevel (Dmai_LogLevel logLevel)
 Set global DMAI debug level setting. Can be overriden by the DMAI_DEBUG environment variable on platforms where it is supported. Note that calling this API will result in all trace (including CE trace) to be directed to stdout.
Void Dmai_init ()
 Initializes DMAI. Must be called before any other DMAI module function.

Variables

GT_Mask ti_sdo_dmai_GTMask
 Global GT trace mask declaration.

Detailed Description

Common header file for all Dmai modules and applications.


Define Documentation

#define Dmai_EINVAL   -5

Invalid input arguments (failure).

#define Dmai_ENOMEM   -4

No memory available (failure).

#define Dmai_EIO   -3

An IO error occured (failure).

#define Dmai_ENOTIMPL   -2

Functionality not implemented (failure).

#define Dmai_EFAIL   -1

General failure code (failure).

#define Dmai_EOK   0

General success code (success).

#define Dmai_EFLUSH   1

The command was flushed (success).

#define Dmai_EPRIME   2

The command was primed (success).

#define Dmai_EFIRSTFIELD   3

Only the first field was processed (success)

#define Dmai_EBITERROR   4

There was a non fatal bit error (success).

#define Dmai_ETIMEOUT   5

The operation was timed out (success).

#define Dmai_EEOF   6

The operation reached end of file

#define Dmai_EAGAIN   7

The command needs to be rerun (success).

#define Dmai_dbg0 ( fmt   )     GT_0trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt)

***INTERNAL*** Debug message with 0 arguments

#define Dmai_dbg1 ( fmt,
arg1   ) 

Value:

GT_1trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt, \
              arg1)
***INTERNAL*** Debug message with 1 arguments

#define Dmai_dbg2 ( fmt,
arg1,
arg2   ) 

Value:

GT_2trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2)
***INTERNAL*** Debug message with 2 arguments

#define Dmai_dbg3 ( fmt,
arg1,
arg2,
arg3   ) 

Value:

GT_3trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3)
***INTERNAL*** Debug message with 3 arguments

#define Dmai_dbg4 ( fmt,
arg1,
arg2,
arg3,
arg4   ) 

Value:

GT_4trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3, arg4)
***INTERNAL*** Debug message with 4 arguments

#define Dmai_dbg5 ( fmt,
arg1,
arg2,
arg3,
arg4,
arg5   ) 

Value:

GT_5trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3, arg4, arg5)
***INTERNAL*** Debug message with 5 arguments

#define Dmai_dbg6 ( fmt,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   ) 

Value:

GT_6trace(ti_sdo_dmai_GTMask, GT_2CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3, arg4, arg5, arg6)
***INTERNAL*** Debug message with 6 arguments

#define Dmai_err0 ( fmt   )     GT_0trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt)

***INTERNAL*** Error message with 0 arguments

#define Dmai_err1 ( fmt,
arg1   ) 

Value:

GT_1trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt, \
              arg1)
***INTERNAL*** Error message with 1 arguments

#define Dmai_err2 ( fmt,
arg1,
arg2   ) 

Value:

GT_2trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2)
***INTERNAL*** Error message with 2 arguments

#define Dmai_err3 ( fmt,
arg1,
arg2,
arg3   ) 

Value:

GT_3trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3)
***INTERNAL*** Error message with 3 arguments

#define Dmai_err4 ( fmt,
arg1,
arg2,
arg3,
arg4   ) 

Value:

GT_4trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3, arg4)
***INTERNAL*** Error message with 4 arguments

#define Dmai_err5 ( fmt,
arg1,
arg2,
arg3,
arg4,
arg5   ) 

Value:

GT_5trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3, arg4, arg5)
***INTERNAL*** Error message with 5 arguments

#define Dmai_err6 ( fmt,
arg1,
arg2,
arg3,
arg4,
arg5,
arg6   ) 

Value:

GT_6trace(ti_sdo_dmai_GTMask, GT_7CLASS, "[" MODULE_NAME "] " fmt, \
              arg1, arg2, arg3, arg4, arg5, arg6)
***INTERNAL*** Error message with 6 arguments

#define Dmai_clear (  )     memset (&(x), 0, sizeof (x))

Utility macro for clearing structures.

#define Dmai_roundUp ( val,
rounding   ) 

Value:

( ( (val) & ((rounding) - 1) ) ? \
    (((val) & ~((rounding) - 1)) + (rounding)) : (val) )
Macro that can be used to round up 'val' to the closest multiple of the value passed in 'rounding'.

Parameters:
[in] val The value to be rounded
[in] rounding The closest multiple of which will be returned. Must be a power of 2.
Return values:
Rounded result

#define Dmai_gtname   "ti.sdo.dmai"

***INTERNAL*** Name of GT Mask used for DMAI.

#define Dmai_Bios_segid   0

DSP/BIOS Segment ID from which to allocate all Dmai objects.


Enumeration Type Documentation

Log Levels.

Enumerator:
Dmai_LogLevel_Notset  Default value when log level is not set.
Dmai_LogLevel_None  No trace output.
Dmai_LogLevel_ErrorsWarnings  Output only errors and warnings.
Dmai_LogLevel_All  Output all messages.


Function Documentation

Int Dmai_setLogLevel ( Dmai_LogLevel  logLevel  ) 

Set global DMAI debug level setting. Can be overriden by the DMAI_DEBUG environment variable on platforms where it is supported. Note that calling this API will result in all trace (including CE trace) to be directed to stdout.

Parameters:
[in] logLevel The Dmai_LogLevel to set to.
Return values:
DMAI_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Dmai_init must be called before this function.

Void Dmai_init (  ) 

Initializes DMAI. Must be called before any other DMAI module function.


Variable Documentation

Global GT trace mask declaration.


Copyright 2011, Texas Instruments Incorporated