1.35.18.11 TWIHSx_IsBusy Function

C

/* x = TWIHS instance number */

/* TWIHS master mode and slave with interrupt enabled */
bool TWIHSx_IsBusy(void)

Summary

Returns the peripheral busy status

Description

TWIHS master mode

In master mode, this function returns true if the TWIHSx module is busy with a transfer. The application can use this function to check if TWIHSx 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.

TWIHS 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 TWIHS transfer is in progress.

Precondition

TWIHSx_Initialize must have been called for the associated TWIHS instance.

Parameters

None.

Returns

true - Busy

false - Not busy

Example

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

Remarks

None