Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
uart_arch.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2009 Antoine Drouin <poinix@gmail.com>
3
*
4
* This file is part of Paparazzi.
5
*
6
* Paparazzi is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2, or (at your option)
9
* any later version.
10
*
11
* Paparazzi is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with Paparazzi; see the file COPYING. If not, write to
18
* the Free Software Foundation, 59 Temple Place - Suite 330,
19
* Boston, MA 02111-1307, USA.
20
*/
21
26
#ifndef UART_ARCH_H
27
#define UART_ARCH_H
28
29
// higher default uart buffer sizes on linux
30
#ifndef UART_RX_BUFFER_SIZE
31
#define UART_RX_BUFFER_SIZE 512
32
#endif
33
#ifndef UART_TX_BUFFER_SIZE
34
#define UART_TX_BUFFER_SIZE 512
35
#endif
36
37
#include "
mcu_periph/uart.h
"
38
39
// for definition of baud rates
40
#include <termios.h>
41
42
// for conversion between linux baud rate definition and actual speed
43
static
inline
int
uart_speed
(
int
def)
44
{
45
switch
(def) {
46
case
B1200
:
return
1200;
47
case
B2400
:
return
2400;
48
case
B4800
:
return
4800;
49
case
B9600
:
return
9600;
50
case
B19200
:
return
19200;
51
case
B38400
:
return
38400;
52
case
B57600
:
return
57600;
53
case
B115200
:
return
115200;
54
case
B230400
:
return
230400;
55
#ifdef B921600
56
case
B921600
:
return
921600;
57
#endif
58
default
:
return
9600;
59
}
60
}
61
#define UART_SPEED(_def) uart_speed(_def)
62
63
#endif
/* UART_ARCH_H */
uart.h
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
B9600
#define B9600
Definition:
uart_arch.h:40
B115200
#define B115200
Definition:
uart_arch.h:45
B38400
#define B38400
Definition:
uart_arch.h:42
B57600
#define B57600
Definition:
uart_arch.h:43
B19200
#define B19200
Definition:
uart_arch.h:41
uart_speed
static int uart_speed(int def)
Definition:
uart_arch.h:43
B1200
#define B1200
Definition:
uart_arch.h:37
B921600
#define B921600
Definition:
uart_arch.h:42
B230400
#define B230400
Definition:
uart_arch.h:46
B4800
#define B4800
Definition:
uart_arch.h:39
B2400
#define B2400
Definition:
uart_arch.h:38
sw
airborne
arch
linux
mcu_periph
uart_arch.h
Generated on Tue Jun 21 2016 14:01:09 for Paparazzi UAS by
1.8.8