2004-10-02 20:37:24 +00:00
|
|
|
/*
|
|
|
|
* Hamlib Interface - parallel communication header
|
2010-04-25 21:15:54 +00:00
|
|
|
* Copyright (c) 2000-2003 by Frank Singleton
|
|
|
|
* Copyright (c) 2000-2010 by Stephane Fillod
|
2004-10-02 20:37:24 +00:00
|
|
|
*
|
|
|
|
*
|
2011-08-22 01:07:57 +00:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2004-10-02 20:37:24 +00:00
|
|
|
*
|
2011-08-22 01:07:57 +00:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
2004-10-02 20:37:24 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2011-08-22 01:07:57 +00:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2004-10-02 20:37:24 +00:00
|
|
|
*
|
2011-08-22 01:07:57 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2004-10-02 20:37:24 +00:00
|
|
|
* License along with this library; if not, write to the Free Software
|
2011-08-22 01:07:57 +00:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2004-10-02 20:37:24 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _PARALLEL_H
|
|
|
|
#define _PARALLEL_H 1
|
|
|
|
|
|
|
|
#include <hamlib/rig.h>
|
|
|
|
#include "iofunc.h"
|
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifdef HAVE_LINUX_PARPORT_H
|
2017-10-05 02:32:08 +00:00
|
|
|
# include <linux/parport.h>
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PARPORT_CONTROL_STROBE
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_CONTROL_STROBE 0x1
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
2017-10-05 02:32:08 +00:00
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifndef PARPORT_CONTROL_AUTOFD
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_CONTROL_AUTOFD 0x2
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
2017-10-05 02:32:08 +00:00
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifndef PARPORT_CONTROL_INIT
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_CONTROL_INIT 0x4
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
2017-10-05 02:32:08 +00:00
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifndef PARPORT_CONTROL_SELECT
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_CONTROL_SELECT 0x8
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PARPORT_STATUS_ERROR
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_STATUS_ERROR 0x8
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
2017-10-05 02:32:08 +00:00
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifndef PARPORT_STATUS_SELECT
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_STATUS_SELECT 0x10
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
2017-10-05 02:32:08 +00:00
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifndef PARPORT_STATUS_PAPEROUT
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_STATUS_PAPEROUT 0x20
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
2017-10-05 02:32:08 +00:00
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifndef PARPORT_STATUS_ACK
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_STATUS_ACK 0x40
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
2017-10-05 02:32:08 +00:00
|
|
|
|
2010-04-25 21:15:54 +00:00
|
|
|
#ifndef PARPORT_STATUS_BUSY
|
2017-10-05 02:32:08 +00:00
|
|
|
# define PARPORT_STATUS_BUSY 0x80
|
2010-04-25 21:15:54 +00:00
|
|
|
#endif
|
|
|
|
|
2004-10-02 20:37:24 +00:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
/* Hamlib internal use, see rig.c */
|
2005-04-03 12:27:17 +00:00
|
|
|
int par_open(hamlib_port_t *p);
|
|
|
|
int par_close(hamlib_port_t *p);
|
|
|
|
int par_ptt_set(hamlib_port_t *p, ptt_t pttx);
|
|
|
|
int par_ptt_get(hamlib_port_t *p, ptt_t *pttx);
|
|
|
|
int par_dcd_get(hamlib_port_t *p, dcd_t *dcdx);
|
2004-10-02 20:37:24 +00:00
|
|
|
|
2005-04-03 12:27:17 +00:00
|
|
|
extern HAMLIB_EXPORT(int) par_write_data(hamlib_port_t *p, unsigned char data);
|
2017-08-05 14:09:12 +00:00
|
|
|
extern HAMLIB_EXPORT(int) par_write_control(hamlib_port_t *p,
|
|
|
|
unsigned char control);
|
|
|
|
|
2005-04-03 12:27:17 +00:00
|
|
|
extern HAMLIB_EXPORT(int) par_read_data(hamlib_port_t *p, unsigned char *data);
|
2017-08-05 14:09:12 +00:00
|
|
|
extern HAMLIB_EXPORT(int) par_read_control(hamlib_port_t *p,
|
|
|
|
unsigned char *control);
|
|
|
|
|
|
|
|
extern HAMLIB_EXPORT(int) par_read_status(hamlib_port_t *p,
|
|
|
|
unsigned char *status);
|
|
|
|
|
2005-04-03 12:27:17 +00:00
|
|
|
extern HAMLIB_EXPORT(int) par_lock(hamlib_port_t *p);
|
|
|
|
extern HAMLIB_EXPORT(int) par_unlock(hamlib_port_t *p);
|
2004-10-02 20:37:24 +00:00
|
|
|
|
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* _PARALLEL_H */
|