Home
Main Screen (Contents)
Contents
1. eM M e eee E 5 SUBADBRESSt ON erc NL etes RN UR NL 6 DATA TRANSEER O S S Room E C S nr WP ON NS AS corr we O 6 AGKNOWLE DGE c o o CN eec UR LN m c LN 8 6 201605 DOCUMENTATION SN TEN eret Een Sa eon 6 MINIMUM SYSTEM CONFIGURATION 77 5 525 eee o oe etit eroe ore LPT TO 12C SE PROFESSIONAL CONTENTS 7 9 5 FILESINSTALLED FOR UPI TO 2C SEIPROEESSIONAIEE e RON 7 LOCATION OF DUR PEN COE PUMA ip EDU OREL 5 iTESTINGITHE INSTALLATION ores te EXPORTED FUNCTIONS USING THE STDCALL ADD EPI BRORT 7 MC m TTE S S NC m 8 o ee 8 GETACCESSMODE RR TR eomm mw o Ae te on mw 8 GETIZCEREQUENCY eem S FORE oO ome c LE LUE UU RES Ric UE 8 GETIPITABDRESSm Re E es ENS ee 8 GETBBPITNU NIBER 7 8 GEIMAXEREGUENCY m oce m IE m Am pu 9 HARDWARE DETE GI e e NUR IAN e 9 IZGREADE Mm mE o Rm ur c Mec M m uet m m We INI 9 I2CREADBIT A PW OUS M AE oss 9 I GREADARRAY STA enne TORN ehem tide eg 9 C READARRAYD Bie Be
2. E 16 SETVWATIIIIM ES 16 POE a 17 STORI GDRIVEREC ee X m 17 ERROR CODES 2 9 E e eae e MISUATSBASIGIEXAMIDIEi es LR 19 DEUPR HI EXAMPLE oes eS 20 eG LPT to I2C SE Professional 2 Protocol General Characteristics The PC protocol allows data to be transferred between devices using two open drain or open collector bi directional lines One line is the serial clock SCL and the other is the serial data SDA The bus master generates the Start conditions the clock signals on SCL as well as the Stop condition An acknowledge is transmitted by the receiving device on the bus after each byte is sent Bit Transfer Data on SDA must be stable while SCL is high The state of SDA when SCL is high determines the logic level of the transmitted data bit Start and Stop Conditions Within the procedure of the I C bus unique situations arise which are defined as START and STOP conditions A HIGH to LOW transition on the SDA line while SCL is HIGH is one such unique case This situation indicates a START condition A LOW to HIGH transition on the SDA line while SCL is HIGH def
3. m ott moss 10 I2 CU READARRAY 4 cem m Lom ois COUPE ute Ne 10 I2 C READARRAVINSSET E e IL ss 20 ae 11 I2 READBYTEZ fo ae E LONE 5 M M ON 11 I2 GST ART cama EON mE US 12 I2CSTOBE ost o RENDIR i 12 IZCWIRITE C e ou Os anc co m ou TN c Nue tw 12 2 MU cs exce TT o m 12 I GNMRITEARRAYAS S Em er RR RR oa D NEN P 13 I2 NW RITEARRAYDBR ote S ENS 13 MEO rM IL MILI ILL 88 LPT to I2C SE Professional TOWRITEARRAYEN 39 o Im AR ore wo a 14 BYTE tss coo e e Ene Mese ec 14 INBUITSTATER DR oe Mem o S s e Rn s cO X s 15 i A 15 co MESA MESS CT ONE NAE 05 ME 15 BU ESEIKO We eem oo s LS n e 15 ERNEUT 15 SCL 6 _ 15 SDA CONTRO E M 15 3 25 r aa ooa eroa 16 16 NUMBERS S M M MEC TM ee mnn m 16 SETSIOWMODE moraa TEE
4. VB GetLPTNumber As byte The GetMaxFrequency function returns the maximum clock frequency possible with the user s computer hardware The value is hardware dependent C C int GetMaxFrequency void Delphi GetMaxFrequency integer VB GetMaxFrequency As Long This function checks to see if the LPT to I2C SE hardware is attached to the currently selected parallel port The two byte Boolean value returned by HardwareDetect contains true non zero if hardware was detected while the return value is false 0 if the hardware was not detected It is important to ensure that hardware is detected since no PC communications will begin until hardware has been detected Therefore after calling the SetLPTNumber function it is a good idea to call HardwareDetect to see if the hardware was detected short int HardwareDetect void Delphi HardwareDetect wordbool VB HardwareDetect As Boolean This function takes a two byte Boolean value and a pointer to data byte and then reads one byte from a device on the PC bus The Boolean value indicates whether the byte will be the last byte read from the PC bus A true non zero indicates that it is the last byte to read while a false 0 indicates that additional bytes will be read The returned value contains the error condition See Error Codes section for return values The data byte is written to the memory location specified by ReadData C C unsigned char I2CRea
5. write array with a double byte subaddress takes five parameters device address the high byte of the device subaddress the low byte of the device subaddress number of bytes to be sent and a pointer to an element within an array of bytes The function ensures that the lsb of the address is a 0 before it is sent to the target device The function returns any error condition it encounters See Error Code section for return values This function is useful for communicating with devices such as large eeproms that use a two byte subaddressing scheme uchar I2CWriteArrayDB uchar address uchar subaddressHigh uchar subaddressLow int nBytes uchar WriteData I2CWriteArrayDB address subaddressHigh subaddressLow byte nBytes integer var WriteData byte byte I2CWriteArrayDB ByVal address As Byte ByVal subaddressHigh As Byte ByVal subaddressLow As Byte ByVal nBytes As Long ByRef WriteData As Byte As Byte Acknowledge Acknowledge Acknowledge Acknowledge from Slave from Slave from Slave from Slave S Address LE SubaddressHigh I WM SubaddressLow I2CWriteArrayDB LPT to I2C SE Professional The I2C10WriteArray function write an array with 10 bit device addressing is similar to the I2CWriteArray function however it uses 10 bit PC addressing The specification states that the 10 bit address has the following format First byte 1111 Oxx R W bit Second byte xxxx xxxx where x the 10 bits of add
6. As Byte The I2CReadArrayNS function read an array with no subaddress is similar to the I2CReadArray function however it does not perform the write to a subaddress before the read is transmitted This function takes three arguments the device address the number of bytes to read and a pointer to an element within an array of bytes It is the calling program s responsibility to allocate the correct memory space for the array The function ensures that the lsb of the address is set to a 1 before it is sent to the target device C C unsigned char I2CReadArrayNS unsigned char address int nBytes unsigned char ReadArray Delphi I2CReadArrayNS address byte nBytes integer var ReadData byte byte VB I2CReadArrayNS ByVal address As Byte ByVal nBytes As Long ByRef ReadData As Byte As Byte Acknowledge No Acknowledge from Slave from Master F Address ES Data Start R nBytes Stop I2CReadArrayNS The I2CReadByte function reads one byte from PC Bus SMBus device The function takes the device address and a pointer to a memory location to store the data byte I2CReadByte returns any error condition it encounters The function ensures that the Isb of the address is a 1 before it is sent to the target device 1 LPT to I2C SE Professional C C unsigned char I2CReadByte unsigned char address unsigned char ReadData Delphi I2CReadByte address byte var ReadData byte b
7. handled appropriately Private Sub Commandl Click Dim ErrorCode As Byte Dim ReadData As Byte Dim Init As Boolean iaequemeye ssim ee Init CheckDriverStatus Check to ensure that the hardware driver has been Init HardwareDetect loaded successfully and the hardware is detected Init SetLPTNumber 1 Set the LPT Number Frequency SetI2CFrequency 50 Set the I C clock frequency to 50KHz ErrorCode I2CStart Generate I C Start Condition ErrorCode I2CWrite 160 Send the EEPROM address in this case ErrorCode I2CWrite 0 Send the subaddress ErrorCode I2CWrite 0 Send first data byte ErrorCode I2CWrite 1 Send second data byte ErrorCode I2CStop Generate I C Stop Condition milliseconds 10 wait 40ms for th rase write cycle to complete ErrorCode I2CStart Generate I C Start Condition ErrorCode I2CWrite 160 Send the EEPROM write address in this case OxAE ErrorCode I2CWrite 0 Send the subaddress ErrorCode I2CStart Generate I C Start Condition ErrorCode I2CWrite 161 Send the EEPROM read address in this case OxAF ErrorCode I2CRead false ReadData Read one byte not last byte abell Caption Int ReadData ErrorCode I2CRead true ReadData Read one byte last byte abel2 Caption Int ReadData ErrorCode I2CStop Generate Stop Condition End Sub VOC SSeS IS LPT to I2C SE Professional Delphi Exa
8. LPT to I2C SE Professional C Made Simple 2 and SMBus Control DLL User s Manual Version 4 Date November 1 2008 LPT to I2C SE Professional Information provided in this document is solely for use with LPT to I2C SE Professional SB Solutions Inc reserves the right to make changes or improvements to this document at any time without notice We assume no liability whatsoever in the sale or use of this product including infringement of any patent or copyright No part of this document may be reproduced or transmitted in any form or by any means electronic or mechanical for any purpose without the express written permission of SB Solutions Inc Microsoft Visual Basic Windows and Windows NT are registered trademarks of Microsoft Corporation Other brand names are trademarks or registered trademarks of their respective owners Questions or comments regarding this document should be emailed to support i2ctools com Suggestions for enhancements should be emailed to support i2ctools com 2008 SB Solutions Inc All rights reserved Revision 4 Nov 08 MCS SS PFE IL Se gt LPT to I2C SE Professional Table of Contents IlGPROTOCOIBE 2 3 NOME AS Me De GENERAWCHARACTERIST ICSE EL sco c e s s n 5 Bil RANSRER SR mie NS e ees INE s 5 START AND STOPIGONDIMIONS eee ae ae 5 ADDRESS yc M eem 0 era
9. LPT to I2C SE device pull down menu Note that when installing the software to a Win32 or Win64 system you must have Administrator privileges or the parallel port drivers will not be loaded correctly After the software has successfully been installed normal user privileges can be restored Users who do not install with Administrator privileges commonly encounter a Privileged Instruction error If you see this error message please log back on as the Administrator and reinstall the software LPT to I2C SE Professional Most programming languages such as Visual C Delphi C Builder and Visual Basic can use the stdcall calling convention The stdcall convention passes the parameters to the functions in the dll from right to left and it is up to the called functions in this case the functions in LPTtoI2CSEpro dll to clean up the stack This function takes the LPT address and returns an LPT number The AddLPTPort function is only needed when PCI based parallel port add in card needs to be used rather than the standard parallel ports found on a PC The LPTaddress can be found in Device Manager within Windows Control Panel Hear E unsigned char AddLPTPort short int LPTaddress Delphi AddLPTPort LPTaddress word byte VB AddLPTPort ByVal LPTaddress As Integer As Byte This function takes no argument and returns the current state of the hardware driver The result is true non zero when the d
10. MB of free HDD space CD ROM drive used for installation only Y Bi directional Parallel Port DB 25 LPT port or PCI based LPT add in card e LPT to I2C SE Professional installation CD ROM e Parallel Port adapter with 256 byte EEPROM Files installed for LPT to I2C SE Professional LPT to I2CSEpro dll this is the actual dll file you will link to your application The installation process places this file in the appropriate Windows WSystem folder LPT toI2C SE Professional User s Manual this document Visual C Delphi C Builder and Visual Basic example files LPT to I2C SE exe application LPT to I2C SE Software User s Manual pdf TVICHW32 SYS installed in the Windows WSystem32 directory TVICHW32 VXD installed in the Windows System directory TVicHW32 DLL installed for all operating systems Getting Started with LPT to I2C SE pdf LPT to I2C SE Hardware User s Manual pdf Software license agreement license txt Registration Form RegFile txt The LPTtoI2CSEpro dll is placed in the Windows System32 directory during installation After LPT to I2C SE Professional has been installed on your hard disk the installation of the driver can be tested with the included LPT to I2C SE application The hardware should be inserted into an available parallel port and then the application can be started If the installation was successful you should be able to read and write from the on board EEPROM using the 256x8 EEPROM from the
11. SetI2CFrequency int frequency Delphi SetI2CFrequency frequency integer integer VB SetlI2Cfrequency ByVal frequency As Long As Long If you have more than one parallel port in your computer you can choose which parallel port to communicate with by using the SetLPTNumber function The function allows you to choose values 1 2 or 3 corresponding to LPT1 LPT2 and LPT3 respectively The 16 bit Boolean return value is true non zero if the parallel port was detected and set to the value passed to the function while it returns false 0 if the chosen parallel port was not available The dll initialization routine attempts to set the active parallel port to LPTI C C short int SetLPTNumber unsigned char LPT Delphi SetLPTNumber LPT byte wordbool VB SetLPT ByVal LPT As Byte As Boolean The SetSlowMode function is only available for backward compatibility Only Slow access mode is available Norma access is no longer supported short int SetSlowMode void Delphi SetSlowMode wordbool VB SetSlowMode As Boolean The PC Bus specification does not specify the amount of time that a device can hold the clock line low to inject a wait hold state in a transmission In order to ensure that the software responds in a predictable manner LPTotI2CSEpro dll has arbitrarily set the maximum wait time between the time it releases the clock and the time that any device holding the clock
12. VB PulseHigh Allows the user to change the state of the SCL pin The state of the SCL pin is returned C C short int SCL Control short int SCL state Delphi SCL Control SCL state wordbool wordbool VB SCL Control ByVal SCL state As Boolean As Boolean Allows the user to change the state of the SDA pin The state of the SDA pin is returned C C short int SDA Control short int SDA State Delphi SDA Control SDA State wordbool wordbool VB SDA Control ByVal SDA state As Boolean As Boolean MOI SSeS ee 1 6 LPT to I2C SE Professional SetNormalMode The SetNormalMode function is only available for backward compatibility Only Slow access mode is available C C short int SetNormalMode void Delphi SetNormalMode wordbool VB SetNormalMode As Boolean This function sets the PC clock frequency to the value passed by the user s program The frequency must be a positive integer If a frequency is selected which is above the maximum frequency use GetMaxFrequency to determine the value the dll will set the frequency to the maximum PC frequency The function returns the measured frequency It is important to note that although we expect better than 5 tolerance on the frequency the actual frequency generated by LPT to I2C SE Professional cannot be guaranteed If an accurate frequency is needed it is recommended that the frequency be verified using test equipment C C int
13. Write or Read before it is sent to the target device unsigned char I2CReadArray unsigned char address unsigned char subaddress int nBytes unsigned char ReadData Delphi I2CReadArray address subaddress byte nBytes integer VB var ReadData byte I2CReadArray ByVal address As Byte ByVal subaddress As Byte nBytes As Long ByRef ReadData As Byte As Byte Acknowledge Acknowledge Acknowledge Acknowledge from Slave from Slave from Slave from Master J DENS EXER TAE ReStart I2CReadArray C C Delphi The I2CReadArrayDB function takes five arguments the device address the high byte of the device subaddress the low byte of the device subaddress the number of bytes to read and a pointer to an element within an array of bytes I2CReadArrayDB sends the message shown below and returns any error condition it encounters It is the calling program s responsibility to allocate the correct memory space for the array The function ensures that the lsb of the address is appropriate 1 or 0 depending on Write or Read before it is sent to the target device This function is useful for communicating with large eeproms that use a two byte subaddressing scheme uchar I2CReadArrayDB uchar address uchar subaddressHigh uchar subaddressLow int nBytes uchar ReadData I2CReadArrayDB address subaddressHigh subaddressLow byte nBytes integer var ReadData byte byte I2CReadAr
14. d short int LastByte unsigned char ReadData Delphi I2CRead LastByte wordbool var ReadData byte byte VB I2CRead ByVal LastByte As Boolean ByRef ReadData As Byte As Byte This function reads one bit from the PC bus and places it in the least significant bit of the memory location specified by ReadData The returned value contains the error condition See Error Codes section for return values These bit functions I2CWriteBit and I2CReadBit are useful for testing for error conditions For example how does a device on the bus react to a misplaced Stop or Start condition This can be simulated by sending out a Start followed by four data bits and then another Start or Stop condition An example using I2CReadBit and I2CWriteBit is included in the installation package C C unsigned char I2CReadBit unsigned char ReadData Delphi I2CReadBit var ReadData byte byte VB I2CReadBit ByRef ReadData As Byte As Byte The I2CReadArray function takes four arguments the device address the device subaddress the number of bytes to read and a pointer to an element within an array of bytes I2CReadArray sends the PC message shown below and returns any error condition it encounters It is the calling program s responsibility to allocate LPT to I2C SE Professional the correct memory space for the array The function ensures that the 150 of the address is appropriate 1 or 0 depending on
15. erst ase Condi tester ErrorCode I2CWrite A0 the EEPROM address in this case ErrorCode I2CWrite 00 Send the subaddress ErrorCode I2CWrite 00 Send first data byte ErrorCode I2CWrite 01 Send second data byte ErrorCode I2CStop Generate I C Stop Condition milliseconds 10 wait 10ms for th rase write cycle to complete e 2 p Genernatey Start Condition ErrorCode I2CWrite A0 Send the EEPROM write address in this case ErrorCode I12CWrite 500 Send the subaddress 1 Start Generace 1 C Start Condition ErrorCode I2CWrite A1 Send the EEPROM read address in this case 1 ErrorCode I12CRead false ReadData Read one byte from the EEPROM not last byte abell Caption IntToStr ReadData ErrorCode I2CRead true Read one byte from the EEPROM last byte abel2 Caption IntToStr ReadData ErrorCode I2CStop Generate I C Stop Condition end else ShowMessage Driver not started end LL 60
16. ess acts like a pointer to the register that needs to be accessed Data Transfer Every byte on the SDA line must be 8 bits long The number of bytes that can be transmitted per transfer is unrestricted Each byte must also be followed by an acknowledge bit Data is transferred with the most significant bit first If a receiver can t receive another complete byte of data until it has performed some other function it can hold the clock line SCL low to force the transmitter into a wait state Although the PC specification does not specify a maximum wait state LPT to I2C SE Professional has set a default maximum wait state length of approximately 50ms This value may be changed by using the SetWaitTime function Acknowledge The acknowledge related clock pulse is generated by the master LPT to I2C SE Professional is always the bus masters The transmitter releases the SDA line during the acknowledge clock pulse The receiver must pull down the SDA line during the acknowledge clock pulse so that it remains stable low during the high period of the clock pulse The master receiver signals the end of a read by not acknowledging the last byte it requires 2 Bus Documentation The complete PC Bus specification can be found at http www nxp com products interface_control i2c VCS 8 LPT to I2C SE Professional v PC with a Pentium 60 and 8MB RAM better v Windows 95 98 ME NT4 2000 XP XP64 Vista and Vista64 6
17. ines a STOP condition The master always generates START and STOP conditions The bus is considered to be busy after the START condition The bus is considered to be free again a certain time after the STOP condition 2 Address The first seven bits of an transmission after a Start condition make up the slave address The eighth bit or the least significant bit is the R W bit that determines the direction of the message 0 in the least significant position of the first byte means that the master will WRITE information to the selected slave A 1 in this position means that the master will READ information from the slave When an PC address is sent each device in a system compares the first seven bits after the START condition SEP HG ae LPT to I2C SE Professional with its own address If they match the device considers itself addressed by the master as a slave receiver or slave transmitter depending on the R W bit When transmitting an address using LPT to I2CSEpro dll the user should use the I2CWrite function and then ensure that the correct least significant bit has been appended 1 for read 0 for write See the Examples section for further information Subaddress When device contains more than one register the various registers are generally accessed using a subaddress that is sent following the device address see the WriteArray and ReadArray sections below The subaddr
18. line low must release the bus as 50ms If this time is exceeded the dll will exit the function The SetWaitTime function allows the user to change the maximum wait hold times for the situation where a slow device needs more than the 50ms initialized by the dll The function returns the value set by the function The minimum time allowed by the function is 5ms C C int SetWaitTime int NewWaitTime Delphi SetWaitTime NewWaitTime integer integer VB SetWaitTime ByVal NewWaitTime As Long As Long M Ie LPT to I2C SE Professional Startl2CDriver Loads the virtual device driver or the kernel mode device driver providing direct access to the LPT ports If the driver was successfully started the function returns True if the function fails it returns False The StartI2CDriver function does not actually need a value of 0 or 1 sent to it as previously required This is only included for backwards compatibility Any integer value may be sent C C short int StartI2CDriver int device Delphi StartI2CDriver device integer wordbool VB StartI2CDriver ByVal device As Long As Boolean Closes the kernel mode driver and releases memory allocated to it It is highly recommended that this function be called before an application is terminated C void StopI2CDriver void Delphi StopI2CDriver VB St
19. mple This example writes two bytes to an EEPROM located on the LPT to I2C SE hardware and then reads them back Before writing or reading it is best to go through an initialization process to ensure everything is functioning correctly This example code shows the minimum functionality and it is up to the user to ensure the returned error codes are handled appropriately In order to use the dll functions they must be imported into the calling program The easiest way to do this is to add the I2Cdeclarations pas file included with LPT to I2C SE Pro to your project by placing this file in the same folder as your project and then using the Add to Project menu item from the Project menu in Delphi You must also add I2Cdeclarations statement in the uses clause of your application see example in the Delphi folder which was installed with LPT to I2C SE Professional procedure TDLLForm btnWriteandRead Sender TObject var ErrorCode ReadData byte TORTOR WO cB Freq integer begin if CheckDriverStatus then Check to ensure that the hardware driver has been begin loaded successfully InitOK HardwareDetect A heck uires the Nardwasemiss eee cbe clt InitOK SetLPTNumber 1 Set the LPT Number Freq SetI2CFrequency 50 Set the I C clock frequency to 50KHz It is not necessary to set the frequency since it defaults to 10KHz at start up Bes
20. ofessional hardware Adapter The function returns a 1 if high and a 0 if low C C int InputState void Delphi InputState integer VB 2 5 The milliseconds delay function allows the user to program delay measured in milliseconds into messages This is particularly useful when programming EEPROM devices that require a minimum erase write time between write transactions C C void milliseconds int Data Delphi milliseconds Data integer VB milliseconds ByVal Data As Long Sends a high or low level to the OUT pin of the LPT to I2C SE Professional Adapter The function takes a 1 for a high level and a 0 for a low level Valid values 0 1 All other values will be ignored C C void Trigger int OutputState Delphi Trigger OutputState integer VB Trigger ByVal OutputState As Long Sends a short low level pulse on the OUT pin of the LPT to I2C SE Professional Adapter followed by a high level The function does not check the intial state of the OUT to ensure it is high before beginning C C void Trigger void Delphi PulseLow VB PulseLow Sends a short high level pulse on the OUT pin of the LPT to I2C SE Professional Adapter followed by a low level The function does not check the intial state of the OUT to ensure it is low before beginning C C void PulseHigh void Delphi PulseHigh
21. opI2CDriver M ee LPT to I2C SE Professional The following error codes are returned by the various functions in LPT to I2CSEpro dll 0x00 No error 0x01 Address not acknowledged only valid for I2CWriteByte I2CReadByte I2CWriteArray and I2CReadArray functions 0x02 Acknowledge not received 0x03 Read acknowledge corrupted should be a 1 but 0 was found 0x04 SCL SDA stuck low both lines found low while they should be high 0x08 SDA stuck low SDA line could not be set to a logic 1 0x09 SDA stuck high SDA line could not be set to a logic 0 SCL stuck high SCL line could not be set to a logic 0 SDA and SCL stuck high both SDA and SCL could not be set low 0x80 S eI sic lowe SCL lime set co al logic OxFF Hardware not detected MUI rM LPT to I2C SE Professional Visual Basic Example This example writes two bytes to the EEPROM located on the LPT to I2C SE hardware and then reads them back In order to use the dll functions they must be imported into the calling program Add the Modulel bas file included with LPT to I2CSEpro dll into your project See the Visual Basic example included with LPTtoI2C SE Professional The following code example writes two bytes to an EEPROM and then reads them back The user should ensure that the error codes returned from the functions are
22. ow does a device on the bus react to a misplaced Stop or Start condition This can be simulated by sending out a Start followed by four data bits and then another Start or Stop condition An example using I2CReadBit and I2CWriteBit is included in the installation package C C unsigned char I2CWriteBit unsigned char DataByte ea SS aaa Che LPT to I2C SE Professional Delphi I2CWriteBit DataByte byte byte VB I2CWriteBit ByVal DataByte As Byte As Byte The I2CWriteArray takes four parameters device address device subaddress number of bytes to be sent and a pointer to an element within an array of bytes It is up to the calling program to correctly define the array of memory to store the data The function ensures that the lsb of the address is 0 before it is sent to the target device The function returns any error condition it encounters See Error Code section for return values unsigned char I2CWriteArray unsigned char address unsigned char subaddress int nBytes unsigned char WriteData Delphi I2CWriteArray address subaddress byte nBytes integer VB var WriteData byte byte I2CWriteArray ByVal address As Byte ByVal subaddress As Byte ByVal nBytes As Long ByRef WriteData As Byte As Byte Acknowledge Acknowledge Acknowledge from Slave from Slave from Slave J Address Data ENT Ww I2CWriteArray C C Delphi The I2CWriteArrayDB
23. rayDB ByVal address As Byte ByVal subaddressHigh As Byte ByVal subaddressLow As Byte ByVal nBytes As Long ByRef ReadData As Byte As Byte Acknowledge Acknowledge Acknowledge Acknowledge Acknowledge from Slave from Slave from Slave from Slave from Master 5 Address SubaddressHigh I Y SubaddressLow fF Address A Daa LE ReStart I2CReadArrayDB The I2C10ReadArray function read an array with 10 bit device addressing is similar to the I2CReadArray function however it uses 10 bit PC addressing The specification states that the 10 bit address has the following format First byte 1111 R W bit Oc SS eS 10 LPT to I2C SE Professional Second byte xxxx xxxx where the 10 bits of address The function takes the received 16 bit address data and uses the lower 10 bits to generate the proper 10 bit PC compliant format A subaddress is also sent after the second byte of the address not shown in diagram below Acknowledge Acknowledge Acknowledge No Acknowledge from Slave from Slave from Slave from Host 1111 Oxx 1111 Oxx ReStart I2C 10ReadArray C C unsigned char I2ClO0ReadArray short int address unsigned char subaddress int nBytes unsigned char ReadData Delphi I2Cl0ReadArray address word subaddress byte nBytes integer var ReadData byte VB I2C10ReadArray ByVal address As Integer ByVal subaddress As Byte nBytes As Long ByRef ReadData As Byte
24. ress The function takes the received 16 bit address data and uses the lower 10 bits to generate the proper 10 bit compliant format A subaddress is also sent after the second byte of the address not shown in diagram below followed by the data C C unsigned char 12C1l0WriteArray short int address unsigned char subaddress int nBytes unsigned char WriteData Delphi I2Cl10WriteArray address word subaddress byte nBytes integer var WriteData byte byte VB I2C10WriteArray ByVal address As Integer ByVal subaddress As Byte ByVal nBytes As Long ByRef WriteData As Byte As Byte Acknowledge Acknowledge Acknowledge from Slave from Slave from Slave 1111 Oxx J TES w 12C10WriteArray The I2CWriteByte function writes one data byte to an PC bus device The function takes two parameters the device address and a single data byte and returns any error condition it encounters see Error Codes section The function ensures that the Isb of the address is a 0 before it is sent to the target device C C unsigned char I2CWriteByte unsigned char address unsigned char Data Delphi I2CWriteByte address Data byte byte VB I2CWriteByte ByVal address As Byte ByVal Data As Byte As Byte Acknowledge Acknowledge from Slave from Slave J DEN oom EN Start Stop I2CWriteByte HEU M ME LPT to I2C SE Professional Reads the state of the IN port on the LPT to I2C SE Pr
25. river is functioning normally and 0 false is if the driver is not started or cannot be started Use this function to ensure that the driver is active before attempting any PC communications Ctt short int CheckDriverStatus void Delphi CheckDriverStatus WordBool VB CheckDriverStatus As Boolean The GetAccessMode function is available for backwards compatibility only The function always returns false which indicates Slow access C C short int GetAccessMode void Delphi GetAccessMode WordBool VB GetAccessMode As Boolean This function takes no arguments and returns the current PC clock frequency C C int GetI2CFrequency void Delphi GetI2CFrequency integer VB GetI2CFrequency As Long The computer s parallel ports have a physical address that can be found using the GetLPTAddress function This function takes no arguments and returns a two byte unsigned integer containing the LPT address Using this function is not required but is available for the user s information short int GetLPTAddress void Delphi GetLPTAddress word GetLPTAddress As Integer 5 The GetLPTNumber function takes no arguments and returns the value of the currently selected parallel port O1 487 LPT to I2C SE Professional The function returns 1 2 or 3 corresponding to LPT1 LPT2 and LPT3 respectively C C unsigned char GetLPTNumbr void Delphi GetLPTNumber byte
26. yte VB I2CReadByte ByVal address As Byte ByRef ReadData As Byte As Byte Acknowledge No Acknowledge from Slave from Master Sp aues EN v Start R Stop I2CReadByte This function takes no arguments and generates an PC Start Condition via the parallel port The function returns any error condition it encounters If the hardware has not been detected the Start condition will not be performed See Error Code section for return values C C unsigned char I2CStart void Delphi I2CStart byte VB I2CStart As Byte This function generates an PC Stop Condition via the parallel port The function returns any error condition it encounters during the transmission See Error Code section for return values C C unsigned char I2CStop void Delphi I2CStop byte VB I2CStop As Byte This function writes one byte passed by the calling program to the PC Bus via the parallel port The function returns any error condition it encounters during the transmission See Error Code section for return values C C unsigned char I2CWrite unsigned char DataByte Delphi I2CWrite DataByte byte byte VB I2CWrite ByVal DataByte As Byte As Byte This function takes on byte and writes the most significant bit to the PC bus The returned value contains the error condition See Error Codes section for return values These bit functions I2CWriteBit and I2CReadBit are useful for testing for error conditions For example h
Download Pdf Manuals
Related Search
Related Contents
56F827 - Freescale Semiconductor E-Z 96 Plant DNA Kit Mode d`emploi secours populaire ZTE Telstra Tough T54 Unlocked Gsm Phone MANUEL D`UTILISATION Type SS Copyright © All rights reserved.
Failed to retrieve file