Silicon Laboratories Stepper Machine Uživatelský manuál Strana 32

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 40
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 31
AN428
32 Rev. 0.6
}
}
else {} // If this transfer is a READ,
// then take no action. Slave
// address was transmitted. A
// separate 'case' is defined
// for data byte recieved.
}
else // If slave NACK,
{
if(SMB_ACKPOLL)
{
STA = 1; // Restart transfer
}
else
{
FAIL = 1; // Indicate failed transfer
} // and handle at end of ISR
}
break;
// Master Receiver: byte received
case SMB_MRDB:
if ( i < SMB_DATA_LEN ) // Is there any data remaining?
{
*pSMB_DATA_IN = SMB0DAT; // Store received byte
pSMB_DATA_IN++; // Increment data in pointer
i++; // Increment number of bytes received
ACK = 1; // Set ACK bit (may be cleared later
// in the code)
}
if (i == SMB_DATA_LEN) // This is the last byte
{
ACK = 0; // Send NACK to indicate last byte
Zobrazit stránku 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 38 39 40

Komentáře k této Příručce

Žádné komentáře