00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _MDDRIVER_TYPES_
00021 #define _MDDRIVER_TYPES_
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 typedef struct {
00035 int time;
00036 unsigned char byte;
00037 } MDRawEvent, *MDRawEventPtr;
00038
00039
00040
00041
00042 #define MD_MAX_EVENT 100
00043
00044
00045
00046
00047 #define MD_MAX_MSG_SIZE 1024 // More than enough
00048
00049
00050 #define MD_CLOCK_MODE_INTERNAL 0
00051 #define MD_CLOCK_MODE_MTC_SYNC 1
00052
00053
00054 #define MD_ERROR_BUSY 100
00055 #define MD_ERROR_NOT_OWNER 101
00056 #define MD_ERROR_QUEUE_FULL 102
00057 #define MD_ERROR_BAD_MODE 103
00058 #define MD_ERROR_UNIT_UNAVAILABLE 104
00059 #define MD_ERROR_ILLEGAL_OPERATION 105
00060 #define MD_ERROR_UNKNOWN_ERROR 106
00061
00062
00063 #define MD_EXCEPTION_MTC_STOPPED 1
00064 #define MD_EXCEPTION_MTC_STARTED_FORWARD 2
00065 #define MD_EXCEPTION_MTC_STARTED_REVERSE 3
00066
00067
00068 #define MD_IGNORE_CLOCK 0x0100
00069 #define MD_IGNORE_START 0x0400
00070 #define MD_IGNORE_CONTINUE 0x0800
00071 #define MD_IGNORE_STOP 0x1000
00072 #define MD_IGNORE_ACTIVE 0x4000
00073 #define MD_IGNORE_RESET 0x8000
00074 #define MD_IGNORE_REAL_TIME 0xdd00
00075
00076 #define MD_PORT_A_UNIT 0
00077 #define MD_PORT_B_UNIT 1
00078
00079
00080 typedef void (*MDDataReplyFunction)(port_t replyPort, short unit, MDRawEvent *events, unsigned int count);
00081 typedef void (*MDAlarmReplyFunction)(port_t replyPort, int requestedTime, int actualTime);
00082 typedef void (*MDExceptionReplyFunction)(port_t replyPort, int exception);
00083 typedef void (*MDQueueReplyFunction)(port_t replyPort, short unit);
00084
00085
00086 typedef struct MDReplyFunctions {
00087 MDDataReplyFunction dataReply;
00088 MDAlarmReplyFunction alarmReply;
00089 MDExceptionReplyFunction exceptionReply;
00090 MDQueueReplyFunction queueReply;
00091 } MDReplyFunctions;
00092
00093 #endif _MDDRIVER_TYPES_