eRPC API Reference
Rev. 1.12.0
NXP Semiconductors
Main Page
API Reference
Classes
Files
File List
File Members
erpc_serial.h
Go to the documentation of this file.
1
/*
2
* This file is part of the Bus Pirate project (http://code.google.com/p/the-bus-pirate/).
3
*
4
* Written and maintained by the Bus Pirate project and http://dangerousprototypes.com
5
*
6
* To the extent possible under law, the project has
7
* waived all copyright and related or neighboring rights to Bus Pirate. This
8
* work is published from United States.
9
*
10
* For details see: http://creativecommons.org/publicdomain/zero/1.0/.
11
*
12
* This program 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.
15
*/
16
/*
17
* OS independent serial interface
18
*
19
* Heavily based on Pirate-Loader:
20
* http://the-bus-pirate.googlecode.com/svn/trunk/bootloader-v4/pirate-loader/source/pirate-loader.c
21
*
22
*/
23
#ifndef MYSERIAL_H_
24
#define MYSERIAL_H_
25
26
#ifdef __APPLE__
27
#include <IOKit/serial/ioss.h>
28
#include <sys/ioctl.h>
29
30
#define B1500000 1500000
31
#define B1000000 1000000
32
#define B921600 921600
33
#endif
34
35
#include <stdint.h>
36
37
#ifdef _WIN32
38
#include <time.h>
39
#include <windows.h>
40
41
#define B115200 115200
42
#define B921600 921600
43
44
typedef
long
speed_t;
45
#else
46
47
#include <sys/select.h>
48
#include <sys/time.h>
49
#include <sys/types.h>
50
#include <termios.h>
51
#include <unistd.h>
52
53
#endif
54
61
#if __cplusplus
62
extern
"C"
{
63
#endif
64
65
int
serial_setup(
int
fd, speed_t speed);
66
int
serial_set_read_timeout(
int
fd, uint8_t vtime, uint8_t vmin);
67
int
serial_write(
int
fd,
const
char
*buf,
int
size);
68
int
serial_read(
int
fd,
char
*buf,
int
size);
69
int
serial_open(
const
char
*port);
70
int
serial_close(
int
fd);
71
72
#if __cplusplus
73
}
74
#endif
75
78
#endif
Copyright 2016-2020 NXP Semiconductors. All rights reserved.