Calibre UK UCA93 manual Libraries for Programming in Microsoft Windows Environments

Page 7

CALIBRE

LIBRARIES FOR PROGRAMMING IN MICROSOFT WINDOWS ENVIRONMENTS

3.1.Introduction

Each utility is documented in a standard format which lists its name, usage, function and effect on the Adapter is given. The Adapter should be setup prior to any data transfer.

Within the DLL there are two versions of some functions e.g. SendAddress and SendAddressNoStatus, the first provides legacy support for software written for other Calibre UK Ltd I2C products, the second format does not return the status.

3.1.1.Legacy Function

The following changes have had to be made to the legacy functions

1)The parameters passed to the setup function are specific to the Adapter

2)The status wait has been removed and is now controlled by hardware, the Adapter will wait up to 500 micro seconds before returning an error code indicating that the transfer failed.

3)The Setnack is now changed on the read you require the acknowledge state to change NOT on the byte before.

4)There is no longer a need to perform a Trash read after a restart.

3.1.2.No Status Functions

The xxNoStatus functions provide faster transfers as they do not require the USB bus to change direction between writing and reading. The function prototypes are included in the manual but care MUST be taken when using these functions not to corrupt the I2C with uncontrolled transfers. These functions are ONLY to be used when users are 100% certain that all devices on the I2C WILL acknowledge their address and that there is a single master.

PLEASE NOTE NO TECHNICAL SUPPORT IS AVAILABLE FOR THESE FUNCTIONS Calibre UK recommend using the block functions detailed below

3.1.3.Block Functions

To aid users wishing to transfer data without the complication of having to write a I2C transfer protocol a number of Block functions have been added. DO NOT exceed the data transfer limitations described in the individual functions as this will cause errors and data corruption.

C and C++ users will undoubtedly wonder why they are passing data to the DLL when they could much more efficiently pass a pointer, unfortunately not all the development environments this Adapter will be used on support pointers.

Issue 1.0

Page 4

01/07/03

 

Image 7
Contents Calibre Calibre Contents Bus Termination and Protection Connecting the Adapter to your SystemGeneral Introduction Packing ListBus Capacitance Limitations/Cable Choice Variable Voltage Bus Power SupplyIntroduction Installing the AdapterLibraries for Programming in Microsoft Windows Environments Function Prototypes Calibre Int BusVoltage Int SlaveBlockTimeoutInt ownaddress Int ClockSpeedNone Int DataByteSendAddress Int I2CDataInt I2Cstatus Using the AdapterReturns an unused integer Int NoBytesToSendInt NoTries Int DataValInt RdData Int TimeoutInt NoBytesToTransmit Int NoBytesToReceive Int PullupVoltage Int Int IOStateSendAddressNoStatus WriteByteNoStatus Stop Real-Time Bus MonitorBit 5 The old STS Bit Bit 4 The BER Bus Error BitAppendix a I2C Communications Adapter Status Codes Bit 7 MSB The old PIN BitBlock Write Function USB Bus CharacteristicsPolling the Status Register and how to avoid it Block FunctionsSlave Receiver Function Slave Transmitter FunctionCalibre Question Do you have software to talk to my........? When the the Most Commonly Asked I2C QuestionsQuestion Get corrupted transfers why is this? General Questions