Calibre UK PICA93LV user manual Windows LIB/DLL Functions

Page 9

CALIBRE

￿

￿

3.4.Windows LIB/DLL Functions

3.4.1.

Files on disc

 

 

\readme.doc

User Information

 

\win\c\I2cinc.h

"C" function prototypes

 

\win\c\lpti2c.lib

I2C "C" library

 

\win\vb30\lpti2c.bas

Visual Basic 3.0 declarations

 

\win\vb30\lpti2c.dll

I2C Visual Basic dynamic link library

The following functions are implemented in the windows libraries:-

void far _pascal _export setup (int baseaddress, int ownaddress, int sclk, int statuswait); int far _pascal _export sendaddress (int slaveaddress, int setnack);

int far _pascal _export restart (int slaveaddress, int setnack); int far _pascal _export getstatus (void);

int far _pascal _export writebyte (int wrData); int far _pascal _export readbyte (int setnack); int far _pascal _export sendstop (void);

int far _pascal _export recover (void);

int far _pascal _export sendbytes (int __far *transferarray); int far _pascal _export getbytes (int __far *transferarray); void far _pascal _export slavelastbyte (void);

Issue 1.3

Page 6

22/07/99

Image 9
Contents Calibre Copyright CalibreContents Introduction Configuring the AdapterGeneral Introduction Packing ListTypical PC Connection Installing the AdapterConnector Pinout Connecting the Adapter to Your SystemPower Supply Bus Capacitance Limitations\C\CLIB\SPICA.LIB Software Utilities\C\CLIB\CPICA.LIB \C\CLIB\MPICA.LIB\B\SOURCE\I2CINC.BAS DOS Qbasic Library/Programs\B\SOURCE\PROMREAD.BAS \B\SOURCE\PROMWRIT.BASWindows LIB/DLL Functions Routines Using the UtilitiesInt ownaddress Int sclkInt i2cstatus Int slaveaddressInt setnack Calibre Int i2cdata Calibre Int i2cstatus Number if the adapter is to read from the slave Ownaddress% Qbasic RoutinesSclk% I2cstatus%Slaveaddress% I2cdata% Setnack%See Appendix a for details status codes I2cstatus% Is to read from the slave Libraries for Programming in Microsoft Windows Environments Int baseaddressInt statuswait Int wrData Int ErrCodeSendaddress Address to be accessed via the I2C, e.g. A1H Int sendbytesint far *transferarray Int far *transferarrayInt bsent Int nobytesread Int getbytesint far *transferarraySlave using the adapter Further Information Appendix a Parallel I2C Communications Adapter Status Codes Bit 4 The Bus Error BER BitBit 7 MSB The Pending Interrupt Not PIN Bit Bit 6 Not UsedAppendix B Parallel I2C Communications Adapter Control Codes Most Commonly Asked I2C Questions Question Get corrupted transfers why is this?Question Do you have software to talk to my........? QuestionCode. Why? Please Email Your Query to