|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sump.analyzer.Device
public class Device
Device provides access to the physical logic analyzer device. It requires the rxtx package from http://www.rxtx.org/ to access the serial port the analyzer is connected to.
Field Summary | |
---|---|
static int |
CLOCK_EXTERNAL_FALLING
use external clock falling edge |
static int |
CLOCK_EXTERNAL_RISING
use external clock rising edge |
static int |
CLOCK_INTERNAL
use internal clock |
Constructor Summary | |
---|---|
Device()
Creates a device object. |
Method Summary | |
---|---|
boolean |
attach(java.lang.String portName,
int portRate)
Attaches the given serial port to the device object. |
void |
detach()
Detaches the currently attached port, if one exists. |
int |
getAvailableChannelCount()
Returns the number of available channels in current configuration. |
int |
getClockSource()
Returns the current clock source. |
int |
getEnabledChannels()
Returns the currently enabled channels. |
int |
getMaximumRate()
Get the maximum sampling rate available. |
int |
getPercentage()
Returns the percentage of the expected data that has already been read. |
static java.lang.String[] |
getPorts()
Gets a string array containing the names all available serial ports. |
int |
getTriggerMask(int stage)
Returns the current trigger mask. |
int |
getTriggerStageCount()
Returns the number of available trigger stages. |
int |
getTriggerValue(int stage)
Returns the current trigger value. |
boolean |
isFilterAvailable()
Returns wether or not the noise filter can be used in the current configuration. |
boolean |
isFilterEnabled()
Returns wether or not the noise filter is enabled. |
boolean |
isRunning()
Returns wether or not the device is currently running. |
boolean |
isTriggerEnabled()
Returns wether or not the trigger is enabled. |
CapturedData |
run()
Sends the configuration to the device, starts it, reads the captured data and returns a CapturedData object containing the data read as well as device configuration information. |
void |
setClockSource(int source)
Sets the clock source to use. |
void |
setEnabledChannels(int mask)
Set enabled channels. |
void |
setFilterEnabled(boolean enable)
Sets wheter or not to enable the noise filter. |
void |
setParallelTrigger(int stage,
int mask,
int value,
int level,
int delay,
boolean startCapture)
Configures the given trigger stage in parallel mode. |
void |
setRate(int rate)
Set the sampling rate. |
void |
setRatio(double ratio)
Sets the ratio for samples to read before and after started. |
void |
setSerialTrigger(int stage,
int channel,
int mask,
int value,
int level,
int delay,
boolean startCapture)
Configures the given trigger stage in serial mode. |
void |
setSize(int size)
Sets the number of samples to obtain when started. |
void |
setTriggerEnabled(boolean enable)
Sets wheter or not to enable the trigger. |
void |
stop()
Informs the thread in run() that it is supposed to stop reading data and return. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CLOCK_INTERNAL
public static final int CLOCK_EXTERNAL_RISING
public static final int CLOCK_EXTERNAL_FALLING
Constructor Detail |
---|
public Device()
Method Detail |
---|
public void setSize(int size)
size
- number of samples, must be between 4 and 256*1024public void setRatio(double ratio)
ratio
- value between 0 and 1; 0 means all before start, 1 all afterpublic void setRate(int rate)
rate
- sampling rate in Hzpublic void setParallelTrigger(int stage, int mask, int value, int level, int delay, boolean startCapture)
In mask and value each bit of the integer parameters represents one channel. The LSB represents channel 0, the MSB channel 31.
When a trigger fires, the trigger level will rise by one. Initially the trigger level is 0.
stage
- trigger stage to write mask und value tomask
- bit map defining which channels to watchvalue
- bit map defining what value to wait for on watched channelslevel
- trigger level at which the trigger will be armed (0 = immediatly)delay
- delay in samples to wait in between match and firestartCapture
- if true
that capture when trigger fires, otherwise only triggel level will increasepublic void setSerialTrigger(int stage, int channel, int mask, int value, int level, int delay, boolean startCapture)
In mask and value each bit of the integer parameters represents one sample. The LSB represents the oldest sample not yet shifted out, the MSB the most recent. (The trigger compares to a 32bit shift register that is shifted by one for each sample.)
When a trigger fires, the trigger level will rise by one. Initially the trigger level is 0.
stage
- trigger stage to write mask und value tochannel
- channel to attach trigger tomask
- bit map defining which channels to watchvalue
- bit map defining what value to wait for on watched channelslevel
- trigger level at which the trigger will be armed (0 = immediatly)delay
- delay in samples to wait in between match and firestartCapture
- if true
that capture when trigger fires, otherwise only triggel level will increasepublic void setTriggerEnabled(boolean enable)
enable
- true
enables the trigger, false
disables it.public void setFilterEnabled(boolean enable)
enable
- true
enables the noise filter, false
disables it.public void setEnabledChannels(int mask)
mask
- bit map defining enabled channelspublic void setClockSource(int source)
source
- can be any CLOCK_ property of this classpublic int getMaximumRate()
public int getTriggerMask(int stage)
stage
- trigger stage to read mask from
public int getTriggerValue(int stage)
stage
- trigger stage to read value from
public int getClockSource()
public int getEnabledChannels()
public boolean isTriggerEnabled()
true
when trigger is enabled, false
otherwisepublic boolean isFilterEnabled()
true
when noise filter is enabled, false
otherwisepublic boolean isFilterAvailable()
true
when noise filter is available, false
otherwisepublic int getTriggerStageCount()
public int getAvailableChannelCount()
public boolean isRunning()
true
when running, false
otherwisepublic int getPercentage()
isRunning()
returns true
.
public static java.lang.String[] getPorts()
public boolean attach(java.lang.String portName, int portRate)
A return value of true
does not guarantee that a
logic analyzer is actually attached to the port.
If the device is already attached to a port this port will be
detached automatically. It is therefore not necessary to manually
call detach()
before reattaching.
portName
- the name of the port to openportRate
- transfer rate to use (bps)
true
when the port has been assigned successfully;
false
otherwise.public void detach()
public CapturedData run() throws java.io.IOException, java.lang.InterruptedException
java.io.IOException
- when writing to or reading from device fails
java.lang.InterruptedException
- if a read time out occurs after trigger match or stop() was called before trigger matchpublic void stop()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |