![Ratoc Systems REX-USB61 Скачать руководство пользователя страница 57](http://html.mh-extra.com/html/ratoc-systems/rex-usb61/rex-usb61_user-manual_788102057.webp)
4. API function reference
Page.4-12
VC
RS_STATUS
usb61_get_hw_info( HANDLE hUsb61Device,
PRS_HARDWARE_INFO pHardwareInfo );
VB
Function
Usb61GetHwInfo(ByVal hUsb61Device As Long,
pHardwareInfo As Byte) As Long
Definition
VB.NET
Function
Usb61GetHwInfo(ByVal hUsb61Device As Integer,
ByRef pHardwareInfo As Object) As Integer
Description Retrieve the hardware information for the SPI/I2C bus operation
Parameters [IN] hUsb61Device : handle of an REX-USB61 device
[OUT] pHardwareInfo : pointer to _RS_HARDWARE_INFO structure
The _RS_HARDWARE_INFO structure is described bellow:
typedef struct _RS_HARDWARE_INFO {
UCHAR DeviceMode;
// SPI/I2C mode
UCHAR MasterSlaveAct; // Master/Slave operation
USHORT Frequency; // frequency of interface
UCHAR OutputVolt; // Output voltage for target device
} RS_HARDWARE_INFO, *PRS_HARDWARE_INFO;
_RS_HARDWARE_INFO structure is defined in usb61def.h.
sample code for VB as the dellow:
Dim pHardWareBuf() As Byte
Dim HardWareInfo As RS_HARDWARE_INFO
ReDim pHardWareBuf(10) As Byte
rsStatus
=
Usb61api.Usb61GetHwInfo(m_hDeviceHandle,
pHardWareBuf)
If rsStatus <> RS_SUCCESS Then
' error process
Else
HardWareInfo.DeviceMode = pHardWareBuf(0)
HardWareInfo.MasterSlaveAct = pHardWareBuf(1)
HardWareInfo.Frequency =
pHardWareBuf(3)*256 + pHardWareBuf(2)
HardWareInfo.OutputVolt = pHardWareBuf(4)
End If
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 ...