Doxygen Documentation

Main Index

Package Index

Package:

GTEM

Version:

V1-3-4

Marked:

(not marked)

Constituent:

gtem

Tag:

linux-gcc


Interface   Compound List   File List   Compound Members   File Members  

gGCCC.c File Reference

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

#include <string.h>
#include "gt_p.h"
#include "gCAL_p.h"
#include "GTEM/gGCCC.h"

Functions

void setCmdHeaderCAL (gtemHandle gt, cmdHeaderCAL *ch, unsigned short ext, unsigned short gcccAddr, unsigned short gcrcAddr)
 initializes a command header structure for a GCCC

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

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

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

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


Detailed Description

Implements command/response for the GCCC.

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

Function Documentation

static int __gcccCmdLoad gtemHandle  gt,
unsigned short  temAddr,
unsigned short  gcccAddr,
unsigned short  func,
unsigned short  reg,
unsigned int  value
[static]
 

Generic routine for sending response-less commands.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
gcccAddr GCCC address of command
func command/response function code
reg register of GCCC to load
value 32-bit value to load into GCCC register
Returns:
G_OK on success
Common subroutine for sending dataless commands and loading GCCC 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 GCCC register to load with value.

int gGCCCcmd gtemHandle  gt,
unsigned short  temAddr,
unsigned short  gcccAddr,
unsigned short  opcode
 

Sends a dataless command to the TEM address.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
gcccAddr GCCC address
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 gGCCCload gtemHandle  gt,
unsigned short  temAddr,
unsigned short  gcccAddr,
unsigned short  reg,
unsigned int  value
 

Loads a register with value.

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

int gGCCCread gtemHandle  gt,
unsigned short  temAddr,
unsigned short  gcccAddr,
unsigned short  reg,
unsigned int *  val
 

Reads a register returing value in val.

Parameters:
gt gtemHandle for TEM
temAddr TEM address of command
gcccAddr GCCC address
reg register of GCCC to read
val pointer to storage to hold the response of the read command
Returns:
G_OK on success
Reads the GCCC 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

void setCmdHeaderCAL gtemHandle  gt,
cmdHeaderCAL ch,
unsigned short  ext,
unsigned short  gcccAddr,
unsigned short  gcrcAddr
 

initializes a command header structure for a GCCC

Parameters:
gt gtemHandle for TEM
ch pointer to command header structure
ext set for "off board" commands, i.e. GCRC and GCFE commands
gcccAddr GCCC address
gcrcAddr GCRC address
Returns:
G_OK on void


Generated on Sat Nov 15 15:36:02 2003 by doxygen 1.3.3