net.sf.jaer.biasgen
Class IPot
java.lang.Object
java.util.Observable
net.sf.jaer.biasgen.Pot
net.sf.jaer.biasgen.IPot
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.EventListener, java.util.Observer, java.util.prefs.PreferenceChangeListener, RemoteControlled
- Direct Known Subclasses:
- ConfigurableIPot
public class IPot
- extends Pot
- implements java.lang.Cloneable, java.util.Observer, RemoteControlled
Describes an IPot, Bernabe Linares Barranco's name for a programamble current source.
These are different in their detailed circuit implementation, being based
on a Bult&Geelen current splitter whose input current is directly split, insread of being mirrored and then split.
I.e., the ones implemented here use a voltage reference for the current splitter that is externally derived instead of
coming from the current mirror gate voltage.
In any case, these are integrated on-chip, e.g.
on retina test chip testchipARCS and temporal contrast dynamic vision sensor Tmpdiff128,
and are programmed over an SPI (serial peripherl interconnect) link from
an off-chip microcontroller. This class holds the state of the IPot and describes it.
This class extends Observer so observers can add themselves to be notified when the pot value changes.
- Author:
- tobi
Field Summary |
protected Biasgen |
biasgen
The enclosing bias generator |
protected int |
shiftRegisterNumber
the position of this ipot in the chain of shift register cells; zero based and starting at the end where the bits are loaded. |
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 |
protected |
IPot(Biasgen biasgen)
Creates a new instance of IPot passing only the biasgen it belongs to. |
|
IPot(Biasgen biasgen,
java.lang.String name,
int shiftRegisterNumber,
Pot.Type type,
Pot.Sex sex,
int bitValue,
int displayPosition,
java.lang.String tooltipString)
Creates a new instance of IPot |
Methods inherited from class net.sf.jaer.biasgen.Pot |
addObserver, decrementBitValue, getBitValue, getChipNumber, getDisplayPosition, getGroup, getMaxBitValue, getMinBitValue, getName, getNumBits, getNumBytes, getPinNumber, getPreferedBitValue, getSex, getTooltipString, getType, incrementBitValue, loadPreferences, preferenceChange, resume, setBitValue, setDisplayPosition, setGroup, setName, setNumBits, setNumBytes, setPinNumber, setSex, setTooltipString, setType, storePreferences, 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 |
biasgen
protected Biasgen biasgen
- The enclosing bias generator
shiftRegisterNumber
protected int shiftRegisterNumber
- the position of this ipot in the chain of shift register cells; zero based and starting at the end where the bits are loaded.
The order is very important because the bits for the FIRST bias in the shift register are loaded LAST.
IPot
protected IPot(Biasgen biasgen)
- Creates a new instance of IPot passing only the biasgen it belongs to. All other parameters take default values.
This IPot also adds itself as an observer for the Masterbias object.
- Parameters:
biasgen
- the biasgen this ipot is part of
IPot
public IPot(Biasgen biasgen,
java.lang.String name,
int shiftRegisterNumber,
Pot.Type type,
Pot.Sex sex,
int bitValue,
int displayPosition,
java.lang.String tooltipString)
- Creates a new instance of IPot
- Parameters:
biasgen
- the containing Biasgen.name
- displayed and used to return by name.shiftRegisterNumber
- the position in the shift register,
0 based, starting on end from which bits are loaded.
This order determines how the bits are sent to the shift register,
lower shiftRegisterNumber are loaded later, so that they end up at the start of the shift register.
The last bit on the shift register is loaded first and is the msb of the last bias
on the shift register.
The last bit loaded into the shift register is the lsb of the first bias on the shift register.type
- (NORMAL, CASCODE) - for user information.sex
- Sex (N, P). User tip.bitValue
- initial bitValue.displayPosition
- position in GUI from top (logical order).tooltipString
- a String to display to user of GUI telling them what the pots does.
toString
public java.lang.String toString()
- Overrides:
toString
in class Pot
setCurrent
public float setCurrent(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.
getCurrent
public float getCurrent()
- Computes the estimated current based on the bit value for the current splitter and the
Pot.masterbias
- Returns:
- current in amps
setChipNumber
public void setChipNumber(int chipNumber)
getShiftRegisterNumber
public int getShiftRegisterNumber()
- The shift register number is ordered so that the lowest shiftRegisterNumber is the bias at the start of the shift register and must be loaded *last*.
The highest number should go to the end of the shift register. This bias needs to be loaded first.
- Returns:
- The shift register number which is ordered so that the lowest shiftRegisterNumber is the bias at the start of the shift register.
setShiftRegisterNumber
public void setShiftRegisterNumber(int shiftRegisterNumber)
- The shift register number is ordered so that the lowest shiftRegisterNumber is the bias at the start of the shift register and must be loaded *last*.
The highest number should go to the end of the shift register. This bias needs to be loaded first.
- Parameters:
shiftRegisterNumber
- which lower towards the input side and starts with 0 by convention.
getMaxCurrent
public float getMaxCurrent()
- Returns:
- max possible current (master current)
getMinCurrent
public float getMinCurrent()
- Returns:
- min possible current (presently zero, although in reality limited by off-current and substrate leakage).
getCurrentResolution
public float getCurrentResolution()
- return resolution of pot in current. This is just Im/2^nbits.
- Returns:
- smallest possible current change -- in principle
incrementCurrent
public void incrementCurrent()
- increment pot value by
Pot.CHANGE_FRACTION
ratio
decrementCurrent
public void decrementCurrent()
- decrement pot value by ratio
changeByRatio
public void changeByRatio(float ratio)
- change ipot current value by ratio
- Parameters:
ratio
- between new current and old value, e.g. 1.1f or 0.9f
update
public void update(java.util.Observable observable,
java.lang.Object obj)
- Responds to updates from Masterbias to notify observers
- Specified by:
update
in interface java.util.Observer
- Parameters:
observable
- ignoredobj
- ignored
makeGUIPotControl
public javax.swing.JComponent makeGUIPotControl()
- Builds the component used to control the IPot. This component is the user interface.
- Specified by:
makeGUIPotControl
in class Pot
- Returns:
- a JComponent that can be added to a GUI
getPhysicalValue
public float getPhysicalValue()
- Description copied from class:
Pot
- returns physical value of bias, e.g. in current amps or voltage volts
- Specified by:
getPhysicalValue
in class Pot
- Returns:
- physical value
getPhysicalValueUnits
public java.lang.String getPhysicalValueUnits()
- Description copied from class:
Pot
- return units (e.g. A, mV) of physical value of bias
- Specified by:
getPhysicalValueUnits
in class Pot
setPhysicalValue
public void setPhysicalValue(float value)
- Description copied from class:
Pot
- sets physical value of bias
- Specified by:
setPhysicalValue
in class Pot
- Parameters:
value
- the physical value, e.g. in amps or volts
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 Pot
- Returns:
- preferences key
getBinaryRepresentation
public byte[] getBinaryRepresentation()
- Computes and returns a the reused array of bytes representing
the bias to be sent over hardware interface to the device.
- Specified by:
getBinaryRepresentation
in class Pot
- 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.
processCommand
public java.lang.String processCommand(RemoteControlCommand command,
java.lang.String input)
- Description copied from interface:
RemoteControlled
- Called when remote control recieved for this RemoteControlled.
- Specified by:
processCommand
in interface RemoteControlled
- Parameters:
command
- the received command that was parsed as being the type sent.input
- the input line which starts with the command token.
- Returns:
- an optional response to the command which can be null.