![Ratoc Systems REX-USB61 Скачать руководство пользователя страница 67](http://html.mh-extra.com/html/ratoc-systems/rex-usb61/rex-usb61_user-manual_788102067.webp)
4. API function reference
Page.4-22
Parameters
[IN] hUsb61Device : handle of an REX-USB61 device
[IN] fDataMode : a bit mask specifying which operation mode for sending on
SPI bus.
The clock polarity and the clock edge determine the value of bit mask.
The bit mask by using the defined symbol as the following:
RS_SPI_PHASE_SETUP_SAMPLE sampling on rising edge
RS_SPI_PHASE_SAMPLE_SETUP sampling on falling edge
RS_SPI_POLARITY_POSITIVE clock polarity is positive
RS_SPI_POLARITY_NEGATIVE clock polarity is negative
RS_SPI_MSB_FIRST MBS first
RS_SPI_LSB_FIRST LSB first
example:
RS_SPI_PHASE_SETUP_SAMPLE | RS_SPI_POLARITY_POSITIVE | RS_SPI_MSB_FIRST
[IN] Frequency : the frequency to request on SPI bus
[OUT] pActualFrequency: the actual frequency value to be set
Return
Values
RS_SUCCESS Function call succeeded.
Error code (refer. 4-5) Function call failed.
VC
RS_STATUS
usb61_spi_transmit_master(
HANDLE
hUsb61Device,
RS_SPI_SS
fSlaveSelect,
USHORT
TransmitSize,
UCHAR *pSendBuf, UCHAR *pRecvBuf );
VB
Function
Usb61SpiTransmitMaster(ByVal hUsb61Device As Long,
ByVal fSlaveSelect As Integer, ByVal TransmitSize As Integer,
ByVal pSendBuf As Byte, pRecvBuf As Byte) As Long
Definition
VB.NET
Function
Usb61SpiTransmitMaster(ByVal hUsb61Device As Integer,
ByVal fSlaveSelect As Short, ByVal transmitSize As Short,
ByVal pSendBuf As Object, ByRef pRecvBuf As Object) As Integer
Description
Write a stream of bytes to the downstream SPI slave device and read back dummy
data.
After write, set SS line status to High.
Parameters
[IN] hUsb61Device : handle of an REX-USB61 device
[IN] fSlaveSelect : Pin number for slave select
enumerated values specifying pin number the bellow:
RS_SPI_SS0 Slave select pin number 0
RS_SPI_SS1 Slave select pin number 1
RS_SPI_SS2 Slave select pin number 2
RS_SPI_SS3 Slave select pin number 3
[IN] TransmitSize : the number of bytes to write
[IN] pSendBuf : pointer to write data
[OUT] pRecvBuf : pointer to read back data
Return
Values
RS_SUCCESS Function call succeeded.
Error code (refer. 4-5) Function call failed.
Содержание REX-USB61
Страница 1: ...USB SPI I2C Protocol Emulator 2013 10 Rev 1 0 ...
Страница 75: ...RATOC Systems Inc All rights reserved ...