GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GNAT / V2-0-1 > gnat_cio / linux-gcc
#include "GNAT/gnat.h"
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. |
int gClrALLhist | ( | gnatHandle | gh | ) |
Clears the latched occupancy status for both Playback and Record FIFOs.
gh | handle of device |
References _regStatus::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_statReg, _BFregStatus::pfael, _BFregStatus::pfafl, _BFregStatus::pfel, _BFregStatus::pffl, _BFregStatus::rfael, _BFregStatus::rfafl, _BFregStatus::rfel, _BFregStatus::rffl, _regStatus::ui, and VERIFY_HANDLE.
int gClrPFhist | ( | gnatHandle | gh | ) |
Clears the latched occupancy status for the Playback FIFOs.
gh | handle of device |
References _regStatus::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_statReg, _BFregStatus::pfael, _BFregStatus::pfafl, _BFregStatus::pfel, _BFregStatus::pffl, _regStatus::ui, and VERIFY_HANDLE.
int gClrRFhist | ( | gnatHandle | gh | ) |
Clears the latched occupancy status for the record FIFO.
gh | handle of device |
References _regStatus::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_statReg, _BFregStatus::rfael, _BFregStatus::rfafl, _BFregStatus::rfel, _BFregStatus::rffl, _regStatus::ui, and VERIFY_HANDLE.
int gCommReady | ( | gnatHandle | gh, | |
int | timeOut | |||
) |
Waits for the COMM board to become ready, via polling.
gh | gnat driver handle previously allocated | |
timeOut | timeout value in sysclk ticks |
References _regStatus::bf, G_OK, GERR_READY_TIMEOUT, _gnat::m_baseAddr, _regBlock::m_statReg, _BFregStatus::runState, and _regStatus::ui.
Referenced by gSendPacket().
int gConnectIrq | ( | gnatHandle | gh | ) |
Prepares driver and board for interrupts.
gh | handle of device |
References G_OK, _gnat::m_irqVec, srvIntr(), and VERIFY_HANDLE.
int gDisableIrq | ( | gnatHandle | gh | ) |
Disables interrupt.
gh | handle of device |
References G_OK, _gnat::m_irqLevel, and VERIFY_HANDLE.
int gEnableAllF | ( | gnatHandle | gh | ) |
Prepares both the playback and record FIFOs for writing, by taking them out of reset.
gh | handle of device |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::pfmr, _BFregControl::pfpr, _BFregControl::rfmr, _BFregControl::rfpr, _regControl::ui, and VERIFY_HANDLE.
Referenced by gFlushPipeline().
int gEnableClk0 | ( | gnatHandle | gh | ) |
Enables continuous clock on channel 0, generated by board.
gh | handle of device |
References _regControl::bf, _BFregControl::chn0clk, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _regControl::ui, and VERIFY_HANDLE.
int gEnableIrq | ( | gnatHandle | gh | ) |
Enables interrupt.
gh | handle of device |
References G_OK, _gnat::m_irqLevel, and VERIFY_HANDLE.
int gEnablePF | ( | gnatHandle | gh | ) |
Prepares the play back FIFO for writing, by taking it out of reset.
gh | handle of device |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::pfmr, _BFregControl::pfpr, _regControl::ui, and VERIFY_HANDLE.
Referenced by gSendPacket().
int gEnableRF | ( | gnatHandle | gh | ) |
Prepares the record FIFO for writing, by taking it out of reset.
gh | handle of device |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::rfmr, _BFregControl::rfpr, _regControl::ui, and VERIFY_HANDLE.
Referenced by gReadRsp(), and gSendPacket().
int gFlushAllF | ( | gnatHandle | gh | ) |
flushes the record and playback FIFOs of the board referenced by handle.
gh | handle of device |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::pfmr, _BFregControl::pfpr, _BFregControl::rfmr, _BFregControl::rfpr, _regControl::ui, and VERIFY_HANDLE.
Referenced by gFlushPipeline().
int gFlushPF | ( | gnatHandle | gh | ) |
flushes the playback FIFO of the board referenced by handle.
gh | handle of device |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::pfpr, _regControl::ui, and VERIFY_HANDLE.
Referenced by gSendPacket().
int gFlushPipeline | ( | gnatHandle | gh | ) |
Purges stale cruft from internal FPGA state machine.
gh | handle of device |
References G_OK, gEnableAllF(), gFlushAllF(), gGetOutMask(), gSetOutMask(), gStartPB(), gWritePF32(), and VERIFY_HANDLE.
int gFlushRF | ( | gnatHandle | gh | ) |
flushes the record FIFO of the board referenced by handle.
gh | handle of device |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::rfpr, _regControl::ui, and VERIFY_HANDLE.
Referenced by gReadRsp(), and gSendPacket().
int gGetActive | ( | gnatHandle | gh, | |
unsigned int * | mode | |||
) |
Returns current active mode for gnatHandle.
gh | handle of device | |
mode | pointer to storage to hold current mode |
References G_OK, GERR_BAD_PARAM, _gnat::m_active, and VERIFY_HANDLE.
int gGetCmdChnl | ( | gnatHandle | gh | ) |
Wrapper for fetching value of gh->m_cmdChannel.
gh | handle of device |
References _gnat::m_cmdChannel.
int gGetIrqLevel | ( | gnatHandle | gh, | |
unsigned int * | level | |||
) |
Get interrupt level for this gnatHandle.
gh | handle of device | |
level | pointer to storage for interrupt level |
References _regInt::bf, G_OK, _BFregInt::irq, _gnat::m_baseAddr, _regBlock::m_intReg, _regInt::ui, and VERIFY_HANDLE.
Referenced by gGetHardwareInfo().
int gGetIrqVector | ( | gnatHandle | gh, | |
unsigned int * | vec | |||
) |
Get interrupt vector for this gnatHandle.
gh | handle of device | |
vec | interrupt vector to get |
References _regInt::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_intReg, _regInt::ui, _BFregInt::vec, and VERIFY_HANDLE.
Referenced by gGetHardwareInfo().
int gGetOutMask | ( | gnatHandle | gh, | |
unsigned int * | mask | |||
) |
Gets the output XOR bit mask used when writing to the FIFO.
gh | handle of device | |
mask | pointer to storage for XOR bit mask |
References G_OK, _gnat::m_outMask, and VERIFY_HANDLE.
Referenced by gFlushPipeline().
int gHasVASU | ( | gnatHandle | gh | ) |
Returns non-zero if VASU board detected.
gh | handle of device |
References G_OK, GERR_BOARD_VERSION, and gSWver().
Referenced by gOpen().
int gHWver | ( | gnatHandle | gh, | |
unsigned short int * | version, | |||
unsigned short int * | revision | |||
) |
fetchs the hardware version and revision numbers from the board
gh | handle of device | |
version | 3 LSB contain hardware version number | |
revision | 3 LSB contain hardware revision number |
References _regStatus::bf, G_OK, GERR_BAD_PARAM, _BFregStatus::hwRev, _BFregStatus::hwVer, _gnat::m_baseAddr, _regBlock::m_statReg, _regStatus::ui, and VERIFY_HANDLE.
Referenced by gGetHardwareInfo(), and gVersion().
int gIsEmptyRF | ( | gnatHandle | gh | ) |
Checks if the record FIFO is empty.
gh | handle of device |
References _regStatus::bf, _gnat::m_baseAddr, _regBlock::m_statReg, _BFregStatus::rfec, _regStatus::ui, and VERIFY_HANDLE.
Referenced by __dumpFIFO(), gReadRsp(), and gSendPacket().
int gLockFIFO | ( | gnatHandle | gh, | |
int | timeOut | |||
) |
Locks access to the COMM board FIFO.
gh | gnat driver handle previously allocated | |
timeOut | timeout value in sysclk ticks |
References G_OK.
int gProbe | ( | gnatHandle | gh | ) |
attempts to probe the local address previously determined by gMapAddr()
gh | handle of device to probe |
References _regControl::bf, boardProbe(), _BFregControl::c0delay, G_OK, GERR_BRD_DETECT, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _gnat::m_localAddr, and _regControl::ui.
Referenced by gOpen().
int gReadRF16 | ( | gnatHandle | gh, | |
unsigned short int * | val | |||
) |
reads a 16-bit short word from record FIFO and stores it val
gh | handle of device | |
val | pointer to 16-bit short word to hold results of read |
References G_OK, _gnat::m_baseAddr, _regBlock::m_rfReg, and VERIFY_HANDLE.
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
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 |
References G_OK, _gnat::m_baseAddr, _regBlock::m_rfReg, and VERIFY_HANDLE.
int gReadRF32 | ( | gnatHandle | gh, | |
unsigned int * | val | |||
) |
reads a 32-bit word from record FIFO and stores it val
gh | handle of device | |
val | 32-bit word to read from record FIFO |
References G_OK, _gnat::m_baseAddr, _regBlock::m_rfReg, and VERIFY_HANDLE.
Referenced by __dumpFIFO(), and gReadRsp().
int gReadRF32v | ( | gnatHandle | gh, | |
unsigned int | nVal, | |||
unsigned int * | aVal | |||
) |
reads nVal 32-bit words from the record FIFO and stores them in aVal
gh | handle of device | |
nVal | number of elements in aVal | |
aVal | pointer to array of 32-bit words -- used to hold the read data |
References G_OK, _gnat::m_baseAddr, _regBlock::m_rfReg, and VERIFY_HANDLE.
int gReset | ( | gnatHandle | gh | ) |
resets the board referenced by handle. Returns the board to a known state.
gh | handle of device to resest |
References G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _regBlock::m_intReg, _regBlock::m_maskCfgReg, _regBlock::m_optReg, _regBlock::m_statReg, and VERIFY_HANDLE.
int gSetAcqSrc | ( | gnatHandle | gh, | |
unsigned int | src | |||
) |
Set the source for initiating playback.
gh | handle of device | |
src | source bit |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::startAcqSrc, _regControl::ui, and VERIFY_HANDLE.
int gSetActive | ( | gnatHandle | gh, | |
unsigned int | mode | |||
) |
Set active member for gnatHandle.
gh | handle of device | |
mode | mode to set handle to |
References _LOG1, G_OK, _gnat::m_active, and VERIFY_HANDLE.
int gSetClkDly | ( | gnatHandle | gh, | |
unsigned char | dly | |||
) |
Set the delay for the channel 0 clock.
gh | handle of device | |
dly | the number of 2ns ticks to delay the channel 0 clock |
References _regControl::bf, _BFregControl::c0delay, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _regControl::ui, and VERIFY_HANDLE.
int gSetCmdChnl | ( | gnatHandle | gh, | |
unsigned char | chnl | |||
) |
Sets the outgoing command number for the clock line.
gh | handle of device | |
chnl | channel number |
References G_OK, GERR_BAD_PARAM, _gnat::m_cmdChannel, MAX_CHANNEL, and VERIFY_HANDLE.
int gSetIrqDelay | ( | gnatHandle | gh, | |
unsigned int | dly | |||
) |
Set interrupt delay for this gnatHandle.
gh | handle of device | |
dly | interrupt dly to set |
References _LOG1, _regInt::bf, _BFregInt::delay, G_OK, _gnat::m_baseAddr, _regBlock::m_intReg, _regInt::ui, and VERIFY_HANDLE.
int gSetIrqLevel | ( | gnatHandle | gh, | |
unsigned int | level | |||
) |
Set interrupt level for this gnatHandle.
gh | handle of device | |
level | interrupt level to set |
References _LOG1, _regInt::bf, G_OK, _BFregInt::irq, _gnat::m_baseAddr, _regBlock::m_intReg, _gnat::m_irqLevel, _regInt::ui, and VERIFY_HANDLE.
int gSetIrqVector | ( | gnatHandle | gh, | |
unsigned int | vector | |||
) |
Set interrupt vector for this gnatHandle.
gh | handle of device | |
vector | interrupt vector to set |
References _LOG1, _regInt::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_intReg, _gnat::m_irqVec, _regInt::ui, _BFregInt::vec, and VERIFY_HANDLE.
int gSetOutMask | ( | gnatHandle | gh, | |
unsigned int | mask | |||
) |
Sets the output XOR bit mask used when writing to the FIFO.
gh | handle of device | |
mask | XOR bit mask |
References G_OK, _gnat::m_outMask, and VERIFY_HANDLE.
Referenced by gFlushPipeline().
int gSetRecDly | ( | gnatHandle | gh, | |
unsigned char | dly | |||
) |
Set the delay for the read back FIFO.
gh | handle of device | |
dly | the number of 25ns ticks to delay the read back FIFO. |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::rbfwDelay, _regControl::ui, and VERIFY_HANDLE.
int gStartPB | ( | gnatHandle | gh | ) |
Start the playblack sequence.
gh | handle of device |
References _regControl::bf, G_OK, _gnat::m_baseAddr, _regBlock::m_ctrlReg, _BFregControl::startAcq, _regControl::ui, and VERIFY_HANDLE.
Referenced by gFlushPipeline(), and gSendPacket().
int gSWver | ( | gnatHandle | gh, | |
unsigned short int * | version, | |||
unsigned short int * | revision | |||
) |
fetchs the software version and revision numbers from the board
gh | handle of device | |
version | 3 LSB contain software version number | |
revision | 3 LSB contain software revision number |
References _regStatus::bf, G_OK, GERR_BAD_PARAM, _gnat::m_baseAddr, _regBlock::m_statReg, _BFregStatus::swRev, _BFregStatus::swVer, _regStatus::ui, and VERIFY_HANDLE.
Referenced by gGetHardwareInfo(), gHasVASU(), and gVersion().
int gTakeIntSem | ( | gnatHandle | gh | ) |
Takes the interrupt sync semaphore.
gh | handle of device |
References G_OK.
int gUnLockFIFO | ( | gnatHandle | gh | ) |
Unlocks access to the COMM board FIFO.
gh | gnat driver handle previously allocated |
References G_OK.
int gVersion | ( | gnatHandle | gh, | |
unsigned short | hwVer, | |||
unsigned short | hwRev, | |||
unsigned short | swVer, | |||
unsigned short | swRev | |||
) |
int gWritePF16 | ( | gnatHandle | gh, | |
unsigned short int | val | |||
) |
writes the 16-bit short word val to the play back FIFO
gh | handle of device | |
val | 16-bit short word to write to play back FIFO |
References _LOG2B, G_OK, _gnat::m_baseAddr, _gnat::m_outMask, _regBlock::m_pfReg, and VERIFY_HANDLE.
Referenced by sendLATpCell().
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
gh | handle of device | |
nItem | number of times to writes val to FIFO | |
val | 16-bit short word to write to play back FIFO |
References G_OK, _gnat::m_baseAddr, _gnat::m_outMask, _regBlock::m_pfReg, and VERIFY_HANDLE.
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
gh | handle of device | |
nVal | number of elements in aVal | |
aVal | pointer to array of 16-bit short words |
References G_OK, _gnat::m_baseAddr, _gnat::m_outMask, _regBlock::m_pfReg, and VERIFY_HANDLE.
Referenced by sendLATpCell().
int gWritePF32 | ( | gnatHandle | gh, | |
unsigned int | val | |||
) |
writes the 32-bit word val to the play back FIFO
gh | handle of device | |
val | 32-bit word to write to play back FIFO |
References G_OK, _gnat::m_baseAddr, _gnat::m_outMask, _regBlock::m_pfReg, and VERIFY_HANDLE.
Referenced by gFlushPipeline().
int gWritePF32n | ( | gnatHandle | gh, | |
unsigned short int | nItem, | |||
unsigned int | val | |||
) |
writes the 32-bit word val to the play back FIFO
gh | handle of device | |
nItem | number of times to writes val to FIFO | |
val | 32-bit word to write to play back FIFO |
References G_OK, _gnat::m_baseAddr, _gnat::m_outMask, _regBlock::m_pfReg, and VERIFY_HANDLE.
int gWritePF32v | ( | gnatHandle | gh, | |
unsigned int | nVal, | |||
unsigned int * | aVal | |||
) |
writes the array of 32-bit words aVal to the play back FIFO
gh | handle of device | |
nVal | number of elements in aVal | |
aVal | pointer to array of 32-bit words |
References G_OK, _gnat::m_baseAddr, _gnat::m_outMask, _regBlock::m_pfReg, and VERIFY_HANDLE.