1.2.21.67 1.3.25.67 1.4.21.67 1.5.25.67 1.6.22.67 1.7.23.67 1.9.19.67 1.29.23.67 1.30.18.67 1.31.18.67 1.32.26.67 1.33.16.67 1.37.18.67 1.38.21.67 1.39.18.67 1.40.20.67 SERCOMx_I2C_IsBusy Function

C

/* x = SERCOM instance number */

/* I2C master mode and slave in interrupt mode */

bool SERCOMx_I2C_IsBusy(void)	

Summary

Returns the Peripheral busy status

Description

I2C master mode

In master mode, this function returns true if the FLEXCOMx TWI module is busy with a transfer. The application can use this function to check if FLEXCOMx TWI 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 as soon as the address match event occurs and returns false after a STOP bit has been detected. The application can use this API to ensure no TWI transfer is in progress.

Precondition

SERCOMx_I2C_Initialize must have been called for the associated SERCOM instance.

Parameters

None.

Returns

Param Description
true Busy
false Not busy

Example

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

Remarks

None.