1.1.11.19 I2CSMBx_HostWriteBlock Function

C

/* x = I2C SMBUS peripheral instance number */

/* I2C SMBUS Host mode */

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

Summary

Writes a block of data to the slave.

Description

This function forms a block write packet and initiates the transfer

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 the buffer containing the data bytes
nWrBytes Number of bytes to write

Returns

None

Example

#define HOST_CMD_WRITE_BYTE 2

for (uint32_t i = 0; i < 32; i++)
{
    wrBuffer[i] = i+1;
}
I2CSMB0_HostWriteBlock(I2C_SLAVE_ADDR, HOST_CMD_WRITE_BLOCK, wrBuffer, 32);

Remarks

None