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