source: trunk/Cosy/incl/dbts.h@ 13452

Last change on this file since 13452 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
File size: 3.3 KB
Line 
1/*-----------------------------------------------------------------------------
2dbts.h -- DBT Slave
3
4Copyright (c) 1994 JANZ Computer AG
5All Rights Reserved
6
7Created 94/10/11 by Soenke Hansen
8Version 1.8 of 98/07/31
9
10Definitions of DBT Protocol command specifiers.
11Status definitions for service confirmations.
12Prototypes of functions defined in dbts.c.
13
14-----------------------------------------------------------------------------*/
15
16
17#ifndef dbts_DEFINED
18#define dbts_DEFINED
19
20#ifdef __cplusplus
21extern "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 */
61extern void InitDbtS(
62 WORD_t , /* timeout interval */
63 void (*)() /* user handler indication/confirmation */
64);
65
66/* Remove the DBT Slave */
67extern void DeleteDbtS(void);
68
69/* Request of Create User Definition Service */
70extern int CreateUserDefReq(struct cob *);
71extern int CreateAllUserDefReq(void);
72
73/* Request of Delete User Definition Service */
74extern int DeleteUserDefReq(int);
75
76/* CANopen stuff */
77/* Request of SYNC cob-ID */
78extern WORD_t GetSYNCId(void);
79extern void PutSYNCId(WORD_t);
80
81/* Request of SYNC pointer to CMS object */
82extern struct cmso *GetPToSYNCCMS(void);
83extern void PutPToSYNCCMS(struct cmso *);
84
85/* Request of HiRes TIMESTAMP pointer to CMS object */
86extern WORD_t GetTSId(void);
87extern void PutTSId(WORD_t);
88
89/* Request of HiRes TIMESTAMP pointer to CMS object */
90extern struct cmso *GetPToTSCMS(void);
91extern void PutPToTSCMS(struct cmso *);
92
93/* Request of time of day TIMESTAMP pointer to CMS object */
94extern WORD_t GetTodTSId(void);
95extern void PutTodTSId(WORD_t);
96
97/* Request of time of day TIMESTAMP pointer to CMS object */
98extern struct cmso *GetPToTodTSCMS(void);
99extern void PutPToTodTSCMS(struct cmso *);
100
101#if CAPS_DBT & CAP_DBT_CONSIST
102
103/* Request of Verify COB Class Service */
104extern int VerifyCobClassReq(void);
105
106/* Request of Get Checksum Service */
107extern 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 */
Note: See TracBrowser for help on using the repository browser.