1.1.11.16 I2CSMBx_HostWriteReadBlock Function

C

/* x = I2C SMBUS peripheral instance number */

/* I2C SMBUS Host mode */

void I2CSMBx_HostWriteReadBlock(uint8_t address, uint8_t cmd, void* pWrdata, uint32_t nWrBytes)

Summary

Writes a block of data and then reads a block of data from the slave

Description

Writes a block of data and then reads a block of data from the slave

Precondition

I2CSMBx_Initialize must have been called for the associated I2C instance.

Parameters

Param Description
address 7-bit / 10-bit slave address.
cmd command byte
pWrdata pointer to write data buffer
nWrBytes Number of bytes to write

Returns

None

Example

#define HOST_CMD_WRITE_READ_BLOCK 6
uint8_t wrBuffer[50] = {0};

I2CSMB0_HostWriteReadBlock(I2C_SLAVE_ADDR, HOST_CMD_WRITE_READ_BLOCK, wrBuffer, 32);

Remarks

None