#include "iec.h"
Go to the source code of this file.
Defines | |
| #define | PARALLEL_DATA_OFFSET 0 |
| #define | PARALLEL_STATUS_OFFSET 1 |
| #define | PARALLEL_CONTROL_OFFSET 2 |
| #define | PARALLEL_REGISTER_SPAN 3 |
| #define | PP_ATN_OUT 0x01 |
| The ATN OUT bit. | |
| #define | PP_CLK_OUT 0x02 |
| The CLOCK OUT bit. | |
| #define | PP_DATA_OUT 0x04 |
| The DATA OUT bit. | |
| #define | PP_RESET_OUT 0x08 |
| The RESET OUT bit. | |
| #define | PP_LP_IRQ 0x10 |
| Bit for allowing interrupts of the LPT. | |
| #define | PP_LP_BIDIR 0x20 |
| Bit for setting set bidirectional mode of the LPT. | |
| #define | PP_ATN_IN 0x10 |
| The ATN IN bit. | |
| #define | PP_CLK_IN 0x20 |
| The CLOCK IN bit. | |
| #define | PP_DATA_IN 0x40 |
| The DATA IN bit. | |
| #define | PP_RESET_IN 0x80 |
| The RESET IN bit. | |
| #define | PAR_PORT (Pdx->ParPortPortAddress + PARALLEL_DATA_OFFSET) |
| #define | IN_PORT (Pdx->ParPortPortAddress + PARALLEL_STATUS_OFFSET) |
| #define | OUT_PORT (Pdx->ParPortPortAddress + PARALLEL_CONTROL_OFFSET) |
| #define | CBMIEC_SET(_set) Pdx->IecOutBits|=(_set); WRITE_PORT_UCHAR(OUT_PORT,(UCHAR)(Pdx->IecOutEor ^ Pdx->IecOutBits)) |
| #define | CBMIEC_RELEASE(_rel) Pdx->IecOutBits&=~(_rel); WRITE_PORT_UCHAR(OUT_PORT,(UCHAR)(Pdx->IecOutEor ^ Pdx->IecOutBits)) |
| #define | CBMIEC_SET_RELEASE(_set, _rel) |
| #define | CBMIEC_GET(_line) ((READ_PORT_UCHAR(IN_PORT)&_line)==0?1:0) |
| #define | cbmiec_show_state(_x_, _y_) |
| A cbmiec_show_state() implementation for release builds. | |
Typedefs | |
| typedef IEC_TIMEOUTS | IEC_TIMEOUTS |
Functions | |
| VOID | cbmiec_schedule_timeout (IN ULONG howlong) |
| Schedule a timeout. | |
| VOID | cbmiec_udelay (IN ULONG howlong) |
| Wait for a timeout. | |
| NTSTATUS | cbmiec_i_raw_read (IN PDEVICE_EXTENSION Pdx, OUT UCHAR *buf, ULONG cnt, OUT ULONG *pReceived) |
| Read some bytes from the IEC bus. | |
| NTSTATUS | cbmiec_i_raw_write (PDEVICE_EXTENSION Pdx, const UCHAR *buf, ULONG cnt, ULONG *pSent, BOOLEAN atn, BOOLEAN talk) |
| Write some bytes to the IEC bus. | |
| VOID | cbmiec_block_irq (PDEVICE_EXTENSION Pdx) |
| Block all interrupts. | |
| VOID | cbmiec_release_irq (PDEVICE_EXTENSION Pdx) |
| Release the interrupts. | |
Variables | |
| IEC_TIMEOUTS | libiec_global_timeouts |
**************************************************************
Definition in file i_iec.h.
|
|
get the value of the parallel port Definition at line 73 of file i_iec.h. Referenced by cbmiec_check_device(), cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_send_byte(), and cbmiec_wait_for_listener(). |
|
|
release an output line on the parallel port Definition at line 67 of file i_iec.h. Referenced by cbmiec_check_device(), cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_init(), cbmiec_pp_write(), cbmiec_release_bus(), cbmiec_reset(), cbmiec_send_byte(), and cbmiec_wait_for_listener(). |
|
|
set an output line on the parallel port Definition at line 65 of file i_iec.h. Referenced by cbmiec_check_device(), cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_init(), cbmiec_pp_read(), cbmiec_reset(), cbmiec_send_byte(), and cbmiec_wait_for_listener(). |
|
|
Value: Pdx->IecOutBits|=(_set); Pdx->IecOutBits&=~(_rel); \
WRITE_PORT_UCHAR(OUT_PORT,(UCHAR)(Pdx->IecOutEor ^ Pdx->IecOutBits))
Definition at line 69 of file i_iec.h. Referenced by cbmiec_iec_setrelease(), and cbmiec_send_byte(). |
|
|
Get the address of the parallel port STATUS register (= the port for input) out of the Pdx info Definition at line 59 of file i_iec.h. Referenced by cbmiec_iec_poll(), cbmiec_iec_wait(), and cbmiec_interrupt(). |
|
|
Get the address of the parallel port CONTROL register (= the port for output) out of the Pdx info |
|
|
Get the address of the parallel port DATA register out of the Pdx info Definition at line 56 of file i_iec.h. Referenced by cbmiec_pp_read(), and cbmiec_pp_write(). |
|
|
the CONTROL register is located here |
|
|
the DATA register is located here |
|
|
the count of port addresses the parallel port occupies |
|
|
the STATUS register is located here |
|
|
The various timeouts of the IEC bus protocol |
|
|
Block all interrupts. This function blocks all interrupt, thus that we cannot be interrupted while executing some critical things. This should not be used for big time periods. Definition at line 95 of file libiec/util.c. References CLI(), DBG_ASSERT, DBGDO, FUNC_ENTER, and FUNC_LEAVE. Referenced by cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_send_byte(), and cbmiec_wait_for_listener(). |
|
||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
Write some bytes to the IEC bus.
Definition at line 55 of file i_rawwrite.c. References cbmiec_block_irq(), CBMIEC_GET, CBMIEC_RELEASE, cbmiec_release_irq(), cbmiec_schedule_timeout(), cbmiec_send_byte(), CBMIEC_SET, cbmiec_udelay(), cbmiec_wait_for_listener(), DBG_ASSERT, DBG_ERROR, DBG_PREFIX, DBG_SUCCESS, DebugNtStatus(), _DEVICE_EXTENSION::Eoi, FUNC_ENTER, _DEVICE_EXTENSION::IrqCount, _DEVICE_EXTENSION::IsSMP, libiec_global_timeouts, PERF_EVENT_WRITE_BYTE, PERF_EVENT_WRITE_BYTE_NO, PP_ATN_OUT, PP_CLK_OUT, PP_DATA_IN, PP_DATA_OUT, QueueShouldCancelCurrentIrp(), IEC_TIMEOUTS::T_10_SEND_BEFORE_1ST_BYTE, IEC_TIMEOUTS::T_11_SEND_BEFORE_BYTE_DELAY, IEC_TIMEOUTS::T_12_SEND_AFTER_BYTE_DELAY, IEC_TIMEOUTS::T_13_SEND_TURN_AROUND_LISTENER_TALKER_T_TK, IEC_TIMEOUTS::T_14_SEND_AT_END_DELAY, IEC_TIMEOUTS::T_9_SEND_WAIT_DEVICES_T_AT, and IEC_TIMEOUTS::T_9_Times. Referenced by cbmiec_close(), cbmiec_listen(), cbmiec_open(), cbmiec_raw_write(), cbmiec_talk(), cbmiec_unlisten(), and cbmiec_untalk(). |
|
|
Release the interrupts. This function releases all interrupt, undoing a previous cbmiec_block_irq() call. Definition at line 119 of file libiec/util.c. References DBG_ASSERT, DBGDO, FUNC_ENTER, FUNC_LEAVE, and STI(). Referenced by cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_send_byte(), and cbmiec_wait_for_listener(). |
|
|
Schedule a timeout. This function schedules a timeout. Scheduling means that other threads have the opportunity to use the processor while we're waiting.
Definition at line 35 of file libiec/util.c. References FUNC_ENTER, and FUNC_LEAVE. Referenced by cbmiec_check_device(), cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_iec_wait(), cbmiec_reset(), and cbmiec_wait_for_listener(). |
|
|
Wait for a timeout. This function waits for a timeout. Waiting means that we want to have an exact timing, so don't give away the processor.
Definition at line 67 of file libiec/util.c. Referenced by cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_iec_wait(), cbmiec_send_byte(), and ParPortSetMode(). |
|
|
timeout values Definition at line 29 of file libiec/init.c. Referenced by cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_iec_wait(), cbmiec_reset(), cbmiec_send_byte(), and cbmiec_wait_for_listener(). |
1.4.2