EasyManua.ls Logo

FTDI LibFT4222 - SPI Slave Write

Default Icon
78 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Application Note
AN_329 User Guide For LibFT4222
Version 1.5
Document Reference No.: FT_001060 Clearance No.: FTDI#406
41
Product Page
Document Feedback Copyright © Future Technology Devices International Limited
if(rxSize>0)
{
recvBuf.resize(rxSize);
if(FT4222_SPISlave_Read(ftHandle,&recvBuf[0], rxSize, &sizeTransferred)==
FT4222_OK)
{
// get data
}
else
{
// get data failed
}
}
}
}
FT4222_UnInitialize(ftHandle);
FT_Close(ftHandle);
3.4.6 SPI Slave Write
FT4222_STATUS FT4222_SPISlave_Write(FT_HANDLE ftHandle, uint8* buffer, uint16
bytesToWrite, uint16* sizeTransferred)
Supported Chip:
FT4222 chip version
Supported
FT4222 Rev A
YES
FT4222 Rev B
YES
FT4222 Rev C
YES
FT4222 Rev D
YES
Summary:
Write data to the transmit queue of the SPI slave device.
For some reasons, support lib will append a dummy byte (0x00) at the first byte automatically.
This additional byte exists at all of the three transfer methods.
Parameters:
ftHandle
Handle of the device.
buffer
Pointer to the buffer that contains the data to be written to the device.
bytesToWrite
Number of bytes to write to the device.
sizeTransferred
Pointer to a variable of type uint16 which receives the number of bytes written
to the device.
Return Value:
FT4222_OK if successful, otherwise the return value is an FT error code.
Error code:
FT4222_DEVICE_NOT_OPENED: The initialization API is not called
FT4222_DEVICE_NOT_SUPPORTED: This device is not a FT4222 chip.
FT4222_IS_NOT_SPI_MODE: The device is not in spi slave mode.
FT4222_INVALID_POINTER: The parameter buffer or sizeTransferred is NULL.
FT4222_INVALID_PARAMETER: Parameter bytesToWrite is equal to zero.

Table of Contents