static inline bool TWI_WaitTransferComplete(Twi *_twi, uint32_t _timeout) { while (!TWI_TransferComplete(_twi)) { if (TWI_FailedAcknowledge(_twi)) return false; if (--_timeout == 0) return false; } return true; }
static inline bool TWI_WaitByteReceived(Twi *_twi, uint32_t _timeout) { while (!TWI_ByteReceived(_twi)) { if (TWI_FailedAcknowledge(_twi)) return false; if (--_timeout == 0) return false; } return true; }
static inline bool TWI_WaitByteSent(Twi *_twi, uint32_t _timeout) { while (!TWI_ByteSent(_twi)) { if (TWI_FailedAcknowledge(_twi)) { return false; } if (--_timeout == 0) { return false; } } return true; }