Hamlib  4.0~git
parallel.h
1 /*
2  * Hamlib Interface - parallel communication header
3  * Copyright (c) 2000-2003 by Frank Singleton
4  * Copyright (c) 2000-2010 by Stephane Fillod
5  *
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 #ifndef _PARALLEL_H
24 #define _PARALLEL_H 1
25 
26 #include <hamlib/rig.h>
27 #include "iofunc.h"
28 
29 #ifdef HAVE_LINUX_PARPORT_H
30 // cppcheck-suppress *
31 # include <linux/parport.h>
32 #endif
33 
34 #ifndef PARPORT_CONTROL_STROBE
35 # define PARPORT_CONTROL_STROBE 0x1
36 #endif
37 
38 #ifndef PARPORT_CONTROL_AUTOFD
39 # define PARPORT_CONTROL_AUTOFD 0x2
40 #endif
41 
42 #ifndef PARPORT_CONTROL_INIT
43 # define PARPORT_CONTROL_INIT 0x4
44 #endif
45 
46 #ifndef PARPORT_CONTROL_SELECT
47 # define PARPORT_CONTROL_SELECT 0x8
48 #endif
49 
50 #ifndef PARPORT_STATUS_ERROR
51 # define PARPORT_STATUS_ERROR 0x8
52 #endif
53 
54 #ifndef PARPORT_STATUS_SELECT
55 # define PARPORT_STATUS_SELECT 0x10
56 #endif
57 
58 #ifndef PARPORT_STATUS_PAPEROUT
59 # define PARPORT_STATUS_PAPEROUT 0x20
60 #endif
61 
62 #ifndef PARPORT_STATUS_ACK
63 # define PARPORT_STATUS_ACK 0x40
64 #endif
65 
66 #ifndef PARPORT_STATUS_BUSY
67 # define PARPORT_STATUS_BUSY 0x80
68 #endif
69 
70 __BEGIN_DECLS
71 
72 /* Hamlib internal use, see rig.c */
73 int par_open(hamlib_port_t *p);
74 int par_close(hamlib_port_t *p);
75 int par_ptt_set(hamlib_port_t *p, ptt_t pttx);
76 int par_ptt_get(hamlib_port_t *p, ptt_t *pttx);
77 int par_dcd_get(hamlib_port_t *p, dcd_t *dcdx);
78 
79 extern HAMLIB_EXPORT(int) par_write_data(hamlib_port_t *p, unsigned char data);
80 extern HAMLIB_EXPORT(int) par_write_control(hamlib_port_t *p,
81  unsigned char control);
82 
83 extern HAMLIB_EXPORT(int) par_read_data(hamlib_port_t *p, unsigned char *data);
84 extern HAMLIB_EXPORT(int) par_read_control(hamlib_port_t *p,
85  unsigned char *control);
86 
87 extern HAMLIB_EXPORT(int) par_read_status(hamlib_port_t *p,
88  unsigned char *status);
89 
90 extern HAMLIB_EXPORT(int) par_lock(hamlib_port_t *p);
91 extern HAMLIB_EXPORT(int) par_unlock(hamlib_port_t *p);
92 
93 __END_DECLS
94 
95 #endif /* _PARALLEL_H */
ptt_t
ptt_t
PTT status.
Definition: rig.h:535
par_ptt_set
int par_ptt_set(hamlib_port_t *p, ptt_t pttx)
Set or unset Push to talk bit on Parallel Port.
Definition: parallel.c:633
par_unlock
int par_unlock(hamlib_port_t *p)
Release lock on Parallel Port.
Definition: parallel.c:591
rig.h
Hamlib rig data structures.
par_write_data
int par_write_data(hamlib_port_t *p, unsigned char data)
Send data on Parallel port.
Definition: parallel.c:244
dcd_t
enum dcd_e dcd_t
DCD status.
par_read_status
int par_read_status(hamlib_port_t *p, unsigned char *status)
Get parallel port status.
Definition: parallel.c:496
par_dcd_get
int par_dcd_get(hamlib_port_t *p, dcd_t *dcdx)
get Data Carrier Detect (squelch) from Parallel Port
Definition: parallel.c:733
par_open
__BEGIN_DECLS int par_open(hamlib_port_t *p)
Open Parallel Port.
Definition: parallel.c:129
par_close
int par_close(hamlib_port_t *p)
Close Parallel Port.
Definition: parallel.c:224
par_ptt_get
int par_ptt_get(hamlib_port_t *p, ptt_t *pttx)
Get state of Push to Talk from Parallel Port.
Definition: parallel.c:690
par_read_control
int par_read_control(hamlib_port_t *p, unsigned char *control)
Read control data for Parallel Port.
Definition: parallel.c:425
par_read_data
int par_read_data(hamlib_port_t *p, unsigned char *data)
Receive data on Parallel port.
Definition: parallel.c:289
par_write_control
int par_write_control(hamlib_port_t *p, unsigned char control)
Set control data for Parallel Port.
Definition: parallel.c:345
par_lock
int par_lock(hamlib_port_t *p)
Get a lock on the Parallel Port.
Definition: parallel.c:559

Generated by doxygen 1.8.18

Hamlib documentation for version 4.0~git -- Tue Jul 28 2020 00:00:00
Project page: http://www.hamlib.org