Download Print this page

STC micro STC8A8K64D4 Series Reference Manual page 444

Advertisement

STC8A8K64D4 Series Manual
// description: Send LIN bus message.
// parameters: The content of the data field to be sent.
// return: none.
// version: VER1.0
// date: 2020-12-2
// remark:
//========================================================================
void Lin_Send(u8 *puts)
{
u8 i;
Lin_SendBreak();
UART2_TxByte(0x55);
UART2_TxByte(Lin_CheckPID(LIN_ID));
for(i=0;i<8;i++)
{
UART2_TxByte(puts[i]);
}
UART2_TxByte(LINCalcChecksum(puts));
}
//========================================================================
// function: void UART1_TxByte(u8 dat)
// description: Send a byte.
// parameters: none.
// return: none..
// version: V1.0, 2014-6-30
//========================================================================
void UART1_TxByte(u8 dat)
{
SBUF = dat;
B_TX1_Busy = 1;
while(B_TX1_Busy);
}
//========================================================================
// function: void UART2_TxByte(u8 dat)
// description: Send a byte.
// parameters: none.
// return: none.
// version: V1.0, 2014-6-30
//========================================================================
void UART2_TxByte(u8 dat)
{
S2BUF = dat;
B_TX2_Busy = 1;
while(B_TX2_Busy);
}
//========================================================================
// function: void PrintString1(u8 *puts)
// description: UART1 sends a string function
// parameters: puts:
String pointer.
// return: none.
// version: VER1.0
// date: 2014-11-28
// remark:
//========================================================================
//Break
//SYNC
//LIN ID
- 428 -

Advertisement

loading
Need help?

Need help?

Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?

This manual is also suitable for:

Micro stc8a8k64d4-64pinMicro stc8a8k64d4-48pin