Calibre UK UCA93 manual Int SlaveAddress, SendAddressNoStatus

Page 18

CALIBRE

3.3.23.SendAddressNoStatus

Function specification

void SendAddressNoStatus(int SlaveAddress, int SetNack, int NoTries)

Parameters are:

int SlaveAddress

 

This is the address to be accessed via the I2C, e.g. A0H.

 

int SetNack

 

This controls whether the 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.

 

Normally there will be another transfer (data read or write) after the

 

SendAddress and so SetNack should be enabled (0);

 

Int NoTries

 

This is the number of times the Adapter is to try to send the address.

Parameters returned

None.

Prerequisites

The Adapter must be configured by running Setup.

Functional description

The function waits for the bus to be free. Then sends the slave address with the

 

appropriate acknowledge.

 

The acknowledge must equal 0.

 

The function will generate a start and send the address. If the slave does not

 

acknowledge then the Adapter will generate a stop. It will try to send the

 

address a number of times equal to NoTries.

3.3.24.WriteByteNoStatus

Function specification

void WriteByteNoStatus(int DataByte)

Parameters are:

int DataByte

 

This is the byte of data to be written.

Parameters returned

None.

Prerequisites

Adapter must be configured using Setup, start and write address sent by

 

SendAddressNoStatus.

Functional description

The function writes the data to the Adapter and then waits for it to be sent.

 

WriteByteNoStatus is compatible with both master write and slave write modes.

3.3.25.ReadByteNoStatus

Function specification

Int ReadByte(int SetNack)

Parameters are:

int SetNack

 

This controls whether the 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

Parameters returned

then acknowledge is enabled, if SetNack = 1 then acknowledge is disabled.

None

Prerequisites

Adapter must be configured using Setup, start and read address sent by

 

SendAddressNoStatus.

Functional description

The data is read from the Adapter.

 

ReadByteNoStatus is compatible with both master read and slave read modes.

3.3.26.SendStopNoStatus

Function specification

void SendStopNoStatus(void)

Parameters are:

None

Parameters returned

None.

Prerequisites

Adapter must be configured using Setup. Should normally only be used at the

 

end of a transmission.

Functional description

Instructs the Adapter to send a stop code and wait for it to be sent.

Issue 1.0

Page 15

01/07/03

 

Image 18
Contents Calibre Calibre Contents Packing List Connecting the Adapter to your SystemGeneral Introduction Bus Termination and ProtectionVariable Voltage Bus Power Supply Bus Capacitance Limitations/Cable ChoiceInstalling the Adapter IntroductionLibraries for Programming in Microsoft Windows Environments Function Prototypes Calibre Int ClockSpeed Int SlaveBlockTimeoutInt ownaddress Int BusVoltageInt I2CData Int DataByteSendAddress NoneUsing the Adapter Int I2CstatusInt DataVal Int NoBytesToSendInt NoTries Returns an unused integerInt Timeout Int RdDataInt NoBytesToTransmit Int NoBytesToReceive Int PullupVoltage Int IOState IntSendAddressNoStatus WriteByteNoStatus Real-Time Bus Monitor StopBit 7 MSB The old PIN Bit Bit 4 The BER Bus Error BitAppendix a I2C Communications Adapter Status Codes Bit 5 The old STS BitBlock Functions USB Bus CharacteristicsPolling the Status Register and how to avoid it Block Write FunctionSlave Transmitter Function Slave Receiver FunctionCalibre General Questions When the the Most Commonly Asked I2C QuestionsQuestion Get corrupted transfers why is this? Question Do you have software to talk to my........?