com.cesys.cebo.cebomsr
Class Counter

java.lang.Object
  extended by com.cesys.cebo.cebomsr.Counter
All Implemented Interfaces:
Input

public final class Counter
extends java.lang.Object
implements Input

Offers functionality for counter periphery. Instances can be retrieved calling getCounters() of the respective Device instance.

Author:
Thomas Hoppe

Nested Class Summary
static class Counter.CounterConfig
          The possible trigger configuration values.
 
Method Summary
 Counter.CounterConfig getConfig()
          Request configuration of the counter.
 java.lang.String getName()
          Returns name of the component.
 boolean isEnabled()
          Get current counter state.
 long read()
          Read current counter value.
 void reset()
          Reset counter to 0.
 void setConfig(Counter.CounterConfig counterConfig)
          Define behavior of the counter.
 void setEnabled(boolean enable)
          Enable or disable counter.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

reset

public void reset()
           throws java.io.IOException
Reset counter to 0.

Throws:
java.io.IOException

setEnabled

public void setEnabled(boolean enable)
                throws java.io.IOException
Enable or disable counter.

Parameters:
enable - State to set.
Throws:
java.io.IOException

isEnabled

public boolean isEnabled()
                  throws java.io.IOException
Get current counter state.

Throws:
java.io.IOException

setConfig

public void setConfig(Counter.CounterConfig counterConfig)
               throws java.io.IOException
Define behavior of the counter.

Parameters:
counterConfig - Use one of the values from Counter::CounterConfig.
Throws:
java.io.IOException

getConfig

public Counter.CounterConfig getConfig()
                                throws java.io.IOException
Request configuration of the counter.

Returns:
One of the values from Counter::CounterConfig.
Throws:
java.io.IOException

read

public long read()
          throws java.io.IOException
Read current counter value.

Throws:
java.io.IOException

getName

public java.lang.String getName()
Returns name of the component.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object