parport(3hal) | HAL | parport(3hal) |
hal_parport - portable access to PC-style parallel ports
#include "hal_parport.h"
int hal_parport_get(int comp_id, hal_parport_t *port, unsigned short base, unsigned short base_hi, unsigned int modes)
void hal_parport_release(hal_parport_t *port)
hal_parport_get allocates a parallel port for exclusive use of the named HAL component. The port must be released with hal_parport_release before the component exits with hal_exit.
If the port is a parallel port known to Linux, and Linux detected a high I/O address, this value is used. Otherwise, if base+0x400 is not registered to any device, it is used. Otherwise, no address is used. If no high address is detected, port->base_hi is 0.
typedef struct { unsigned short base; unsigned short base_hi; .... // and further unspecified fields } hal_parport_t;
hal_parport_get returns a HAL status code. On success, port is filled out with information about the allocated port. On failure, the contents of port are undefined except that it is safe (but not required) to pass this port to hal_parport_release.
hal_parport_release does not return a value. It always succeeds.
In new code, prefer use of rtapi_parport to hal_parport.
2006-10-12 | LinuxCNC Documentation |