Пример #1
0
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;
}
Пример #2
0
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;
}
Пример #3
0
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;
}