File: serialVFD_io.h

package info (click to toggle)
lcdproc 0.5.9-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 5,064 kB
  • sloc: ansic: 59,645; sh: 1,740; perl: 681; makefile: 417
file content (53 lines) | stat: -rw-r--r-- 1,987 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*-
 * Copyright (C) 2006 Stefan Herdler
 *
 * This driver is based on wirz-sli.c, hd44780.c, drv_base.c and NoritakeVFD
 * driver. It may contain parts of other drivers of this package too.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 */

/*
 * 2006-05-16 Version 0.3: everything should work (not all hardware tested!)
 */

#ifndef SERIALVFD_IO_H
#define SERIALVFD_IO_H

int serialVFD_init_serial (Driver *drvthis);
int serialVFD_init_parallel (Driver *drvthis);
void serialVFD_write_serial (Driver *drvthis, unsigned char *dat, size_t length);
void serialVFD_write_parallel (Driver *drvthis, unsigned char *dat, size_t length);
void serialVFD_close_serial (Driver *drvthis);
void serialVFD_close_parallel (Driver *drvthis);

/** Function list for low-level I/O routines */
typedef struct Port_fkt {
	void (*write_fkt) (Driver *drvthis, unsigned char *dat, size_t length);
	int (*init_fkt) (Driver *drvthis);
	void (*close_fkt) (Driver *drvthis);
} Port_fkt;

/**
 * Array with function pointers to low-level I/O routines.
 * Port_Function[0] stores routines for serial ports, Port_Function[1] those
 * for parallel ports.
 */
static const Port_fkt Port_Function[] = {
	{serialVFD_write_serial, serialVFD_init_serial, serialVFD_close_serial},
	{serialVFD_write_parallel, serialVFD_init_parallel, serialVFD_close_parallel}
};

#endif