TWI_StartRead
Default mainpageat91libperipheralstwiTWI_StartRead
Description Source Call Graph
Start Line: 193
void TWI_StartRead(AT91S_TWI *pTwi, unsigned char address, unsigned int iaddress, unsigned char isize)
{
    //TRACE_DEBUG("TWI_StartRead()\n\r");
    SANITY_CHECK(pTwi);
    SANITY_CHECK((address & 0x80) == 0);
    SANITY_CHECK((iaddress & 0xFF000000) == 0);
    SANITY_CHECK(isize < 4);

    // Set slave address and number of internal address bytes
    pTwi->TWI_MMR = 0;
    pTwi->TWI_MMR = (isize << 8) | AT91C_TWI_MREAD | (address << 16);

    // Set internal address bytes
    pTwi->TWI_IADR = 0;
    pTwi->TWI_IADR = iaddress;

    // Send START condition
    pTwi->TWI_CR = AT91C_TWI_START;
}