Doxygen Documentation

Main Index

Package Index

Package:

GAEM

Version:

V2-1-2

Marked:

(not marked)

Constituent:

gaem

Tag:

sun-gcc


Interface   Compound List   File List   Compound Members   File Members  

gAEM.c File Reference

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

#include <string.h>
#include "ga_p.h"
#include "gAEM_p.h"
#include "GAEM/gAEM.h"

Functions

void setCmdHeaderAEM (gaemHandle ga, cmdHeaderLATp *ch, unsigned short type, unsigned short bcast, unsigned short inst, unsigned short ext)
 initializes a command header structure for a AEM

void setAEMlocalAD (gaemHandle ga, unsigned short func, unsigned short reg, localLATpAD *ad)
 initializes a local access descriptor structure for a AEM

void packPayloadAEM (gaemHandle ga, unsigned int cmdHeader, unsigned int localAD, unsigned int value, unsigned int *payload)
 Packs the cmdHeader, localLATpAD and value into the 64-bit payload.

int __aemCmdLoad (gaemHandle ga, unsigned short func, unsigned short reg, unsigned int value)
 Generic routine for sending response-less commands.

int gAEMcmd (gaemHandle ga, unsigned short opcode)
 Sends a dataless command to the AEM.

int gAEMload (gaemHandle ga, unsigned short reg, unsigned int value)
 Loads a register with value.

int __aemCmdRead (gaemHandle ga, unsigned short reg, unsigned int *val)
 Reads a register returing value in val.

int gAEMread (gaemHandle ga, unsigned short reg, unsigned int *val)
 Reads a register returing value in val.

int gAEMlam (gaemHandle ga)
 Sends the "Look At Me" message to the AEM.

int setCmdStrParityAEM (gaemHandle ga, unsigned short p)
 p determines if the AEM command string parity is inverted

int getCmdStrParityAEM (gaemHandle ga, unsigned short *p)
 Returns current AEM command string parity.

int setAccessDescParityAEM (gaemHandle ga, unsigned short p)
 Sets the current AEM access descriptor parity.

int getAccessDescParityAEM (gaemHandle ga, unsigned short *p)
 Returns current AEM access descriptor parity.

int setCmdPayloadParityAEM (gaemHandle ga, unsigned short p)
 p determines if the AEM command payload parity is inverted

int getCmdPayloadParityAEM (gaemHandle ga, unsigned short *p)
 Returns the current AEM command payload parity.

int gAEM_SetAddr (gaemHandle ga, unsigned short aemAddr)
 Sets system wide AEM LATp address.

int gAEM_GetAddr (gaemHandle ga, unsigned short *aemAddr)
 Gets system wide AEM LATp address.


Detailed Description

Implements command/response for the AEM.

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

Function Documentation

int __aemCmdLoad gaemHandle  ga,
unsigned short  func,
unsigned short  reg,
unsigned int  value
 

Generic routine for sending response-less commands.

Parameters:
ga gaemHandle for AEM
func command/response function code
reg register of AEM to load
value 32-bit value to load into AEM register
Returns:
G_OK on success
Common subroutine for sending dataless commands and loading AEM on board 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 AEM register to load with value.

int __aemCmdRead gaemHandle  ga,
unsigned short  reg,
unsigned int *  val
 

Reads a register returing value in val.

Parameters:
ga gaemHandle for AEM
reg register of AEM to read
val pointer to storage to hold the response of the read command
Returns:
G_OK on success
Reads the GAEM 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 gAEM_GetAddr gaemHandle  ga,
unsigned short *  aemAddr
 

Gets system wide AEM LATp address.

Parameters:
ga gaemHandle for AEM
aemAddr pointer to hold AEM address
Returns:
G_OK on success
See also:
gAEM_SetAddr()
Gets the system-wide AEM LATp address.

int gAEM_SetAddr gaemHandle  ga,
unsigned short  aemAddr
 

Sets system wide AEM LATp address.

Parameters:
ga gaemHandle for AEM
aemAddr AEM address
Returns:
G_OK on success
Sets the system-wide AEM LATp address. This function is intended to be called once during system initialization. It might also be useful during testing.

int gAEMcmd gaemHandle  ga,
unsigned short  opcode
 

Sends a dataless command to the AEM.

Parameters:
ga gaemHandle for AEM
opcode opcode of command to send
Returns:
G_OK on success
Sends the dataless command specified by opcode to the AEM.

int gAEMlam gaemHandle  ga  ) 
 

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

Parameters:
ga gaemHandle for AEM
Returns:
G_OK on success
Sends the "Look At Me" message to the AEM. This is used to switch the command/response wire used by the AEM. If the AEM 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 gAEMload gaemHandle  ga,
unsigned short  reg,
unsigned int  value
 

Loads a register with value.

Parameters:
ga gaemHandle for AEM
reg register of AEM to load
value 32-bit value to load into AEM register
Returns:
G_OK on success
Loads the AEM register specified by reg with value

int gAEMread gaemHandle  ga,
unsigned short  reg,
unsigned int *  val
 

Reads a register returing value in val.

Parameters:
ga gaemHandle for AEM
reg register of AEM to read
val pointer to storage to hold the response of the read command
Returns:
G_OK on success
Reads the AEM register specified by reg. val is filled on return.

int getAccessDescParityAEM gaemHandle  ga,
unsigned short *  p
 

Returns current AEM access descriptor parity.

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

int getCmdPayloadParityAEM gaemHandle  ga,
unsigned short *  p
 

Returns the current AEM command payload parity.

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

int getCmdStrParityAEM gaemHandle  ga,
unsigned short *  p
 

Returns current AEM command string parity.

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

void packPayloadAEM gaemHandle  ga,
unsigned int  cmdHeader,
unsigned int  localAD,
unsigned int  value,
unsigned int *  payload
 

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

Parameters:
ga gaemHandle for AEM
cmdHeader 32-bit command header word
localAD 32-bit local access descriptor word
value 32-bit value to load into AEM 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 AEM Common Controller.

int setAccessDescParityAEM gaemHandle  ga,
unsigned short  p
 

Sets the current AEM access descriptor parity.

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

void setAEMlocalAD gaemHandle  ga,
unsigned short  func,
unsigned short  reg,
localLATpAD ad
 

initializes a local access descriptor structure for a AEM

Parameters:
ga gaemHandle for AEM
func AEM fucntion code
reg register of AEM
ad pointer to local access descriptor structure
Returns:
void

void setCmdHeaderAEM gaemHandle  ga,
cmdHeaderLATp ch,
unsigned short  type,
unsigned short  bcast,
unsigned short  inst,
unsigned short  ext
 

initializes a command header structure for a AEM

Parameters:
ga gaemHandle for AEM
ch pointer to command header structure
type type of on board AEM object
bcast set for broadcast commands
inst instance (address) of ACD object
ext set for "off board" commands, i.e. GARC and GAFE commands
Returns:
G_OK on void

int setCmdPayloadParityAEM gaemHandle  ga,
unsigned short  p
 

p determines if the AEM command payload parity is inverted

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

int setCmdStrParityAEM gaemHandle  ga,
unsigned short  p
 

p determines if the AEM command string parity is inverted

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


Generated on Sat Nov 15 15:42:28 2003 by doxygen 1.3.3