Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
tcas.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2010 ENAC
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
24 
30 #ifndef TCAS_H
31 #define TCAS_H
32 
33 #include "std.h"
35 
36 extern float tcas_alt_setpoint;
38 
39 #define TCAS_NO_ALARM 0
40 #define TCAS_TA 1
41 #define TCAS_RA 2
43 
44 extern uint8_t tcas_status;
45 extern enum tcas_resolve tcas_resolve;
46 extern uint8_t tcas_ac_RA;
47 
51 };
52 
54 
55 extern void tcas_init( void );
56 extern void tcas_periodic_task_1Hz( void );
57 extern void tcas_periodic_task_4Hz( void );
58 
59 #define CallTCAS() { if (tcas_status == TCAS_RA) v_ctl_altitude_setpoint = tcas_alt_setpoint; }
60 
61 #define ParseTcasResolve() { \
62  if (DL_TCAS_RESOLVE_ac_id(dl_buffer) == AC_ID) { \
63  uint8_t ac_id_conflict = DL_TCAS_RESOLVE_ac_id_conflict(dl_buffer); \
64  tcas_acs_status[the_acs_id[ac_id_conflict]].resolve = DL_TCAS_RESOLVE_resolve(dl_buffer); \
65  } \
66 }
67 
68 #endif // TCAS
void tcas_periodic_task_4Hz(void)
Definition: tcas.c:220
enum tcas_resolve resolve
Definition: tcas.h:50
uint8_t status
Definition: tcas.h:49
uint8_t tcas_ac_RA
Definition: tcas.c:45
Definition: tcas.h:42
void tcas_init(void)
Definition: tcas.c:73
float tcas_tau_ta
Definition: tcas.c:41
Definition: tcas.h:42
Definition: tcas.h:42
float tcas_alim
Definition: tcas.c:41
#define NB_ACS
Definition: traffic_info.h:33
unsigned char uint8_t
Definition: types.h:14
uint8_t tcas_status
Definition: tcas.c:43
void tcas_periodic_task_1Hz(void)
Definition: tcas.c:103
float tcas_tau_ra
Definition: tcas.c:41
struct tcas_ac_status tcas_acs_status[NB_ACS]
Definition: tcas.c:46
float tcas_dmod
Definition: tcas.c:41
Informations relative to the other aircrafts.
tcas_resolve
Definition: tcas.h:42
float tcas_alt_setpoint
Definition: tcas.c:40