Blockwrite, Setblockdata, Blockwritestatus – Calibre UK UCA93 User Manual

Page 13: Blockread, Calibre

Advertising
background image

CALIBRE

Issue 1.0

Page 10

01/07/03

3.3.9.

BlockWrite

Function specification

void BlockWrite(int SlaveWriteAddress, int MSB_WordAddress, int
LSB_WordAddress,int NoBytesToSend, int NoTries )

Parameters are:

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
ever is the greater).

3.3.12.

BlockRead

Function

specification

void BlockRead(int SlaveAddress, int MSB_WordAddress, int
LSB_WordAddress, int NoBytesToRead, int NoTries )

Parameters are:

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

Advertising