|
Description:
The user does not have to care about the complicated USB bus
protocol, but can directly work with USB2.0 bus. USB2dll is merged into
the development environment and the user can access
his hardware using the functions of USB2dll.
The Software of the interface module is written
automatically by USB2dll to the controller, so that the newest update of
the software is always installed in the interface module (hardware).
You can start developing usb2.0 hardware at now!
Functions of USB2dLL:
The current version enables you to manipulate 24
IO-lines, communicate with i2c-hardware at 100khz or 400khz
or transfer data over a 8 or 16 bit parallel bus,
SPI bus and a parallel port designer.
DLL-functions in detail:
General Usb-functions:
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-functions:
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-functions:
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-functions:
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-functions:
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
|