AT42QTAN0040 ATMEL [ATMEL Corporation], AT42QTAN0040 Datasheet - Page 11

no-image

AT42QTAN0040

Manufacturer Part Number
AT42QTAN0040
Description
Driving the AT42QT2160 QMatrix Sensor IC
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
10702A–AT42–07/08
/*=====================================================================================
====================================================================================*/
uint8_t SendByte ( uint8_t TxByte )
{
}
/*=====================================================================================
====================================================================================*/
uint8_t GetByte ( uint8_t AckBit )
{
uint8_t i,b, Result = I2C_OK;
for (b = 0; b < 8; b++)
{
}
FloatSDA /* prepare to receive ACK bit */
SetHiSCL /* read ACK bit */
if ( SDA == 1 )
SetLoSCL
return Result;
uint8_t i,b, RxByte = 0;
FloatSDA
for (b = 0; b < 8; b++)
{
Function:
Input:
Output:
if ( TxByte & 0x80 )
else
SendCLOCK
TxByte <<= 1;
Result = I2C_FAIL;
Function:
Input:
Output:
RxByte <<= 1;
SetHiSCL;
SetHiSDA
SetLoSDA
SendByte()
Byte to send
I2C_OK if device ACKs, I2C_FAIL if device NACKs
/* shift out data byte */
GetByte()
State of ACK bit to send
Received byte
/* shift in data byte */
Driving the AT42QT2160
11

Related parts for AT42QTAN0040