#include <sys/types.h>
Go to the source code of this file.
Defines | |
| #define | EXTERN extern |
| #define | CBMAPIDECL |
| #define | WINAPI |
| #define | CBM_FILE int |
| #define | CBM_FILE_INVALID ((CBM_FILE)-1) |
| #define | IEC_DATA 0x01 |
| #define | IEC_CLOCK 0x02 |
| #define | IEC_ATN 0x04 |
| #define | IEC_RESET 0x08 |
Enumerations | |
| enum | cbm_device_type_e { cbm_dt_unknown = -1, cbm_dt_cbm1541, cbm_dt_cbm1570, cbm_dt_cbm1571, cbm_dt_cbm1581 } |
| enum | cbm_cable_type_e { cbm_ct_unknown = -1, cbm_ct_none, cbm_ct_xp1541 } |
Functions | |
| EXTERN int CBMAPIDECL | cbm_driver_open (CBM_FILE *f, int port) |
| Opens the driver. | |
| EXTERN void CBMAPIDECL | cbm_driver_close (CBM_FILE f) |
| Closes the driver. | |
| EXTERN void CBMAPIDECL | cbm_lock (CBM_FILE f) |
| Lock the parallel port for the driver. | |
| EXTERN void CBMAPIDECL | cbm_unlock (CBM_FILE f) |
| Unlock the parallel port for the driver. | |
| EXTERN const char *CBMAPIDECL | cbm_get_driver_name (int port) |
| Get the name of the driver for a specific parallel port. | |
| EXTERN int CBMAPIDECL | cbm_listen (CBM_FILE f, __u_char dev, __u_char secadr) |
| Send a LISTEN on the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_talk (CBM_FILE f, __u_char dev, __u_char secadr) |
| Send a TALK on the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_open (CBM_FILE f, __u_char dev, __u_char secadr, const void *fname, size_t len) |
| Open a file on the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_close (CBM_FILE f, __u_char dev, __u_char secadr) |
| Close a file on the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_raw_read (CBM_FILE f, void *buf, size_t size) |
| Read data from the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_raw_write (CBM_FILE f, const void *buf, size_t size) |
| Write data to the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_unlisten (CBM_FILE f) |
| Send an UNLISTEN on the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_untalk (CBM_FILE f) |
| Send an UNTALK on the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_get_eoi (CBM_FILE f) |
| Get EOI flag after bus read. | |
| EXTERN int CBMAPIDECL | cbm_clear_eoi (CBM_FILE f) |
| Reset the EOI flag. | |
| EXTERN int CBMAPIDECL | cbm_reset (CBM_FILE f) |
| RESET all devices. | |
| EXTERN __u_char CBMAPIDECL | cbm_pp_read (CBM_FILE f) |
| Read a byte from a XP1541/XP1571 cable. | |
| EXTERN void CBMAPIDECL | cbm_pp_write (CBM_FILE f, __u_char c) |
| Write a byte to a XP1541/XP1571 cable. | |
| EXTERN int CBMAPIDECL | cbm_iec_poll (CBM_FILE f) |
| Read status of all bus lines. | |
| EXTERN int CBMAPIDECL | cbm_iec_get (CBM_FILE f, int line) |
| Get the (logical) state of a line on the IEC serial bus. | |
| EXTERN void CBMAPIDECL | cbm_iec_set (CBM_FILE f, int line) |
| Activate a line on the IEC serial bus. | |
| EXTERN void CBMAPIDECL | cbm_iec_release (CBM_FILE f, int line) |
| Deactivate a line on the IEC serial bus. | |
| EXTERN void CBMAPIDECL | cbm_iec_setrelease (CBM_FILE f, int set, int release) |
| Activate and deactive a line on the IEC serial bus. | |
| EXTERN int CBMAPIDECL | cbm_iec_wait (CBM_FILE f, int line, int state) |
| Wait for a line to have a specific state. | |
| EXTERN int CBMAPIDECL | cbm_upload (CBM_FILE f, __u_char dev, int adr, const void *prog, size_t size) |
| Upload a program into a floppy's drive memory. | |
| EXTERN int CBMAPIDECL | cbm_device_status (CBM_FILE f, __u_char dev, void *buf, size_t bufsize) |
| Read the drive status from a floppy. | |
| EXTERN int CBMAPIDECL | cbm_exec_command (CBM_FILE f, __u_char dev, const void *cmd, size_t len) |
| Executes a command in the floppy drive. | |
| EXTERN int CBMAPIDECL | cbm_identify (CBM_FILE f, __u_char drv, enum cbm_device_type_e *t, const char **type_str) |
| Identify the connected floppy drive. | |
| EXTERN int CBMAPIDECL | cbm_identify_xp1541 (CBM_FILE HandleDevice, __u_char DeviceAddress, enum cbm_device_type_e *CbmDeviceType, enum cbm_cable_type_e *CableType) |
| Identify the cable connected to a specific floppy drive. | |
| EXTERN char CBMAPIDECL | cbm_petscii2ascii_c (char character) |
| Convert a PETSCII character to ASCII. | |
| EXTERN char CBMAPIDECL | cbm_ascii2petscii_c (char character) |
| Convert an ASCII character to PETSCII. | |
| EXTERN char *CBMAPIDECL | cbm_petscii2ascii (char *str) |
| Convert an null-termined PETSCII string to ASCII. | |
| EXTERN char *CBMAPIDECL | cbm_ascii2petscii (char *str) |
| Convert an null-termined ASCII string to PETSCII. | |
| EXTERN __u_char CBMAPIDECL | cbm_parallel_burst_read (CBM_FILE f) |
| PARBURST: Read from the parallel port. | |
| EXTERN void CBMAPIDECL | cbm_parallel_burst_write (CBM_FILE f, __u_char c) |
| PARBURST: Write to the parallel port. | |
| EXTERN int CBMAPIDECL | cbm_parallel_burst_read_track (CBM_FILE f, __u_char *buffer, unsigned int length) |
| PARBURST: Read a complete track. | |
| EXTERN int CBMAPIDECL | cbm_parallel_burst_write_track (CBM_FILE f, __u_char *buffer, unsigned int length) |
| PARBURST: Write a complete track. | |
**************************************************************
Definition in file opencbm.h.
|
|
The "file descriptor" for an opened driver Definition at line 78 of file opencbm.h. Referenced by cbm_i_i_driver_install(), CbmInstallUpdate(), vdd_driver_open(), and VDDDispatch(). |
|
|
CBMAPIDECL is a dummy on Linux |
|
|
EXTERN is not defined on Linux |
|
|
Specify the ATN line Definition at line 86 of file opencbm.h. Referenced by opencbm_init(). |
|
|
Specify the CLOCK line Definition at line 85 of file opencbm.h. Referenced by opencbm_init(). |
|
|
Specify the DATA line Definition at line 84 of file opencbm.h. Referenced by opencbm_init(). |
|
|
Specify the RESET line Definition at line 87 of file opencbm.h. Referenced by opencbm_init(). |
|
|
WINAPI is a dummy on Linux |
|
|
Specifies the type of a device for cbm_identify() |
|
|
Specifies the type of a device for cbm_identify() |
|
|
Convert an null-termined ASCII string to PETSCII. This function converts a string in ASCII to PETSCII.
Definition at line 161 of file petscii.c. References cbm_ascii2petscii_c(). |
|
|
Convert an ASCII character to PETSCII. This function converts a character in ASCII to PETSCII.
Definition at line 106 of file petscii.c. Referenced by cbm_ascii2petscii(). |
|
|
Reset the EOI flag. This function resets the EOI ("End of Information") flag which might be still set after reading the IEC serial bus.
Definition at line 517 of file cbm.c. References cbmarch_clear_eoi(), FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by vdd_clear_eoi(). |
|
||||||||||||||||
|
Close a file on the IEC serial bus. This function closes a file on the IEC serial bus.
Definition at line 409 of file cbm.c. References cbmarch_close(), FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by vdd_close(). |
|
||||||||||||||||||||
|
Read the drive status from a floppy. This function reads the drive status of a connected floppy drive.
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(). |
|
|
Closes the driver. Closes the driver, which has be opened with cbm_driver_open() before.
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(). |
|
||||||||||||
|
Opens the driver. This function Opens the driver.
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(). |
|
||||||||||||||||||||
|
Executes a command in the floppy drive. This function Executes a command in the connected floppy drive.
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(). |
|
|
Get the name of the driver for a specific parallel port. Get the name of the driver for a specific parallel port.
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(). |
|
|
Get EOI flag after bus read. This function gets the EOI ("End of Information") flag after reading the IEC serial bus.
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(). |
|
||||||||||||||||||||
|
Identify the connected floppy drive. This function tries to identify a connected floppy drive. For this, it performs some M-R operations.
Definition at line 65 of file detect.c. References cbm_dt_cbm1541, cbm_dt_cbm1570, cbm_dt_cbm1571, cbm_dt_cbm1581, cbm_dt_unknown, cbm_exec_command(), cbmarch_raw_read(), cbmarch_talk(), cbmarch_untalk(), FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by cbm_identify_xp1541(), and vdd_identify(). |
|
||||||||||||||||||||
|
Identify the cable connected to a specific floppy drive. This function tries to identify if the given floppy drive has an XP1541 cable connected.
Definition at line 188 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(). |
|
||||||||||||
|
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.
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(). |
|
|
Read status of all bus lines. This function reads the state of all lines on the IEC serial bus.
If cbm_driver_open() did not succeed, it is illegal to call this function.
Definition at line 641 of file cbm.c. References cbmarch_iec_poll(), FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by vdd_iec_poll(). |
|
||||||||||||
|
Deactivate a line on the IEC serial bus. This function deactivates (sets to 5V) a line on the IEC serial bus.
Definition at line 696 of file cbm.c. References cbmarch_iec_release(), FUNC_ENTER, and FUNC_LEAVE. Referenced by vdd_iec_release(). |
|
||||||||||||
|
Activate a line on the IEC serial bus. This function activates (sets to 0V) a line on the IEC serial bus.
Definition at line 668 of file cbm.c. References cbmarch_iec_set(), FUNC_ENTER, and FUNC_LEAVE. Referenced by vdd_iec_set(). |
|
||||||||||||||||
|
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.
Definition at line 733 of file cbm.c. References cbmarch_iec_setrelease(), FUNC_ENTER, and FUNC_LEAVE. Referenced by vdd_iec_setrelease(). |
|
||||||||||||||||
|
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.
Definition at line 769 of file cbm.c. References cbmarch_iec_wait(), FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by vdd_iec_wait(). |
|
||||||||||||||||
|
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.
Definition at line 284 of file cbm.c. References cbmarch_listen(), FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by vdd_listen(). |
|
|
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.
Definition at line 145 of file cbm.c. References cbmarch_lock(), FUNC_ENTER, and FUNC_LEAVE. |
|
||||||||||||||||||||||||
|
Open a file on the IEC serial bus. This function opens a file on the IEC serial bus.
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(). |
|
|
PARBURST: Read from the parallel port. This function is a helper function for parallel burst: It reads from the parallel port.
Definition at line 952 of file cbm.c. References cbmarch_parallel_burst_read(), FUNC_ENTER, and FUNC_LEAVE_UCHAR. |
|
||||||||||||||||
|
PARBURST: Read a complete track. This function is a helper function for parallel burst: It reads a complete track from the disk
Definition at line 1006 of file cbm.c. References cbmarch_parallel_burst_read_track(), FUNC_ENTER, and FUNC_LEAVE_INT. |
|
||||||||||||
|
PARBURST: Write to the parallel port. This function is a helper function for parallel burst: It writes to the parallel port.
Definition at line 975 of file cbm.c. References cbmarch_parallel_burst_write(), FUNC_ENTER, and FUNC_LEAVE. |
|
||||||||||||||||
|
PARBURST: Write a complete track. This function is a helper function for parallel burst: It writes a complete track to the disk
Definition at line 1035 of file cbm.c. References cbmarch_parallel_burst_write_track(), FUNC_ENTER, and FUNC_LEAVE_INT. |
|
|
Convert an null-termined PETSCII string to ASCII. This function converts a string in PETSCII to ASCII.
Definition at line 137 of file petscii.c. References cbm_petscii2ascii_c(). |
|
|
Convert a PETSCII character to ASCII. This function converts a character in PETSCII to ASCII.
Definition at line 65 of file petscii.c. Referenced by cbm_petscii2ascii(). |
|
|
Read a byte from a XP1541/XP1571 cable. This function reads a single byte from the parallel portion of an XP1541/1571 cable.
If cbm_driver_open() did not succeed, it is illegal to call this function.
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(). |
|
||||||||||||
|
Write a byte to a XP1541/XP1571 cable. This function writes a single byte to the parallel portion of a XP1541/1571 cable.
If cbm_driver_open() did not succeed, it is illegal to call this function.
Definition at line 610 of file cbm.c. References cbmarch_pp_write(), FUNC_ENTER, and FUNC_LEAVE. Referenced by vdd_pp_write(). |
|
||||||||||||||||
|
Read data from the IEC serial bus. This function retrieves data after a cbm_talk().
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(). |
|
||||||||||||||||
|
Write data to the IEC serial bus. This function sends data after a cbm_listen().
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(). |
|
|
RESET all devices. This function performs a hardware RESET of all devices on the IEC serial bus.
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(). |
|
||||||||||||||||
|
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.
Definition at line 315 of file cbm.c. References cbmarch_talk(), FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by vdd_talk(). |
|
|
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.
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(). |
|
|
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.
Definition at line 172 of file cbm.c. References cbmarch_unlock(), FUNC_ENTER, and FUNC_LEAVE. |
|
|
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.
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(). |
|
||||||||||||||||||||||||
|
Upload a program into a floppy's drive memory. This function writes a program into the drive's memory via use of "M-W" commands.
Definition at line 73 of file upload.c. References cbmarch_listen(), cbmarch_raw_write(), cbmarch_unlisten(), DBG_ASSERT, FUNC_ENTER, and FUNC_LEAVE_INT. Referenced by vdd_upload(). |
1.4.2