OpenCBM
dbgread.c
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 2008 Spiro Trikaliotis
8  *
9  */
10 
19 #include <wdm.h>
20 #include "cbm_driver.h"
21 #include "i_iec.h"
22 
23 
25 #define PARALLEL_STATUS_PORT_MASK_VALUES 0xF8
26 
50 NTSTATUS
51 cbmiec_iec_dbg_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Return)
52 {
53  UCHAR valueRead;
54 
55  FUNC_ENTER();
56 
57  valueRead = READ_PORT_UCHAR(IN_PORT);
58 
59  *Return = valueRead & PARALLEL_STATUS_PORT_MASK_VALUES;
60 
61  DBG_PRINT((DBG_PREFIX "Read from Status Port: %02x, converted to %02x", valueRead, *Return));
62 
63  FUNC_LEAVE_NTSTATUS_CONST(STATUS_SUCCESS);
64 }
Internal functions and definitions of the libiec library.
#define IN_PORT
Definition: i_iec.h:58
#define FUNC_ENTER()
Definition: debug.h:347
Definitions for the opencbm driver.
#define DBG_PREFIX
Definition: debug.h:320
NTSTATUS cbmiec_iec_dbg_read(IN PDEVICE_EXTENSION Pdx, OUT UCHAR *Return)
Read a byte from the parallel port input register.
Definition: dbgread.c:51
#define PARALLEL_STATUS_PORT_MASK_VALUES
Definition: dbgread.c:25
#define DBG_PRINT(_xxx)
Definition: debug.h:403
#define READ_PORT_UCHAR(_x_)
READ_PORT_UCHAR replacement for debugging.
Definition: i_iec.h:211