OpenCBM
iec.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2004-2009 Spiro Trikaliotis
8  *
9  */
10 
19 #ifndef CBMIEC_H
20 #define CBMIEC_H
21 
23 typedef
24 enum iec_checkdevice
25 {
30 
31 extern NTSTATUS
32 cbmiec_wait_for_drives_ready(IN PDEVICE_EXTENSION Pdx);
33 
34 extern NTSTATUS
35 cbmiec_reset(IN PDEVICE_EXTENSION Pdx);
36 
37 extern BOOLEAN
38 cbmiec_send_byte(IN PDEVICE_EXTENSION Pdx, IN UCHAR Byte);
39 
40 extern VOID
41 cbmiec_wait_for_listener(IN PDEVICE_EXTENSION Pdx, IN BOOLEAN SendEoi);
42 
43 extern VOID
44 cbmiec_release_bus(IN PDEVICE_EXTENSION Pdx);
45 
46 extern NTSTATUS
47 cbmiec_untalk(IN PDEVICE_EXTENSION Pdx);
48 
49 extern NTSTATUS
50 cbmiec_unlisten(IN PDEVICE_EXTENSION Pdx);
51 
52 extern NTSTATUS
53 cbmiec_listen(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress);
54 
55 extern NTSTATUS
56 cbmiec_talk(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress);
57 
58 extern NTSTATUS
59 cbmiec_open(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress);
60 
61 extern NTSTATUS
62 cbmiec_close(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress);
63 
64 extern NTSTATUS
65 cbmiec_get_eoi(IN PDEVICE_EXTENSION Pdx, OUT PBOOLEAN Result);
66 
67 extern NTSTATUS
68 cbmiec_clear_eoi(IN PDEVICE_EXTENSION Pdx);
69 
70 extern NTSTATUS
71 cbmiec_iec_wait(IN PDEVICE_EXTENSION Pdx, IN UCHAR Line, IN UCHAR State, OUT PUCHAR Result);
72 
73 extern NTSTATUS
74 cbmiec_iec_poll(IN PDEVICE_EXTENSION Pdx, OUT PUCHAR Result);
75 
76 extern NTSTATUS
77 cbmiec_iec_set(IN PDEVICE_EXTENSION Pdx, IN USHORT Line);
78 
79 extern NTSTATUS
80 cbmiec_iec_release(IN PDEVICE_EXTENSION Pdx, IN USHORT Line);
81 
82 extern NTSTATUS
83 cbmiec_iec_setrelease(IN PDEVICE_EXTENSION Pdx, IN USHORT Set, IN USHORT Release);
84 
85 extern NTSTATUS
86 cbmiec_iec_dbg_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR * Value);
87 
88 extern NTSTATUS
89 cbmiec_iec_dbg_write(IN PDEVICE_EXTENSION Pdx, IN UCHAR Value);
90 
91 extern NTSTATUS
92 cbmiec_pp_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Byte);
93 
94 extern NTSTATUS
95 cbmiec_pp_write(IN PDEVICE_EXTENSION Pdx, IN UCHAR Byte);
96 
97 extern BOOLEAN
98 cbmiec_interrupt(IN PDEVICE_EXTENSION Pdx);
99 
100 extern NTSTATUS
101 cbmiec_cleanup(IN PDEVICE_EXTENSION Pdx);
102 
103 extern NTSTATUS
104 cbmiec_init(IN PDEVICE_EXTENSION Pdx);
105 
106 extern NTSTATUS
107 cbmiec_global_init(IN PHANDLE HKey);
108 
109 extern NTSTATUS
110 cbmiec_raw_write(IN PDEVICE_EXTENSION Pdx, IN const PUCHAR Buffer, IN ULONG BufferLength, OUT ULONG* Written);
111 
112 extern NTSTATUS
113 cbmiec_raw_read(IN PDEVICE_EXTENSION Pdx, OUT PUCHAR Buffer, IN ULONG BufferLength, OUT ULONG* Read);
114 
115 extern VOID
116 cbmiec_set_cabletype(IN PDEVICE_EXTENSION Pdx, IN IEC_CABLETYPE CableType);
117 
118 extern NTSTATUS
119 cbmiec_check_device(IN PDEVICE_EXTENSION Pdx, OUT IEC_CHECKDEVICE *CheckDevice);
120 
121 extern NTSTATUS
122 cbmiec_parallel_burst_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR* Byte);
123 
124 extern NTSTATUS
125 cbmiec_parallel_burst_write(IN PDEVICE_EXTENSION Pdx, IN UCHAR Byte);
126 
127 extern NTSTATUS
128 cbmiec_parallel_burst_read_track(IN PDEVICE_EXTENSION Pdx, OUT UCHAR* Buffer, IN ULONG BufferLength);
129 
130 extern NTSTATUS
131 cbmiec_parallel_burst_read_track_var(IN PDEVICE_EXTENSION Pdx, OUT UCHAR* Buffer, IN ULONG BufferLength);
132 
133 extern NTSTATUS
134 cbmiec_parallel_burst_write_track(IN PDEVICE_EXTENSION Pdx, IN UCHAR* Buffer, IN ULONG BufferLength);
135 
136 extern NTSTATUS
137 cbmiec_test_irq(IN PDEVICE_EXTENSION Pdx, OUT PVOID Buffer, IN ULONG BufferLength);
138 
139 extern NTSTATUS
140 cbmiec_checkcable(PDEVICE_EXTENSION Pdx);
141 
142 extern BOOLEAN
143 cbmiec_is_cable_state_wrong(PDEVICE_EXTENSION Pdx);
144 
145 #endif /* #ifndef CBMIEC_H */
BOOLEAN cbmiec_interrupt(IN PDEVICE_EXTENSION Pdx)
Interrupt handler for the IEC bus.
Definition: interrupt.c:40
NTSTATUS cbmiec_clear_eoi(IN PDEVICE_EXTENSION Pdx)
Reset the EOI state.
Definition: eoi.c:61
BOOLEAN cbmiec_send_byte(IN PDEVICE_EXTENSION Pdx, IN UCHAR Byte)
Write one byte to the IEC bus.
Definition: sendbyte.c:39
NTSTATUS cbmiec_iec_wait(IN PDEVICE_EXTENSION Pdx, IN UCHAR Line, IN UCHAR State, OUT PUCHAR Result)
Wait for a line to have a specific value.
Definition: wait.c:45
enum iec_cabletype IEC_CABLETYPE
iec_checkdevice
Definition: iec.h:23
NTSTATUS cbmiec_untalk(IN PDEVICE_EXTENSION Pdx)
Send an UNTALK over the IEC bus.
Definition: untalk.c:38
NTSTATUS cbmiec_global_init(IN PHANDLE HKey)
Initialization for libiec which are global in nature.
Definition: libiec/init.c:251
NTSTATUS cbmiec_iec_setrelease(IN PDEVICE_EXTENSION Pdx, IN USHORT Set, IN USHORT Release)
Activate and deactive a line on the IEC serial bus.
Definition: setrelease.c:59
NTSTATUS cbmiec_init(IN PDEVICE_EXTENSION Pdx)
Initialize the IEC bus.
Definition: libiec/init.c:199
NTSTATUS cbmiec_close(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress)
Close a file on the IEC bus.
VOID cbmiec_set_cabletype(IN PDEVICE_EXTENSION Pdx, IN IEC_CABLETYPE CableType)
Set the type of the IEC cable.
Definition: libiec/init.c:139
NTSTATUS cbmiec_get_eoi(IN PDEVICE_EXTENSION Pdx, OUT PBOOLEAN Result)
Check if an EOI signal has been sent over the IEC bus.
Definition: eoi.c:40
NTSTATUS cbmiec_check_device(IN PDEVICE_EXTENSION Pdx, OUT IEC_CHECKDEVICE *CheckDevice)
Fast IEC drive detection.
Definition: checkdevice.c:49
NTSTATUS cbmiec_unlisten(IN PDEVICE_EXTENSION Pdx)
Send an UNLISTEN over the IEC bus.
Definition: unlisten.c:38
VOID cbmiec_release_bus(IN PDEVICE_EXTENSION Pdx)
Release the IEC bus.
Definition: releasebus.c:38
NTSTATUS cbmiec_iec_release(IN PDEVICE_EXTENSION Pdx, IN USHORT Line)
Release a specific line on the IEC bus.
Definition: release.c:42
NTSTATUS cbmiec_raw_write(IN PDEVICE_EXTENSION Pdx, IN const PUCHAR Buffer, IN ULONG BufferLength, OUT ULONG *Written)
Write some bytes to the IEC bus.
Definition: rawwrite.c:47
enum iec_checkdevice IEC_CHECKDEVICE
NTSTATUS cbmiec_raw_read(IN PDEVICE_EXTENSION Pdx, OUT PUCHAR Buffer, IN ULONG BufferLength, OUT ULONG *Read)
Read some bytes from the IEC bus.
Definition: rawread.c:48
NTSTATUS cbmiec_test_irq(IN PDEVICE_EXTENSION Pdx, OUT PVOID Buffer, IN ULONG BufferLength)
Test for IRQ capabilities.
Definition: testirq.c:41
NTSTATUS cbmiec_cleanup(IN PDEVICE_EXTENSION Pdx)
Cleanup the IEC bus.
Definition: libiec/init.c:116
NTSTATUS cbmiec_listen(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress)
Send a LISTEN over the IEC bus.
Definition: listen.c:44
NTSTATUS cbmiec_talk(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress)
Send a TALK over the IEC bus.
Definition: talk.c:44
NTSTATUS cbmiec_reset(IN PDEVICE_EXTENSION Pdx)
Send a RESET to the IEC bus.
Definition: reset.c:103
NTSTATUS cbmiec_open(IN PDEVICE_EXTENSION Pdx, IN UCHAR DeviceAddress, IN UCHAR SecondaryAddress)
Open a file on the IEC bus.
NTSTATUS cbmiec_iec_dbg_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Value)
Read a byte from the parallel port input register.
Definition: dbgread.c:51
NTSTATUS cbmiec_checkcable(PDEVICE_EXTENSION Pdx)
Determine the type of cable (XA1541/XM1541) on the IEC bus.
Definition: checkcable.c:334
BOOLEAN cbmiec_is_cable_state_wrong(PDEVICE_EXTENSION Pdx)
@@@
Definition: checkcable.c:511
NTSTATUS cbmiec_parallel_burst_read_track_var(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Buffer, IN ULONG BufferLength)
@@@
Definition: mnib.c:371
NTSTATUS cbmiec_iec_poll(IN PDEVICE_EXTENSION Pdx, OUT PUCHAR Result)
Polls the status of the lines on the IEC bus.
Definition: poll.c:39
NTSTATUS cbmiec_wait_for_drives_ready(IN PDEVICE_EXTENSION Pdx)
Wait for the drives to become ready after a RESET.
Definition: reset.c:39
NTSTATUS cbmiec_parallel_burst_read_track(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Buffer, IN ULONG BufferLength)
@@@
Definition: mnib.c:304
VOID cbmiec_wait_for_listener(IN PDEVICE_EXTENSION Pdx, IN BOOLEAN SendEoi)
Wait until listener is ready to receive.
Definition: waitlistener.c:80
NTSTATUS cbmiec_iec_set(IN PDEVICE_EXTENSION Pdx, IN USHORT Line)
Set a specific line on the IEC bus.
Definition: set.c:42
NTSTATUS cbmiec_pp_write(IN PDEVICE_EXTENSION Pdx, IN UCHAR Byte)
Write a byte to the X[M|A]P1541 cable.
Definition: ppwrite.c:42
NTSTATUS cbmiec_iec_dbg_write(IN PDEVICE_EXTENSION Pdx, IN UCHAR Value)
Write a byte to the parallel port output register.
Definition: dbgwrite.c:56
NTSTATUS cbmiec_parallel_burst_write(IN PDEVICE_EXTENSION Pdx, IN UCHAR Byte)
@@@
Definition: mnib.c:134
NTSTATUS cbmiec_pp_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Byte)
Read a byte from the X[M|A]P1541 cable.
Definition: ppread.c:79
NTSTATUS cbmiec_parallel_burst_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Byte)
@@@
Definition: mnib.c:79