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

Constituent: gnat_cio     Tag: mv2304


Interface   Data Structures   File List   Data Fields   Globals  

gio.h File Reference

Defines the input/output methods for the gnat driver. More...

#include "GNAT/gnat.h"

Include dependency graph for gio.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Functions

int gReset (gnatHandle gh)
 resets the board referenced by handle. Returns the board to a known state.

int gFlushAllF (gnatHandle gh)
 flushes the record and playback FIFOs of the board referenced by handle.

int gFlushRF (gnatHandle gh)
 flushes the record FIFO of the board referenced by handle.

int gFlushPF (gnatHandle gh)
 flushes the playback FIFO of the board referenced by handle.

int gProbe (gnatHandle gh)
 attempts to probe the local address previously determined by gMapAddr()

int gHWver (gnatHandle gh, unsigned short int *version, unsigned short int *revision)
 fetchs the hardware version and revision numbers from the board

int gSWver (gnatHandle gh, unsigned short int *version, unsigned short int *revision)
 fetchs the software version and revision numbers from the board

int gWritePF16 (gnatHandle gh, unsigned short int val)
 writes the 16-bit short word val to the play back FIFO

int gWritePF16n (gnatHandle gh, unsigned short int nItem, unsigned short int val)
 writes the 16-bit short word val to the play back FIFO nItem times

int gWritePF16v (gnatHandle gh, unsigned short int nVal, unsigned short int *aVal)
 writes the array of 16-bit short words aVal to the play back FIFO

int gWritePF32 (gnatHandle gh, unsigned int val)
 writes the 32-bit word val to the play back FIFO

int gWritePF32n (gnatHandle gh, unsigned short int nItem, unsigned int val)
 writes the 32-bit word val to the play back FIFO

int gWritePF32v (gnatHandle gh, unsigned int nVal, unsigned int *aVal)
 writes the array of 32-bit words aVal to the play back FIFO

int gReadRF16 (gnatHandle gh, unsigned short int *val)
 reads a 16-bit short word from record FIFO and stores it val

int gReadRF16v (gnatHandle gh, unsigned short int nVal, unsigned short int *aVal)
 reads nVal 16-bit short words from the record FIFO and stores them in aVal

int gReadRF32 (gnatHandle gh, unsigned int *val)
 reads a 32-bit word from record FIFO and stores it val

int gReadRF32v (gnatHandle gh, unsigned int nVal, unsigned int *aVal)
 reads nVal 32-bit words from the record FIFO and stores them in aVal

int gEnableAllF (gnatHandle gh)
 Prepares both the playback and record FIFOs for writing, by taking them out of reset.

int gEnablePF (gnatHandle gh)
 Prepares the play back FIFO for writing, by taking it out of reset.

int gEnableRF (gnatHandle gh)
 Prepares the record FIFO for writing, by taking it out of reset.

int gEnableClk0 (gnatHandle gh)
 Enables continuous clock on channel 0, generated by board.

int gFlushPipeline (gnatHandle gh)
 Purges stale cruft from internal FPGA state machine.

int gClrALLhist (gnatHandle gh)
 Clears the latched occupancy status for both Playback and Record FIFOs.

int gClrPFhist (gnatHandle gh)
 Clears the latched occupancy status for the Playback FIFOs.

int gClrRFhist (gnatHandle gh)
 Clears the latched occupancy status for the record FIFO.

int gIsEmptyRF (gnatHandle gh)
 Checks if the record FIFO is empty.

int gStartPB (gnatHandle gh)
 Start the playblack sequence.

int gSetAcqSrc (gnatHandle gh, unsigned int src)
 Set the source for initiating playback.

int gSetRecDly (gnatHandle gh, unsigned char dly)
 Set the delay for the read back FIFO.

int gSetClkDly (gnatHandle gh, unsigned char dly)
 Set the delay for the channel 0 clock.

int gSetIrqDelay (gnatHandle gh, unsigned int dly)
 Set interrupt delay for this gnatHandle.

int gSetIrqLevel (gnatHandle gh, unsigned int level)
 Set interrupt level for this gnatHandle.

int gGetIrqLevel (gnatHandle gh, unsigned int *level)
 Get interrupt level for this gnatHandle.

int gSetIrqVector (gnatHandle gh, unsigned int vector)
 Set interrupt vector for this gnatHandle.

int gGetIrqVector (gnatHandle gh, unsigned int *vector)
 Get interrupt vector for this gnatHandle.

int gConnectIrq (gnatHandle gh)
 Prepares driver and board for interrupts.

int gEnableIrq (gnatHandle gh)
 Enables interrupt.

int gDisableIrq (gnatHandle gh)
 Disables interrupt.

int gSetOutMask (gnatHandle gh, unsigned int mask)
 Sets the output XOR bit mask used when writing to the FIFO.

int gGetOutMask (gnatHandle gh, unsigned int *mask)
 Gets the output XOR bit mask used when writing to the FIFO.

int gTakeIntSem (gnatHandle gh)
 Takes the interrupt sync semaphore.

int gSetActive (gnatHandle gh, unsigned int mode)
 Set active member for gnatHandle.

int gGetActive (gnatHandle gh, unsigned int *mode)
 Returns current active mode for gnatHandle.

int gVersion (gnatHandle gh, unsigned short hwVer, unsigned short hwRev, unsigned short swVer, unsigned short swRev)
 Checks the COMM Board hardware version/revision.

int gCommReady (gnatHandle gh, int timeOut)
 Waits for the COMM board to become ready, via polling.

int gLockFIFO (gnatHandle gh, int timeOut)
 Locks access to the COMM board FIFO.

int gUnLockFIFO (gnatHandle gh)
 Unlocks access to the COMM board FIFO.

int gGetCmdChnl (gnatHandle gh)
 Wrapper for fetching value of gh->m_cmdChannel.

int gSetCmdChnl (gnatHandle gh, unsigned char chnl)
 Sets the outgoing command number for the clock line.

int gHasVASU (gnatHandle gh)
 Returns non-zero if VASU board detected.


Detailed Description

Defines the input/output methods for the gnat driver.

Author:
Curt Brune -- curt@slac.stanford.edu

Function Documentation

gClrALLhist gnatHandle  gh  ) 
 

Clears the latched occupancy status for both Playback and Record FIFOs.

Parameters:
gh handle of device
Returns:
OK on success
See also:
gClrPFhist(), gClrRFhist()
Clears the occupancy status flags ( Empty, Full, Almost Empty, Almost Full ) for both the record FIFO and the playback FIFO.

gClrPFhist gnatHandle  gh  ) 
 

Clears the latched occupancy status for the Playback FIFOs.

Parameters:
gh handle of device
Returns:
OK on success
See also:
gClrRFhist(), gClrALLhist()
Clears the occupancy status flags ( Empty, Full, Almost Empty, Almost Full ) for the playback FIFO.

gClrRFhist gnatHandle  gh  ) 
 

Clears the latched occupancy status for the record FIFO.

Parameters:
gh handle of device
Returns:
OK on success
See also:
gClrPFhist(), gClrALLhist()
Clears the occupancy status flags ( Empty, Full, Almost Empty, Almost Full ) for the record FIFO.

int gCommReady gnatHandle  gh,
int  timeOut
 

Waits for the COMM board to become ready, via polling.

Parameters:
gh gnat driver handle previously allocated
timeOut timeout value in sysclk ticks
Returns:
G_OK on success or GERR_READY_TIMEOUT on timeout.

gConnectIrq gnatHandle  gh  ) 
 

Prepares driver and board for interrupts.

Parameters:
gh handle of device
Returns:
OK on success

Here is the call graph for this function:

gDisableIrq gnatHandle  gh  ) 
 

Disables interrupt.

Parameters:
gh handle of device
Returns:
OK on success

gEnableAllF gnatHandle  gh  ) 
 

Prepares both the playback and record FIFOs for writing, by taking them out of reset.

Parameters:
gh handle of device
Returns:
OK on success
See also:
gEnableRF(), gEnablePF(), gWritePF32(), gWritePF32v(), gWritePF16(), gWritePF16v()

gEnableClk0 gnatHandle  gh  ) 
 

Enables continuous clock on channel 0, generated by board.

Parameters:
gh handle of device
Returns:
OK on success

gEnableIrq gnatHandle  gh  ) 
 

Enables interrupt.

Parameters:
gh handle of device
Returns:
OK on success

gEnablePF gnatHandle  gh  ) 
 

Prepares the play back FIFO for writing, by taking it out of reset.

Parameters:
gh handle of device
Returns:
OK on success
See also:
gEnableRF(), gEnableAllF(), gWritePF32(), gWritePF32v(), gWritePF16(), gWritePF16v()

gEnableRF gnatHandle  gh  ) 
 

Prepares the record FIFO for writing, by taking it out of reset.

Parameters:
gh handle of device
Returns:
OK on success
See also:
gEnablePF(), gEnableAllF(), gReadRF32(), gReadRF32v(), gReadRF16(), gReadRF16v()

int gFlushAllF gnatHandle  gh  ) 
 

flushes the record and playback FIFOs of the board referenced by handle.

Parameters:
gh handle of device
Returns:
OK if successful
See also:
gFlushRF(), gFlushPF()

int gFlushPF gnatHandle  gh  ) 
 

flushes the playback FIFO of the board referenced by handle.

Parameters:
gh handle of device
Returns:
OK if successful

gFlushPipeline gnatHandle  gh  ) 
 

Purges stale cruft from internal FPGA state machine.

Parameters:
gh handle of device
Returns:
OK on success
Purges stale data from internal FPGA pipeline by playing back one word of 0x3FFFF through the system.

Here is the call graph for this function:

int gFlushRF gnatHandle  gh  ) 
 

flushes the record FIFO of the board referenced by handle.

Parameters:
gh handle of device
Returns:
OK if successful

gGetActive gnatHandle  gh,
unsigned int *  mode
 

Returns current active mode for gnatHandle.

Parameters:
gh handle of device
mode pointer to storage to hold current mode
See also:
gSetActive()
Returns:
OK on success
Returns the current active mode for the gnatHandle. A value of 0 means inactive, while a non-zero value means active.

int gGetCmdChnl gnatHandle  gh  ) 
 

Wrapper for fetching value of gh->m_cmdChannel.

Parameters:
gh handle of device
Returns:
value of gh->m_cmdChannel

gGetIrqLevel gnatHandle  gh,
unsigned int *  level
 

Get interrupt level for this gnatHandle.

Parameters:
gh handle of device
level pointer to storage for interrupt level
See also:
gSetIrqVector, gSetIrqLevel, gGetIrqVector
Returns:
OK on success

gGetIrqVector gnatHandle  gh,
unsigned int *  vec
 

Get interrupt vector for this gnatHandle.

Parameters:
gh handle of device
vec interrupt vector to get
See also:
gSetIrqVector, gSetIrqLevel, gGetIrqLevel
Returns:
OK on success

gGetOutMask gnatHandle  gh,
unsigned int *  mask
 

Gets the output XOR bit mask used when writing to the FIFO.

Parameters:
gh handle of device
mask pointer to storage for XOR bit mask
Returns:
OK on success
See also:
gWritePF16(), gWritePF16v(), gWritePF32(), gWritePF32v(), gSetOutMask()
Gets the XOR bit mask used when writing data to the playback FIFO.

int gHasVASU gnatHandle  gh  ) 
 

Returns non-zero if VASU board detected.

Parameters:
gh handle of device
Returns:
value of gh->m_vasu

Here is the call graph for this function:

gHWver gnatHandle  gh,
unsigned short int *  version,
unsigned short int *  revision
 

fetchs the hardware version and revision numbers from the board

Parameters:
gh handle of device
version 3 LSB contain hardware version number
revision 3 LSB contain hardware revision number
Returns:
OK on success
See also:
gSWver()

gIsEmptyRF gnatHandle  gh  ) 
 

Checks if the record FIFO is empty.

Parameters:
gh handle of device
Returns:
Non-zero if record FIFO is empty, zero otherwise.

int gLockFIFO gnatHandle  gh,
int  timeOut
 

Locks access to the COMM board FIFO.

Parameters:
gh gnat driver handle previously allocated
timeOut timeout value in sysclk ticks
Returns:
G_OK on success or GERR_READY_TIMEOUT on timeout.

int gProbe gnatHandle  gh  ) 
 

attempts to probe the local address previously determined by gMapAddr()

Parameters:
gh handle of device to probe
Returns:
OK if board probed.
See also:
gMapAddr()

Here is the call graph for this function:

gReadRF16 gnatHandle  gh,
unsigned short int *  val
 

reads a 16-bit short word from record FIFO and stores it val

Parameters:
gh handle of device
val pointer to 16-bit short word to hold results of read
Returns:
OK on success
See also:
gReadRF16v(), gReadRF32(), gReadRF32v()

gReadRF16v gnatHandle  gh,
unsigned short int  nVal,
unsigned short int *  aVal
 

reads nVal 16-bit short words from the record FIFO and stores them in aVal

Parameters:
gh handle of device
nVal number of words to read from record FIFO
aVal pointer to array of 16-bit short words -- used to hold the read data
Returns:
OK on success
See also:
gReadRF16(), gReadRF32(), gReadRF32v()

gReadRF32 gnatHandle  gh,
unsigned int *  val
 

reads a 32-bit word from record FIFO and stores it val

Parameters:
gh handle of device
val 32-bit word to read from record FIFO
Returns:
OK on success
See also:
gReadRF32v(), gReadRF16(), gReadRF16v()
Note that the FIFO width is only 18 bits long so the result is anded with 0x3FFFF.

gReadRF32v gnatHandle  gh,
unsigned int  nVal,
unsigned int *  aVal
 

reads nVal 32-bit words from the record FIFO and stores them in aVal

Parameters:
gh handle of device
nVal number of elements in aVal
aVal pointer to array of 32-bit words -- used to hold the read data
Returns:
OK on success
See also:
gReadRF32(), gReadRF16(), gReadRF16v()
Note that the FIFO width is only 18 bits long so the result is anded with 0x3FFFF.

int gReset gnatHandle  gh  ) 
 

resets the board referenced by handle. Returns the board to a known state.

Parameters:
gh handle of device to resest
Returns:
OK if board reset

gSetAcqSrc gnatHandle  gh,
unsigned int  src
 

Set the source for initiating playback.

Parameters:
gh handle of device
src source bit
Returns:
OK on success
The src parameter defines which of two possible sources to use for initiating playback from the FIFOs. If is zero the source is the transition of bit 31 of the control register from 0 to 1. If is non-zero the source is the external signal brought in through the front panel LEMO connector labeled "START IN".

gSetActive gnatHandle  gh,
unsigned int  mode
 

Set active member for gnatHandle.

Parameters:
gh handle of device
mode mode to set handle to
See also:
gGetActive()
Returns:
OK on success
Used to mode switch between commanding and event taking for single COMM board operation. A value of 0 means inactive, while a non-zero value means active.

gSetClkDly gnatHandle  gh,
unsigned char  dly
 

Set the delay for the channel 0 clock.

Parameters:
gh handle of device
dly the number of 2ns ticks to delay the channel 0 clock
See also:
gStartPB()
Returns:
OK on success
Fix-up for timing skews between multiple COMM boards. The delay field is 6 bits wide, allowing for delays from 0 to 64ns in 2ns increments.

int gSetCmdChnl gnatHandle  gh,
unsigned char  chnl
 

Sets the outgoing command number for the clock line.

Parameters:
gh handle of device
chnl channel number
Returns:
G_OK on success

gSetIrqDelay gnatHandle  gh,
unsigned int  dly
 

Set interrupt delay for this gnatHandle.

Parameters:
gh handle of device
dly interrupt dly to set
See also:
gSetIrqLevel(), gSetIrqVector()
Returns:
OK on success

gSetIrqLevel gnatHandle  gh,
unsigned int  level
 

Set interrupt level for this gnatHandle.

Parameters:
gh handle of device
level interrupt level to set
See also:
gSetIrqVector, gSetIrqDelay, gGetIrqLevel, gGetIrqVector
Returns:
OK on success

gSetIrqVector gnatHandle  gh,
unsigned int  vector
 

Set interrupt vector for this gnatHandle.

Parameters:
gh handle of device
vector interrupt vector to set
See also:
gSetIrqLevel, gSetIrqDelay
Returns:
OK on success

gSetOutMask gnatHandle  gh,
unsigned int  mask
 

Sets the output XOR bit mask used when writing to the FIFO.

Parameters:
gh handle of device
mask XOR bit mask
Returns:
OK on success
See also:
gWritePF16(), gWritePF16v(), gWritePF32(), gWritePF32v(), gGetOutMask()
Sets the XOR bit mask used when writing data to the playback FIFO.

gSetRecDly gnatHandle  gh,
unsigned char  dly
 

Set the delay for the read back FIFO.

Parameters:
gh handle of device
dly the number of 25ns ticks to delay the read back FIFO.
See also:
gStartPB()
Returns:
OK on success
After starting playback wait dly 25ns intervals before clocking data into the record FIFO. The delay register is 8 bits wide, allowing for delays from 0 to 6.4usec in 25ns increments.

gStartPB gnatHandle  gh  ) 
 

Start the playblack sequence.

Parameters:
gh handle of device
Returns:
OK on success

gSWver gnatHandle  gh,
unsigned short int *  version,
unsigned short int *  revision
 

fetchs the software version and revision numbers from the board

Parameters:
gh handle of device
version 3 LSB contain software version number
revision 3 LSB contain software revision number
Returns:
OK on success
See also:
gHWver()

gTakeIntSem gnatHandle  gh  ) 
 

Takes the interrupt sync semaphore.

Parameters:
gh handle of device
Returns:
OK on success

int gUnLockFIFO gnatHandle  gh  ) 
 

Unlocks access to the COMM board FIFO.

Parameters:
gh gnat driver handle previously allocated
Returns:
G_OK on success or GERR_READY_TIMEOUT on timeout.

gVersion gnatHandle  gh,
unsigned short  hwVer,
unsigned short  hwRev,
unsigned short  swVer,
unsigned short  swRev
 

Checks the COMM Board hardware version/revision.

Parameters:
gh handle of device
hwVer COMM Board hardware version
hwRev COMM Board hardware revision
swVer COMM Board firmware version
swRev COMM Board firmware revision
Returns:
OK on success

Here is the call graph for this function:

gWritePF16 gnatHandle  gh,
unsigned short int  val
 

writes the 16-bit short word val to the play back FIFO

Parameters:
gh handle of device
val 16-bit short word to write to play back FIFO
Returns:
OK on success
See also:
gWritePF16v(), gWritePF32(), gWritePF32v(), gSetOutMask()
The data is written to the play back FIFO -- the data is first XOR-ed with gh->m_outMask before writing to the FIFO.

gWritePF16n gnatHandle  gh,
unsigned short int  nItem,
unsigned short int  val
 

writes the 16-bit short word val to the play back FIFO nItem times

Parameters:
gh handle of device
nItem number of times to writes val to FIFO
val 16-bit short word to write to play back FIFO
Returns:
OK on success
See also:
gWritePF16v(), gWritePF32(), gWritePF32v(), gSetOutMask()
nItem copies of val is written to the play back FIFO -- the data is first XOR-ed with gh->m_outMask before writing to the FIFO.

gWritePF16v gnatHandle  gh,
unsigned short int  nVal,
unsigned short int *  aVal
 

writes the array of 16-bit short words aVal to the play back FIFO

Parameters:
gh handle of device
nVal number of elements in aVal
aVal pointer to array of 16-bit short words
Returns:
OK on success
See also:
gWritePF16(), gWritePF32(), gWritePF32v(), gSetOutMask()
The data is written to the play back FIFO -- the data is first XOR-ed with gh->m_outMask before writing to the FIFO.

gWritePF32 gnatHandle  gh,
unsigned int  val
 

writes the 32-bit word val to the play back FIFO

Parameters:
gh handle of device
val 32-bit word to write to play back FIFO
Returns:
OK on success
See also:
gWritePF32v(), gWritePF16(), gWritePF16v(), gSetOutMask()
The data is written to the play back FIFO -- the data is first XOR-ed with gh->m_outMask before writing to the FIFO.

gWritePF32n gnatHandle  gh,
unsigned short int  nItem,
unsigned int  val
 

writes the 32-bit word val to the play back FIFO

Parameters:
gh handle of device
nItem number of times to writes val to FIFO
val 32-bit word to write to play back FIFO
Returns:
OK on success
See also:
gWritePF32v(), gWritePF16(), gWritePF16v(), gSetOutMask()
nItem copies of val is written to the play back FIFO -- the data is first XOR-ed with gh->m_outMask before writing to the FIFO.

gWritePF32v gnatHandle  gh,
unsigned int  nVal,
unsigned int *  aVal
 

writes the array of 32-bit words aVal to the play back FIFO

Parameters:
gh handle of device
nVal number of elements in aVal
aVal pointer to array of 32-bit words
Returns:
OK on success
See also:
gWritePF32(), gWritePF16(), gWritePF16v(), gSetOutMask()
The data is written to the play back FIFO -- the data is first XOR-ed with gh->m_outMask before writing to the FIFO.


Generated on Thu Oct 21 08:27:03 2004 by doxygen 1.3.3