 |
Doxygen Documentation |
Main Index |
Package Index |
Package: |
GAEM |
Version: |
V2-1-2 |
Marked: |
(not marked) |
Constituent: |
vaem |
Tag: |
sun-gcc |
Interface Compound List File List Compound Members File Members
gAENV.c File Reference
Implements command/response for the AEM's "Environmental Monitor".
More...
#include "ga_p.h"
#include "gAEM_p.h"
#include "GAEM/gAENV.h"
#include <string.h>
|
Functions |
| void | packPayloadAENV (gaemHandle ga, unsigned int cmdHeader, unsigned int localAD, unsigned long long value, unsigned int *payload) |
| | Packs the cmdHeader, localLATpAD and value into the 96-bit payload.
|
| int | __aenvCmdLoad (gaemHandle ga, unsigned short func, unsigned short reg, unsigned long long value) |
| | Generic routine for sending response-less commands.
|
| int | gAENVload (gaemHandle ga, unsigned short reg, unsigned long long value) |
| | Loads a register with value.
|
| int | gAENVread (gaemHandle ga, unsigned short reg, unsigned long long *value) |
| | Reads a register specified by reg and stores result in value.
|
Detailed Description
Implements command/response for the AEM's "Environmental Monitor".
- Author:
- Curt Brune -- curt@slac.stanford.edu
Currently only the Virtual AEM is supported. The fidelity of the emulation is quite low.
Command Fidelity ======= =============================== dataless Succeed, but no effect on electronics
register writes Succeed, but no effect on electronics
register reads Succeed, but always return 0 -- timeout for non-existent registers.
Note: All the registers are 64-bits wide.
Function Documentation
| int __aenvCmdLoad |
( |
gaemHandle |
ga, |
|
|
unsigned short |
func, |
|
|
unsigned short |
reg, |
|
|
unsigned long long |
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 AENV on board registers 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 AENV register to load with value. |
| int gAENVload |
( |
gaemHandle |
ga, |
|
|
unsigned short |
reg, |
|
|
unsigned long long |
value |
|
) |
|
|
|
|
Loads a register with value.
- Parameters:
-
| ga | gaemHandle for AEM |
| reg | register of AEM to load |
| value | 64-bit value to load into AENV register |
- Returns:
- G_OK on success
The value written to AENV registers is ignored, but the act of writing initiates the ADC acquisition cycle.
In the VAEM no action is taken. |
| int gAENVread |
( |
gaemHandle |
ga, |
|
|
unsigned short |
reg, |
|
|
unsigned long long * |
value |
|
) |
|
|
|
|
Reads a register specified by reg and stores result in value.
- Parameters:
-
| ga | gaemHandle for AEM |
| reg | register of AEM to load |
| value | pointer to 64-bit value to store register read result |
- Returns:
- G_OK on success
Returns the 4 ADC values associated with reg in the AEM Environmental Monitor.
In the VAEM this function always returns a value of 0. |
| void packPayloadAENV |
( |
gaemHandle |
ga, |
|
|
unsigned int |
cmdHeader, |
|
|
unsigned int |
localAD, |
|
|
unsigned long long |
value, |
|
|
unsigned int * |
payload |
|
) |
|
|
|
|
Packs the cmdHeader, localLATpAD and value into the 96-bit payload.
- Parameters:
-
| ga | gaemHandle for AEM |
| cmdHeader | 32-bit command header word |
| localAD | 32-bit local access descriptor word |
| value | 64-bit value to load into AENV register |
| payload | pointer to 96-bits of pre-allocated storage |
- Returns:
- void
Packs the bits of cmdHeader, localAD and value into the 96-bits pointed to by payload. The packing is specific to local "on board" registers for the AEM Environmental Monitor. |
Generated on Sat Nov 15 15:42:39 2003 by
1.3.3