AT42QTAN0040 ATMEL [ATMEL Corporation], AT42QTAN0040 Datasheet - Page 13
![no-image](/images/no-image-200.jpg)
AT42QTAN0040
Manufacturer Part Number
AT42QTAN0040
Description
Driving the AT42QT2160 QMatrix Sensor IC
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet
1.AT42QTAN0040.pdf
(14 pages)
10702A–AT42–07/08
/*=====================================================================================
====================================================================================*/
uint8_t ReadQtI2c ( uint8_t SlaveAddress,
{
}
/*--------------------------End of I2C Driver ---------------------------------------*/
uint8_t ReadAddress, uint8_t ReadLength, uint8_t *ReadPtr )
uint8_t i, Result;
/* write address-pointer to device */
Result = WriteQtI2c ( SlaveAddress, ReadAddress, 0, 0 );
if ( Result == I2C_OK )
{
}
return Result;
Function:
Input:
Output:
do {
} while ( Result != I2C_OK );
do {
} while ( ReadLength );
SendSTOP; /* terminate transfer */
SendSTART;
if ( (Result = SendByte ( (SlaveAddress << 1) + READ_FLAG) ) != I2C_OK )
*ReadPtr++ = GetByte ( --ReadLength );
/* attempt to address device until ACK is received */
SendSTOP;
ReadQtI2c() Executes multi-byte read from QT-device
SlaveAddress = Device address on the I2C bus
ReadAddress = Register address
ReadLength = Number of bytes to read
ReadPtr = Pointer to byte array for read-data
I2C_OK if transfer completes, I2C_FAIL if device NACKs
Driving the AT42QT2160
13