![Ratoc Systems REX-USB61 User Manual Download Page 58](http://html.mh-extra.com/html/ratoc-systems/rex-usb61/rex-usb61_user-manual_788102058.webp)
4. API function reference
Page.4-13
VC
RS_STATUS
usb61_mode_change( HANDLE hUsb61Device,
UINT fDeviceMode, USHORT i2cSlaveAddr );
VB
Function
Usb61ModeChange(ByVal hUsb61Device As Long,
ByVal fDeviceMode As Long,
ByVal i2cSlaveAddr As Integer) As Long
Definition
VB.NET
Function
Usb61ModeChange(ByVal hUsb61Device As Integer,
ByVal fDeviceMode As Integer,
ByVal i2cSlaveAddr As Short) As Integer
Description
Configure SPI/I2C mode and Master/Slave operation.
Parameters
[IN] hUsb61Device : Handle of an REX-USB61 device
[IN] fDeviceMode : Device mode setting bits
Set the value of bit operation by using the defined symbol as the
following:
RS_DEVMODE_SPI SPI mode
RS_DEVMODE_I2C I2C mode
RS_DEVMODE_MASTER Master operation
RS_DEVMODE_SLAVE Slave operation
Example:
RS_DEVMODE_SPI | RS_DEVMODE_MASTER (SPI master)
[IN] i2cSlaveAddr : Address of I2C target device, when set I2C slave
mode.
Return
Values
RS_SUCCESS Function call succeeded.
Error code (refer. 4-5) Function call failed.
VC
RS_STATUS
usb61_set_interval( HANDLE hUsb61Device,
USHORT IntervalCnt);
VB
Function
Usb61SetInterval(ByVal hUsb61Device As Long,
ByVal IntervalCnt As Long) As Long
Definition
VB.NET
Function
Usb61SetInterval(ByVal hUsb61Device As Integer,
ByVal IntervalCnt As Integer) As Integer
Description
Configure the interval time of sending byte data to the SPI/I2C bus.
(a micro-second unit)
* The actual interval is longer than the time set, because
includes
processing time.
(If do not call this function, then actual interval is 0 micro-second)
* Need to call usb61_mode_change(), before calling this function.
Parameters
[IN] hUsb61Device : handle of an REX-USB61 device
[IN] IntervalCnt : Interval for send data (micro-second: 0 - 65535)
Return
Values
RS_SUCCESS Function call succeeded.
Error code (refer. 4-5) Function call failed.