OpenCBM
talk.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 
43 NTSTATUS
44 cbmiec_talk(IN PDEVICE_EXTENSION Pdx, IN UCHAR Device, IN UCHAR Secaddr)
45 {
46  NTSTATUS ntStatus;
47  ULONG sent;
48  UCHAR buffer[2];
49 
50  FUNC_ENTER();
51 
52  FUNC_PARAM((DBG_PREFIX "Device = 0x%02x, Secaddr = 0x%02x", (int)Device, (int)Secaddr));
53 
54  // send a 0x4x / 0x6y (talk device x, secaddr y) under control of ATN
55 
56  buffer[0] = 0x40 | Device;
57  buffer[1] = 0x60 | Secaddr;
58  ntStatus = cbmiec_i_raw_write(Pdx, buffer, 2, &sent, 1, 1);
59 
60  Pdx->DoNotReleaseBus = TRUE;
61 
62  FUNC_LEAVE_NTSTATUS(ntStatus);
63 }
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.
Definition: i_rawwrite.c:54
NTSTATUS cbmiec_talk(IN PDEVICE_EXTENSION Pdx, IN UCHAR Device, IN UCHAR Secaddr)
Send a TALK over the IEC bus.
Definition: talk.c:44
Internal functions and definitions of the libiec library.
#define FUNC_ENTER()
Definition: debug.h:347
#define FUNC_PARAM(_xxx)
Definition: debug.h:351
Definitions for the opencbm driver.
#define DBG_PREFIX
Definition: debug.h:320