Doxygen Documentation

Main Index

Package Index

Package:

GTEM

Version:

V1-3-4

Marked:

(not marked)

Constituent:

gtem

Tag:

sun-gcc


Interface   Compound List   File List   Compound Members   File Members  

gTEM.c File Reference

Implements command/response for the TEM. More...

#include <string.h>
#include "gt_p.h"
#include "gTEM_p.h"

Functions

void setCmdHeaderTEM (gtemHandle gt, cmdHeaderLATp *ch, unsigned short type)
 initializes a command header structure for a TEM

void setLocalAD (gtemHandle gt, unsigned short func, unsigned short reg, localLATpAD *ad)
 initializes a local access descriptor structure for a TEM

void packPayloadTEM (gtemHandle gt, unsigned int cmdHeader, unsigned int localAD, unsigned int value, unsigned int *payload)
 Packs the cmdHeader, localLATpAD and value into the 64-bit payload.

int __temCmdLoad (gtemHandle gt, unsigned short temAddr, unsigned short type, unsigned short func, unsigned short reg, unsigned int value)
 Generic routine for sending response-less commands.

int gTEMcmd (gtemHandle gt, unsigned short temAddr, unsigned short opcode)
 Sends a dataless command to the TEM address.

int gTEMload (gtemHandle gt, unsigned short temAddr, unsigned short reg, unsigned int value)
 Loads a register with value.

int __temCmdReadN (gtemHandle gt, unsigned short temAddr, unsigned short type, unsigned short reg, unsigned short nItems, unsigned int *val)
 Reads a register returing value in val.

int __temCmdRead (gtemHandle gt, unsigned short temAddr, unsigned short type, unsigned short reg, unsigned int *val)
 Reads a register returing value in val.

int gTEMread (gtemHandle gt, unsigned short temAddr, unsigned short reg, unsigned int *val)
 Reads a register returing value in val.

int gTEMlam (gtemHandle gt, unsigned short temAddr)
 Sends the "Look At Me" message to the TEM.

int setCellHeaderParity (gtemHandle gt, unsigned short p)
 p determines if the LATp CellHeader Parity is inverted

int getCellHeaderParity (gtemHandle gt, unsigned short *p)
 Returns the current LATp cell header parity setting in p.

int setCellBodyParity (gtemHandle gt, unsigned short p)
 p determines if the LATp Cell Body Parity is inverted

int getCellBodyParity (gtemHandle gt, unsigned short *p)
 Returns the current LATp cell body parity setting in p.

int setCmdStrParityTEM (gtemHandle gt, unsigned short p)
 p determines if the TEM command string parity is inverted

int getCmdStrParityTEM (gtemHandle gt, unsigned short *p)
 Returns the current TEM command string parity.

int setAccessDescParityTEM (gtemHandle gt, unsigned short p)
 p determines if the TEM access descriptor parity is inverted

int getAccessDescParityTEM (gtemHandle gt, unsigned short *p)
 Returns the current TEM access descriptor parity.

int setCmdPayloadParityTEM (gtemHandle gt, unsigned short p)
 p determines if the TEM command payload parity is inverted

int getCmdPayloadParityTEM (gtemHandle gt, unsigned short *p)
 Returns current TEM command payload parity.


Detailed Description

Implements command/response for the TEM.

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

Function Documentation

int __temCmdLoad gtemHandle  gt,
unsigned short  temAddr,
unsigned short  type,
unsigned short  func,
unsigned short  reg,
unsigned int  value
 

Generic routine for sending response-less commands.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
type type of on board TEM object ( GTEM or GTIC )
func command/response function code
reg register of TEM to load
value 32-bit value to load into TEM register
Returns:
G_OK on success
Common subroutine for sending dataless commands and loading TEM on board registers (GTEM and GTIC) registers. The func parameter indicates a "dataless" or "load" command.

For dataless commands reg is interpreted as the "opcode" of the dataless command and value is ignored.

For load commands reg is the TEM register to load with value.

int __temCmdRead gtemHandle  gt,
unsigned short  temAddr,
unsigned short  type,
unsigned short  reg,
unsigned int *  val
 

Reads a register returing value in val.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
type type of on board TEM object ( GTEM or GTIC )
reg register of TEM to read
val pointer to storage to hold the response of the read command
Returns:
G_OK on success
Reads a 32-bit value from the TEM/GTIC register specified by reg. val is filled on return.

The following error codes are returned when LATp errors occur:

  • GERR_LATP_HEADER_PARITY
  • GERR_LATP_CELL_PARITY
  • GERR_LATP_TRUNCATE

int __temCmdReadN gtemHandle  gt,
unsigned short  temAddr,
unsigned short  type,
unsigned short  reg,
unsigned short  nItems,
unsigned int *  val
 

Reads a register returing value in val.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
type type of on board TEM object ( GTEM or GTIC )
reg register of TEM to read
nItems number of 32-bit values to read from response
val pointer to storage to hold the response of the read command
Returns:
G_OK on success
Reads nItems 32-bit values from the TEM/GTIC register specified by reg. val is filled on return.

For most cases nItems is 1, indicating a simple 32-bit register read. For the GTIC ADCS register, however, nItems will be 3 for reading 3 32-bit words from the register. At the most nItems can be 4, if nItems is greater than 4 return GERR_BAD_PARAM.

The following error codes are returned when LATp errors occur:

  • GERR_LATP_HEADER_PARITY
  • GERR_LATP_CELL_PARITY
  • GERR_LATP_TRUNCATE

int getAccessDescParityTEM gtemHandle  gt,
unsigned short *  p
 

Returns the current TEM access descriptor parity.

Parameters:
gt gtemHandle for TEM
p pointer to hold boolean value
Returns:
STATUS
if p is non-zero then all out going TEM commands will have their access descriptor parity inverted. This is used for testing parity errors. The default value is 0.

int getCellBodyParity gtemHandle  gt,
unsigned short *  p
 

Returns the current LATp cell body parity setting in p.

Parameters:
gt gtemHandle for TEM
p pointer to hold boolean value
Returns:
STATUS
If p is non-zero then all out going LATp packets will have their cell body parity inverted. This is used for testing parity errors. The default value is 0.

int getCellHeaderParity gtemHandle  gt,
unsigned short *  p
 

Returns the current LATp cell header parity setting in p.

Parameters:
gt gtemHandle for TEM
p pointer to hold boolean value
Returns:
STATUS
If p is non-zero then all out going LATp packets will have their cell header parity inverted. This is used for testing parity errors. The default value is 0.

int getCmdPayloadParityTEM gtemHandle  gt,
unsigned short *  p
 

Returns current TEM command payload parity.

Parameters:
gt gtemHandle for TEM
p pointer to hold boolean value
Returns:
STATUS
if p is non-zero then all out going TEM commands will have their command payload parity inverted. This is used for testing parity errors. The default value is 0.

int getCmdStrParityTEM gtemHandle  gt,
unsigned short *  p
 

Returns the current TEM command string parity.

Parameters:
gt gtemHandle for TEM
p pointer to hold boolean value
Returns:
STATUS
if p is non-zero then all out going TEM commands will have their command string parity inverted. This is used for testing parity errors. The default value is 0.

int gTEMcmd gtemHandle  gt,
unsigned short  temAddr,
unsigned short  opcode
 

Sends a dataless command to the TEM address.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
opcode opcode of command to send
Returns:
G_OK on success
Sends the dataless command specified by opcode to the TEM address specified by temAddr.

int gTEMlam gtemHandle  gt,
unsigned short  temAddr
 

Sends the "Look At Me" message to the TEM.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
Returns:
G_OK on success
Sends the "Look At Me" message to the TEM. This is used to switch the command/response wire used by the TEM. If the TEM decodes the "Look At Me" message on either it's A or B command channel it will switch to that channel for future commanding.

int gTEMload gtemHandle  gt,
unsigned short  temAddr,
unsigned short  reg,
unsigned int  value
 

Loads a register with value.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
reg register of TEM to load
value 32-bit value to load into TEM register
Returns:
G_OK on success
Loads the TEM register specified by reg with value

int gTEMread gtemHandle  gt,
unsigned short  temAddr,
unsigned short  reg,
unsigned int *  val
 

Reads a register returing value in val.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
reg register of TEM to read
val pointer to storage to hold the response of the read command
Returns:
G_OK on success
Reads the TEM register specified by reg. val is filled on return.

void packPayloadTEM gtemHandle  gt,
unsigned int  cmdHeader,
unsigned int  localAD,
unsigned int  value,
unsigned int *  payload
 

Packs the cmdHeader, localLATpAD and value into the 64-bit payload.

Parameters:
gt gtemHandle for TEM
cmdHeader 32-bit command header word
localAD 32-bit local access descriptor word
value 32-bit value to load into TEM register
payload pointer to 64-bits of pre-allocated storage
Returns:
void
Packs the bits of cmdHeader, localAD and value into the 64-bits pointed to by payload. The packing is specific to local "on board" registers for the TEM Common Controller and GCCC.

int setAccessDescParityTEM gtemHandle  gt,
unsigned short  p
 

p determines if the TEM access descriptor parity is inverted

Parameters:
gt gtemHandle for TEM
p boolean value
Returns:
G_OK
if p is non-zero then all out going TEM commands will have their access descriptor parity inverted. This is used for testing parity errors. The default value is 0.

int setCellBodyParity gtemHandle  gt,
unsigned short  p
 

p determines if the LATp Cell Body Parity is inverted

Parameters:
gt gtemHandle for TEM
p boolean value
Returns:
STATUS
If p is non-zero then all out going LATp packets will have their cell body parity inverted. This is used for testing parity errors. The default value is 0.

int setCellHeaderParity gtemHandle  gt,
unsigned short  p
 

p determines if the LATp CellHeader Parity is inverted

Parameters:
gt gtemHandle for TEM
p boolean value
Returns:
STATUS
If p is non-zero then all out going LATp packets will have their cell header parity inverted. This is used for testing parity errors. The default value is 0.

void setCmdHeaderTEM gtemHandle  gt,
cmdHeaderLATp ch,
unsigned short  type
 

initializes a command header structure for a TEM

Parameters:
gt gtemHandle for TEM
ch pointer to command header structure
type type of on board TEM object
Returns:
G_OK on void

int setCmdPayloadParityTEM gtemHandle  gt,
unsigned short  p
 

p determines if the TEM command payload parity is inverted

Parameters:
gt gtemHandle for TEM
p boolean value
Returns:
G_OK
if p is non-zero then all out going TEM commands will have their command payload parity inverted. This is used for testing parity errors. The default value is 0.

int setCmdStrParityTEM gtemHandle  gt,
unsigned short  p
 

p determines if the TEM command string parity is inverted

Parameters:
gt gtemHandle for TEM
p boolean value
Returns:
G_OK
if p is non-zero then all out going TEM commands will have their command string parity inverted. This is used for testing parity errors. The default value is 0.

void setLocalAD gtemHandle  gt,
unsigned short  func,
unsigned short  reg,
localLATpAD ad
 

initializes a local access descriptor structure for a TEM

Parameters:
gt gtemHandle for TEM
func TEM fucntion code
reg register of TEM
ad pointer to local access descriptor structure
Returns:
void


Generated on Sat Nov 15 15:37:03 2003 by doxygen 1.3.3