]> rtime.felk.cvut.cz Git - linux-lin.git/blob - lin_config/src/lin_config.h
e46cf8af19bf1249cf66340082c3683943c1df16
[linux-lin.git] / lin_config / src / lin_config.h
1 #ifndef _LIN_CONFIG_H_
2 #define _LIN_CONFIG_H_
3
4 #define FLASH_CONF_fl                           (1 << 0)
5 #define RESET_DEVICE_fl                         (1 << 1)
6 #define SLLIN_ATTACH_fl                         (1 << 2)
7 #define SLLIN_DETACH_fl                         (1 << 3)
8
9 #define MAX_LIN_ID                              0x3F
10 #define PCL_DEFAULT_CONFIG                      "config.pclin"
11
12 struct linc_scheduler_entry {
13         int lin_id;
14         int interval_ms;
15 };
16
17 /* Index in this array = LIN ID */
18 struct linc_frame_entry {
19         int status; /* 1 = active; 0 = unactive */
20         int data_len;
21         char data[8];
22 };
23
24 struct linc_lin_state {
25         int is_active;          /* Is LIN device active */
26         int baudrate;           /* LIN baudrate */
27         int master_status;      /* LIN node type -- Master or Slave */
28         int bus_termination;    /* LIN bus termination in device -- Master or Slave */
29
30         /* Subscriber/publisher table entries */
31         struct linc_frame_entry frame_entry[MAX_LIN_ID];
32         /* Scheduler table entries */
33         // FIXME max value
34         struct linc_scheduler_entry scheduler_entry[100];
35         int scheduler_entries_cnt; /* No. of configured scheduler entries */
36
37         char *dev;              /* Path to LIN device to be configured */
38         int flags;              /* Flags passed to configuration function
39                                 of particular device */
40 };
41 struct linc_lin_state linc_lin_state;
42
43
44 #endif /* _LIN_CONFIG_H_ */