|
Beschreibung:
Der Anwender hat sich nicht um das komplizierte USB BUS Protokoll
zu kümmern, sondern kann direkt mit dem USB2.0 Bus arbeiten. Die USB2dll
wird in die Entwicklungs Umgebung eingebunden. Der Anwender kann dann
über Funktionen der USB2dll auf seine Hardware zugreifen.
Die Software des Interface Moduls wird über die USB2dll automatisch in
den Baustein geschrieben, so dass immer das neuste Update der Software
im Interface Modul (Hardware) installiert ist.
Sie können sofort mit USB 2.0 loslegen!
Funktionen der DLL:
In der aktuellen Version stellt die DLL Funktionen zur Manipulation
der
24 IO-Leitungen und zur Datenübertragung per Highspeed I²C
Bus (400Khz) und Low Speed I²C Bus (100 Khz) sowie 8 oder 16 Bit
Parallel Bus,
ein Paralell Bus Designer und ISP BUS
zur Verfügung.
Im Detail sind dies, weitere siehe Dokumentation:
Generelle Usb-Routinen:
function UsbSetTimeout(DevNum : Byte; timeout : Word) : boolean;
UsbOpen(DevNum
: Byte) : boolean;
UsbClose(DevNum : Byte) : boolean;
UsbInit - function UsbInit(DevNum : Byte) : Boolean;
UsbGetError - function UsbGetError : Byte;
UsbGetErrorStringByNr - function UsbGetErrorStringByNr(ErrNr : Byte;
PString : PChar) : boolean;
UsbSetLicense - function UsbSetLicense(Filename : PChar) : boolean;
UsbCheckSpeed(DevNum : Byte; var Speed : Byte) : boolean;
UsbGetVersion(VersionStr : PChar);
UsbWaituSec(usec : DWord);
UsbGetStatus(DevNum : Byte) : Boolean;
UsbRetrieveAllErrors(DevNum : Byte; RetrieveAll : Boolean) : boolean;
UsbDevicePresent(DevNum : Byte) : Boolean;
UsbDeviceInitialized(DevNum : Byte) : Boolean;
IO-Routinen:
UsbSetIOState - function UsbSetIOState(DevNum, LineNum, State : Byte)
: boolean;
UsbSetIODir - function UsbSetIODir(DevNum, LineNum, State
: Byte) : boolean;
UsbGetIOState - function UsbGetIOState(DevNum, LineNum :
Byte; var State : Byte) : boolean;
UsbSetPortState - function UsbSetPortState(DevNum, PortNum,
State : Byte) : boolean;
UsbSetPortDir - function UsbSetPortDir(DevNum, PortNum, Dir
: Byte) : boolean;
UsbGetPortState - function UsbGetPortState(DevNum, PortNum
: Byte; var State : Byte) : boolean;
I2C-Routinen:
UsbI2CSetTimeout(DevNum : Byte; Timeout : Word) : Boolean;
UsbI2CSetSpeed - function UsbI2CSetSpeed(DevNum, Speed : Byte)
: boolean;
UsbI2CWriteBytes - function UsbI2CWriteBytes(DevNum, SlaveAddr:
Byte; Lenght : Word; P : Pointer) : boolean;
UsbI2CWriteByte - function UsbI2cWriteByte(DevNum, SlaveAddr,
Data : Byte) : boolean;
UsbI2CReadBytes - function UsbI2CReadBytes(DevNum, SlaveAddr:
Byte; Lenght : Word; P : Pointer) : boolean;
UsbI2CReadByte - function UsbI2CReadByte(DevNum, SlaveAddr
: Byte; var Data : Byte) : boolean;
Usbi2cWriteAfterRead - function UsbI2CWriteAndReadBytes(DevNum,
SlaveAddr : Byte; WriteLen,
ReadLen
: Word; PWrite, PRead : Pointer) : boolean;
EEProm-Routinen:
UsbEEpSetTimeout(DevNum : Byte; Timeout : Word) : Boolean;
UsbEEpWriteBytes - function UsbEEpWriteBytes(DevNum : Byte; Addr
: Word; Length : Word; PData : Pointer) : boolean;
UsbEEpWriteByte - function UsbEEpWriteByte(DevNum : Byte; Addr
: Word; Data : Byte) : boolean;
UsbEEpReadBytes - function UsbEEpReadBytes(DevNum : Byte; Addr
: Word; Length : Word; PData : Pointer) : boolean;
UsbEEpReadByte - function UsbEEpReadByte(DevNum : Byte; Addr
: Word; var Data : Byte) : boolean;
UsbEEpSetAddr(DevNum, SlaveAddr : Byte) : boolean;
Parallelbus-Routinen:
UsbParSetTimeout(DevNum : Byte; Timeout : Word) : Boolean;
UsbParSetWaveforms(DevNum, InWfIdx, OutWfIdx : Byte) : Boolean;
UsbParInit - function UsbParInit(DevNum, mode :Byte) : boolean;
UsbParInitUsingArray - function UsbParInitUsingArray(DevNum
: Byte; PData : Pointer) : boolean;
UsbParOut - function UsbParOut(DevNum : Byte; Data : Pointer;
Len : DWord) : boolean;
UsbParIn - function UsbParIn(DevNum : Byte; Data : Pointer;
Len : DWord) : boolean;
UsbParOut(0, @Buffer, 25); // transmits a coherent 25 Byte
sized data block
UsbParOut(0, @Buffer, 512); // transmits a coherent 512
Byte sized data block
UsbParOut(0, @Buffer, 1500); // transmits two coherent
512 Byte sized Data block and one 476 Byte sized data block
UsbGetRdyState(DevNum : Byte; var Rdy : Byte) : boolean;
stdcall;
SPI-Routinen:
UsbSpiInit(DevNum : Byte; LsbFirst : Boolean; SPIMode :
Byte; Speed : Byte) : Boolean;
UsbSpiTransfer(DevNum : Byte; PWrite, PRead : Pointer;
Len : Word) : Boolean;
UsbSpiTransferByte(DevNum : Byte; DatWrite : Byte; var
PDatRead : Byte) : Boolean;
Latency times und speed:
UsbParOut(0, @Buffer[i], 1); // Writes 1 Byte to the parallel
bus
UsbParOut(0, @Buffer, 64); // Writes 64 Byte to the parallel
bus
|