OpenCBM
Macros | Functions
detect.c File Reference

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

#include "debug.h"
#include <stdlib.h>
#include "opencbm.h"
#include "archlib.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 (CBM_FILE HandleDevice, unsigned char DeviceAddress, enum cbm_device_type_e *CbmDeviceType, const char **CbmDeviceString)
 Identify the connected floppy drive. More...
 

Detailed Description

Shared library / DLL for accessing the driver.



Author
Michael Klein, Spiro Trikaliotis

Definition in file detect.c.

Macro Definition Documentation

#define DBG_PROGNAME   "OPENCBM.DLL"

The name of the executable

Definition at line 26 of file detect.c.

#define DBG_USERMODE

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

Definition at line 23 of file detect.c.

Function Documentation

int CBMAPIDECL cbm_identify ( CBM_FILE  HandleDevice,
unsigned char  DeviceAddress,
enum cbm_device_type_e CbmDeviceType,
const char **  CbmDeviceString 
)

Identify the connected floppy drive.

This function tries to identify a connected floppy drive. For this, it performs some M-R operations.

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 will hold the type of the device.
CbmDeviceStringPointer to a pointer which will point on a string which tells the name of the device.
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 66 of file detect.c.

References cbm_dt_cbm1541, cbm_dt_cbm1570, cbm_dt_cbm1571, cbm_dt_cbm1581, cbm_dt_cbm3040, cbm_dt_cbm4040, cbm_dt_cbm8050, cbm_dt_cbm8250, cbm_dt_unknown, cbm_exec_command(), cbm_raw_read(), cbm_talk(), cbm_untalk(), FUNC_ENTER, and FUNC_LEAVE_INT.

Referenced by cbm_identify_xp1541(), and vdd_identify().