Calibre UK UCA93 manual Int NoBytesToSend, Int NoTries, Int DataVal, Returns an unused integer

Page 13

 

 

 

CALIBRE

 

3.3.9.

BlockWrite

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Function specification

void BlockWrite(int SlaveWriteAddress, int MSB_WordAddress, int

Parameters are:

LSB_WordAddress,int NoBytesToSend, int NoTries )

int SlaveAddress

 

 

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

 

 

int MSB_WordAddress, int LSB_WordAddress

 

 

This is the location within the slave for the data. The use of two bytes allows

 

 

users to communicate with devices requiring two byte pointers e.g. 24C64

 

 

EEPROMS. If one (or both) of the word addresses are not required set the

 

 

value to a number greater than 255 and it will not be transmitted.

 

 

int NoBytesToSend

 

 

The number of bytes to be sent which MUST be pre loaded into the driver

 

 

buffers. The maximum size of this buffer is 2048 exceeding this WILL cause

 

 

the data to be corrupted.

 

 

Int NoTries

 

 

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

Parameters returned

None.

Prerequisites

Adapter must be configured using Setup. The data MUST be loaded into the

 

 

driver buffers PRIOR to calling this functions (see SetBlockData).

Functional description

This function causes the Adapter to send a block of data via the I2C bus.

3.3.10.SetBlockData

Function specification

int SetBlockData(int DataVal)

Parameters are:

Int DataVal

Parameters returned

Returns an unused integer.

Prerequisites

Adapter must be configured using setup.

Functional description

This stores data in the driver buffers read to be sent by the BlockWrite function.

 

MAXIMUM DATA SIZE 2048 bytes.

3.3.11.BlockWriteStatus

Function specification

int BlockWriteStatus (void))

 

 

 

Parameters are:

None

 

 

 

 

 

Parameters returned

int TransferStatus.

 

 

 

 

 

Returns 0 if the transfer has not been completed.

 

 

 

Returns the I2C Bus status if the transfer is completed.

 

 

Returns 9009H if the transfer time out.

 

 

 

Prerequisites

Adapter must be configured using Setup. Data must have been sent using the

 

BlockWrite function.

 

 

 

 

Functional description

Returns the current status of the BlockWrite transfer NOTE this function will

 

 

time out if the block is not sent in NoBytes / 100 seconds (or 1 second which

 

3.3.12. BlockRead

ever is the greater).

 

 

 

 

 

 

 

 

 

 

Function specification

void

BlockRead(int

SlaveAddress,

int

MSB_WordAddress,

int

Parameters are:

LSB_WordAddress, int NoBytesToRead, int NoTries )

 

int SlaveAddress

 

 

 

 

 

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

 

is a read address then the Word Addresses WILL NOT be sent.

 

 

int MSB_WordAddress, int LSB_WordAddress

 

 

 

This is the location within the slave for the data. The use of two bytes allows

 

users to communicate with devices requiring two byte pointers e.g. 24C64

 

EEPROMS. If one (or both) of the word addresses are not required set the

 

value to a number greater than 255 and it will not be transmitted.

 

 

int NoBytesToRead

 

 

 

 

 

The number of bytes to be sent which MUST be pre loaded into the driver

 

buffers. The maximum size of this buffer is 2048 exceeding this WILL cause

 

the data to be corrupted.

 

 

 

 

 

Int NoTries

 

 

 

 

Issue 1.0

 

 

 

 

Page 10

 

01/07/03

 

 

 

 

 

 

Image 13
Contents Calibre Calibre Contents General Introduction Connecting the Adapter to your SystemPacking List Bus Termination and ProtectionBus Capacitance Limitations/Cable Choice Variable Voltage Bus Power SupplyIntroduction Installing the AdapterLibraries for Programming in Microsoft Windows Environments Function Prototypes Calibre Int ownaddress Int SlaveBlockTimeoutInt ClockSpeed Int BusVoltageSendAddress Int DataByteInt I2CData NoneInt I2Cstatus Using the AdapterInt NoTries Int NoBytesToSendInt DataVal Returns an unused integerInt RdData Int TimeoutInt NoBytesToTransmit Int NoBytesToReceive Int PullupVoltage Int Int IOStateSendAddressNoStatus WriteByteNoStatus Stop Real-Time Bus MonitorAppendix a I2C Communications Adapter Status Codes Bit 4 The BER Bus Error BitBit 7 MSB The old PIN Bit Bit 5 The old STS BitPolling the Status Register and how to avoid it USB Bus CharacteristicsBlock Functions Block Write FunctionSlave Receiver Function Slave Transmitter FunctionCalibre Question Get corrupted transfers why is this? When the the Most Commonly Asked I2C QuestionsGeneral Questions Question Do you have software to talk to my........?