PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
rs232.h
Go to the documentation of this file.
1/*
2***************************************************************************
3*
4* Author: Teunis van Beelen
5*
6* Copyright (C) 2005 - 2023 Teunis van Beelen
7*
8* Email: teuniz@protonmail.com
9*
10***************************************************************************
11*
12* This program is free software: you can redistribute it and/or modify
13* it under the terms of the GNU General Public License as published by
14* the Free Software Foundation, either version 3 of the License.
15*
16* This program 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, see <http://www.gnu.org/licenses/>.
23*
24***************************************************************************
25*/
26
27/* For more info and how to use this library, visit: http://www.teuniz.net/RS-232/ */
28
29
30#ifndef rs232_INCLUDED
31#define rs232_INCLUDED
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37#include <stdio.h>
38#include <string.h>
39
40
41
42#if defined(__linux__) || defined(__FreeBSD__)
43
44#include <termios.h>
45#include <sys/ioctl.h>
46#include <unistd.h>
47#include <fcntl.h>
48#include <sys/types.h>
49#include <sys/stat.h>
50#include <limits.h>
51#include <sys/file.h>
52#include <errno.h>
53
54#else
55
56#include <windows.h>
57
58#endif
59
60int RS232_OpenComport(int, int, const char *, int);
61int RS232_PollComport(int, unsigned char *, int);
62int RS232_SendByte(int, unsigned char);
63int RS232_SendBuf(int, unsigned char *, int);
65void RS232_cputs(int, const char *);
76void RS232_flushRX(int);
77void RS232_flushTX(int);
79int RS232_GetPortnr(const char *);
80
81#ifdef __cplusplus
82} /* extern "C" */
83#endif
84
85#endif
86
87
void RS232_cputs(int, const char *)
void RS232_CloseComport(int)
void RS232_disableRTS(int)
int RS232_IsDSREnabled(int)
int RS232_OpenComport(int, int, const char *, int)
void RS232_flushRXTX(int)
int RS232_GetPortnr(const char *)
void RS232_enableBREAK(int)
void RS232_disableBREAK(int)
void RS232_flushRX(int)
int RS232_SendBuf(int, unsigned char *, int)
int RS232_IsCTSEnabled(int)
int RS232_PollComport(int, unsigned char *, int)
int RS232_IsRINGEnabled(int)
int RS232_SendByte(int, unsigned char)
int RS232_IsDCDEnabled(int)
void RS232_flushTX(int)
void RS232_enableRTS(int)
void RS232_disableDTR(int)
void RS232_enableDTR(int)