jAER project on SourceForge

ch.unizh.ini.jaer.chip.dvs320
Class ConfigurableIPot

java.lang.Object
  extended by java.util.Observable
      extended by net.sf.jaer.biasgen.Pot
          extended by net.sf.jaer.biasgen.IPot
              extended by ch.unizh.ini.jaer.chip.dvs320.ConfigurableIPot
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.util.Observer, java.util.prefs.PreferenceChangeListener, RemoteControlled
Direct Known Subclasses:
ConstrainedConfigurableIPot

public class ConfigurableIPot
extends IPot

An IPot with full configurability. The sex (N/P), type (NORMAL/CASCODE), current level (LOW,NORNAL), enabled state (normal, or weakly tied to rail), buffer bias current, and bias current can all be digitally configured. First implemented on TCVS320, improved on DVS320.

Author:
tobi

Nested Class Summary
static class ConfigurableIPot.BiasEnabled
          If enabled=true the bias operates normally, if enabled=false, then the bias is disabled by being weakly tied to the appropriate rail (depending on bias sex, N or P).
static class ConfigurableIPot.CurrentLevel
          Operating current level, defines whether to use shifted-source current mirrors for small currents.
 
Nested classes/interfaces inherited from class net.sf.jaer.biasgen.Pot
Pot.Sex, Pot.Type
 
Field Summary
protected static int bitValueMask
          Bit mask for bias current value bits
protected static int bufferBiasMask
          Bit mask for buffer bias bits
protected  int bufferBitValue
          The bit value of the buffer bias current
protected static int enabledMask
          Bit mask for flag bias enabled (normal operation) or disabled (tied weakly to rail)
protected static int lowCurrentModeMask
          Bit mask for flag low current mode enabled
static int maxBitValue
          Max bias bit value
static int maxBufferValue
          Maximum buffer bias value (all bits on)
protected static int numBiasBits
          Number of bits used for bias value
protected static int numBufferBiasBits
          The number of bits specifying buffer bias currrent as fraction of master bias current
protected static int sexMask
          Bit mask for flag for bias sex (N or P)
protected static int typeMask
          Bit mask for flag for bias type (normal or cascode)
 
Fields inherited from class net.sf.jaer.biasgen.IPot
biasgen, shiftRegisterNumber
 
Fields inherited from class net.sf.jaer.biasgen.Pot
bitValue, CHANGE_FRACTION, chip, chipNumber, displayPosition, group, log, masterbias, name, numBits, numBytes, pinNumber, prefs, sex, tooltipString, type
 
Constructor Summary
ConfigurableIPot(Biasgen biasgen)
           
ConfigurableIPot(Biasgen biasgen, java.lang.String name, int shiftRegisterNumber, Pot.Type type, Pot.Sex sex, boolean lowCurrentModeEnabled, boolean enabled, int bitValue, int bufferBitValue, int displayPosition, java.lang.String tooltipString)
          Creates a new instance of IPot
 
Method Summary
protected  int computeBinaryRepresentation()
          Computes the actual bit pattern to be sent to chip based on configuration values
 ConfigurableIPot.BiasEnabled getBiasEnabled()
          Returns enabled via enum
 byte[] getBinaryRepresentation()
          Computes and returns a the reused array of bytes representing the bias to be sent over hardware interface to the device.
 int getBufferBitValue()
           
 float getBufferCurrent()
          Computes the estimated current based on the bit value for the current splitter and the Pot.masterbias
 ConfigurableIPot.CurrentLevel getCurrentLevel()
           
 int getPreferedBitValue()
          returns the preference value
 boolean isEnabled()
          returns enabled via boolean
 boolean isLowCurrentModeEnabled()
           
 void loadPreferences()
          loads and makes active the preference value.
 javax.swing.JComponent makeGUIPotControl()
          Builds the component used to control the IPot.
protected  java.lang.String prefsKey()
          Returns the String key by which this pot is known in the Preferences.
 void setBiasEnabled(ConfigurableIPot.BiasEnabled biasEnabled)
          Sets bias enabled via enum
 void setBufferBitValue(int bufferBitValue)
          Set the buffer bias bit value
 float setBufferCurrent(float current)
          sets the bit value based on desired current and Pot.masterbias current.
 void setCurrentLevel(ConfigurableIPot.CurrentLevel currentLevel)
          Sets whether this is a normal type or low current bias which uses shifted source
 void setEnabled(boolean enabled)
          sets enabled via boolean
 void setLowCurrentModeEnabled(boolean lowCurrentModeEnabled)
           
 void setSex(Pot.Sex sex)
          Overrides super of setSex (N or P) to call observers
 void setType(Pot.Type type)
          Overrides super of type (NORNAL or CASCODE) to call observers
 void storePreferences()
          stores as a preference the bit value
 java.lang.String toString()
           
 
Methods inherited from class net.sf.jaer.biasgen.IPot
changeByRatio, decrementCurrent, getCurrent, getCurrentResolution, getMaxCurrent, getMinCurrent, getPhysicalValue, getPhysicalValueUnits, getShiftRegisterNumber, incrementCurrent, processCommand, setChipNumber, setCurrent, setPhysicalValue, setShiftRegisterNumber, update
 
Methods inherited from class net.sf.jaer.biasgen.Pot
addObserver, decrementBitValue, getBitValue, getChipNumber, getDisplayPosition, getGroup, getMaxBitValue, getMinBitValue, getName, getNumBits, getNumBytes, getPinNumber, getSex, getTooltipString, getType, incrementBitValue, preferenceChange, resume, setBitValue, setDisplayPosition, setGroup, setName, setNumBits, setNumBytes, setPinNumber, setTooltipString, suspend, toBitPatternString
 
Methods inherited from class java.util.Observable
clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

enabledMask

protected static int enabledMask
Bit mask for flag bias enabled (normal operation) or disabled (tied weakly to rail)


lowCurrentModeMask

protected static int lowCurrentModeMask
Bit mask for flag low current mode enabled


sexMask

protected static int sexMask
Bit mask for flag for bias sex (N or P)


typeMask

protected static int typeMask
Bit mask for flag for bias type (normal or cascode)


bitValueMask

protected static int bitValueMask
Bit mask for bias current value bits


bufferBiasMask

protected static int bufferBiasMask
Bit mask for buffer bias bits


numBiasBits

protected static int numBiasBits
Number of bits used for bias value


numBufferBiasBits

protected static int numBufferBiasBits
The number of bits specifying buffer bias currrent as fraction of master bias current


bufferBitValue

protected int bufferBitValue
The bit value of the buffer bias current


maxBufferValue

public static int maxBufferValue
Maximum buffer bias value (all bits on)


maxBitValue

public static int maxBitValue
Max bias bit value

Constructor Detail

ConfigurableIPot

public ConfigurableIPot(Biasgen biasgen)

ConfigurableIPot

public ConfigurableIPot(Biasgen biasgen,
                        java.lang.String name,
                        int shiftRegisterNumber,
                        Pot.Type type,
                        Pot.Sex sex,
                        boolean lowCurrentModeEnabled,
                        boolean enabled,
                        int bitValue,
                        int bufferBitValue,
                        int displayPosition,
                        java.lang.String tooltipString)
Creates a new instance of IPot

Parameters:
biasgen -
name -
shiftRegisterNumber - the position in the shift register, 0 based, starting on end from which bits are loaded
type - (NORMAL, CASCODE)
sex - Sex (N, P)
lowCurrentModeEnabled - bias is normal (false) or in low current mode (true)
enabled - bias is enabled (true) or weakly tied to rail (false)
bitValue - initial bitValue
bufferBitValue - buffer bias bit value
displayPosition - position in GUI from top (logical order)
tooltipString - a String to display to user of GUI telling them what the pots does
Method Detail

makeGUIPotControl

public javax.swing.JComponent makeGUIPotControl()
Builds the component used to control the IPot. This component is the user interface.

Overrides:
makeGUIPotControl in class IPot
Returns:
a JComponent that can be added to a GUI

getBufferBitValue

public int getBufferBitValue()

setBufferBitValue

public void setBufferBitValue(int bufferBitValue)
Set the buffer bias bit value

Parameters:
bufferBitValue - the value which has maxBufferValue as maximum and specifies fraction of master bias

getBiasEnabled

public ConfigurableIPot.BiasEnabled getBiasEnabled()
Returns enabled via enum

Returns:
appropriate BiasEnabled enum

setBiasEnabled

public void setBiasEnabled(ConfigurableIPot.BiasEnabled biasEnabled)
Sets bias enabled via enum

Parameters:
biasEnabled -

isEnabled

public boolean isEnabled()
returns enabled via boolean

Returns:
boolean true if enabled

setEnabled

public void setEnabled(boolean enabled)
sets enabled via boolean

Parameters:
enabled -

isLowCurrentModeEnabled

public boolean isLowCurrentModeEnabled()

setLowCurrentModeEnabled

public void setLowCurrentModeEnabled(boolean lowCurrentModeEnabled)

computeBinaryRepresentation

protected int computeBinaryRepresentation()
Computes the actual bit pattern to be sent to chip based on configuration values


getBinaryRepresentation

public byte[] getBinaryRepresentation()
Description copied from class: IPot
Computes and returns a the reused array of bytes representing the bias to be sent over hardware interface to the device.

Overrides:
getBinaryRepresentation in class IPot
Returns:
array of bytes to be sent, by convention values are ordered in big endian format so that byte 0 is the most significant byte and is sent first to the hardware.

prefsKey

protected java.lang.String prefsKey()
Returns the String key by which this pot is known in the Preferences. For IPot's, this name is the Chip simple class name followed by IPot., e.g. "Tmpdiff128.IPot.Pr".

Overrides:
prefsKey in class IPot
Returns:
preferences key

storePreferences

public void storePreferences()
stores as a preference the bit value

Overrides:
storePreferences in class Pot

loadPreferences

public void loadPreferences()
loads and makes active the preference value. The name should be set before this is called.

Overrides:
loadPreferences in class Pot

getPreferedBitValue

public int getPreferedBitValue()
returns the preference value

Overrides:
getPreferedBitValue in class Pot

setBufferCurrent

public float setBufferCurrent(float current)
sets the bit value based on desired current and Pot.masterbias current. Observers are notified if value changes.

Parameters:
current - in amps
Returns:
actual float value of current after resolution clipping.

getBufferCurrent

public float getBufferCurrent()
Computes the estimated current based on the bit value for the current splitter and the Pot.masterbias

Returns:
current in amps

toString

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

getCurrentLevel

public ConfigurableIPot.CurrentLevel getCurrentLevel()

setCurrentLevel

public void setCurrentLevel(ConfigurableIPot.CurrentLevel currentLevel)
Sets whether this is a normal type or low current bias which uses shifted source


setType

public void setType(Pot.Type type)
Overrides super of type (NORNAL or CASCODE) to call observers

Overrides:
setType in class Pot

setSex

public void setSex(Pot.Sex sex)
Overrides super of setSex (N or P) to call observers

Overrides:
setSex in class Pot

jAER project on SourceForge