1 | /*-----------------------------------------------------------------------------
|
---|
2 | dbts.h -- DBT Slave
|
---|
3 |
|
---|
4 | Copyright (c) 1994 JANZ Computer AG
|
---|
5 | All Rights Reserved
|
---|
6 |
|
---|
7 | Created 94/10/11 by Soenke Hansen
|
---|
8 | Version 1.8 of 98/07/31
|
---|
9 |
|
---|
10 | Definitions of DBT Protocol command specifiers.
|
---|
11 | Status definitions for service confirmations.
|
---|
12 | Prototypes of functions defined in dbts.c.
|
---|
13 |
|
---|
14 | -----------------------------------------------------------------------------*/
|
---|
15 |
|
---|
16 |
|
---|
17 | #ifndef dbts_DEFINED
|
---|
18 | #define dbts_DEFINED
|
---|
19 |
|
---|
20 | #ifdef __cplusplus
|
---|
21 | extern "C" {
|
---|
22 | #endif
|
---|
23 |
|
---|
24 | #include "defs.h"
|
---|
25 | #include "msg.h"
|
---|
26 | #include "calconf.h"
|
---|
27 | #include "cms.h"
|
---|
28 |
|
---|
29 | /* Components of service confirmation message */
|
---|
30 | #define dbts_stat u.m1.w[0]
|
---|
31 | #define dbts_cobid u.m1.w[1]
|
---|
32 | #define dbts_cksum u.m1.w[2]
|
---|
33 |
|
---|
34 | /* Command specifiers in DBT Protocol */
|
---|
35 | #define DBT_CS_CREATE_1 2 /* Create User Definition part 1 */
|
---|
36 | #define DBT_CS_CREATE_2 3 /* Create User Definition part 2 */
|
---|
37 | #define DBT_CS_CREATE_3 4 /* Create User Definition part 3 */
|
---|
38 | #define DBT_CS_DELETE 0 /* Delete User Definition */
|
---|
39 | #define DBT_CS_VERIFY 5 /* Verify COB Class */
|
---|
40 | #define DBT_CS_CHECKSUM 6 /* Get Checksum */
|
---|
41 | #define DBT_CS_NIL 255 /* Nil */
|
---|
42 |
|
---|
43 |
|
---|
44 | /* Status (return) values of DBT Slave services on success or failure */
|
---|
45 | #define STAT_OKAY 0x00 /* service completed successfully */
|
---|
46 | #define STAT_NOSERV 0x01 /* DBT services not allowed */
|
---|
47 | #define STAT_PROT_ERR 0x02 /* protocol error */
|
---|
48 | #define STAT_TIMED_OUT 0x03 /* timed out on confirmation */
|
---|
49 | #define STAT_TIMER_ERR 0x04 /* timer could not be set */
|
---|
50 | #define STAT_ASSIGN_ERR 0x05 /* failed to assign CAL protocol Id */
|
---|
51 | #define STAT_TX_ERR 0x10 /* service failed */
|
---|
52 | #define STAT_REMOTE_ERR 0x20 /* error code from DBT Master */
|
---|
53 |
|
---|
54 | #ifdef FIRMWARE
|
---|
55 |
|
---|
56 | /* DBT Slave not implemented if the distribution capability
|
---|
57 | is not configured. */
|
---|
58 | #if CAPS_DBT & CAP_DBT_DISTRIB
|
---|
59 |
|
---|
60 | /* Initialize the DBT Slave */
|
---|
61 | extern void InitDbtS(
|
---|
62 | WORD_t , /* timeout interval */
|
---|
63 | void (*)() /* user handler indication/confirmation */
|
---|
64 | );
|
---|
65 |
|
---|
66 | /* Remove the DBT Slave */
|
---|
67 | extern void DeleteDbtS(void);
|
---|
68 |
|
---|
69 | /* Request of Create User Definition Service */
|
---|
70 | extern int CreateUserDefReq(struct cob *);
|
---|
71 | extern int CreateAllUserDefReq(void);
|
---|
72 |
|
---|
73 | /* Request of Delete User Definition Service */
|
---|
74 | extern int DeleteUserDefReq(int);
|
---|
75 |
|
---|
76 | /* CANopen stuff */
|
---|
77 | /* Request of SYNC cob-ID */
|
---|
78 | extern WORD_t GetSYNCId(void);
|
---|
79 | extern void PutSYNCId(WORD_t);
|
---|
80 |
|
---|
81 | /* Request of SYNC pointer to CMS object */
|
---|
82 | extern struct cmso *GetPToSYNCCMS(void);
|
---|
83 | extern void PutPToSYNCCMS(struct cmso *);
|
---|
84 |
|
---|
85 | /* Request of HiRes TIMESTAMP pointer to CMS object */
|
---|
86 | extern WORD_t GetTSId(void);
|
---|
87 | extern void PutTSId(WORD_t);
|
---|
88 |
|
---|
89 | /* Request of HiRes TIMESTAMP pointer to CMS object */
|
---|
90 | extern struct cmso *GetPToTSCMS(void);
|
---|
91 | extern void PutPToTSCMS(struct cmso *);
|
---|
92 |
|
---|
93 | /* Request of time of day TIMESTAMP pointer to CMS object */
|
---|
94 | extern WORD_t GetTodTSId(void);
|
---|
95 | extern void PutTodTSId(WORD_t);
|
---|
96 |
|
---|
97 | /* Request of time of day TIMESTAMP pointer to CMS object */
|
---|
98 | extern struct cmso *GetPToTodTSCMS(void);
|
---|
99 | extern void PutPToTodTSCMS(struct cmso *);
|
---|
100 |
|
---|
101 | #if CAPS_DBT & CAP_DBT_CONSIST
|
---|
102 |
|
---|
103 | /* Request of Verify COB Class Service */
|
---|
104 | extern int VerifyCobClassReq(void);
|
---|
105 |
|
---|
106 | /* Request of Get Checksum Service */
|
---|
107 | extern int GetChecksumReq(int);
|
---|
108 |
|
---|
109 | #endif /* CAPS_DBT & CAP_DBT_CONSIST */
|
---|
110 | #endif /* CAPS_DBT & CAP_DBT_DISTRIB */
|
---|
111 |
|
---|
112 | #endif /* FIRMWARE */
|
---|
113 |
|
---|
114 | #ifdef __cplusplus
|
---|
115 | }
|
---|
116 | #endif
|
---|
117 |
|
---|
118 | #endif /* !dbts_DEFINED */
|
---|