U2C-11 USB-I2C/SPI/GPIO Interface Adapter

 
Main Page   Modules   Compound List   File List   Compound Members   File Members  

SPI data transfer routines


Functions

U2C_RESULT U2C_SpiReadWrite (HANDLE hDevice, BYTE *pOutBuffer, BYTE *pInBuffer, unsigned short Length)
 Shift in/out byte stream. More...

U2C_RESULT U2C_SpiWrite (HANDLE hDevice, BYTE *pOutBuffer, unsigned short Length)
 Shift out byte stream. More...

U2C_RESULT U2C_SpiRead (HANDLE hDevice, BYTE *pInBuffer, unsigned short Length)
 Shift in byte stream. More...


Function Documentation

U2C_RESULT U2C_SpiRead ( HANDLE hDevice,
BYTE * pInBuffer,
unsigned short Length )
 

Shift in byte stream.

The U2C_SpiRead function shifts in (reads) a stream of bytes from the SPI slave device

Parameters:
hDevice   Handle to the I2CBridge device
pInBuffer   Pointer to the buffer that receives the data shifted in from the SPI slave device
Length   Number of bytes to be shifted in
Returns:
  • U2C_SUCCESS - The data was successfully read.
  • U2C_HARDWARE_NOT_FOUND - I2CBridge device referenced by hDevice handle was not found

U2C_RESULT U2C_SpiReadWrite ( HANDLE hDevice,
BYTE * pOutBuffer,
BYTE * pInBuffer,
unsigned short Length )
 

Shift in/out byte stream.

The U2C_SpiReadWrite function shifts out (writes) and in (reads) a stream of bytes to/from the SPI slave device

Parameters:
hDevice   Handle to the I2CBridge device
pOutBuffer   Pointer to the buffer containing the data to be shifted out to the slave SPI device
pInBuffer   Pointer to the buffer that receives the data shifted in from the slave SPI device
Length   Number of bytes to be transferred via SPI bus
Returns:
  • U2C_SUCCESS - The data was successfully transmitted via SPI bus.
  • U2C_HARDWARE_NOT_FOUND - I2CBridge device referenced by hDevice handle was not found

U2C_RESULT U2C_SpiWrite ( HANDLE hDevice,
BYTE * pOutBuffer,
unsigned short Length )
 

Shift out byte stream.

The U2C_SpiWrite function shifts out (writes) a stream of bytes to the SPI slave device.

Parameters:
hDevice   Handle to the I2CBridge device
pOutBuffer   Pointer to the buffer containing the data to be shifted out to the slave SPI device
Length   Number of bytes to be shifted out to the slave SPI device
Returns:
  • U2C_SUCCESS - The data was successfully written.
  • U2C_HARDWARE_NOT_FOUND - I2CBridge device referenced by hDevice handle was not found

Copyright DiMAX 2002-2004