Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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 
41  RIGHT };
42 
43 /* this is for the v1 protocol which does its own mixing */
46  YAW,
48  CMD_NB };
49 
56  volatile uint32_t nb_err;
57 };
58 
59 
60 extern struct ActuatorsAsctec actuators_asctec;
61 
62 #define actuators_asctec_SetCommand(_v) { \
63  actuators_asctec.cmd = _v; \
64  }
65 
66 #define actuators_asctec_SetNewAddr(_v) { \
67  actuators_asctec.new_addr = _v; \
68  }
69 
70 #define actuators_asctec_SetCurAddr(_v) { \
71  actuators_asctec.cur_addr = _v; \
72  }
73 
74 extern void actuators_asctec_init(void);
75 extern void actuators_asctec_set(bool_t motors_on);
76 
77 #define ActuatorAsctecSet(_i, _v) { actuators_asctec.cmds[_i] = _v; }
78 #define ActuatorsAsctecInit() actuators_asctec_init()
79 #define ActuatorsAsctecCommit() actuators_asctec_set(autopilot_motors_on)
80 
81 
82 #endif /* ACTUATORS_ASCTEC_H */
struct ActuatorsAsctec actuators_asctec
void actuators_asctec_set(bool_t motors_on)
actuators_asctec_cmd
int32_t cmds[CMD_NB]
I2C transaction structure.
Definition: i2c.h:93
actuators_asctec_cmds
unsigned long uint32_t
Definition: types.h:18
signed long int32_t
Definition: types.h:19
actuators_asctec_addr
struct i2c_transaction i2c_trans
void actuators_asctec_init(void)
enum actuators_asctec_addr new_addr
enum actuators_asctec_cmd cmd
enum actuators_asctec_addr cur_addr
volatile uint32_t nb_err
Architecture independent I2C (Inter-Integrated Circuit Bus) API.