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
vn200_serial.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2015 Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu
3
* Utah State University, http://aggieair.usu.edu/
4
*
5
* This file is part of paparazzi.
6
*
7
* paparazzi is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2, or (at your option)
10
* any later version.
11
*
12
* paparazzi 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. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with paparazzi; see the file COPYING. If not, write to
19
* the Free Software Foundation, 59 Temple Place - Suite 330,
20
* Boston, MA 02111-1307, USA.
21
*/
29
#ifndef VN200_SERIAl_H
30
#define VN200_SERIAl_H
31
32
#include "
std.h
"
33
#include "
mcu_periph/uart.h
"
34
35
/*
36
* Defines for the serial communication
37
*/
38
#define VN_SYNC 0xFA
39
#define VN_OUTPUT_GROUP 0x39
40
#define VN_GROUP_BYTES 8
41
42
#define VN_BUFFER_SIZE 512
43
#define VN_HEADER_SIZE 9
44
#define VN_PAYLOAD_SIZE 144
45
46
47
enum
VNMsgStatus
{
48
VNMsgSync
,
49
VNMsgHeader
,
50
VNMsgGroup
,
51
VNMsgData
,
52
VNMsgCheck
53
};
54
55
struct
VNPacket
{
56
bool_t
msg_available
;
57
uint32_t
chksm_error
;
58
uint32_t
hdr_error
;
59
uint8_t
msg_buf
[
VN_BUFFER_SIZE
];
60
enum
VNMsgStatus
status
;
61
uint8_t
msg_idx
;
62
uint16_t
datalength
;
63
uint16_t
overrun_error
;
64
uint16_t
noise_error
;
65
uint16_t
framing_error
;
66
uint16_t
calc_chk
;
67
uint16_t
rec_chk
;
68
uint16_t
counter
;
69
};
70
71
enum
VNStatus
{
72
VNNotTracking
,
73
VNOutOfSpecs
,
74
VNOK
75
};
76
77
void
vn200_event
(
struct
VNPacket
*vnp);
78
void
vn200_read_message
(
void
);
79
void
vn200_parse
(
struct
VNPacket
*vnp,
uint8_t
c);
80
81
82
#endif
/* VN200_SERIAl_H */
uint16_t
unsigned short uint16_t
Definition:
types.h:16
VNPacket::overrun_error
uint16_t overrun_error
Definition:
vn200_serial.h:63
uart.h
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
VN_BUFFER_SIZE
#define VN_BUFFER_SIZE
Definition:
vn200_serial.h:42
VNPacket::msg_idx
uint8_t msg_idx
Definition:
vn200_serial.h:61
VNMsgCheck
Definition:
vn200_serial.h:52
VNPacket::rec_chk
uint16_t rec_chk
Definition:
vn200_serial.h:67
VNPacket::chksm_error
uint32_t chksm_error
Definition:
vn200_serial.h:57
VNMsgGroup
Definition:
vn200_serial.h:50
VNNotTracking
Definition:
vn200_serial.h:72
VNPacket::counter
uint16_t counter
Definition:
vn200_serial.h:68
VNPacket::hdr_error
uint32_t hdr_error
Definition:
vn200_serial.h:58
VNPacket::noise_error
uint16_t noise_error
Definition:
vn200_serial.h:64
VNMsgStatus
VNMsgStatus
Definition:
vn200_serial.h:47
VNPacket::msg_available
bool_t msg_available
Definition:
vn200_serial.h:56
VNMsgHeader
Definition:
vn200_serial.h:49
VNOutOfSpecs
Definition:
vn200_serial.h:73
VNPacket
Definition:
vn200_serial.h:55
VNPacket::calc_chk
uint16_t calc_chk
Definition:
vn200_serial.h:66
vn200_parse
void vn200_parse(struct VNPacket *vnp, uint8_t c)
Packet Collection & state machine.
Definition:
vn200_serial.c:87
uint32_t
unsigned long uint32_t
Definition:
types.h:18
VNStatus
VNStatus
Definition:
vn200_serial.h:71
VNMsgSync
Definition:
vn200_serial.h:48
std.h
VNPacket::datalength
uint16_t datalength
Definition:
vn200_serial.h:62
vn200_read_message
void vn200_read_message(void)
VNPacket::framing_error
uint16_t framing_error
Definition:
vn200_serial.h:65
uint8_t
unsigned char uint8_t
Definition:
types.h:14
vn200_event
void vn200_event(struct VNPacket *vnp)
Definition:
vn200_serial.c:77
VNPacket::msg_buf
uint8_t msg_buf[VN_BUFFER_SIZE]
Definition:
vn200_serial.h:59
VNMsgData
Definition:
vn200_serial.h:51
VNPacket::status
enum VNMsgStatus status
Definition:
vn200_serial.h:60
VNOK
Definition:
vn200_serial.h:74
sw
airborne
peripherals
vn200_serial.h
Generated on Tue Jun 21 2016 14:01:24 for Paparazzi UAS by
1.8.8