1.1.11.10 I2CSMBx_IsBusy Function

C

/* x = I2C SMBUS peripheral instance number */

bool I2CSMBx_IsBusy(void)

Summary

Returns the Peripheral busy status.

Description

I2C master mode

In master mode, this function returns true if the I2CSMBx module is busy with a transfer. The application can use this function to check if I2CSMBx module is busy before calling any of the data transfer functions. The library does not allow a data transfer operation if another transfer operation is already in progress.

I2C slave mode

In slave mode, the function returns true if a start bit has been detected last on the bus by the peripheral. The application can use this API to ensure no I2C transfer is in progress.

Precondition

I2CSMBx_Initialize must have been called for the associated I2C instance.

Parameters

None.

Returns

true - Busy

false - Not busy

Example

// wait for the current transfer to complete
while(I2CSMB0_IsBusy());

Remarks

None.