public class Ad7794Eval extends SpiBus
| Modifier and Type | Field and Description |
|---|---|
static int |
CAL_INT_FULL
Public constants
|
static int |
CAL_INT_ZERO
Public constants
|
static int |
CAL_SYS_FULL
Public constants
|
static int |
CAL_SYS_ZERO
Public constants
|
static int |
CFG_BOOST
Public constants
|
static int |
CFG_BUFFERED
Public constants
|
static int |
CFG_BURNOUT
Public constants
|
static int |
CFG_CHANNEL_M
Public constants
|
static int |
CFG_CHANNEL_V
Public constants
|
static int |
CFG_GAIN_M
Public constants
|
static int |
CFG_GAIN_V
Public constants
|
static int |
CFG_REF_DETECT
Public constants
|
static int |
CFG_REFSEL_M
Public constants
|
static int |
CFG_REFSEL_V
Public constants
|
static int |
CFG_STANDARD
Public constants
|
static int |
CFG_UNIPOLAR
Public constants
|
static int |
CFG_VBIAS_M
Public constants
|
static int |
CFG_VBIAS_V
Public constants
|
static int |
CHAN_AIN1
Public constants
|
static int |
CHAN_AIN1A
Public constants
|
static int |
CHAN_AIN2
Public constants
|
static int |
CHAN_AIN3
Public constants
|
static int |
CHAN_AIN4
Public constants
|
static int |
CHAN_AIN5
Public constants
|
static int |
CHAN_AIN6
Public constants
|
static int |
CHAN_TEMP
Public constants
|
static int |
CHAN_VDD
Public constants
|
static int |
CLOCK_EXT
Public constants
|
static int |
CLOCK_EXT_HALF
Public constants
|
static int |
CLOCK_INT
Public constants
|
static int |
CLOCK_INT_AVL
Public constants
|
static int |
COM_ADDRESS_M
Public constants
|
static int |
COM_ADDRESS_V
Public constants
|
static int |
COM_CONT_READ
Public constants
|
static int |
COM_READ
Public constants
|
static int |
CONFIG_REG
Public constants
|
static int |
DATA_REG
Public constants
|
static int |
DIO_ENABLE
Public constants
|
static int |
DIO_P1DATA
Public constants
|
static int |
DIO_P2DATA
Public constants
|
static int |
FRS_RATE_10
Public constants
|
static int |
FRS_RATE_12
Public constants
|
static int |
FRS_RATE_123
Public constants
|
static int |
FRS_RATE_16
Public constants
|
static int |
FRS_RATE_17
Public constants
|
static int |
FRS_RATE_19
Public constants
|
static int |
FRS_RATE_242
Public constants
|
static int |
FRS_RATE_33
Public constants
|
static int |
FRS_RATE_39
Public constants
|
static int |
FRS_RATE_4
Public constants
|
static int |
FRS_RATE_470
Public constants
|
static int |
FRS_RATE_50
Public constants
|
static int |
FRS_RATE_6
Public constants
|
static int |
FRS_RATE_62
Public constants
|
static int |
FRS_RATE_8
Public constants
|
static int |
GAIN_1
Public constants
|
static int |
GAIN_128
Public constants
|
static int |
GAIN_16
Public constants
|
static int |
GAIN_2
Public constants
|
static int |
GAIN_32
Public constants
|
static int |
GAIN_4
Public constants
|
static int |
GAIN_64
Public constants
|
static int |
GAIN_8
Public constants
|
static float |
HALF_RANGE |
static int |
ID_REG
Public constants
|
static int |
IEXCDIR_11
Public constants
|
static int |
IEXCDIR_12
Public constants
|
static int |
IEXCDIR_21
Public constants
|
static int |
IEXCDIR_22
Public constants
|
static int |
IEXCENA_10
Public constants
|
static int |
IEXCENA_1000
Public constants
|
static int |
IEXCENA_210
Public constants
|
static int |
IEXCENA_OFF
Public constants
|
static float |
INT_TEMP_SCALE |
static float |
INT_VOLT_SCALE |
static int |
IO_DIOENA
Public constants
|
static int |
IO_IEXCDIR_M
Public constants
|
static int |
IO_IEXCDIR_V
Public constants
|
static int |
IO_IEXCENA_M
Public constants
|
static int |
IO_IEXCENA_V
Public constants
|
static int |
IO_IO1DAT
Public constants
|
static int |
IO_IO2DAT
Public constants
|
static int |
IO_REG
Public constants
|
static int |
IO_STANDARD
Public constants
|
static int |
MOD_AMP_CM
Public constants
|
static int |
MOD_CHOP_DIS
Public constants
|
static int |
MOD_CLOCK_M
Public constants
|
static int |
MOD_CLOCK_V
Public constants
|
static int |
MOD_FRS_M
Public constants
|
static int |
MOD_FRS_V
Public constants
|
static int |
MOD_MODE_M
Public constants
|
static int |
MOD_MODE_V
Public constants
|
static int |
MOD_PSW
Public constants
|
static int |
MOD_STANDARD
Public constants
|
static int |
MODE_CONT
Public constants
|
static int |
MODE_IDLE
Public constants
|
static int |
MODE_INT_F_CAL
Public constants
|
static int |
MODE_INT_Z_CAL
Public constants
|
static int |
MODE_PWR_DOWN
Public constants
|
static int |
MODE_REG
Public constants
|
static int |
MODE_SINGLE
Public constants
|
static int |
MODE_SYS_F_CAL
Public constants
|
static int |
MODE_SYS_Z_CAL
Public constants
|
static int |
OFFSET_REG
Public constants
|
static int |
OPTN_CONFIG
Public constants
|
static int |
OPTN_IMMED
Public constants
|
static int |
OPTN_SINGLE
Public constants
|
static int |
RANGE_1250
Public constants
|
static int |
RANGE_156
Public constants
|
static int |
RANGE_19
Public constants
|
static int |
RANGE_2500
Public constants
|
static int |
RANGE_312
Public constants
|
static int |
RANGE_39
Public constants
|
static int |
RANGE_625
Public constants
|
static int |
RANGE_78
Public constants
|
static float |
REF_VOLTAGE |
static int |
REFSEL_EXT1
Public constants
|
static int |
REFSEL_EXT2
Public constants
|
static int |
REFSEL_INT
Public constants
|
static int |
SCALE_REG
Public constants
|
static int |
STATUS_REG
Public constants
|
static int |
STS_AD7794
Public constants
|
static int |
STS_CHANNEL_M
Public constants
|
static int |
STS_CHANNEL_V
Public constants
|
static int |
STS_ERROR
Public constants
|
static int |
STS_NOXREF
Public constants
|
static int |
STS_READY
Public constants
|
static int |
VBIAS_AIN1
Public constants
|
static int |
VBIAS_AIN2
Public constants
|
static int |
VBIAS_AIN3
Public constants
|
static int |
VBIAS_OFF
Public constants
|
| Constructor and Description |
|---|
Ad7794Eval() |
| Modifier and Type | Method and Description |
|---|---|
int |
calibrate(int chan,
int type)
Calibrates an ADC channel
|
void |
cleanupThermistor()
Cleans up after reading the thermistor
|
int |
commReg(int regnum,
boolean read)
Generates communications register value
|
void |
connect(int index) |
int[] |
getCalibration(int chan)
Gets the calibration data for an ADC channel.
|
int |
getChannel()
Gets the channel number
|
int |
getClockSource()
Gets the clock source
|
int |
getConvMode()
Gets the conversion mode
|
int |
getConvRate()
Gets the conversion rate
|
int |
getDio()
Gets the DIO values
|
int |
getGain()
Gets the ADC gain
|
int |
getRefSelect()
Gets the reference selection
|
int[] |
getRegSizes()
Gets the array of register sizes
|
int |
getSourceDirection()
Gets the current source direction
|
int |
getSourceEnable()
Gets the current source enable value
|
int |
getStatus()
Gets the board status
|
boolean |
isBuffered()
Gets the buffered mode
|
boolean |
isPowerSwitch()
Gets the power switch state
|
boolean |
isRefDetect()
Gets the reference detect mode
|
boolean |
isUnipolar()
Gets the unipolar mode
|
int |
readAdc(int chan,
int optns)
Reads an ADC channel
|
int |
readRegister(int regnum)
Reads a register.
|
float |
readTemperature(int optns)
Reads the internal temperature sensor
|
float |
readThermistor(int optns)
Reads the on-board thermistor
|
float |
readVdd(int optns)
Reads the internal voltage monitor
|
void |
setBuffered(boolean enable)
Sets the buffered mode
|
void |
setChannel(int chan)
Sets the channel number
|
void |
setClockSource(int source)
Sets the clock source
|
void |
setConvMode(int mode)
Sets the conversion mode
|
void |
setConvRate(int rate)
Sets the conversion rate
|
void |
setDebug(boolean on)
Sets the debug state.
|
void |
setDio(int value)
Sets the DIO values
|
void |
setGain(int gain)
Sets the ADC gain
|
void |
setPowerSwitch(boolean on)
Sets the power switch state
|
void |
setRefDetect(boolean enable)
Sets the reference detect mode
|
void |
setRefSelect(int mode)
Sets the reference selection
|
void |
setSourceDirection(int dirn)
Sets the current source direction
|
void |
setSourceEnable(int enab)
Sets the current source enable value
|
void |
setUnipolar(boolean enable)
Sets the unipolar mode
|
void |
setupStandard()
Performs standard board setup
|
void |
setupThermistor()
Sets up for reading the thermistor
|
void |
updateRegister(int regnum,
int mask,
int value)
Updates a register
|
void |
writeRegister(int regnum,
int value)
Writes a register
|
getRdyTimeout, load, readRegister, setRdyTimeout, updateRegister, writeRegisterload, readMemory, readMemory, setReset, setUsbDevice, writeMemory, writeMemorypublic static final int STATUS_REG
public static final int MODE_REG
public static final int CONFIG_REG
public static final int DATA_REG
public static final int ID_REG
public static final int IO_REG
public static final int OFFSET_REG
public static final int SCALE_REG
public static final int COM_READ
public static final int COM_ADDRESS_M
public static final int COM_ADDRESS_V
public static final int COM_CONT_READ
public static final int STS_READY
public static final int STS_ERROR
public static final int STS_NOXREF
public static final int STS_AD7794
public static final int STS_CHANNEL_M
public static final int STS_CHANNEL_V
public static final int MOD_MODE_M
public static final int MOD_MODE_V
public static final int MODE_CONT
public static final int MODE_SINGLE
public static final int MODE_IDLE
public static final int MODE_PWR_DOWN
public static final int MODE_INT_Z_CAL
public static final int MODE_INT_F_CAL
public static final int MODE_SYS_Z_CAL
public static final int MODE_SYS_F_CAL
public static final int MOD_PSW
public static final int MOD_AMP_CM
public static final int MOD_CLOCK_M
public static final int MOD_CLOCK_V
public static final int CLOCK_INT
public static final int CLOCK_INT_AVL
public static final int CLOCK_EXT
public static final int CLOCK_EXT_HALF
public static final int MOD_CHOP_DIS
public static final int MOD_FRS_M
public static final int MOD_FRS_V
public static final int FRS_RATE_470
public static final int FRS_RATE_242
public static final int FRS_RATE_123
public static final int FRS_RATE_62
public static final int FRS_RATE_50
public static final int FRS_RATE_39
public static final int FRS_RATE_33
public static final int FRS_RATE_19
public static final int FRS_RATE_17
public static final int FRS_RATE_16
public static final int FRS_RATE_12
public static final int FRS_RATE_10
public static final int FRS_RATE_8
public static final int FRS_RATE_6
public static final int FRS_RATE_4
public static final int MOD_STANDARD
public static final int CFG_VBIAS_M
public static final int CFG_VBIAS_V
public static final int VBIAS_OFF
public static final int VBIAS_AIN1
public static final int VBIAS_AIN2
public static final int VBIAS_AIN3
public static final int CFG_BURNOUT
public static final int CFG_UNIPOLAR
public static final int CFG_BOOST
public static final int CFG_GAIN_M
public static final int CFG_GAIN_V
public static final int GAIN_1
public static final int GAIN_2
public static final int GAIN_4
public static final int GAIN_8
public static final int GAIN_16
public static final int GAIN_32
public static final int GAIN_64
public static final int GAIN_128
public static final int RANGE_2500
public static final int RANGE_1250
public static final int RANGE_625
public static final int RANGE_312
public static final int RANGE_156
public static final int RANGE_78
public static final int RANGE_39
public static final int RANGE_19
public static final int CFG_REFSEL_M
public static final int CFG_REFSEL_V
public static final int REFSEL_EXT1
public static final int REFSEL_EXT2
public static final int REFSEL_INT
public static final int CFG_REF_DETECT
public static final int CFG_BUFFERED
public static final int CFG_CHANNEL_M
public static final int CFG_CHANNEL_V
public static final int CHAN_AIN1
public static final int CHAN_AIN2
public static final int CHAN_AIN3
public static final int CHAN_AIN4
public static final int CHAN_AIN5
public static final int CHAN_AIN6
public static final int CHAN_TEMP
public static final int CHAN_VDD
public static final int CHAN_AIN1A
public static final int CFG_STANDARD
public static final int IO_DIOENA
public static final int IO_IO2DAT
public static final int IO_IO1DAT
public static final int IO_IEXCDIR_M
public static final int IO_IEXCDIR_V
public static final int IEXCDIR_12
public static final int IEXCDIR_21
public static final int IEXCDIR_11
public static final int IEXCDIR_22
public static final int IO_IEXCENA_M
public static final int IO_IEXCENA_V
public static final int IEXCENA_OFF
public static final int IEXCENA_10
public static final int IEXCENA_210
public static final int IEXCENA_1000
public static final int IO_STANDARD
public static final int OPTN_CONFIG
public static final int OPTN_SINGLE
public static final int OPTN_IMMED
public static final int DIO_ENABLE
public static final int DIO_P1DATA
public static final int DIO_P2DATA
public static final int CAL_INT_ZERO
public static final int CAL_INT_FULL
public static final int CAL_SYS_ZERO
public static final int CAL_SYS_FULL
public static final float HALF_RANGE
public static final float REF_VOLTAGE
public static final float INT_TEMP_SCALE
public static final float INT_VOLT_SCALE
public void connect(int index)
throws org.lsst.ccs.drivers.commons.DriverException
index - The index of the board in the list of all matching onesorg.lsst.ccs.drivers.commons.DriverExceptionpublic int commReg(int regnum,
boolean read)
public void setupStandard()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int[] getRegSizes()
public int getStatus()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setChannel(int chan)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The channel number to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getChannel()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setConvMode(int mode)
throws org.lsst.ccs.drivers.commons.DriverException
mode - The mode value to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getConvMode()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setClockSource(int source)
throws org.lsst.ccs.drivers.commons.DriverException
source - The source value to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getClockSource()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setPowerSwitch(boolean on)
throws org.lsst.ccs.drivers.commons.DriverException
on - Whether or not to set power switch onorg.lsst.ccs.drivers.commons.DriverExceptionpublic boolean isPowerSwitch()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setConvRate(int rate)
throws org.lsst.ccs.drivers.commons.DriverException
rate - The rate value to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getConvRate()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setUnipolar(boolean enable)
throws org.lsst.ccs.drivers.commons.DriverException
enable - Whether or not to set unipolar modeorg.lsst.ccs.drivers.commons.DriverExceptionpublic boolean isUnipolar()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setBuffered(boolean enable)
throws org.lsst.ccs.drivers.commons.DriverException
enable - Whether or not to set buffered modeorg.lsst.ccs.drivers.commons.DriverExceptionpublic boolean isBuffered()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setRefDetect(boolean enable)
throws org.lsst.ccs.drivers.commons.DriverException
enable - Whether or not to set reference detect modeorg.lsst.ccs.drivers.commons.DriverExceptionpublic boolean isRefDetect()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setRefSelect(int mode)
throws org.lsst.ccs.drivers.commons.DriverException
mode - The reference selection value to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getRefSelect()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setGain(int gain)
throws org.lsst.ccs.drivers.commons.DriverException
gain - The gain value to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getGain()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setDio(int value)
throws org.lsst.ccs.drivers.commons.DriverException
value - The DIO values to set, the OR of the following:
DIO_ENABLE: enable digital output
DIO_P1DATA: set 1 on pin P1
DIO_P2DATA: set 1 on pin P2org.lsst.ccs.drivers.commons.DriverExceptionpublic int getDio()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setSourceDirection(int dirn)
throws org.lsst.ccs.drivers.commons.DriverException
dirn - The direction value to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getSourceDirection()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void setSourceEnable(int enab)
throws org.lsst.ccs.drivers.commons.DriverException
enab - The enable value to setorg.lsst.ccs.drivers.commons.DriverExceptionpublic int getSourceEnable()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int readAdc(int chan,
int optns)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The ADC channel to read (0 - 7)optns - Options word, composed of the following possible bit
masks:
OPTN_CONFIG: First configures the conversion mode.
OPTN_SINGLE: Configures for a single conversion,
otherwise continuous.
OPTN_IMMED: Reads the data register immediately
instead of waiting for a conversion to
complete.org.lsst.ccs.drivers.commons.DriverExceptionpublic float readTemperature(int optns)
throws org.lsst.ccs.drivers.commons.DriverException
optns - Options word, composed of the following possible bit
masks:
OPTN_CONFIG: First configures the conversion mode.
OPTN_SINGLE: Configures for a single conversion,
otherwise continuous.
OPTN_IMMED: Reads the data register immediately
instead of waiting for a conversion to
complete.org.lsst.ccs.drivers.commons.DriverExceptionpublic float readVdd(int optns)
throws org.lsst.ccs.drivers.commons.DriverException
optns - Options word, composed of the following possible bit
masks:
OPTN_CONFIG: First configures the conversion mode.
OPTN_SINGLE: Configures for a single conversion,
otherwise continuous.
OPTN_IMMED: Reads the data register immediately
instead of waiting for a conversion to
complete.org.lsst.ccs.drivers.commons.DriverExceptionpublic float readThermistor(int optns)
throws org.lsst.ccs.drivers.commons.DriverException
optns - Options word, composed of the following possible bit
masks:
OPTN_CONFIG: First configures the conversion mode.
OPTN_SINGLE: Configures for a single conversion,
otherwise continuous.
OPTN_IMMED: Reads the data register immediately
instead of waiting for a conversion to
complete.org.lsst.ccs.drivers.commons.DriverExceptionpublic void setupThermistor()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic void cleanupThermistor()
throws org.lsst.ccs.drivers.commons.DriverException
org.lsst.ccs.drivers.commons.DriverExceptionpublic int calibrate(int chan,
int type)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The ADC channel to calibrate (0 - 7)type - The type of calibration to perform:
CAL_INT_ZERO: internal zero-point
CAL_INT_FULL: internal full-scale
CAL_SYS_ZERO: system zero-point
CAL_SYS_FULL: system full-scaleorg.lsst.ccs.drivers.commons.DriverExceptionpublic int[] getCalibration(int chan)
throws org.lsst.ccs.drivers.commons.DriverException
chan - The ADC channel (0 - 7)org.lsst.ccs.drivers.commons.DriverExceptionpublic void setDebug(boolean on)
on - The debug state to setpublic int readRegister(int regnum)
throws org.lsst.ccs.drivers.commons.DriverException
regnum - The register to readorg.lsst.ccs.drivers.commons.DriverExceptionpublic void writeRegister(int regnum,
int value)
throws org.lsst.ccs.drivers.commons.DriverException
regnum - The register to writevalue - The value to writeorg.lsst.ccs.drivers.commons.DriverExceptionpublic void updateRegister(int regnum,
int mask,
int value)
throws org.lsst.ccs.drivers.commons.DriverException
regnum - The register to updatemask - The mask of bits to updatevalue - The value to write, under the maskorg.lsst.ccs.drivers.commons.DriverExceptionCopyright © 2019 LSST. All rights reserved.