1.35.17.5 TWIx_IsBusy Function

C

/* x = TWI instance number */

/* TWI master mode */
bool TWIx_IsBusy(void)

Summary

Returns the TWI Peripheral busy status.

Description

This function returns true if TWI module is busy with a transfer. The application can use this function to check if 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.

Precondition

TWIx_Initialize must have been called for the associated TWI instance.

Parameters

None.

Returns

true - Busy

false - Not busy

Example

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

Remarks

None