5 #include "lin_config.h"
7 #define PCL_PKT_MAX_SIZE 16
8 #define PCL_HEADERS_SIZE 2 /* There are 2 bytes of headers */
9 #define PCL_CHECKSUM_SIZE 1
10 #define PCL_STX_SIZE 1
11 #define PCL_PACKET_OVERHEAD (PCL_HEADERS_SIZE + PCL_CHECKSUM_SIZE)
15 #define PCL_SEQ_NO_ofs 4
16 #define PCL_SEQ_FRLEN_ofs 0
17 #define PCL_CTRL_TIFACE_ofs 6
18 #define PCL_CTRL_COMC_ofs 0
20 #define PCL_SEQ_FRLEN_msk 0xF
22 #define PCL_PACKET_LIN_IFACE 0x2
23 #define PCL_PACKET_MODULE_IFACE 0x3
25 /* Logical representation of a packet sent to PCAN-LIN converter via RS232 */
27 uint8_t stx; /* Start transmission; Always set to 0x2 */
28 uint8_t seq_no; /* Sequence number */
29 uint8_t seq_frlen; /* Frame length */
30 uint8_t ctrl_tiface;/* Target interface */
31 uint8_t ctrl_comc; /* Command code */
32 uint8_t parms[8]; /* Parameters; Number of parameters depends
33 on the frame length */
34 uint8_t chks; /* Checksum; Bitwise XOR of all bytes except STX */
37 int pcl_config(struct linc_lin_state *linc_lin_state);
39 #endif /* _PCL_CONFIG_H_ */