OpenCBM
Macros | Functions
detectxp1541.c File Reference

Shared library / DLL for accessing the driver Detect an XP1541/XP1571 parallel cable. More...

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

Go to the source code of this file.

Macros

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

Functions

int CBMAPIDECL cbm_identify_xp1541 (CBM_FILE HandleDevice, unsigned char DeviceAddress, enum cbm_device_type_e *CbmDeviceType, enum cbm_cable_type_e *CableType)
 Identify the cable connected to a specific floppy drive. More...
 

Detailed Description

Shared library / DLL for accessing the driver Detect an XP1541/XP1571 parallel cable.



Author
Spiro Trikaliotis

Definition in file detectxp1541.c.

Macro Definition Documentation

#define DBG_PROGNAME   "OPENCBM.DLL"

The name of the executable

Definition at line 25 of file detectxp1541.c.

#define DBG_USERMODE

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

Definition at line 22 of file detectxp1541.c.

Function Documentation

int CBMAPIDECL cbm_identify_xp1541 ( CBM_FILE  HandleDevice,
unsigned char  DeviceAddress,
enum cbm_device_type_e CbmDeviceType,
enum cbm_cable_type_e CableType 
)

Identify the cable connected to a specific floppy drive.

This function tries to identify if the given floppy drive has an XP1541 cable connected.

Parameters
HandleDeviceA CBM_FILE which contains the file handle of the driver.
DeviceAddressThe address of the device on the IEC serial bus. This is known as primary address, too.
CbmDeviceTypePointer to an enum which holds the type of the device. If this pointer is NULL or the device type is set to unknown, this function calls cbm_identify itself to find out the device type. If this pointer is not set to NULL, this function will return the device type there.
CableTypePointer to an enum which will hold the cable type of the device on return.
Returns
0 if the drive could be contacted. It does not mean that the device could be identified.

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

Definition at line 187 of file detectxp1541.c.

References cbm_ct_none, cbm_ct_unknown, cbm_ct_xp1541, cbm_dt_cbm1541, cbm_dt_cbm1570, cbm_dt_cbm1571, cbm_dt_unknown, cbm_identify(), cbm_pp_read(), DBG_ASSERT, DBG_PREFIX, DBG_PRINT, FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by vdd_identify_xp1541().