Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 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 
53 };
54 
55 struct VNPacket {
56  bool_t msg_available;
69 };
70 
71 enum VNStatus {
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 */
unsigned short uint16_t
Definition: types.h:16
uint16_t overrun_error
Definition: vn200_serial.h:63
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
#define VN_BUFFER_SIZE
Definition: vn200_serial.h:42
uint8_t msg_idx
Definition: vn200_serial.h:61
uint16_t rec_chk
Definition: vn200_serial.h:67
uint32_t chksm_error
Definition: vn200_serial.h:57
uint16_t counter
Definition: vn200_serial.h:68
uint32_t hdr_error
Definition: vn200_serial.h:58
uint16_t noise_error
Definition: vn200_serial.h:64
VNMsgStatus
Definition: vn200_serial.h:47
bool_t msg_available
Definition: vn200_serial.h:56
uint16_t calc_chk
Definition: vn200_serial.h:66
void vn200_parse(struct VNPacket *vnp, uint8_t c)
Packet Collection & state machine.
Definition: vn200_serial.c:87
unsigned long uint32_t
Definition: types.h:18
VNStatus
Definition: vn200_serial.h:71
uint16_t datalength
Definition: vn200_serial.h:62
void vn200_read_message(void)
uint16_t framing_error
Definition: vn200_serial.h:65
unsigned char uint8_t
Definition: types.h:14
void vn200_event(struct VNPacket *vnp)
Definition: vn200_serial.c:77
uint8_t msg_buf[VN_BUFFER_SIZE]
Definition: vn200_serial.h:59
enum VNMsgStatus status
Definition: vn200_serial.h:60