
Cypress CY3640 USB Starter Kit
User’s Guide
Cypress Semiconductor Ver 0.993
Page 48
I. Thermometer driver reference
The Cypress driver is accessed through the Windows DeviceIoControl() API. The following code
and table illustrates its use.
Type OVERLAPPED
Internal As Long
InternalHigh As Long
offset As Long
OffsetHigh As Long
hEvent As Long
End Type
Public gOverlapped As OVERLAPPED
Public hgDrvrHnd As LONG
Dim lIn as long, lInSize as long, lOut as long, lOutSize as long, lSize as long
Dim ltemp as long
ltemp = DeviceIoControl(hgDrvrHnd, 4&, lIn, lInSize, lOut, lOutSize, lSize, gOverlapped)
Command Command Value Out Value
Size (Bytes) lIn lOut
Function Value lIn lOut MSB LSB MSB LSB
Set LED Brightness
0Eh 2 1 NA NA Brightness 0Eh NA NA NA Status
Read Thermometer
0Bh 1 3 NA Button Temp 0Bh Button Sign Temp Status
Read Port
014h 2 2 NA NA Port 014h NA NA Value Status
Write Port
015h 3 1 NA Value Port 015h NA NA NA Status
Read RAM
016h 2 2 NA NA Address 016h NA NA Value Status
Write RAM
017h 3 1 NA Value Address 017h NA NA NA Status
Read ROM
018h 3 2 NA Index NA 018h NA NA Value Status
Indexed to USBSendROMBufferBase