User`s manual

XP8500
Software Reference s 43
int adc4
_
compute( struct adc4coeff cnvrsn,
int data1, float volt1, int data2,
float volt2 )
Computes the zero
_
offset and invgain for the adc4coeff
structure pointed to by cnvrsn. The function computes the constants
zero
_
offset and invgain based on A/D readings of two known
input voltages to allow input data to be corrected later using the
formula
voltage = invgain * ( zero
_
offset  data) .
data1 is the raw A/D reading for the known input voltage volt1.
data2 is the raw A/D reading for the known input voltage volt2.
RETURN VALUE: 0 if the constants are computed successfully, 1 if
the data used resulted in divide by zero while computing the constants.
int adc4
_
eerd( unsigned int board_adr,
int address )
Reads byte data from EEPROM data address.
board
_
adr is the physical address of the XP8500 board, defined as
0000 1100 ppxy. Addresses range from 0 to 511 for the 512 bytes of
EEPROM memory storage.
RETURN VALUE: non-negative value for data, 1 if the XP8500
board cannot be found, 2 if a problem occurs while accessing the
EEPROM.
int adc4
_
eewr( unsigned int board
_
adr,
int address, char data )
Writes byte data to EEPROM data address.
board
_
adr is the physical address of the XP8500 board, defined as
0000 1100 ppxy.
address is 0 to 511 for the 512 bytes of EEPROM memory storage.
The top 256 bytes can be write-protected using with jumpers on
header J3.
RETURN VALUE: 0 if the data is successfully written to the
EEPROM, 1 if the XP8500 board cannot be found, 2 if a problem
occurs while accessing the EEPROM, 3 if a write to the top 256
bytes of EEPROM was attempted while the write-protect jumper is
connected.