GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > GNAT / V2-0-0

Constituent: gnat_cio     Tag: sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

bndl.c File Reference

Implements the channel bundle methods. More...

#include <stdlib.h>
#include <string.h>
#include "GNAT/gnat.h"
#include "GNAT/bndl.h"
#include "gnat_p.h"
#include "GNAT/log.h"

Include dependency graph for bndl.c:

Include dependency graph

Defines

#define BNDL_DATA(p)   ((unsigned short int *)(p->m_bndlData))
 Accessor macro to bundle data.


Functions

int gBndlClear (gnatHandle gh)
 zeroes out the bundle array

int gBndlGetDepth (gnatHandle gh, unsigned int *depth)
 Returns the depth of the bunlde bh in the pointer depth.

int gBndlAddChnl (gnatHandle gh, unsigned char chnlNum, unsigned int nChnlData, unsigned int *pChnlData)
 Inserts the bits pointed to by chnlData into channel chnlNum of the channel bundle.

int gBndlGetChnl (gnatHandle gh, unsigned char chnlNum, unsigned int nChnlData, unsigned int *pChnlData)
 Retrieves the bits contained in channel number chnlNum of bundle in gh.

unsigned short * gBndlGetBndl (gnatHandle gh)
 returns pointer to bundle storage


Detailed Description

Implements the channel bundle methods.

Author:
Curt Brune -- curt@slac.stanford.edu
These routines allow for the creation and manipulation of channel bundles for the COMM I/O board. Essentially this boils down to a serial to parallel conversion

Function Documentation

int gBndlAddChnl gnatHandle  gh,
unsigned char  chnlNum,
unsigned int  nChnlData,
unsigned int *  pChnlData
 

Inserts the bits pointed to by chnlData into channel chnlNum of the channel bundle.

Parameters:
gh gnat driver handle previously allocated
chnlNum the channel in the bundle that chnlData is to be inserted into (0-15)
nChnlData the number of 32-bit words in pChnlData
pChnlData a pointer to the channel bits.
Returns:
OK if close successful
See also:
gBndlGetChnl()
The number of unsigned ints in pChnlData must be less than or equal to the bundle depth of gh, i.e. if pChnlData points to two unsigned ints (64 bits) then depth of gh must be two 32-entry blocks (64 entries total) or greater.

int gBndlClear gnatHandle  gh  ) 
 

zeroes out the bundle array

Parameters:
gh gnat driver handle previously allocated
Returns:
OK if close successful

unsignd short * gBndlGetBndl gnatHandle  gh  ) 
 

returns pointer to bundle storage

Parameters:
gh gnat driver handle previously allocated
Returns:
pointer to bunlde storage or NULL

int gBndlGetChnl gnatHandle  gh,
unsigned char  chnlNum,
unsigned int  nChnlData,
unsigned int *  pChnlData
 

Retrieves the bits contained in channel number chnlNum of bundle in gh.

Parameters:
gh gnat driver handle previously allocated
chnlNum the channel number in the bundle bh to fetch.
nChnlData the number of 32-bit words to fetch and store in pChnlData
pChnlData a pointer to store to hold the channel bits.
Returns:
OK if close successful
See also:
gBndlAddChnl()
The number of unsigned ints nChnlData in pChnlData must be less than or equal to the bundle depth of @ gh, i.e. if gh has a depth of 2 nChnlData can be 2 or 1.

int gBndlGetDepth gnatHandle  gh,
unsigned int *  depth
 

Returns the depth of the bunlde bh in the pointer depth.

Parameters:
gh gnat driver handle previously allocated
depth output parameter used to return the depth of bh
Returns:
OK if close successful


Generated on Thu Oct 21 08:28:46 2004 by doxygen 1.3.3