OpenCBM
Macros | Functions
checkcable.c File Reference

Check and test the cable type. More...

#include <wdm.h>
#include "cbm_driver.h"
#include "i_iec.h"

Go to the source code of this file.

Macros

#define PP_XA_ATN_OUT   0x01
 @@@ More...
 
#define PP_XA_CLK_OUT   0x02
 @@@ More...
 
#define PP_XA_DATA_OUT   0x04
 @@@ More...
 
#define PP_XA_RESET_OUT   0x08
 @@@ More...
 
#define PP_XA_EOR_OUT   0xcb
 @@@ More...
 
#define PP_XA_ATN_IN   0x10
 @@@ More...
 
#define PP_XA_CLK_IN   0x20
 @@@ More...
 
#define PP_XA_DATA_IN   0x40
 @@@ More...
 
#define PP_XA_RESET_IN   0x80
 @@@ More...
 
#define PP_XA_EOR_IN   0x80
 @@@ More...
 
#define PP_XM_ATN_OUT   PP_XA_ATN_OUT
 @@@ More...
 
#define PP_XM_CLK_OUT   PP_XA_CLK_OUT
 @@@ More...
 
#define PP_XM_DATA_OUT   PP_XA_DATA_OUT
 @@@ More...
 
#define PP_XM_RESET_OUT   PP_XA_RESET_OUT
 @@@ More...
 
#define PP_XM_EOR_OUT   0xc4
 @@@ More...
 
#define PP_XM_ATN_IN   PP_XA_ATN_IN
 @@@ More...
 
#define PP_XM_CLK_IN   PP_XA_CLK_IN
 @@@ More...
 
#define PP_XM_DATA_IN   PP_XA_DATA_IN
 @@@ More...
 
#define PP_XM_RESET_IN   PP_XA_RESET_IN
 @@@ More...
 
#define PP_XM_EOR_IN   PP_XA_EOR_IN
 @@@ More...
 
#define PP_XE_ATN_OUT   PP_XM_ATN_OUT
 @@@ More...
 
#define PP_XE_CLK_OUT   PP_XM_CLK_OUT
 @@@ More...
 
#define PP_XE_DATA_OUT   PP_XM_RESET_OUT
 @@@ More...
 
#define PP_XE_RESET_OUT   PP_XM_DATA_OUT
 @@@ More...
 
#define PP_XE_EOR_OUT   PP_XM_EOR_OUT
 @@@ More...
 
#define PP_XE_ATN_IN   PP_XM_ATN_IN
 @@@ More...
 
#define PP_XE_CLK_IN   PP_XM_CLK_IN
 @@@ More...
 
#define PP_XE_DATA_IN   PP_XM_RESET_IN
 @@@ More...
 
#define PP_XE_RESET_IN   PP_XM_DATA_IN
 @@@ More...
 
#define PP_XE_EOR_IN   PP_XM_EOR_IN
 @@@ More...
 
#define READ(_x)   ((((READ_PORT_UCHAR(OUT_PORT) ^ Pdx->IecOutEor)) & (_x)) ? 1 : 0)
 @@@ More...
 
#define SHOW(_x, _y)
 @@@ More...
 
#define SHOW1()
 @@@ More...
 

Functions

NTSTATUS cbmiec_checkcable (PDEVICE_EXTENSION Pdx)
 Determine the type of cable (XA1541/XM1541) on the IEC bus. More...
 
VOID cbmiec_setcablestate (PDEVICE_EXTENSION Pdx, CABLESTATE State)
 Set the current state of the cable detection.
 
BOOLEAN cbmiec_is_cable_state_wrong (PDEVICE_EXTENSION Pdx)
 @@@ More...
 

Detailed Description

Check and test the cable type.



Author
Spiro Trikaliotis

Definition in file checkcable.c.

Macro Definition Documentation

#define PP_XA_ATN_IN   0x10

@@@

Todo:
document

Definition at line 31 of file checkcable.c.

Referenced by cbmiec_checkcable().

#define PP_XA_ATN_OUT   0x01

@@@

Todo:
document

Definition at line 25 of file checkcable.c.

Referenced by cbmiec_checkcable().

#define PP_XA_CLK_IN   0x20

@@@

Todo:
document

Definition at line 32 of file checkcable.c.

#define PP_XA_CLK_OUT   0x02

@@@

Todo:
document

Definition at line 26 of file checkcable.c.

#define PP_XA_DATA_IN   0x40

@@@

Todo:
document

Definition at line 33 of file checkcable.c.

#define PP_XA_DATA_OUT   0x04

@@@

Todo:
document

Definition at line 27 of file checkcable.c.

#define PP_XA_EOR_IN   0x80

@@@

Todo:
document

Definition at line 35 of file checkcable.c.

#define PP_XA_EOR_OUT   0xcb

@@@

Todo:
document

Definition at line 29 of file checkcable.c.

#define PP_XA_RESET_IN   0x80

@@@

Todo:
document

Definition at line 34 of file checkcable.c.

#define PP_XA_RESET_OUT   0x08

@@@

Todo:
document

Definition at line 28 of file checkcable.c.

#define PP_XE_ATN_IN   PP_XM_ATN_IN

@@@

Todo:
document

Definition at line 60 of file checkcable.c.

#define PP_XE_ATN_OUT   PP_XM_ATN_OUT

@@@

Todo:
document

Definition at line 54 of file checkcable.c.

#define PP_XE_CLK_IN   PP_XM_CLK_IN

@@@

Todo:
document

Definition at line 61 of file checkcable.c.

#define PP_XE_CLK_OUT   PP_XM_CLK_OUT

@@@

Todo:
document

Definition at line 55 of file checkcable.c.

#define PP_XE_DATA_IN   PP_XM_RESET_IN

@@@

Todo:
document

Definition at line 62 of file checkcable.c.

#define PP_XE_DATA_OUT   PP_XM_RESET_OUT

@@@

Todo:
document

Definition at line 56 of file checkcable.c.

#define PP_XE_EOR_IN   PP_XM_EOR_IN

@@@

Todo:
document

Definition at line 64 of file checkcable.c.

#define PP_XE_EOR_OUT   PP_XM_EOR_OUT

@@@

Todo:
document

Definition at line 58 of file checkcable.c.

#define PP_XE_RESET_IN   PP_XM_DATA_IN

@@@

Todo:
document

Definition at line 63 of file checkcable.c.

#define PP_XE_RESET_OUT   PP_XM_DATA_OUT

@@@

Todo:
document

Definition at line 57 of file checkcable.c.

#define PP_XM_ATN_IN   PP_XA_ATN_IN

@@@

Todo:
document

Definition at line 46 of file checkcable.c.

#define PP_XM_ATN_OUT   PP_XA_ATN_OUT

@@@

Todo:
document

Definition at line 40 of file checkcable.c.

#define PP_XM_CLK_IN   PP_XA_CLK_IN

@@@

Todo:
document

Definition at line 47 of file checkcable.c.

#define PP_XM_CLK_OUT   PP_XA_CLK_OUT

@@@

Todo:
document

Definition at line 41 of file checkcable.c.

#define PP_XM_DATA_IN   PP_XA_DATA_IN

@@@

Todo:
document

Definition at line 48 of file checkcable.c.

#define PP_XM_DATA_OUT   PP_XA_DATA_OUT

@@@

Todo:
document

Definition at line 42 of file checkcable.c.

#define PP_XM_EOR_IN   PP_XA_EOR_IN

@@@

Todo:
document

Definition at line 50 of file checkcable.c.

#define PP_XM_EOR_OUT   0xc4

@@@

Todo:
document

Definition at line 44 of file checkcable.c.

#define PP_XM_RESET_IN   PP_XA_RESET_IN

@@@

Todo:
document

Definition at line 49 of file checkcable.c.

#define PP_XM_RESET_OUT   PP_XA_RESET_OUT

@@@

Todo:
document

Definition at line 43 of file checkcable.c.

#define READ (   _x)    ((((READ_PORT_UCHAR(OUT_PORT) ^ Pdx->IecOutEor)) & (_x)) ? 1 : 0)

@@@

Todo:
document
Parameters
_x
Returns

Definition at line 156 of file checkcable.c.

#define SHOW (   _x,
  _y 
)

@@@

Todo:
document
Parameters
_x
_y

Definition at line 165 of file checkcable.c.

#define SHOW1 ( )
Value:
DBG_CABLE((DBG_PREFIX "############ ATN OUT = %u, CLOCK OUT = %u, DATA OUT = %u, RESET OUT = %u", \
\
DBG_CABLE((DBG_PREFIX "############ ATN IN = %u, CLOCK IN = %u, DATA IN = %u, RESET IN = %u", \
#define CBMIEC_GET(_line)
Definition: i_iec.h:75
#define PP_ATN_OUT
The ATN OUT bit.
Definition: i_iec.h:39
#define PP_DATA_OUT
The DATA OUT bit.
Definition: i_iec.h:41
#define PP_CLK_IN
The CLOCK IN bit.
Definition: i_iec.h:50
#define PP_RESET_OUT
The RESET OUT bit.
Definition: i_iec.h:42
#define READ(_x)
@@@
Definition: checkcable.c:156
#define PP_DATA_IN
The DATA IN bit.
Definition: i_iec.h:51
#define PP_CLK_OUT
The CLOCK OUT bit.
Definition: i_iec.h:40
#define PP_RESET_IN
The RESET IN bit.
Definition: i_iec.h:52
#define PP_ATN_IN
The ATN IN bit.
Definition: i_iec.h:49
#define DBG_PREFIX
Definition: debug.h:320

@@@

Todo:
document

Definition at line 169 of file checkcable.c.

Function Documentation

NTSTATUS cbmiec_checkcable ( PDEVICE_EXTENSION  Pdx)

Determine the type of cable (XA1541/XM1541) on the IEC bus.

This function tries to determine the type of cable with which the IEC bus is connected to the PC's parallel port. Afterwards, some variables in the device extension are initialized to reflect the type.

Parameters
PdxPointer to the device extension.
Returns
If the routine succeeds, it returns STATUS_SUCCESS. Otherwise, it returns one of the error status values.

Definition at line 334 of file checkcable.c.

References CABLESTATE_TESTED, CABLESTATE_UNKNOWN, CBMIEC_GET, cbmiec_setcablestate(), DBG_ERROR, DBG_PREFIX, DBG_SUCCESS, FUNC_ENTER, LogErrorString, OUT_PORT, PP_XA_ATN_IN, PP_XA_ATN_OUT, and READ_PORT_UCHAR.

Referenced by cbmiec_i_raw_read(), cbmiec_i_raw_write(), cbmiec_init(), and cbmiec_release_bus().

BOOLEAN cbmiec_is_cable_state_wrong ( PDEVICE_EXTENSION  Pdx)

@@@

Todo:
document
Parameters
Pdx
Returns

Definition at line 511 of file checkcable.c.

References CBMIEC_ARE_OUTPUT_LINES_CORRECT.

Referenced by cbm_execute_createopen().