00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _MKMDDRIVER_TYPES_
00027 #define _MKMDDRIVER_TYPES_
00028
00029
00030
00031
00032
00033
00034 #import <mach/kern_return.h>
00035 #import <mach/message.h>
00036 #import <mach/port.h>
00037
00038
00039 typedef struct {
00040 int time;
00041 unsigned char byte;
00042 } MKMDRawEvent, *MKMDRawEventPtr;
00043
00044
00045
00046
00047 #define MKMD_MAX_EVENT 100
00048
00049
00050
00051
00052 #define MKMD_MAX_MSG_SIZE 1024 // More than enough
00053
00054
00055 #define MKMD_CLOCK_MODE_INTERNAL 0
00056 #define MKMD_CLOCK_MODE_MTC_SYNC 1
00057
00058
00059 #define MKMD_ERROR_BUSY 100
00060 #define MKMD_ERROR_NOT_OWNER 101
00061 #define MKMD_ERROR_QUEUE_FULL 102
00062 #define MKMD_ERROR_BAD_MODE 103
00063 #define MKMD_ERROR_UNIT_UNAVAILABLE 104
00064 #define MKMD_ERROR_ILLEGAL_OPERATION 105
00065 #define MKMD_ERROR_UNKNOWN_ERROR 106
00066
00067
00068 #define MKMD_EXCEPTION_MTC_STOPPED 1
00069 #define MKMD_EXCEPTION_MTC_STARTED_FORWARD 2
00070 #define MKMD_EXCEPTION_MTC_STARTED_REVERSE 3
00071
00072
00073 #define MKMD_IGNORE_CLOCK 0x0100
00074 #define MKMD_IGNORE_START 0x0400
00075 #define MKMD_IGNORE_CONTINUE 0x0800
00076 #define MKMD_IGNORE_STOP 0x1000
00077 #define MKMD_IGNORE_ACTIVE 0x4000
00078 #define MKMD_IGNORE_RESET 0x8000
00079 #define MKMD_IGNORE_REAL_TIME 0xdd00
00080
00081 #define MKMD_PORT_A_UNIT 0
00082 #define MKMD_PORT_B_UNIT 1
00083
00084
00085 typedef void (*MKMDDataReplyFunction)(mach_port_t replyPort, short unit, MKMDRawEvent *events, unsigned int count);
00086 typedef void (*MKMDAlarmReplyFunction)(mach_port_t replyPort, int requestedTime, int actualTime);
00087 typedef void (*MKMDExceptionReplyFunction)(mach_port_t replyPort, int exception);
00088 typedef void (*MKMDQueueReplyFunction)(mach_port_t replyPort, short unit);
00089
00090
00091 typedef struct MKMDReplyFunctions {
00092 MKMDDataReplyFunction dataReply;
00093 MKMDAlarmReplyFunction alarmReply;
00094 MKMDExceptionReplyFunction exceptionReply;
00095 MKMDQueueReplyFunction queueReply;
00096 } MKMDReplyFunctions;
00097
00098 #endif _MKMDDRIVER_TYPES_