Specifications
5. Demonstration Projects LIN Bus 2.0 Reference Design
50 Cypress Semiconductor – Rev. ** October 25, 2006
if(BufferFrame4[1] & Temp)
Transmitter_CPutString("ON ");
else
Transmitter_CPutString("OFF ");
Temp >>= 1;
}
Transmitter_PutCRLF();
Transmitter_PutCRLF();
}
}
}
void UpdateFrame1(void)
{
BYTE i;
BYTE x;
// Load up the 8 byte message with the status of DIP Switchs S2.
// If the SW is in the "ON" position, the associated data byte
// will be set to 1, else 0.
x = PRT2DR;
for(i=0; i < 8; i++)
{ // Loop through each DIP Switch
TempBuffer[i]= 1;
if((x & 0x80) == 0)
{
TempBuffer[i] = 0;
}
x = x << 1;
}
l_bytes_wr(Frame1, 1, 8, TempBuffer);
}
// This function configures both the nodes present in the cluster
void NodeConfiguration(void)
{
BYTE bError;
BYTE Retries;
// Configure Message 0x1001 of CPM
Retries = 0;
do
{
bError = ConfigureNode(1, 0x1234, 0x1001, 0xF0);
Retries++;
}
while((bError == 1) && (Retries < 2));
// Configure Message 0x1002 of CPM
Retries = 0;
do
{
bError = ConfigureNode(1, 0x1234, 0x1002, 0x9C);
Retries++;
}
while((bError == 1) && (Retries < 2));
// Configure Message 0x1002 of CPM
Retries = 0;