Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

chnldefs.h

Go to the documentation of this file.
00001 /** ============================================================================
00002  *  @file   chnldefs.h
00003  *
00004  *  @path   $(DSPLINK)/gpp/inc/usr/
00005  *
00006  *  @brief  Defines data types and structures used by CHNL component.
00007  *
00008  *  @ver    1.65.00.03
00009  *  ============================================================================
00010  *  @copyright Copyright (C) 2002-2009, Texas Instruments Incorporated -
00011  *  http://www.ti.com/
00012  *
00013  *  Redistribution and use in source and binary forms, with or without
00014  *  modification, are permitted provided that the following conditions
00015  *  are met:
00016  *  
00017  *  *  Redistributions of source code must retain the above copyright
00018  *     notice, this list of conditions and the following disclaimer.
00019  *  
00020  *  *  Redistributions in binary form must reproduce the above copyright
00021  *     notice, this list of conditions and the following disclaimer in the
00022  *     documentation and/or other materials provided with the distribution.
00023  *  
00024  *  *  Neither the name of Texas Instruments Incorporated nor the names of
00025  *     its contributors may be used to endorse or promote products derived
00026  *     from this software without specific prior written permission.
00027  *  
00028  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00029  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00030  *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00031  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00032  *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00033  *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00034  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00035  *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00036  *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00037  *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
00038  *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039  *  ============================================================================
00040  */
00041 
00042 
00043 #if !defined (CHNLDEFS_H)
00044 #define CHNLDEFS_H
00045 
00046 
00047 /*  ----------------------------------- DSP/BIOS Link                   */
00048 #include <dsplink.h>
00049 #include <procdefs.h>
00050 
00051 
00052 #if defined (__cplusplus)
00053 extern "C" {
00054 #endif
00055 
00056 
00057 /** ============================================================================
00058  *  @const  MAX_ALLOC_BUFFERS
00059  *
00060  *  @brief  Maximum number of buffers that can be allocated
00061  *          through CHNL_AllocateBuffer.
00062  *  ============================================================================
00063  */
00064 #define MAX_ALLOC_BUFFERS      1000u
00065 
00066 /** ============================================================================
00067  *  @const  MAX_CHANNELS
00068  *
00069  *  @brief  Maximum number of channels that can be created for each DSP.
00070  *  ============================================================================
00071  */
00072 #define MAX_CHANNELS           16u
00073 
00074 
00075 #if defined (CHNL_COMPONENT)
00076 /** ============================================================================
00077  *  @macro  IS_VALID_CHNLID
00078  *
00079  *  @brief  Is the chnl ID valid.
00080  *  ============================================================================
00081  */
00082 #define IS_VALID_CHNLID(dspId, chnlId)                                      \
00083                                 (    IS_VALID_PROCID (dspId)                \
00084                                  &&  (chnlId < MAX_CHANNELS))
00085 #else /* if defined (CHNL_COMPONENT) */
00086 #define IS_VALID_CHNLID(dspId, chnlId)  FALSE
00087 #endif /* if defined (CHNL_COMPONENT) */
00088 
00089 
00090 /** ============================================================================
00091  *  @name   ChannelMode
00092  *
00093  *  @brief  Mode of a channel.
00094  *
00095  *  @param  ChannelMode_Input
00096  *              Indicates the channel as an Input channel (from DSP to GPP).
00097  *  @param  ChannelMode_Output
00098  *              Indicates the channel as an Output channel (from GPP to DSP).
00099  *  ============================================================================
00100  */
00101 typedef enum {
00102     ChannelMode_Input  = 0x1u,
00103     ChannelMode_Output = 0x2u
00104 } ChannelMode ;
00105 
00106 /** ============================================================================
00107  *  @name   ChannelDataSize
00108  *
00109  *  @brief  Width of data being sent on channel.
00110  *
00111  *  @param  ChannelDataSize_16bits
00112  *              Indicates the data to be transferred through the channel
00113  *              as 16 bit data.
00114  *  @param  ChannelDataSize_32bits
00115  *              Indicates the data to be transferred through the channel
00116  *              as 32 bit data.
00117  *  ============================================================================
00118  */
00119 typedef enum {
00120     ChannelDataSize_16bits = 1u,
00121     ChannelDataSize_32bits = 2u
00122 } ChannelDataSize ;
00123 
00124 
00125 /** ============================================================================
00126  *  @name   ChannelAttrs
00127  *
00128  *  @brief  Channel Attributes.
00129  *
00130  *  @param  endianism
00131  *              Endiannism information currently not used.
00132  *  @param  mode
00133  *              Mode of channel (Input or output).
00134  *  @param  size
00135  *              Size of data sent on channel (16 bits or 32 bits).
00136  *  ============================================================================
00137  */
00138 typedef struct ChannelAttrs_tag {
00139     Endianism       endianism ;
00140     ChannelMode     mode      ;
00141     ChannelDataSize size      ;
00142 } ChannelAttrs ;
00143 
00144 /** ============================================================================
00145  *  @name   ChannelIOInfo
00146  *
00147  *  @brief  Information for adding or reclaiming a IO request.
00148  *
00149  *  @param  buffer
00150  *              Buffer pointer.
00151  *  @param  size
00152  *              Size of buffer.
00153  *  @param  arg
00154  *              Argument to receive or send.
00155  *  ============================================================================
00156  */
00157 typedef struct ChannelIOInfo_tag {
00158     Char8 *   buffer ;
00159     Uint32    size ;
00160     Uint32    arg ;
00161 } ChannelIOInfo ;
00162 
00163 
00164 #if defined (__cplusplus)
00165 }
00166 #endif
00167 
00168 
00169 #endif /* !defined (CHNLDEFS_H) */

Generated on Fri Jul 16 14:34:01 2010 for DSP/BIOSLink by  doxygen 1.4.4