SpiSlave

com.ftdi.j2xx.interfaces

## Interface SpiSlave

- All Known Implementing Classes:
    FT_4222_Spi_Slave

      public interface SpiSlave

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getRxStatus(int[] pRxSize)` Get number of bytes in the receive queue.
    `int` | `init()` Initialize the deivce as SPI slave.
    `int` | `read(byte[] buffer, int bufferSize, int[] sizeOfRead)` Get number of bytes in the receive queue.
    `int` | `reset()` Reset the SPI slave device.
    `int` | `write(byte[] buffer, int bufferSize, int[] sizeTransferred)` Write data to the transmit queue of the SPI slave device.

- - ### Method Detail

    - #### init

          int init()

      Initialize the deivce as SPI slave.
      Returns:
        0 if successful, otherwise the return value is an FT error code.

    - #### getRxStatus

          int getRxStatus(int[] pRxSize)

      Get number of bytes in the receive queue.
      Parameters:
        `iSpiIdx` - number of bytes in the receive queue.
      Returns:
        0 if successful, otherwise the return value is an FT error code.

    - #### read

          int read(byte[] buffer,
                 int bufferSize,
                 int[] sizeOfRead)

      Get number of bytes in the receive queue.
      Parameters:
        `buffer` - buffer that receives the data from the device.
        `bufferSize` - number of bytes to read from the device.
        `sizeOfRead` - number of bytes read from the device.
      Returns:
        0 if successful, otherwise the return value is an FT error code.

    - #### write

          int write(byte[] buffer,
                  int bufferSize,
                  int[] sizeTransferred)

      Write data to the transmit queue of the SPI slave device.
      Parameters:
        `buffer` - buffer that contains the data to be written to the device.
        `bufferSize` - number of bytes to read from the device.
        `sizeTransferred` - number of bytes written to the device.
      Returns:
        0 if successful, otherwise the return value is an FT error code.

    - #### reset

          int reset()

      Reset the SPI slave device.
      Returns:
        0 if successful, otherwise the return value is an FT error code.

About FTDI | FTDI Licence Terms