-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserial.h
41 lines (37 loc) · 1.1 KB
/
serial.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
/**
* @file serial.h
* UNIX Serial port device open/close for read()/write() to operate.
* Setup serial port to blast bytes over a Unix file descriptor.
*
* @copyright
* Copyright (C) 2016 Real Flight Systems
* @author James F Dougherty <[email protected]>
*/
/**
* @defgroup serial serial
* @addtogroup serial
* @{
*/
/**
* @brief serial port open
*
* Open the serial port device file (e.g. /dev/ttyUSB0) for read/write
* at default 9600bps operational mode of Digole displays. Set
* terminal characteristics for binary data and no HW flow control.
* Save the current tty and HW com port attributes to be restored at
* shutdown via #serial_close
*
* @param comport string value for the device file (e.g. "/dev/ttyUSB0")
* @param highspeed when non-zero, the UART is opened at 115200baud
*/
int serial_open(char* comport, int highspeed);
/**
* @brief serial port close
*
* Close the serial port file descriptor and restore terminal and HW
* com port to their original settings.
*
* @param sfd serial file descriptor returned from #serial_open
*/
void serial_close(int sfd);
/** @}*/