truck-code
das_clt.h
Go to the documentation of this file.
1 
13 #ifndef SRC_JBUS_DAS_CLT_H_
14 #define SRC_JBUS_DAS_CLT_H_
15 
16 #include <devctl.h>
17 
18 
19 #define DAS_MSG_BUF 2048
20 #define MIN_SAMPLE_TICK 1
21 #define MAX_SAMPLE_TICK 0xffff
22 #define NUM_SCAN_ENT 96 /* Number of scan table entries. */
23 #define DAS_MAX_TIMERS 10
24 
25 
29 enum {
30  DAS_QUERY,
31  DAS_DA_SYNC,
32  DAS_DA_TERM,
33  DAS_DIG_DIR,
34  DAS_DIG_OUT,
35  DAS_DIG_IN,
36  DAS_AD_ENQ,
37  DAS_AD_TERM,
38  DAS_AD_SET_SMP,
39  DAS_TMR_MODE,
40  DAS_TEST_PULSE,
41  CAN_FILTER,
42  CAN_ARM,
43  CAN_I82527_READ,
44  CAN_I82527_WRITE,
45  CAN_EMPTY_Q,
46  CAN_GET_ERRS,
47  CAN_CLEAR_ERRS,
48 };
49 
50 
56 #define _DCMD_DAS 0x0f00
57 
58 #define DCMD_DAS_QUERY __DIOF(_DCMD_DAS, DAS_QUERY, das_info_typ)
59 #define DCMD_DAS_DA_SYNC __DIOT(_DCMD_DAS, DAS_DA_SYNC, das_da_sync_t)
60 #define DCMD_DAS_DA_TERM __DIOT(_DCMD_DAS, DAS_DA_TERM, int)
61 #define DCMD_DAS_DIG_DIR __DIOT(_DCMD_DAS, DAS_DIG_DIR, long)
62 #define DCMD_DAS_DIG_OUT __DIOTF(_DCMD_DAS, DAS_DIG_OUT, int) /* TODO: replace from das_dout_t */
63 #define DCMD_DAS_DIG_IN __DIOTF(_DCMD_DAS, DAS_DIG_IN, int) /* TODO: replace from das_din_t */
64 #define DCMD_DAS_AD_ENQ __DIOT(_DCMD_DAS, DAS_AD_ENQ, sigevent)
65 #define DCMD_DAS_AD_TERM __DIOT(_DCMD_DAS, DAS_AD_TERM, int)
66 #define DCMD_DAS_AD_SET_SMP __DIOT(_DCMD_DAS, DAS_AD_SET_SMP, das_sample_t)
67 #define DCMD_DAS_TMR_MODE __DIOT(_DCMD_DAS, DAS_TMR_MODE, das_tmr_mode_t)
68 #define DCMD_DAS_TEST_PULSE __DIOT(_DCMD_DAS, DAS_TEST_PULSE, int)
69 #define DCMD_CAN_I82527_READ __DIOF(_DCMD_DAS, CAN_I82527_READ, can_msg_t)
70 #define DCMD_CAN_I82527_WRITE __DIOT(_DCMD_DAS, CAN_I82527_WRITE, can_msg_t)
71 #define DCMD_CAN_ARM __DIOT(_DCMD_DAS, CAN_ARM, sigevent)
72 #define DCMD_CAN_FILTER __DIOT(_DCMD_DAS, CAN_FILTER, can_filter_t)
73 #define DCMD_CAN_EMPTY_Q __DIOTF(_DCMD_DAS, CAN_EMPTY_Q, int)
74 #define DCMD_CAN_GET_ERRS __DIOTF(_DCMD_DAS, CAN_GET_ERRS, can_err_count_t)
75 #define DCMD_CAN_CLEAR_ERRS __DIOTF(_DCMD_DAS, CAN_CLEAR_ERRS, can_err_count_t)
76 
80 #define _IOMGR_DAS 0xff00
81 
82 enum {
83  IOMSG_DAS_AD_READ,
84  IOMSG_DAS_AD_SET_SCAN,
85  IOMSG_DAS_TMR_SCAN,
86  IOMSG_DAS_TMR_READ,
87 };
88 
89 
90 #endif /* SRC_JBUS_DAS_CLT_H_ */