Defines the interfaces and data structures for the API sub-component CHNL.
============================================================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ============================================================================
#include <dsplink.h>
#include <chnldefs.h>
Go to the source code of this file.
Defines | |
#define | CHNL_Create CHNL_create |
#define | CHNL_Delete CHNL_delete |
#define | CHNL_AllocateBuffer CHNL_allocateBuffer |
#define | CHNL_FreeBuffer CHNL_freeBuffer |
#define | CHNL_Issue CHNL_issue |
#define | CHNL_Reclaim CHNL_reclaim |
#define | CHNL_Idle CHNL_idle |
#define | CHNL_Flush CHNL_flush |
#define | CHNL_Control CHNL_control |
Functions | |
EXPORT_API DSP_STATUS | CHNL_create (IN ProcessorId procId, IN ChannelId chnlId, IN ChannelAttrs *attrs) |
Creates resources used for transferring data between GPP and DSP. | |
EXPORT_API DSP_STATUS | CHNL_delete (IN ProcessorId procId, IN ChannelId chnlId) |
Releases channel resources used for transferring data between GPP and DSP. | |
EXPORT_API DSP_STATUS | CHNL_allocateBuffer (IN ProcessorId procId, IN ChannelId chnlId, OUT Char8 **bufArray, IN Uint32 size, IN Uint32 numBufs) |
Allocates an array of buffers of specified size and returns them to the client. | |
EXPORT_API DSP_STATUS | CHNL_freeBuffer (IN ProcessorId procId, IN ChannelId chnlId, IN Char8 **bufArray, IN Uint32 numBufs) |
Frees buffer(s) allocated by CHNL_allocateBuffer. | |
EXPORT_API DSP_STATUS | CHNL_issue (IN ProcessorId procId, IN ChannelId chnlId, IN ChannelIOInfo *ioReq) |
Issues an input or output request on a specified channel. | |
EXPORT_API DSP_STATUS | CHNL_reclaim (IN ProcessorId procId, IN ChannelId chnlId, IN Uint32 timeout, IN OUT ChannelIOInfo *ioReq) |
Gets the buffer back that has been issued to this channel. This call blocks for specified timeout value ranging from NO_WAIT to WAIT_FOREVER. | |
EXPORT_API DSP_STATUS | CHNL_idle (IN ProcessorId procId, IN ChannelId chnlId) |
In the input mode channel, this function resets the channel and causes any currently buffered input data to be discarded. | |
EXPORT_API DSP_STATUS | CHNL_flush (IN ProcessorId procId, IN ChannelId chnlId) |
Discards all the requested buffers that are pending for transfer both in case of input mode channel as well as output mode channel. One must still have to call the CHNL_reclaim to get back the discarded buffers. | |
EXPORT_API DSP_STATUS | CHNL_control (IN ProcessorId procId, IN ChannelId chnlId, IN Int32 cmd, Pvoid arg) |
Provides a hook to perform device dependent control operations on channels. |
#define CHNL_Create CHNL_create |
============================================================================
============================================================================
#define CHNL_Delete CHNL_delete |
============================================================================
============================================================================
#define CHNL_AllocateBuffer CHNL_allocateBuffer |
============================================================================
============================================================================
#define CHNL_FreeBuffer CHNL_freeBuffer |
============================================================================
============================================================================
#define CHNL_Issue CHNL_issue |
============================================================================
============================================================================
#define CHNL_Reclaim CHNL_reclaim |
============================================================================
============================================================================
#define CHNL_Idle CHNL_idle |
============================================================================
============================================================================
#define CHNL_Flush CHNL_flush |
============================================================================
============================================================================
#define CHNL_Control CHNL_control |
============================================================================
============================================================================
EXPORT_API DSP_STATUS CHNL_create | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId, | ||
IN ChannelAttrs * | attrs | ||
) |
Creates resources used for transferring data between GPP and DSP.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Id to open. |
attrs | Channel attributes - if NULL, default attributes are applied. |
EXPORT_API DSP_STATUS CHNL_delete | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId | ||
) |
Releases channel resources used for transferring data between GPP and DSP.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Identifier. |
EXPORT_API DSP_STATUS CHNL_allocateBuffer | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId, | ||
OUT Char8 ** | bufArray, | ||
IN Uint32 | size, | ||
IN Uint32 | numBufs | ||
) |
Allocates an array of buffers of specified size and returns them to the client.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Identifier. |
size | Size of each buffer. |
bufArray | Pointer to receive array of allocated buffers. |
numBufs | Number of buffers to allocate. |
EXPORT_API DSP_STATUS CHNL_freeBuffer | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId, | ||
IN Char8 ** | bufArray, | ||
IN Uint32 | numBufs | ||
) |
Frees buffer(s) allocated by CHNL_allocateBuffer.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Identifier. |
bufArray | Pointer to the array of buffers to freed. |
numBufs | Number of buffers to be freed. |
EXPORT_API DSP_STATUS CHNL_issue | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId, | ||
IN ChannelIOInfo * | ioReq | ||
) |
Issues an input or output request on a specified channel.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Identifier. |
ioReq | Information regarding IO. |
EXPORT_API DSP_STATUS CHNL_reclaim | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId, | ||
IN Uint32 | timeout, | ||
IN OUT ChannelIOInfo * | ioReq | ||
) |
Gets the buffer back that has been issued to this channel. This call blocks for specified timeout value ranging from NO_WAIT to WAIT_FOREVER.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Identifier. |
timeout | Timeout value for this operation. Unit of timeout is OS dependent. |
ioReq | Information needed for doing reclaim. |
EXPORT_API DSP_STATUS CHNL_idle | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId | ||
) |
In the input mode channel, this function resets the channel and causes any currently buffered input data to be discarded.
============================================================================
In the output mode channel, this function causes any currently queued buffers to be transferred through the channel. It causes the client to wait for as long as it takes for the data to be transferred through the channel.
procId | Processor Identifier. |
chnlId | Channel Identifier. |
EXPORT_API DSP_STATUS CHNL_flush | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId | ||
) |
Discards all the requested buffers that are pending for transfer both in case of input mode channel as well as output mode channel. One must still have to call the CHNL_reclaim to get back the discarded buffers.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Identifier. |
EXPORT_API DSP_STATUS CHNL_control | ( | IN ProcessorId | procId, |
IN ChannelId | chnlId, | ||
IN Int32 | cmd, | ||
Pvoid | arg | ||
) |
Provides a hook to perform device dependent control operations on channels.
============================================================================
procId | Processor Identifier. |
chnlId | Channel Identifier. |
cmd | Command id. |
arg | Optional argument for the specified command. |