GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> GNAT / V2-0-1 > gnat_cio / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

ginit.h File Reference

Defines the creation and initialization methods for the gnat driver. More...

#include "GNAT/gnat.h"
#include "GNAT/info.h"

Functions

unsigned int gSizeOfGh (void)
 Hides the private implemenation of the gnat registers. Allows user to allocate memory.
int gInitDrv (void)
 Driver wide initialization: allocate memory, semaphores, etc...
int gInitDev (void)
 Device initialization: flush buffers, init registers, etc...
int gOpen (gnatHandle gh, unsigned int physAddr)
 maps the physical address to an instance of the driver object
int gClose (gnatHandle gh)
 shuts down the device attached to handle
int gGetDriverInfo (DriverInfo *di)
 fills in driver info struct
int gGetHardwareInfo (gnatHandle gh, HardwareInfo *hi)
 fills in hardware info struct
int gGetLogicalAddr (gnatHandle gh, unsigned int *addr)
 returns the logical address attached to handle
int gGetPhysAddr (gnatHandle gh, unsigned int *addr)
 returns the physical address attached to handle


Detailed Description

Defines the creation and initialization methods for the gnat driver.

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

Function Documentation

int gClose ( gnatHandle  gh  ) 

shuts down the device attached to handle

Parameters:
gh handle of device to close
Returns:
OK if close successful
See also:
gOpen()

References G_OK, GERR_BAD_HANDLE, _gnat::m_active, _gnat::m_baseAddr, _gnat::m_irqLevel, _gnat::m_localAddr, and _gnat::m_physAddr.

int gGetDriverInfo ( DriverInfo di  ) 

int gGetHardwareInfo ( gnatHandle  gh,
HardwareInfo hi 
)

int gGetLogicalAddr ( gnatHandle  gh,
unsigned int *  addr 
)

returns the logical address attached to handle

Parameters:
gh handle of device to close
addr pointer to storage for holding logical address
Returns:
G_OK on successs
See also:
gOpen()

References G_OK, GERR_BAD_HANDLE, GERR_BAD_PARAM, and _gnat::m_localAddr.

Referenced by gGetHardwareInfo().

int gGetPhysAddr ( gnatHandle  gh,
unsigned int *  addr 
)

returns the physical address attached to handle

Parameters:
gh handle of device to close
addr pointer to storage for holding physical address
Returns:
G_OK on successs
See also:
gOpen()

References G_OK, GERR_BAD_HANDLE, GERR_BAD_PARAM, and _gnat::m_physAddr.

Referenced by gGetHardwareInfo().

gInitDev ( void   ) 

Device initialization: flush buffers, init registers, etc...

Returns:
G_OK on success
See also:
gInitDev()

References G_OK.

gInitDrv ( void   ) 

Driver wide initialization: allocate memory, semaphores, etc...

Returns:
G_OK on success
See also:
gInitDev()

References G_OK.

gOpen ( gnatHandle  gh,
unsigned int  physAddr 
)

maps the physical address to an instance of the driver object

Parameters:
gh gnat driver handle previously allocated
physAddr the physical address of the comm IO board
Returns:
OK for success
See also:
gClose()
Attempts to map physAddr into a local (logical) address. If successful it binds the physical and logical address to the driver object refered to by handle. If unsucessful it clears both the physical and local address for handle and returns ERROR.

References CLK_CHNL_NUM, CMD_CHNL_NUM, G_OK, GERR_ADDR_MAP, GERR_BAD_HANDLE, GERR_MEM, gHasVASU(), gProbe(), _gnat::m_active, _gnat::m_baseAddr, _gnat::m_bndlDepth, _gnat::m_clkChannel, _gnat::m_cmdChannel, _gnat::m_detect, _gnat::m_intCount, _gnat::m_irqLevel, _gnat::m_irqVec, _gnat::m_latpIntr, _gnat::m_localAddr, _gnat::m_nSkipRsp, _gnat::m_outMask, _gnat::m_physAddr, _gnat::m_vasu, MAX_BNDL_DEPTH, PACKET_READY_INTR_LEVEL, PACKET_READY_INTR_VECTOR, and _LATp_Interface::timeout.

unsigned int gSizeOfGh ( void   ) 

Hides the private implemenation of the gnat registers. Allows user to allocate memory.

Returns:
the size of struct _gnat
See also:
gOpen()


Generated on Wed Nov 21 22:06:11 2012 by  doxygen 1.5.8