All communication between the user space applications and the kernel module
is done with ioctl's. Since ioctl's are quite unportable and hardly provide
any type-safety, there are a number of wrapper-functions along with a couple
of convenience functions implemented in libcbm4linux.a
. The Prototypes can
be found in cbm4linux.h>
.
These defines are used by the cbm_iec_*() functions. You will definitely need this if you intend to implement your own custom transfer routines. See the d64copy source for more information.
This is the name of the cbm4linux character device. Normally /dev/cbm
.
This file needs to be opened to access any cbm4linux functionality.
(All functions: f must be a valid file descriptor)
Tell device dev to listen on secondary channel secadr. Return value 0 on success, < 0 means error.
Tell device dev to talk on secondary channel secadr. Return value 0 on success, < 0 means error.
Prepare device dev for opening a file. This device listens for the file name after this call which is normally sent by a call to the write()-function followed by an unlisten() call. Return value 0 on success, < 0 means error.
Close file associated with secondard address secadr on device dev. Return value 0 on success, < 0 means error.
Send unlisten on bus. Return value 0 on success, < 0 means error.
Send untalk on bus. Return value 0 on success, < 0 means error. descriptor.
Get EOI flag after bus read, return velue is 0 with no EOI, otherwise 1. When EOI is set to 1, the active talker has nothing more to send.
Do a hardware reset on all connected devices. Control is returned after a 5 second delay.
Read byte from XP1541/XP1571 bus. No hardshaking or such involved.
Write byte to XP1541/XP1571 bus. No hardshaking or such involved.
Read status of all bus lines. Return value if a combination of
IEC_ATN
, IEC_CLOCK
and IEC_DATA
.
Get (logical) status of line line.
Activate line line (set to 0V).
Release line line (set to 5V).
Experimental.
Write prog into device dev's memory space via a series of M-W commands.
Read device status info buf, at most bufsize bytes are read. Returns atoi(buf).
Execute command cmd. Returns number of bytes actually written.