public class FTDI2xx_RH
extends net.sf.yad2xx.mpsse.I2C
Operates an FTDI device as an I2C port using the MPSSE feature. See FTDI Application Notes AN113 and AN255 for details.
It appears that only the FT232H supports open drain outputs. According to AN255:
The FT2232H and FT4232H could also be used in place of the FT232H. Both the FT2232H and FT4232H have two MPSSE channels. However, please note that these devices do not feature the open-drain option used here in the FT232H and so the pins need to be manually tri-stated when not writing on the I2C bus. This requires a small change to the routines used to generate the I2C protocol.If using something other than an FT232H, series resistors for SCL and SDA are recommended.
Pinouts are:
Constructor and Description |
---|
FTDI2xx_RH(net.sf.yad2xx.Device device,
int clockRate) |
Modifier and Type | Method and Description |
---|---|
float |
getAD7150Value(DataChannelDescriptor dataSource)
gets the sensor value.
|
float |
getSensorValue(DataChannelDescriptor dataSource)
gets the sensor value.
|
void |
listRegisters(int i2cAddr,
byte startReg,
int byteCount)
gets the sensor value
|
byte[] |
readRegisters(int i2cAddr,
byte startReg,
int byteCount)
gets the sensor value
|
void |
setOutputState(int channel,
boolean b)
sets the output state
|
public float getAD7150Value(DataChannelDescriptor dataSource) throws java.lang.Exception
dataSource
- the description of hardware channel, register and byte lengthjava.lang.Exception
- ...public float getSensorValue(DataChannelDescriptor dataSource) throws java.lang.Exception
dataSource
- the description of hardware channel, register and byte lengthjava.lang.Exception
- ...public void setOutputState(int channel, boolean b)
channel
- the hardware channelb
- ON?public byte[] readRegisters(int i2cAddr, byte startReg, int byteCount) throws java.lang.Exception
i2cAddr
- the address of the i2c devicestartReg
- the start registerbyteCount
- the byte count to readjava.lang.Exception
- ...public void listRegisters(int i2cAddr, byte startReg, int byteCount) throws java.lang.Exception
i2cAddr
- the address of the i2c devicestartReg
- the start registerbyteCount
- the byte count to readjava.lang.Exception
- ...RH, 2017