SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
FrameQ.h
Go to the documentation of this file.
1 
10 /*
11  * ============================================================================
12  *
13  * Copyright (c) 2008-2012, Texas Instruments Incorporated
14  *
15  * Redistribution and use in source and binary forms, with or without
16  * modification, are permitted provided that the following conditions
17  * are met:
18  *
19  * * Redistributions of source code must retain the above copyright
20  * notice, this list of conditions and the following disclaimer.
21  *
22  * * Redistributions in binary form must reproduce the above copyright
23  * notice, this list of conditions and the following disclaimer in the
24  * documentation and/or other materials provided with the distribution.
25  *
26  * * Neither the name of Texas Instruments Incorporated nor the names of
27  * its contributors may be used to endorse or promote products derived
28  * from this software without specific prior written permission.
29  *
30  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41  * Contact information for paper mail:
42  * Texas Instruments
43  * Post Office Box 655303
44  * Dallas, Texas 75265
45  * Contact information:
46  * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
47  * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
48  * ============================================================================
49  *
50  */
51 
52 
53 #ifndef FRAMEQ_H_0x6e6f
54 #define FRAMEQ_H_0x6e6f
55 
56 #include <ti/syslink/FrameQDefs.h>
57 #include <ti/syslink/SysLink.h>
58 #include <ti/ipc/Notify.h>
59 
60 #if defined (__cplusplus)
61 extern "C" {
62 #endif
63 
64 /* =============================================================================
65  * All success and failure codes for the module
66  * =============================================================================
67  */
71 #define FrameQ_S_ALREADYDESTROYED 2
72 
76 #define FrameQ_S_ALREADYSETUP 1
77 
81 #define FrameQ_S_SUCCESS 0
82 
86 #define FrameQ_E_FAIL -1
87 
91 #define FrameQ_E_INVALIDARG -2
92 
96 #define FrameQ_E_NOTFOUND -3
97 
101 #define FrameQ_E_INST_EXISTS -4
102 
106 #define FrameQ_E_WRITER_EXISTS -5
107 
111 #define FrameQ_E_ALLOC_FRAME -6
112 
116 #define FrameQ_E_ALLOC_FRAMEBUF -7
117 
121 #define FrameQ_E_MEMORY -8
122 
126 #define FrameQ_E_EMPTY -9
127 
131 #define FrameQ_E_CREATE_NAMESERVER -10
132 
136 #define FrameQ_E_CREATE_GATEMP -11
137 
141 #define FrameQ_E_OPEN_GATEMP -12
142 
146 #define FrameQ_E_FAIL_CLIENTN0TIFYMGR_CREATE -13
147 
151 #define FrameQ_E_FAIL_CLIENTN0TIFYMGR_OPEN -14
152 
156 #define FrameQ_E_MAX_READERS -15
157 
161 #define FrameQ_E_ACCESSDENIED -16
162 
166 #define FrameQ_E_INVALIDSTATE -17
167 
171 #define FrameQ_E_OSFAILURE -18
172 
176 #define FrameQ_E_FAIL_NAMESERVERADD -19
177 
181 #define FrameQ_E_INVALID_INTERFACE -20
182 
186 #define FrameQ_E_NOTIMPLEMENTED -21
187 
191 #define FrameQ_E_OPEN_NAMESERVER -22
192 
196 #define FrameQ_E_INVALID_FRAMEQBUFMGRID -23
197 
202 #define FrameQ_E_INSUFFICENT_FRAMES -24
203 
207 #define FrameQ_E_ALLOC_MEMORY -25
208 
212 #define FrameQ_E_FRAMEQBUFMGROPEN -26
213 
217 #define FrameQ_E_LISTMPOPEN -27
218 
222 #define FrameQ_E_CLIENTNOTIFYMGRREGCLIENT -28
223 
227 #define FrameQ_E_FRAMEQBUFMGRREGCLIENT -29
228 
232 #define FrameQ_E_CLIENTNOTIFYMGRUNREGCLIENT -30
233 
237 #define FrameQ_E_FRAMEQBUFMGRUNREGCLIENT -31
238 
242 #define FrameQ_E_ALREADYREGISTERED -32
243 
247 #define FrameQ_E_NAMESERVERADD -33
248 
249 /* =============================================================================
250  * macros & defines
251  * =============================================================================
252  */
256 #define FrameQ_FrameBufInfo Frame_FrameBufInfo
257 
261 #define FrameQ_FrameHeader Frame_FrameHeader
262 
267 
271 #define FrameQ_MAX_NAMELEN (32u)
272 
276 #define FrameQ_MAXFILLEDQUEUS_FOR_READER (16)
277 
281 #define FrameQ_MAX_INST_READERS (2u)
282 
283 
287 #define FrameQ_MAX_INSTANCES (64u)
288 
292 #define FrameQ_NOTIFY_RESERVED_EVENTNO (1u)
293 
300 
301 /* =============================================================================
302  * Structures & Enums
303  * =============================================================================
304  */
305 
309 typedef struct FrameQ_Object * FrameQ_Handle;
310 
315 
319 typedef enum FrameQ_NotifyType_Tag {
320  FrameQ_NOTIFICATION_NONE = SysLink_NOTIFICATION_NONE,
322  FrameQ_NOTIFICATION_ALWAYS = SysLink_NOTIFICATION_ALWAYS,
324  FrameQ_NOTIFICATION_ONCE = SysLink_NOTIFICATION_ONCE,
329  FrameQ_NOTIFICATION_HDWRFIFO_ALWAYS = SysLink_NOTIFICATION_HDWRFIFO_ALWAYS,
333  FrameQ_NOTIFICATION_HDWRFIFO_ONCE = SysLink_NOTIFICATION_HDWRFIFO_ONCE
340 
344 typedef enum FrameQ_OpenMode_Tag {
352 
391 
395 typedef enum FrameQ_Interface_Tag {
402 
406 typedef struct FrameQ_Config_Tag {
407  UInt32 eventNo;
421 } FrameQ_Config;
422 
428 typedef struct FrameQ_CreateParams_Tag {
429  UInt32 size;
433  String name;
436  /* Open flag to indicate create/open. internal flag. Caller should not
437  * touch this flag during create
438  */
440 
446  String name;
448  Ptr sharedAddr;
457 
463 typedef struct FrameQ_Params {
465  Ptr impParams;
470 } FrameQ_Params;
471 
475 typedef struct FrameQ_NotifyParams_Tag {
484  Ptr cbContext;
490 
491 /* =============================================================================
492  * APIs
493  * =============================================================================
494  */
509 
526 FrameQ_Handle FrameQ_create(Ptr params);
527 
544 Int32 FrameQ_delete(FrameQ_Handle *pHandle);
545 
571  Int32 FrameQ_open(Ptr openParams, FrameQ_Handle *handlePtr);
572 
599 Int32 FrameQ_openByAddr(FrameQ_Handle *handlePtr, Ptr openParams);
600 
616 Int32 FrameQ_close(FrameQ_Handle *pHandle);
617 
641 Int32 FrameQ_alloc(FrameQ_Handle handle, FrameQ_Frame *framePtr);
642 
674 Int32 FrameQ_allocv(FrameQ_Handle handle, FrameQ_Frame framePtr[],
675  UInt32 freeQId[], UInt8 *numFrames);
676 
698 Int32 FrameQ_free(FrameQ_Handle handle, FrameQ_Frame frame);
699 
724 Int32 FrameQ_freev(FrameQ_Handle handle, FrameQ_Frame framePtr[],
725  UInt32 numFrames);
726 
750 Int32 FrameQ_put(FrameQ_Handle handle, FrameQ_Frame frame);
751 
776 Int32 FrameQ_putv(FrameQ_Handle handle, FrameQ_Frame framePtr[],
777  UInt32 filledQueueId[], UInt8 numFrames);
778 
797 Int32 FrameQ_get(FrameQ_Handle handle, FrameQ_Frame *framePtr);
798 
831 Int32 FrameQ_getv(FrameQ_Handle handle, FrameQ_Frame pframe[],
832  UInt32 filledQueueId[], UInt8 *numFrames);
833 
853 Int32 FrameQ_dup(FrameQ_Handle handle, FrameQ_Frame frame,
854  FrameQ_Frame *dupedFrame);
855 
876 Int32 FrameQ_registerNotifier(FrameQ_Handle handle,
877  FrameQ_NotifyParams *notifyParams);
878 
892 Int32 FrameQ_unregisterNotifier(FrameQ_Handle handle);
893 
910 Int32 FrameQ_sendNotify(FrameQ_Handle handle, UInt16 msg);
911 
929 Int32 FrameQ_getNumFrames(FrameQ_Handle handle, UInt32 *numFrames);
930 
949 Int32 FrameQ_getvNumFrames(FrameQ_Handle handle, UInt32 numFrames[],
950  UInt8 filledQId[], UInt8 numFilledQids);
951 
972 Int32 FrameQ_getNumFreeFrames(FrameQ_Handle handle, UInt32 *numFreeFrames);
973 
996 Int32 FrameQ_getvNumFreeFrames(FrameQ_Handle handle, UInt32 numFreeFrames[],
997  UInt8 freeQId[], UInt8 numFreeQids);
998 
1009 Int32 FrameQ_control(FrameQ_Handle handle, Int32 cmd, Ptr arg);
1010 
1018 Ptr FrameQ_getExtendedHeaderPtr(FrameQ_Frame frame);
1019 
1020 
1021 /*=============================================================================
1022  * Helper APIs
1023  *=============================================================================
1024  */
1032 UInt32 FrameQ_getNumFrameBuffers(FrameQ_Frame frame);
1033 
1042 Ptr FrameQ_getFrameBuffer(FrameQ_Frame frame, UInt32 frameBufNum);
1043 
1052 UInt32 FrameQ_getFrameBufSize(FrameQ_Frame frame, UInt32 frameBufNum);
1053 
1062 UInt32 FrameQ_getFrameBufValidSize(FrameQ_Frame frame, UInt32 frameBufNum);
1063 
1073 UInt32 FrameQ_getFrameBufDataStartOffset(FrameQ_Frame frame,
1074  UInt32 frameBufNum);
1075 
1087 Int32 FrameQ_setFrameBufValidSize(FrameQ_Frame frame, UInt32 frameBufNum,
1088  UInt32 validDataSize);
1089 
1102 Int32 FrameQ_setFrameBufDataStartOffset(FrameQ_Frame frame,
1103  UInt32 frameBufNum, UInt32 dataStartOffset);
1104 
1105 
1122 
1123 
1146 
1147 
1154 
1155 
1156 #if defined (__cplusplus)
1157 }
1158 #endif
1159 
1160 
1161 #endif /*FRAMEQ_H_0x6e6f*/
Copyright 2014, Texas Instruments Incorporated