public class FT_Spi_Slave
extends com.ftdi.j2xx.protocol.SpiSlaveThread
FT SPI Slave Protocol
Example of using the FT SPI Slave Protocol
Init
------------------------------------------------
mSPISlave = mFT4222Device0.getSpiSlaveDevice();
FT_4222_Spi_Slave ft4222_spi_ext = (FT_4222_Spi_Slave) mSPISlave;
if(ft4222_spi_ext != null)
ft4222_spi_ext.setDrivingStrength(SPI_DrivingStrength.DS_12MA, SPI_DrivingStrength.DS_16MA, SPI_DrivingStrength.DS_16MA);
mFTSPISlave = new FT_Spi_Slave(mSPISlave);
mFTSPISlave.open();
mFTSPISlave.registerSpiSlaveListener(this);
Listener
------------------------------------------------
Constructor and Description |
---|
FT_Spi_Slave(SpiSlave pSlaveInterface)
FT SPI Slave Protocol Constructor
|
Modifier and Type | Method and Description |
---|---|
int |
close()
Close FTDI SPI Slave protocol device
|
int |
open()
Open FTDI SPI Slave protocol device
|
void |
registerSpiSlaveListener(SpiSlaveListener pListener)
Register SPI Slave action listener
|
int |
write(byte[] wrBuf)
Write data to end device
|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public FT_Spi_Slave(SpiSlave pSlaveInterface)
pSlaveInterface
- a spi interface used for the protocolpublic void registerSpiSlaveListener(SpiSlaveListener pListener)
pListener
- SpiSlaveListener listenerpublic int open()
public int close()
public int write(byte[] wrBuf)
wrBuf
- buffer to write to end device