Calibre UK PICA93LV Manual De Usuario

Descargar
Página de 35
CALIBRE
Issue 1.3
 
Page 22
22/07/99
Parameters returned
int ErrCode.
If the transfer time out occurs error code 8004H is returned otherwise the
status is returned.
Prerequisites 
Adapter must be configured using setup, start and write address sent by
sendaddress.
Functional description  The function writes the data to the adapter and then waits for it to be sent.
Should a time-out occur during the sending of the data then error code 8004H
is returned, otherwise the status is returned.
Writebyte is compatible with both master write and slave write modes.
4.4.7.
readbyte
Function specification
Int readbyte(int setnack)
Parameters are:
int setnack
This controls whether the Parallel I2C Communications Adapter transmits an
Acknowledge down the I2C Bus on reception of a byte. The last byte received
during a transfer must not be acknowledged, in all other cases acknowledge
must be enabled. If setnack = 0 then acknowledge is enabled, if setnack = 1
then acknowledge is disabled. Therefore, if a read (odd numbered) address is
being sent AND only 1 Byte is to be read, setnack should be set to = 1; in all
other cases it must be clear = 0.
Parameters returned
int I2CData
The data read, if a time-out occurs the ErrCode 8005H is returned.
Prerequisites 
Adapter must be configured using setup, start and read address sent by
sendaddress.
Functional description  If setnack is 1 the function writes 40H to the control register to establish the
correct acknowledge procedure.
The data is read from the adapter.
Should a time-out occur then an error code 8005H is returned, otherwise the
data is returned.
Readbyte is compatible with both master read and slave read modes.
4.4.8.
sendstop
Function specification
Int sendstop( )
Parameters are:
None.
Parameters returned
int ErrCode.
If the transfer time out occurs error code 8002H is returned otherwise the
status is returned.
Prerequisites
Adapter must be configured using setup. Should normally only be used at the
end of a transmission. Correct acknowledge sequence must have been
applied if the transmission was a read.
Functional description
Instruct the adapter to send a stop code and wait for it to be sent.
Should a time-out occur during the sending of a stop then an error code
8002H is returned, otherwise the status is returned.