0.1.1
by Reinhard Tartler
Import upstream version 0.11.0~svn1143 |
1 |
/* $Id: drv_generic_parport.h 840 2007-09-09 12:17:42Z michael $
|
2 |
* $URL: https://ssl.bulix.org/svn/lcd4linux/trunk/drv_generic_parport.h $
|
|
325
by reinelt
[lcd4linux @ 2004-01-20 14:35:38 by reinelt] |
3 |
*
|
4 |
* generic driver helper for parallel port displays
|
|
5 |
*
|
|
0.1.1
by Reinhard Tartler
Import upstream version 0.11.0~svn1143 |
6 |
* Copyright (C) 1999, 2000 Michael Reinelt <michael@reinelt.co.at>
|
508
by reinelt
[lcd4linux @ 2005-01-18 06:30:21 by reinelt] |
7 |
* Copyright (C) 2004 The LCD4Linux Team <lcd4linux-devel@users.sourceforge.net>
|
325
by reinelt
[lcd4linux @ 2004-01-20 14:35:38 by reinelt] |
8 |
*
|
9 |
* This file is part of LCD4Linux.
|
|
10 |
*
|
|
11 |
* LCD4Linux is free software; you can redistribute it and/or modify
|
|
12 |
* it under the terms of the GNU General Public License as published by
|
|
13 |
* the Free Software Foundation; either version 2, or (at your option)
|
|
14 |
* any later version.
|
|
15 |
*
|
|
16 |
* LCD4Linux is distributed in the hope that it will be useful,
|
|
17 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19 |
* GNU General Public License for more details.
|
|
20 |
*
|
|
21 |
* You should have received a copy of the GNU General Public License
|
|
22 |
* along with this program; if not, write to the Free Software
|
|
23 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
24 |
*
|
|
25 |
*/
|
|
26 |
||
27 |
/*
|
|
28 |
*
|
|
29 |
* exported fuctions:
|
|
30 |
*
|
|
31 |
* int drv_generic_parport_open (void)
|
|
32 |
* reads 'Port' entry from config and opens
|
|
33 |
* the parallel port
|
|
34 |
* returns 0 if ok, -1 on failure
|
|
35 |
*
|
|
36 |
* int drv_generic_parport_close (void)
|
|
37 |
* closes parallel port
|
|
38 |
* returns 0 if ok, -1 on failure
|
|
39 |
*
|
|
40 |
* unsigned char drv_generic_parport_wire_ctrl (char *name, char *deflt)
|
|
41 |
* reads wiring for one control signal from config
|
|
42 |
* returns DRV_GENERIC_PARPORT_CONTROL_* or 255 on error
|
|
43 |
*
|
|
489
by reinelt
[lcd4linux @ 2004-09-18 15:58:57 by reinelt] |
44 |
* unsigned char drv_generic_parport_hardwire_ctrl (char *name)
|
45 |
* returns hardwiring for one control signal
|
|
46 |
* same as above, but does not read from config,
|
|
539
by reinelt
[lcd4linux @ 2005-05-04 06:13:05 by reinelt] |
47 |
* but checks the config and emits a warning that the config
|
489
by reinelt
[lcd4linux @ 2004-09-18 15:58:57 by reinelt] |
48 |
* entry will be ignored
|
49 |
* returns DRV_GENERIC_PARPORT_CONTROL_* or 255 on error
|
|
50 |
*
|
|
539
by reinelt
[lcd4linux @ 2005-05-04 06:13:05 by reinelt] |
51 |
* unsigned char drv_generic_parport_wire_status (char *name, char *deflt)
|
52 |
* reads wiring for one status signal from config
|
|
53 |
* returns DRV_GENERIC_PARPORT_STATUS_* or 255 on error
|
|
54 |
*
|
|
325
by reinelt
[lcd4linux @ 2004-01-20 14:35:38 by reinelt] |
55 |
* unsigned char drv_generic_parport_wire_data (char *name, char *deflt)
|
56 |
* reads wiring for one data signal from config
|
|
57 |
* returns 1<<bitpos or 255 on error
|
|
58 |
*
|
|
59 |
* void drv_generic_parport_direction (int direction)
|
|
60 |
* 0 - write to parport
|
|
61 |
* 1 - read from parport
|
|
62 |
*
|
|
486
by reinelt
[lcd4linux @ 2004-09-18 08:22:59 by reinelt] |
63 |
* unsigned char drv_generic_parport_status (void)
|
64 |
* reads control lines
|
|
65 |
*
|
|
325
by reinelt
[lcd4linux @ 2004-01-20 14:35:38 by reinelt] |
66 |
* void drv_generic_parport_control (unsigned char mask, unsigned char value)
|
67 |
* frobs control line and takes care of inverted signals
|
|
68 |
*
|
|
69 |
* void drv_generic_parport_toggle (unsigned char bit, int level, int delay)
|
|
70 |
* toggles the line <bit> to <level> for <delay> nanoseconds
|
|
71 |
*
|
|
72 |
* void drv_generic_parport_data (unsigned char value)
|
|
73 |
* put data bits on DB1..DB8
|
|
74 |
*
|
|
75 |
* unsigned char drv_generic_parport_read (void)
|
|
76 |
* reads a byte from the parallel port
|
|
77 |
*
|
|
78 |
* void drv_generic_parport_debug(void)
|
|
79 |
* prints status of control lines
|
|
80 |
*
|
|
81 |
*/
|
|
82 |
||
83 |
#ifndef _DRV_GENERIC_PARPORT_H_
|
|
84 |
#define _DRV_GENERIC_PARPORT_H_
|
|
85 |
||
546
by reinelt
[lcd4linux @ 2005-05-08 04:32:43 by reinelt] |
86 |
int drv_generic_parport_open(const char *section, const char *driver); |
87 |
int drv_generic_parport_close(void); |
|
88 |
unsigned char drv_generic_parport_wire_ctrl(const char *name, const char *deflt); |
|
89 |
unsigned char drv_generic_parport_hardwire_ctrl(const char *name, const char *deflt); |
|
90 |
unsigned char drv_generic_parport_wire_status(const char *name, const char *deflt); |
|
91 |
unsigned char drv_generic_parport_wire_data(const char *name, const char *deflt); |
|
92 |
void drv_generic_parport_direction(const int direction); |
|
93 |
unsigned char drv_generic_parport_status(void); |
|
94 |
void drv_generic_parport_control(const unsigned char mask, const unsigned char value); |
|
598
by reinelt
[lcd4linux @ 2005-12-12 05:52:03 by reinelt] |
95 |
void drv_generic_parport_toggle(const unsigned char bit, const int level, const unsigned long delay); |
546
by reinelt
[lcd4linux @ 2005-05-08 04:32:43 by reinelt] |
96 |
void drv_generic_parport_data(const unsigned char data); |
97 |
unsigned char drv_generic_parport_read(void); |
|
98 |
void drv_generic_parport_debug(void); |
|
325
by reinelt
[lcd4linux @ 2004-01-20 14:35:38 by reinelt] |
99 |
|
100 |
#endif
|