glip  0.1.0-dev
The Generic Logic Interfacing Project
Utility Functionality

Data Structures

struct  glip_version
 

Functions

const struct glip_versionglip_get_version (void)
 
void glip_set_caller_ctx (struct glip_ctx *ctx, void *caller_ctx)
 
void * glip_get_caller_ctx (struct glip_ctx *ctx)
 
unsigned int glip_get_fifo_width (struct glip_ctx *ctx)
 
unsigned int glip_get_channel_count (struct glip_ctx *ctx)
 

Detailed Description

Some functionality of GLIP cannot be put into a real category, so this "Utility" group contains a mixed bag of useful library functions.

Function Documentation

const struct glip_version* glip_get_version ( void  )

Get the version of the GLIP library

Returns
the library version information
void glip_set_caller_ctx ( struct glip_ctx ctx,
void *  caller_ctx 
)

Set a caller context pointer

In some cases GLIP executes callback functions. These functions always provide the GLIP context object of type struct glip_ctx. To make it possible to associate the GLIP context with the right context of the calling application register the context or this (in C++) pointer with GLIP and retrieve it inside the callback using glip_get_caller_ctx().

GLIP does not use this pointer in any way, you're free to set it to whatever your application needs.

Parameters
ctxthe library context
caller_ctxthe caller context pointer
See also
glip_get_caller_ctx()
glip_set_log_fn() for a code example using this functionality
void* glip_get_caller_ctx ( struct glip_ctx ctx)

Get the caller context pointer

Parameters
ctxthe library context
Returns
the caller context pointer
See also
glip_set_caller_ctx()
unsigned int glip_get_fifo_width ( struct glip_ctx ctx)

Get the width of the FIFO on the logic side in bytes

Depending on the used backend and possibly the logic configuration different FIFO widths on the logic side are possible. Data is always transferred in chunks of at least one FIFO width, so make sure to always transfer at least as many bytes as the FIFO is wide.

Parameters
ctxthe library context
Returns
the width of the FIFO on the target side in bytes
unsigned int glip_get_channel_count ( struct glip_ctx ctx)

Get the number of supported channels

Depending on the backend (and possibly the target device) a different number of channels might be supported.

Parameters
ctxthe library contexxt
Returns
the number of supported channels