SERDISP_CONNECT

Accessing an output device

serdisp_CONN_t * SDCONN_open (const char sdcdev[])
 opens an output device More...
 
void SDCONN_close (serdisp_CONN_t *sdcd)
 closes an output device More...
 

Deprecated functions

serdisp_CONN_t * SDCONN_import_PP (int directIO, int hport)
 imports an existing parport handle More...
 

Detailed Description

Introduction

serdisp_connect.h offers functions for opening and closing output devices using a descriptor ('sdcd').

Features

Output devices

Supported access methods

Nota Bene: ioctl vs. direct-io is only valid for displays connected to parallel or serial ports.

The default output-method uses 'ioctl'-calls using device names (eg: /dev/parport0).

serdisplib also supports using direct-IO (using port-addresses and inline-assembler).

Pros and contras

Tested compilers

Operating systems (tested)

Operating systems (untested)

Function Documentation

void SDCONN_close ( serdisp_CONN_t *  sdcd)
Parameters
sdcdserdisp connect descriptor
serdisp_CONN_t* SDCONN_import_PP ( int  directIO,
int  hport 
)

import an existing already opened parport device / port and create a sdcd struct out of it

Parameters
directIO1: yes -> outp-calls, 0: no -> ioctl-calls
hportif directIO: port (eg: 0x378), else: descriptor for parport dev
Return values
!NULLserdisp connect descriptor
NULLoperation was unsuccessful
Deprecated:
has not been used so far, unsafe
Attention
USE WITH CARE!!! all permissions and stuff like that must be ok before!! no checking for validity in here
serdisp_CONN_t* SDCONN_open ( const char  sdcdev[])
Parameters
sdcdevdevice name or port-number of device to open

Format: [conntype:]device

  • conntype (connection type) is case insensitive
  • no connection type is needed for known devices (list below)

List of known devices:

device           conntype remark
---------------- -------- ----------------------------------------
/dev/parportX    PAR      or PARPORT (alias name)
/dev/ppiX        PAR      bsd
/dev/ecppX       PAR      solaris
0x378            PAR      first parallel port, linux, direct IO
0x278            PAR      second parallel port, linux, direct IO
/dev/ttySX       SERRAW
/dev/ttyUSBX     SERRAW
/dev/cuaX        SERRAW
0x3f8            SERRAW   first serial port, linux, direct IO
0x2f8            SERRAW   second serial port, linux, direct IO    

Examples:

sdcdev                   remark
-----------------------  -----------------------------------------------
"/dev/parport0"          parallel port, ioctl, linux
"0x378"                  parallel port, direct IO, linux 86 only
"/dev/ecpp0"             parallel port, ioctl, solaris
"/dev/ttyS0"             serial port, ioctl, should be os-indepentend (POSIX)
"0x3f8"                  serial port, direct IO, linux x86 only

"serraw:/dev/ttyS0"      serial device, ioctl
"SERRAW:/dev/ttyS0"      the same as above because connection type is case-insensitive
"SERPORT:/dev/ttyS0"     the same because SERPORT and SERRAW are synonyms
"serraw:0x3f8"           serial device, direct IO
"par:/dev/parport0"      linux, ioctl    
Return values
!NULLserdisp connect descriptor
NULLoperation was unsuccessful
Attention
direct IO is only supported with linux (for now - maybe someone may try if this is also valid with freebsd).