OpenCBM
poll.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 1999-2004 Michael Klein <michael(dot)klein(at)puffin(dot)lb(dot)shuttle(dot)de>
8  * Copyright 2001-2004 Spiro Trikaliotis
9  *
10  */
11 
22 #include <wdm.h>
23 #include "cbm_driver.h"
24 #include "i_iec.h"
25 
38 NTSTATUS
39 cbmiec_iec_poll(IN PDEVICE_EXTENSION Pdx, OUT PUCHAR Result)
40 {
41  UCHAR ch;
42 
43  FUNC_ENTER();
44 
46 
47  *Result = 0;
48 
49  if((ch & PP_DATA_IN) == 0) *Result |= IEC_LINE_DATA;
50  if((ch & PP_CLK_IN) == 0) *Result |= IEC_LINE_CLOCK;
51  if((ch & PP_ATN_IN) == 0) *Result |= IEC_LINE_ATN;
52  if((ch & PP_RESET_IN)== 0) *Result |= IEC_LINE_RESET;
53 
54  FUNC_LEAVE_NTSTATUS_CONST(STATUS_SUCCESS);
55 }
#define PP_CLK_IN
The CLOCK IN bit.
Definition: i_iec.h:50
Internal functions and definitions of the libiec library.
#define IN_PORT
Definition: i_iec.h:58
#define PP_DATA_IN
The DATA IN bit.
Definition: i_iec.h:51
#define IEC_LINE_RESET
Definition: cbmioctl.h:80
#define IEC_LINE_DATA
Definition: cbmioctl.h:74
#define PP_RESET_IN
The RESET IN bit.
Definition: i_iec.h:52
#define FUNC_ENTER()
Definition: debug.h:347
#define PP_ATN_IN
The ATN IN bit.
Definition: i_iec.h:49
Definitions for the opencbm driver.
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
#define IEC_LINE_ATN
Definition: cbmioctl.h:78
#define IEC_LINE_CLOCK
Definition: cbmioctl.h:76
#define READ_PORT_UCHAR(_x_)
READ_PORT_UCHAR replacement for debugging.
Definition: i_iec.h:211