-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparlcd.h
50 lines (36 loc) · 1.3 KB
/
parlcd.h
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
/*
* Copyright 2000-2001 by Geert Uytterhoeven <[email protected]>
*
* This programs is subject to the terms and conditions of the GNU General
* Public License
*/
/*
* Parallel Port Register Definitions
*/
#define PARPORT_BASE 0x378
#define PARPORT_DATA (PARPORT_BASE+0)
#define PARPORT_STATUS (PARPORT_BASE+1)
#define PARPORT_CONTROL (PARPORT_BASE+2)
#define PARPORT_CONTROL_STROBE 0x1
#define PARPORT_CONTROL_AUTOFD 0x2
#define PARPORT_CONTROL_INIT 0x4
#define PARPORT_CONTROL_SELECT 0x8
#define PARPORT_STATUS_ERROR 0x8
#define PARPORT_STATUS_SELECT 0x10
#define PARPORT_STATUS_PAPEROUT 0x20
#define PARPORT_STATUS_ACK 0x40
#define PARPORT_STATUS_BUSY 0x80
/*
* Parallel Port Register Access
*/
static inline u8 parport_read_data(void) { return inb(PARPORT_DATA); }
static inline void parport_write_data(u8 val) { outb(val, PARPORT_DATA); }
static inline u8 parport_read_status(void) { return inb(PARPORT_STATUS); }
static inline void parport_write_status(u8 val) { outb(val, PARPORT_STATUS); }
static inline u8 parport_read_control(void) { return inb(PARPORT_CONTROL); }
static inline void parport_write_control(u8 val) { outb(val, PARPORT_CONTROL); }
/*
* Parallel Port LCD Control
*/
extern void parlcd_init(int width);
extern void parlcd_cleanup(void);