| 1 | /*-----------------------------------------------------------------------------
|
|---|
| 2 | lmts.h -- LMT Slave
|
|---|
| 3 |
|
|---|
| 4 | Copyright (c) 1994 JANZ Computer AG
|
|---|
| 5 | All Rights Reserved
|
|---|
| 6 |
|
|---|
| 7 | Created 95/02/02 by Soenke Hansen
|
|---|
| 8 | Version 1.5 of 96/04/18
|
|---|
| 9 |
|
|---|
| 10 | Various definitions: LMT Address type, LMT command specifiers,
|
|---|
| 11 | macros for data indicated to the LMT User.
|
|---|
| 12 | Prototypes of functions defined in lmts.c.
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 | -----------------------------------------------------------------------------*/
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 | #ifndef lmts_DEFINED
|
|---|
| 19 | #define lmts_DEFINED
|
|---|
| 20 |
|
|---|
| 21 | #ifdef __cplusplus
|
|---|
| 22 | extern "C" {
|
|---|
| 23 | #endif
|
|---|
| 24 |
|
|---|
| 25 | #include "defs.h"
|
|---|
| 26 | #include "msg.h"
|
|---|
| 27 |
|
|---|
| 28 | /* There is one CAL Object associated with the LMT Slave */
|
|---|
| 29 | extern struct calo *LmtSlave; /* receives COBs from LMT Master */
|
|---|
| 30 |
|
|---|
| 31 | /* LMT Address type */
|
|---|
| 32 | struct lmt_addr {
|
|---|
| 33 | BYTE_t manuf[8]; /* manufacturer name */
|
|---|
| 34 | BYTE_t prod[8]; /* product name */
|
|---|
| 35 | BYTE_t serno[8]; /* serial number */
|
|---|
| 36 | };
|
|---|
| 37 | #if TYPEDEFS == 1
|
|---|
| 38 | typedef struct lmt_addr LmtAddr;
|
|---|
| 39 | #else
|
|---|
| 40 | #define LmtAddr struct lmt_addr
|
|---|
| 41 | #endif
|
|---|
| 42 |
|
|---|
| 43 | /* Parameters to user indications */
|
|---|
| 44 | #define lmts_mode u.m1.w[0] /* LMT Mode */
|
|---|
| 45 | #define lmts_btr u.m1.w[0] /* Bit Timing Parameter */
|
|---|
| 46 |
|
|---|
| 47 | /* Command specifiers in LMT Protocol */
|
|---|
| 48 | #define LMT_CS_SWITCH_SEL_MANUF 1 /* Switch Mode Select: Manuf. Name */
|
|---|
| 49 | #define LMT_CS_SWITCH_SEL_PROD 2 /* Switch Mode Select: Product Name */
|
|---|
| 50 | #define LMT_CS_SWITCH_SEL_SERNO 3 /* Switch Mode Select: Serial # */
|
|---|
| 51 | #define LMT_CS_SWITCH_GLOBAL 4 /* Switch Mode Global */
|
|---|
| 52 | #define LMT_CS_CONF_MODID 17 /* Configure Module ID */
|
|---|
| 53 | #define LMT_CS_CONF_MODNAME 18 /* Configure Module Name */
|
|---|
| 54 | #define LMT_CS_CONF_BITTIME 19 /* Configure Bit Timing */
|
|---|
| 55 | #define LMT_CS_ACTV_BITTIME 21 /* Activate Bit Timing */
|
|---|
| 56 | #define LMT_CS_STORE_CONFIG 23 /* Store Configuration */
|
|---|
| 57 | #define LMT_CS_INQUIRE_MANUF 36 /* Inquire Manufacturer Name */
|
|---|
| 58 | #define LMT_CS_INQUIRE_PROD 37 /* Inquire Product Name */
|
|---|
| 59 | #define LMT_CS_INQUIRE_SERNO 38 /* Inquire Serial Number */
|
|---|
| 60 |
|
|---|
| 61 | /* Nil command specifier */
|
|---|
| 62 | #define LMT_CS_NIL 0 /* not used by protocols */
|
|---|
| 63 |
|
|---|
| 64 | /* Allocate and initialize LMT Slave */
|
|---|
| 65 | extern void InitLmtS(
|
|---|
| 66 | WORD_t , /* configured bit timing parameters */
|
|---|
| 67 | void (*)() /* user handler indication/confirmation */
|
|---|
| 68 | );
|
|---|
| 69 |
|
|---|
| 70 | /* Deallocate LMT Slave */
|
|---|
| 71 | extern void DeleteLmtS(void);
|
|---|
| 72 |
|
|---|
| 73 | /* Create LMT Address */
|
|---|
| 74 | extern void CreateLmtAddress(LmtAddr *);
|
|---|
| 75 |
|
|---|
| 76 | #ifdef __cplusplus
|
|---|
| 77 | }
|
|---|
| 78 | #endif
|
|---|
| 79 |
|
|---|
| 80 | #endif /* !lmts_DEFINED */
|
|---|