SysLink API Reference  2.21.03.11
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
RingIO.h
Go to the documentation of this file.
1 
124 /*
125  * ============================================================================
126  *
127  * Copyright (c) 2008-2012, Texas Instruments Incorporated
128  *
129  * Redistribution and use in source and binary forms, with or without
130  * modification, are permitted provided that the following conditions
131  * are met:
132  *
133  * * Redistributions of source code must retain the above copyright
134  * notice, this list of conditions and the following disclaimer.
135  *
136  * * Redistributions in binary form must reproduce the above copyright
137  * notice, this list of conditions and the following disclaimer in the
138  * documentation and/or other materials provided with the distribution.
139  *
140  * * Neither the name of Texas Instruments Incorporated nor the names of
141  * its contributors may be used to endorse or promote products derived
142  * from this software without specific prior written permission.
143  *
144  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
145  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
146  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
147  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
148  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
149  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
150  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
151  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
152  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
153  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
154  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
155  * Contact information for paper mail:
156  * Texas Instruments
157  * Post Office Box 655303
158  * Dallas, Texas 75265
159  * Contact information:
160  * http://www-k.ext.ti.com/sc/technical-support/product-information-centers.htm?
161  * DCMP=TIHomeTracking&HQS=Other+OT+home_d_contact
162  * ============================================================================
163  *
164  */
165 
166 
167 
168 #ifndef RINGIO_H_0xd3f4
169 #define RINGIO_H_0xd3f4
170 
171 /* Utilities headers */
172 #include <ti/syslink/SysLink.h>
173 
174 #if defined (__cplusplus)
175 extern "C" {
176 #endif
177 
178 
179 /* =============================================================================
180  * All success and failure codes for the module
181  * =============================================================================
182  */
190 #define RingIO_S_PENDINGATTRIBUTE 4
191 
197 #define RingIO_S_NOTCONTIGUOUSDATA 3
198 
202 #define RingIO_S_BUSY 2
203 
207 #define RingIO_S_ALREADYSETUP 1
208 
212 #define RingIO_S_SUCCESS 0
213 
217 #define RingIO_E_FAIL -1
218 
222 #define RingIO_E_INVALIDARG -2
223 
227 #define RingIO_E_MEMORY -3
228 
232 #define RingIO_E_ALREADYEXISTS -4
233 
237 #define RingIO_E_NOTFOUND -5
238 
242 #define RingIO_E_TIMEOUT -6
243 
247 #define RingIO_E_INVALIDSTATE -7
248 
252 #define RingIO_E_OSFAILURE -8
253 
257 #define RingIO_E_RESOURCE -9
258 
262 #define RingIO_E_RESTART -10
263 
267 #define RingIO_E_INVALIDMSG -11
268 
272 #define RingIO_E_NOTOWNER -12
273 
277 #define RingIO_E_REMOTEACTIVE -13
278 
282 #define RingIO_E_INVALIDHEAPID -14
283 
287 #define RingIO_E_INVALIDPROCID -15
288 
292 #define RingIO_E_MAXREACHED -16
293 
297 #define RingIO_E_INUSE -17
298 
302 #define RingIO_E_INVALIDCONTEXT -18
303 
307 #define RingIO_E_BADVERSION -19
308 
313 #define RingIO_E_BUFWRAP -20
314 
318 #define RingIO_E_BUFEMPTY -21
319 
323 #define RingIO_E_BUFFULL -22
324 
329 #define RingIO_E_PENDINGDATA -23
330 
335 #define RingIO_E_VARIABLEATTRIBUTE -24
336 
337 
341 #define RingIO_E_WRONGSTATE -25
342 
345 #define RingIO_E_NOTIFYFAIL -26
346 
351 #define RingIO_E_PENDINGATTRIBUTE -27
352 
353 
354 /* =============================================================================
355  * Typedefs
356  * =============================================================================
357  */
362 
370 
371 /* =============================================================================
372  * Forward declarations
373  * =============================================================================
374  */
378 typedef struct RingIO_Object * RingIO_Handle;
379 
380 /* =============================================================================
381  * Structures & Enums
382  * =============================================================================
383  */
384 
385 typedef enum RingIO_Type_Tag {
389 } RingIO_Type;
390 
391 /* =============================================================================
392  * Structures for instance related configuration
393  * =============================================================================
394  */
400 typedef struct RingIO_Params_Tag {
401  String name;
405 } RingIO_Params;
406 
410 typedef enum RingIO_OpenMode_Tag {
416 
421 typedef struct RingIO_openParams_Tag {
422  UInt32 flags;
429 
430 
443 
444 
449 typedef enum RingIO_Flags_tag {
462 } RingIO_Flags;
463 
467 typedef enum RingIO_NotifyType_Tag {
468  RingIO_NOTIFICATION_NONE = SysLink_NOTIFICATION_NONE,
470  RingIO_NOTIFICATION_ALWAYS = SysLink_NOTIFICATION_ALWAYS,
473  RingIO_NOTIFICATION_ONCE = SysLink_NOTIFICATION_ONCE,
479  SysLink_NOTIFICATION_HDWRFIFO_ALWAYS,
485  SysLink_NOTIFICATION_HDWRFIFO_ONCE
493 
506 
507 
508 /* =============================================================================
509  * APIs to be used in Application
510  * =============================================================================
511  */
512 /* =============================================================================
513  * Instance creation and deletion related API's
514  * =============================================================================
515  */
532 Void RingIO_Params_init (Void * params);
533 
563 RingIO_Handle RingIO_create(const Void *params);
564 
588 Int RingIO_delete(RingIO_Handle *handlePtr);
589 
607 UInt32 RingIO_sharedMemReq(const Void *params,
608  RingIO_sharedMemReqDetails *sharedMemReqDetails);
609 
610 /* =============================================================================
611  * Instance opening and closing related API's
612  * =============================================================================
613  */
640 Int RingIO_open(String name, const RingIO_openParams *params, UInt16 *procIds,
641  RingIO_Handle *handlePtr);
642 
668 Int RingIO_openByAddr(Ptr ctrlSharedAddr, const RingIO_openParams *params,
669  RingIO_Handle *handlePtr);
670 
696 Int RingIO_close(RingIO_Handle *handlePtr);
697 
698 
699 /* =============================================================================
700  * Instance Notification related API's
701  * =============================================================================
702  */
744 Int RingIO_registerNotifier(RingIO_Handle handle,
745  RingIO_NotifyType notifyType, UInt32 watermark,
746  RingIO_NotifyFxn notifyFunc, Ptr cbContext);
747 
766 Int RingIO_unregisterNotifier(RingIO_Handle handle);
767 
782 Int RingIO_setWaterMark(RingIO_Handle handle, UInt32 watermark);
783 
784 
800 Int RingIO_setNotifyType(RingIO_Handle handle, RingIO_NotifyType notifyType);
801 
802 
803 /*=============================================================================
804  * Main RingIO APIs called by application for RingIO functions
805  *=============================================================================
806  */
864 Int RingIO_acquire(RingIO_Handle handle, RingIO_BufPtr *pData, UInt32 *pSize);
865 
866 
885 Int RingIO_release(RingIO_Handle handle, UInt32 size);
886 
887 
908 Int RingIO_cancel(RingIO_Handle handle);
909 
910 
950 Int RingIO_getvAttribute(RingIO_Handle handle, UInt16 *type, UInt32 *param,
951  RingIO_BufPtr vptr, UInt32 *pSize);
952 
953 
1003 Int RingIO_setvAttribute(RingIO_Handle handle, UInt16 type, UInt32 param,
1004  RingIO_BufPtr pData, UInt32 size, Bool sendNotification);
1005 
1006 
1039 Int RingIO_getAttribute(RingIO_Handle handle, UInt16 *type, UInt32 *param);
1040 
1081 Int RingIO_setAttribute(RingIO_Handle handle, UInt16 type, UInt32 param,
1082  Bool sendNotification);
1083 
1084 
1132 Int RingIO_flush(RingIO_Handle handle, Bool hardFlush, UInt16 *type,
1133  UInt32 *param, UInt32 *bytesFlushed);
1134 
1135 
1151 Int RingIO_sendNotify(RingIO_Handle handle, RingIO_NotifyMsg msg);
1152 
1153 
1154 /*=============================================================================
1155  * Helper APIs
1156  *=============================================================================
1157  */
1168 UInt RingIO_getValidSize(RingIO_Handle handle);
1169 
1180 UInt RingIO_getEmptySize(RingIO_Handle handle);
1181 
1192 UInt RingIO_getValidAttrSize(RingIO_Handle handle);
1193 
1204 UInt RingIO_getEmptyAttrSize(RingIO_Handle handle);
1205 
1216 UInt RingIO_getAcquiredOffset(RingIO_Handle handle);
1217 
1228 UInt RingIO_getAcquiredSize(RingIO_Handle handle);
1229 
1240 UInt RingIO_getWaterMark(RingIO_Handle handle);
1241 
1242 #if defined (__cplusplus)
1243 }
1244 #endif
1245 
1246 
1247 #endif /* RINGIO_H_0xd3f4 */
Copyright 2014, Texas Instruments Incorporated