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

no-image

AT42QTAN0040

Manufacturer Part Number
AT42QTAN0040
Description
Driving the AT42QT2160 QMatrix Sensor IC
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
12
}
/*=====================================================================================
====================================================================================*/
uint8_t WriteQtI2c ( uint8_t SlaveAddress,
{
}
}
if ( AckBit )
else
SendCLOCK
return RxByte;
uint8_t WriteAddress, uint8_t WriteLength, uint8_t *WritePtr )
uint8_t i, Result;
do {
} while ( Result != I2C_OK );
/* write address-pointer to device */
Result = SendByte ( WriteAddress );
while ( (Result == I2C_OK) && WriteLength-- )
SendSTOP;
return Result;
Driving the AT42QT2160
if ( SDA )
SetLoSCL;
SetLoSDA
SetHiSDA
Function:
Input:
Output:
SendSTART;
if ( (Result = SendByte ( SlaveAddress << 1 )) != I2C_OK )
Result = SendByte ( *WritePtr++ );
RxByte |= 1;
/* attempt to address device until ACK is received */
SendSTOP;
/* terminate transfer */
/* send ACK bit */
WriteQtI2c() Executes multi-byte write to QT-device
SlaveAddress = Device address on the I2C bus
WriteAddress = Register address
WriteLength = Number of bytes to write
WritePtr = Pointer to byte array containing write-data
I2C_OK if transfer completes, I2C_FAIL if device NACKs
10702A–AT42–07/08

Related parts for AT42QTAN0040