Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

cbm.c File Reference

Shared library / DLL for accessing the driver. More...

#include "debug.h"
#include <stdlib.h>
#include <string.h>
#include "opencbm.h"
#include "archlib.h"

Go to the source code of this file.

Defines

#define DBG_USERMODE
#define DBG_PROGNAME   "OPENCBM.DLL"
#define DLL
 mark: We are building the DLL */

Functions

const char *CBMAPIDECL cbm_get_driver_name (int PortNumber)
 Get the name of the driver for a specific parallel port.
int CBMAPIDECL cbm_driver_open (CBM_FILE *HandleDevice, int PortNumber)
 Opens the driver.
void CBMAPIDECL cbm_driver_close (CBM_FILE HandleDevice)
 Closes the driver.
void CBMAPIDECL cbm_lock (CBM_FILE HandleDevice)
 Lock the parallel port for the driver.
void CBMAPIDECL cbm_unlock (CBM_FILE HandleDevice)
 Unlock the parallel port for the driver.
int CBMAPIDECL cbm_raw_write (CBM_FILE HandleDevice, const void *Buffer, size_t Count)
 Write data to the IEC serial bus.
int CBMAPIDECL cbm_raw_read (CBM_FILE HandleDevice, void *Buffer, size_t Count)
 Read data from the IEC serial bus.
int CBMAPIDECL cbm_listen (CBM_FILE HandleDevice, __u_char DeviceAddress, __u_char SecondaryAddress)
 Send a LISTEN on the IEC serial bus.
int CBMAPIDECL cbm_talk (CBM_FILE HandleDevice, __u_char DeviceAddress, __u_char SecondaryAddress)
 Send a TALK on the IEC serial bus.
int CBMAPIDECL cbm_open (CBM_FILE HandleDevice, __u_char DeviceAddress, __u_char SecondaryAddress, const void *Filename, size_t FilenameLength)
 Open a file on the IEC serial bus.
int CBMAPIDECL cbm_close (CBM_FILE HandleDevice, __u_char DeviceAddress, __u_char SecondaryAddress)
 Close a file on the IEC serial bus.
int CBMAPIDECL cbm_unlisten (CBM_FILE HandleDevice)
 Send an UNLISTEN on the IEC serial bus.
int CBMAPIDECL cbm_untalk (CBM_FILE HandleDevice)
 Send an UNTALK on the IEC serial bus.
int CBMAPIDECL cbm_get_eoi (CBM_FILE HandleDevice)
 Get EOI flag after bus read.
int CBMAPIDECL cbm_clear_eoi (CBM_FILE HandleDevice)
 Reset the EOI flag.
int CBMAPIDECL cbm_reset (CBM_FILE HandleDevice)
 RESET all devices.
__u_char CBMAPIDECL cbm_pp_read (CBM_FILE HandleDevice)
 Read a byte from a XP1541/XP1571 cable.
void CBMAPIDECL cbm_pp_write (CBM_FILE HandleDevice, __u_char Byte)
 Write a byte to a XP1541/XP1571 cable.
int CBMAPIDECL cbm_iec_poll (CBM_FILE HandleDevice)
 Read status of all bus lines.
void CBMAPIDECL cbm_iec_set (CBM_FILE HandleDevice, int Line)
 Activate a line on the IEC serial bus.
void CBMAPIDECL cbm_iec_release (CBM_FILE HandleDevice, int Line)
 Deactivate a line on the IEC serial bus.
void CBMAPIDECL cbm_iec_setrelease (CBM_FILE HandleDevice, int Set, int Release)
 Activate and deactive a line on the IEC serial bus.
int CBMAPIDECL cbm_iec_wait (CBM_FILE HandleDevice, int Line, int State)
 Wait for a line to have a specific state.
int CBMAPIDECL cbm_iec_get (CBM_FILE HandleDevice, int Line)
 Get the (logical) state of a line on the IEC serial bus.
int CBMAPIDECL cbm_device_status (CBM_FILE HandleDevice, __u_char DeviceAddress, void *Buffer, size_t BufferLength)
 Read the drive status from a floppy.
int CBMAPIDECL cbm_exec_command (CBM_FILE HandleDevice, __u_char DeviceAddress, const void *Command, size_t Size)
 Executes a command in the floppy drive.
__u_char CBMAPIDECL cbm_parallel_burst_read (CBM_FILE HandleDevice)
 PARBURST: Read from the parallel port.
void CBMAPIDECL cbm_parallel_burst_write (CBM_FILE HandleDevice, __u_char Value)
 PARBURST: Write to the parallel port.
int CBMAPIDECL cbm_parallel_burst_read_track (CBM_FILE HandleDevice, __u_char *Buffer, unsigned int Length)
 PARBURST: Read a complete track.
int CBMAPIDECL cbm_parallel_burst_write_track (CBM_FILE HandleDevice, __u_char *Buffer, unsigned int Length)
 PARBURST: Write a complete track.


Detailed Description

Shared library / DLL for accessing the driver.

**************************************************************

Author:
Michael Klein, Spiro Trikaliotis
Version:
Id
cbm.c,v 1.20 2006/04/10 10:26:33 trikalio Exp


Definition in file cbm.c.


Define Documentation

#define DBG_PROGNAME   "OPENCBM.DLL"
 

The name of the executable

Definition at line 25 of file cbm.c.

#define DBG_USERMODE
 

Mark: We are in user-space (for debug.h)

Definition at line 22 of file cbm.c.


Function Documentation

int CBMAPIDECL cbm_clear_eoi CBM_FILE  HandleDevice  ) 
 

Reset the EOI flag.

This function resets the EOI ("End of Information") flag which might be still set after reading the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
0 on success, != 0 means an error has occured.
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 517 of file cbm.c.

References cbmarch_clear_eoi(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_clear_eoi().

int CBMAPIDECL cbm_close CBM_FILE  HandleDevice,
__u_char  DeviceAddress,
__u_char  SecondaryAddress
 

Close a file on the IEC serial bus.

This function closes a file on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
DeviceAddress The address of the device on the IEC serial bus. This is known as primary address, too.
SecondaryAddress The secondary address for the device on the IEC serial bus.
Returns:
0 on success, else failure
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 409 of file cbm.c.

References cbmarch_close(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_close().

int CBMAPIDECL cbm_device_status CBM_FILE  HandleDevice,
__u_char  DeviceAddress,
void *  Buffer,
size_t  BufferLength
 

Read the drive status from a floppy.

This function reads the drive status of a connected floppy drive.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
DeviceAddress The address of the device on the IEC serial bus. This is known as primary address, too.
Buffer Pointer to a buffer which will hold the drive's status after successfull calling,
BufferLength The length of the buffer pointed to by Buffer in bytes.
Returns:
Returns the int representation of the drive status, that is, the numerical value of the first return value from the drive. This is the error number.
This function will never write more than BufferLength bytes. Nevertheless, the buffer will always be terminated with a trailing zero.

If an error occurs, this function returns a "99, DRIVER ERROR,00,00\r" and the value 99.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 845 of file cbm.c.

References cbm_raw_read(), cbmarch_talk(), cbmarch_untalk(), DBG_ASSERT, FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_device_status().

void CBMAPIDECL cbm_driver_close CBM_FILE  HandleDevice  ) 
 

Closes the driver.

Closes the driver, which has be opened with cbm_driver_open() before.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
cbm_driver_close() should be called to balance a previous call to cbm_driver_open().

If cbm_driver_open() did not succeed, it is illegal to call cbm_driver_close().

Definition at line 111 of file cbm.c.

References cbmarch_driver_close(), FUNC_ENTER, and FUNC_LEAVE.

Referenced by vdd_driver_close(), and vdd_driver_open().

int CBMAPIDECL cbm_driver_open CBM_FILE *  HandleDevice,
int  PortNumber
 

Opens the driver.

This function Opens the driver.

Parameters:
HandleDevice Pointer to a CBM_FILE which will contain the file handle of the driver.
PortNumber The port number of the driver to open. 0 means "default" driver, while values != 0 enumerate each driver.
Returns:
==0: This function completed successfully !=0: otherwise
PortNumber is not allowed to exceed 10.

cbm_driver_open() should be balanced with cbm_driver_close().

Definition at line 89 of file cbm.c.

References cbmarch_driver_open(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_driver_open().

int CBMAPIDECL cbm_exec_command CBM_FILE  HandleDevice,
__u_char  DeviceAddress,
const void *  Command,
size_t  Size
 

Executes a command in the floppy drive.

This function Executes a command in the connected floppy drive.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
DeviceAddress The address of the device on the IEC serial bus. This is known as primary address, too.
Command Pointer to a string which holds the command to be executed.
Size The length of the command in bytes. If zero, the Command has to be a null-terminated string.
Returns:
0 on success.
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 918 of file cbm.c.

References cbmarch_listen(), cbmarch_raw_write(), cbmarch_unlisten(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by cbm_identify(), and vdd_exec_command().

const char* CBMAPIDECL cbm_get_driver_name int  PortNumber  ) 
 

Get the name of the driver for a specific parallel port.

Get the name of the driver for a specific parallel port.

Parameters:
PortNumber The port number for the driver to open. 0 means "default" driver, while values != 0 enumerate each driver.
Returns:
Returns a pointer to a null-terminated string containing the driver name, or NULL if an error occurred.
Bug:
PortNumber is not allowed to exceed 10.

Definition at line 61 of file cbm.c.

References cbmarch_get_driver_name(), FUNC_ENTER, and FUNC_LEAVE_STRING.

Referenced by vdd_get_driver_name().

int CBMAPIDECL cbm_get_eoi CBM_FILE  HandleDevice  ) 
 

Get EOI flag after bus read.

This function gets the EOI ("End of Information") flag after reading the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
!= 0 if EOI was signalled, else 0.
If a previous read returned less than the specified number of bytes, there are two possible reasons: Either an error occurred on the IEC serial bus, or an EOI was signalled. To find out the cause, check with this function.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 494 of file cbm.c.

References cbmarch_get_eoi(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_get_eoi().

int CBMAPIDECL cbm_iec_get CBM_FILE  HandleDevice,
int  Line
 

Get the (logical) state of a line on the IEC serial bus.

This function gets the (logical) state of a line on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Line The line to be tested. This must be exactly one of IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET.
Returns:
1 if the line is set, 0 if it is not
If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!

Definition at line 798 of file cbm.c.

References cbmarch_iec_poll(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by cbmarch_iec_wait(), and vdd_iec_get().

int CBMAPIDECL cbm_iec_poll CBM_FILE  HandleDevice  ) 
 

Read status of all bus lines.

This function reads the state of all lines on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
The state of the lines. The result is an OR between the bit flags IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET.
This function just reads the port. No handshaking is performed at all.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!

Definition at line 641 of file cbm.c.

References cbmarch_iec_poll(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_iec_poll().

void CBMAPIDECL cbm_iec_release CBM_FILE  HandleDevice,
int  Line
 

Deactivate a line on the IEC serial bus.

This function deactivates (sets to 5V) a line on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Line The line to be deactivated. This must be exactly one of IEC_DATA, IEC_CLOCK, IEC_ATN, or IEC_RESET.
If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!

Definition at line 696 of file cbm.c.

References cbmarch_iec_release(), FUNC_ENTER, and FUNC_LEAVE.

Referenced by vdd_iec_release().

void CBMAPIDECL cbm_iec_set CBM_FILE  HandleDevice,
int  Line
 

Activate a line on the IEC serial bus.

This function activates (sets to 0V) a line on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Line The line to be activated. This must be exactly one of IEC_DATA, IEC_CLOCK, IEC_ATN, or IEC_RESET.
If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!

Definition at line 668 of file cbm.c.

References cbmarch_iec_set(), FUNC_ENTER, and FUNC_LEAVE.

Referenced by vdd_iec_set().

void CBMAPIDECL cbm_iec_setrelease CBM_FILE  HandleDevice,
int  Set,
int  Release
 

Activate and deactive a line on the IEC serial bus.

This function activates (sets to 0V, L) and deactivates (set to 5V, H) lines on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Set The mask of which lines should be set. This has to be a bitwise OR between the constants IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET
Release The mask of which lines should be released. This has to be a bitwise OR between the constants IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET
If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!
Remarks:
If a bit is specified in the Set as well as in the Release mask, the effect is undefined.

Definition at line 733 of file cbm.c.

References cbmarch_iec_setrelease(), FUNC_ENTER, and FUNC_LEAVE.

Referenced by vdd_iec_setrelease().

int CBMAPIDECL cbm_iec_wait CBM_FILE  HandleDevice,
int  Line,
int  State
 

Wait for a line to have a specific state.

This function waits for a line to enter a specific state on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Line The line to be deactivated. This must be exactly one of IEC_DATA, IEC_CLOCK, IEC_ATN, and IEC_RESET.
State If zero, then wait for this line to be deactivated.
If not zero, then wait for this line to be activated.
Returns:
The state of the IEC bus on return (like cbm_iec_poll).
If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!

Definition at line 769 of file cbm.c.

References cbmarch_iec_wait(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_iec_wait().

int CBMAPIDECL cbm_listen CBM_FILE  HandleDevice,
__u_char  DeviceAddress,
__u_char  SecondaryAddress
 

Send a LISTEN on the IEC serial bus.

This function sends a LISTEN on the IEC serial bus. This prepares a LISTENer, so that it will wait for our bytes we will write in the future.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
DeviceAddress The address of the device on the IEC serial bus. This is known as primary address, too.
SecondaryAddress The secondary address for the device on the IEC serial bus.
Returns:
0 means success, else failure
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 284 of file cbm.c.

References cbmarch_listen(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_listen().

void CBMAPIDECL cbm_lock CBM_FILE  HandleDevice  ) 
 

Lock the parallel port for the driver.

This function locks the driver onto the parallel port. This way, no other program or driver can allocate the parallel port and interfere with the communication.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
If cbm_driver_open() did not succeed, it is illegal to call cbm_driver_close().

Remarks:
A call to cbm_lock() is undone with a call to cbm_unlock().
Note that it is *not* necessary to call this function (or cbm_unlock()) when all communication is done with the handle to opencbm open (that is, between cbm_driver_open() and cbm_driver_close(). You only need this function to pin the driver to the port even when cbm_driver_close() is to be executed (for example, because the program terminates).

Definition at line 145 of file cbm.c.

Referenced by cbm_execute_devicecontrol().

int CBMAPIDECL cbm_open CBM_FILE  HandleDevice,
__u_char  DeviceAddress,
__u_char  SecondaryAddress,
const void *  Filename,
size_t  FilenameLength
 

Open a file on the IEC serial bus.

This function opens a file on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
DeviceAddress The address of the device on the IEC serial bus. This is known as primary address, too.
SecondaryAddress The secondary address for the device on the IEC serial bus.
Filename The filename of the file to be opened
FilenameLength The size of the Filename. If zero, the Filename has to be a null-terminated string.
Returns:
0 means success, else failure
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 351 of file cbm.c.

References cbm_raw_write(), cbm_unlisten(), cbmarch_open(), DBG_PREFIX, DBG_WARN, FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_open().

__u_char CBMAPIDECL cbm_parallel_burst_read CBM_FILE  HandleDevice  ) 
 

PARBURST: Read from the parallel port.

This function is a helper function for parallel burst: It reads from the parallel port.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
The value read from the parallel port
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 952 of file cbm.c.

References cbmarch_parallel_burst_read(), FUNC_ENTER, and FUNC_LEAVE_UCHAR.

int CBMAPIDECL cbm_parallel_burst_read_track CBM_FILE  HandleDevice,
__u_char *  Buffer,
unsigned int  Length
 

PARBURST: Read a complete track.

This function is a helper function for parallel burst: It reads a complete track from the disk

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Buffer Pointer to a buffer which will hold the bytes read.
Length The length of the Buffer.
Returns:
!= 0 on success.
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 1006 of file cbm.c.

References cbmarch_parallel_burst_read_track(), FUNC_ENTER, and FUNC_LEAVE_INT.

void CBMAPIDECL cbm_parallel_burst_write CBM_FILE  HandleDevice,
__u_char  Value
 

PARBURST: Write to the parallel port.

This function is a helper function for parallel burst: It writes to the parallel port.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Value The value to be written to the parallel port
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 975 of file cbm.c.

References cbmarch_parallel_burst_write(), FUNC_ENTER, and FUNC_LEAVE.

int CBMAPIDECL cbm_parallel_burst_write_track CBM_FILE  HandleDevice,
__u_char *  Buffer,
unsigned int  Length
 

PARBURST: Write a complete track.

This function is a helper function for parallel burst: It writes a complete track to the disk

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Buffer Pointer to a buffer which hold the bytes to be written.
Length The length of the Buffer.
Returns:
!= 0 on success.
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 1035 of file cbm.c.

References cbmarch_parallel_burst_write_track(), FUNC_ENTER, and FUNC_LEAVE_INT.

__u_char CBMAPIDECL cbm_pp_read CBM_FILE  HandleDevice  ) 
 

Read a byte from a XP1541/XP1571 cable.

This function reads a single byte from the parallel portion of an XP1541/1571 cable.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
the byte which was received on the parallel port
This function reads the current state of the port. No handshaking is performed at all.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!

Definition at line 579 of file cbm.c.

References cbmarch_pp_read(), FUNC_ENTER, and FUNC_LEAVE_UCHAR.

Referenced by cbm_identify_xp1541(), and vdd_pp_read().

void CBMAPIDECL cbm_pp_write CBM_FILE  HandleDevice,
__u_char  Byte
 

Write a byte to a XP1541/XP1571 cable.

This function writes a single byte to the parallel portion of a XP1541/1571 cable.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Byte the byte to be output on the parallel port
This function just writes on the port. No handshaking is performed at all.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Bug:
This function can't signal an error, thus, be careful!

Definition at line 610 of file cbm.c.

References cbmarch_pp_write(), FUNC_ENTER, and FUNC_LEAVE.

Referenced by vdd_pp_write().

int CBMAPIDECL cbm_raw_read CBM_FILE  HandleDevice,
void *  Buffer,
size_t  Count
 

Read data from the IEC serial bus.

This function retrieves data after a cbm_talk().

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Buffer Pointer to a buffer which will hold the bytes read.
Count Number of bytes to be read at most.
Returns:
>= 0: The actual number of bytes read. <0 indicates an error.
At most Count bytes are read.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 245 of file cbm.c.

References cbmarch_raw_read(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by cbm_device_status(), and vdd_raw_read().

int CBMAPIDECL cbm_raw_write CBM_FILE  HandleDevice,
const void *  Buffer,
size_t  Count
 

Write data to the IEC serial bus.

This function sends data after a cbm_listen().

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Buffer Pointer to a buffer which hold the bytes to write to the bus.
Count Number of bytes to be written.
Returns:
>= 0: The actual number of bytes written. <0 indicates an error.
This function tries to write Count bytes. Anyway, if an error occurs, this function can stop prematurely.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 209 of file cbm.c.

References cbmarch_raw_write(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by cbm_open(), and vdd_raw_write().

int CBMAPIDECL cbm_reset CBM_FILE  HandleDevice  ) 
 

RESET all devices.

This function performs a hardware RESET of all devices on the IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
0 on success, else failure
Don't overuse this function! Normally, an initial RESET should be enough.

Control is returned after a delay which ensures that all devices are ready again.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 546 of file cbm.c.

References cbmarch_reset(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_reset().

int CBMAPIDECL cbm_talk CBM_FILE  HandleDevice,
__u_char  DeviceAddress,
__u_char  SecondaryAddress
 

Send a TALK on the IEC serial bus.

This function sends a TALK on the IEC serial bus. This prepares a TALKer, so that it will prepare to send us some bytes in the future.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
DeviceAddress The address of the device on the IEC serial bus. This is known as primary address, too.
SecondaryAddress The secondary address for the device on the IEC serial bus.
Returns:
0 means success, else failure
If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 315 of file cbm.c.

References cbmarch_talk(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_talk().

int CBMAPIDECL cbm_unlisten CBM_FILE  HandleDevice  ) 
 

Send an UNLISTEN on the IEC serial bus.

This function sends an UNLISTEN on the IEC serial bus. Other than LISTEN and TALK, an UNLISTEN is not directed to just one device, but to all devices on that IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
0 on success, else failure
At least on a 1541 floppy drive, an UNLISTEN also undoes a previous TALK.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 437 of file cbm.c.

References cbmarch_unlisten(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by cbm_open(), and vdd_unlisten().

void CBMAPIDECL cbm_unlock CBM_FILE  HandleDevice  ) 
 

Unlock the parallel port for the driver.

This function unlocks the driver from the parallel port. This way, other programs and drivers can allocate the parallel port and do their own communication with whatever device they use.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
If cbm_driver_open() did not succeed, it is illegal to call cbm_driver_close().

Remarks:
Look at cbm_lock() for an explanation of this function.

Definition at line 172 of file cbm.c.

Referenced by cbm_execute_devicecontrol().

int CBMAPIDECL cbm_untalk CBM_FILE  HandleDevice  ) 
 

Send an UNTALK on the IEC serial bus.

This function sends an UNTALK on the IEC serial bus. Other than LISTEN and TALK, an UNTALK is not directed to just one device, but to all devices on that IEC serial bus.

Parameters:
HandleDevice A CBM_FILE which contains the file handle of the driver.
Returns:
0 on success, else failure
At least on a 1541 floppy drive, an UNTALK also undoes a previous LISTEN.

If cbm_driver_open() did not succeed, it is illegal to call this function.

Definition at line 465 of file cbm.c.

References cbmarch_untalk(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_untalk().


Generated on Sun Apr 30 18:46:05 2006 for opencbm by  doxygen 1.4.2