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
actuators_asctec.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-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 ACTUATORS_ASCTEC_H
27 #define ACTUATORS_ASCTEC_H
28 
29 #include "mcu_periph/i2c.h"
30 
31 #include "generated/airframe.h"
32 
37  };
38 
43  };
44 
45 /* this is for the v1 protocol which does its own mixing */
48  YAW,
51  };
52 
59  volatile uint32_t nb_err;
60 };
61 
62 
63 extern struct ActuatorsAsctec actuators_asctec;
64 
65 #define actuators_asctec_SetCommand(_v) { \
66  actuators_asctec.cmd = _v; \
67  }
68 
69 #define actuators_asctec_SetNewAddr(_v) { \
70  actuators_asctec.new_addr = _v; \
71  }
72 
73 #define actuators_asctec_SetCurAddr(_v) { \
74  actuators_asctec.cur_addr = _v; \
75  }
76 
77 extern void actuators_asctec_init(void);
78 extern void actuators_asctec_set(bool_t motors_on);
79 
80 #define ActuatorAsctecSet(_i, _v) { actuators_asctec.cmds[_i] = _v; }
81 #define ActuatorsAsctecInit() actuators_asctec_init()
82 #define ActuatorsAsctecCommit() actuators_asctec_set(autopilot_motors_on)
83 
84 
85 #endif /* ACTUATORS_ASCTEC_H */
enum actuators_asctec_addr cur_addr
struct ActuatorsAsctec actuators_asctec
void actuators_asctec_set(bool_t motors_on)
actuators_asctec_cmd
struct i2c_transaction i2c_trans
enum actuators_asctec_addr new_addr
actuators_asctec_cmds
volatile uint32_t nb_err
int32_t cmds[CMD_NB]
unsigned long uint32_t
Definition: types.h:18
I2C transaction structure.
Definition: i2c.h:93
signed long int32_t
Definition: types.h:19
actuators_asctec_addr
void actuators_asctec_init(void)
enum actuators_asctec_cmd cmd
Architecture independent I2C (Inter-Integrated Circuit Bus) API.