📄 linmsg2.c
字号:
/******************************************************************************
*
* Copyright (C) 2003 Motorola, Inc.
* All Rights Reserved
*
* Filename: $RCSfile: LINmsg.c,v $
* Author: $Author: r57404 $
* Locker: $Locker: $
* State: $State: Exp $
* Revision: $Revision: 1.3 $
*
* Functions: LIN header file for message configuration
*
* History: Use the RCS command log to display revision history
* information.
*
* Description:
*
* Notes: Users should alter this file to define the required LIN messages
*
*
******************************************************************************/
//includes
#include "LINdriver.h"
/*************** LIN Frame setup dependant variables **************************/
/* */
/* This is where the user will define the frames used in the application */
/* */
/******************************************************************************/
//Define what messages will be used in the application, as "Message0xID", where
//ID is the message id in hex with the parity bits included.
//Define the frame data field for each message - the data field can be 2, 4 or 8
//bytes long.
//U8 volatile Message0x1A[2]; // id 0x1A = 0x1A with parity
//U8 volatile Message0x5B[2]; // id 0x1B = 0x5B with parity , low sensor, high switch
U8 volatile Message0x50[2]; // id 0x10 = 0x50 with parity
U8 volatile Message0x11[2]; // id 0x11 = 0x11 with parity
//U8 volatile Message0x08[2];
/* Pointer array pointing to all frames, must be setup in the same order as
IdTbl[] and MessageCountTbl[] */
U8 volatile * MessagePointerTbl[] = {Message0x50,Message0x11};
/* Relevant identifier table (array), must be setup in the same order as
*MessagePointerTbl[] and MessageCountTbl[]. Remember that the id must have
parity bits included. */
U8 const near IdTbl[] = {0x50,0x11};
/* Table below defines number of bytes in the message data and shows if the
message should be sent or received. The LSHB is the length of data frame +1
(checksum) (e.g. Message0x20[4]=> LSHB= 5) */
/*LSHB = Byte count incl Checksum; MSHB =>F=Ignore, 1 = Receive, 0 = Send;
Must be setup in the same order as .....*/
U8 const near MessageCountTbl[] = {0x13, 0x03};
//LIN_LIST_SIZE is the number of Id:s in the IdTbl[]
#define LIN_LIST_SIZE (( sizeof(IdTbl)) / sizeof( IdTbl[0] ) )
//No_of_Ids is the number of Ids in IdTbl[]
U8 const No_of_Ids = LIN_LIST_SIZE;
U8 volatile LinMsgStatus[LIN_LIST_SIZE]; //to store message status,
//e.g. LIN_MSG_NODATA or LIN_MSG_UPDATED
/*************** END LIN Frame setup dependant variables. *********************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -