Specifications
5. Demonstration Projects LIN Bus 2.0 Reference Design
48 Cypress Semiconductor – Rev. ** October 25, 2006
NextTask = l_sch_tick();
}
// Check if Frame1 has completed succesfully
if(BufferFrame1[0] & bfLAST_TRANSACTION_OK)
{
// Clear the bfLAST_TRANSACTION_OK flag
BufferFrame1[0] &= ~bfLAST_TRANSACTION_OK;
// Update the signals in Frame1
UpdateFrame1();
// Transmit the Master switch status on serial port
Transmitter_CPutString("Master Switch Status : ");
for(i=0; i<8; i++)
{
if(BufferFrame1[i+1] == 0)
Transmitter_CPutString("OFF ");
else
Transmitter_CPutString("ON ");
}
Transmitter_PutCRLF();
}
// Check if Frame2 has completed succesfully
if(BufferFrame2[0] & bfLAST_TRANSACTION_OK)
{
// Clear the bfLAST_TRANSACTION_OK flag
BufferFrame2[0] &= ~bfLAST_TRANSACTION_OK;
// Read from the Buffer
l_bytes_rd(Frame2, 1, 2, TempBuffer);
// Update Resistance Value from the updated TempBuffer
Resistance = (TempBuffer[1] << 8) | TempBuffer[0];
// Convert the Resistance to String value.
itoa(OutputString, Resistance, 10);
// Send the Resistance value on the Serial Port
Transmitter_CPutString("Slave-1 Resistance : ");
Transmitter_PutString(OutputString);
Transmitter_PutCRLF();
}
// Check if Frame3 has completed successfully
// This is the switch status from Slave 2. Update LED5 and LED6
// as per the Slave2 switch status
if(BufferFrame3[0] & bfLAST_TRANSACTION_OK)
{
// Clear the bfLAST_TRANSACTION_OK flag
BufferFrame3[0] &= ~bfLAST_TRANSACTION_OK;
// Read the bytes from Frame3 to TempBuffer
l_bytes_rd(Frame3, 1, 2, TempBuffer);
// Transmit the Master switch status on serial port
Transmitter_CPutString("Slave-2 Switch Status: ");