Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
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
33
enum
actuators_asctec_cmd
{
NONE
,
34
TEST
,
35
REVERSE
,
36
SET_ADDR
37
};
38
39
enum
actuators_asctec_addr
{
FRONT
,
40
BACK
,
41
LEFT
,
42
RIGHT
43
};
44
45
/* this is for the v1 protocol which does its own mixing */
46
enum
actuators_asctec_cmds
{
PITCH
,
47
ROLL
,
48
YAW
,
49
THRUST
,
50
CMD_NB
51
};
52
53
struct
ActuatorsAsctec
{
54
enum
actuators_asctec_cmd
cmd
;
55
enum
actuators_asctec_addr
cur_addr
;
56
enum
actuators_asctec_addr
new_addr
;
57
int32_t
cmds
[
CMD_NB
];
58
struct
i2c_transaction
i2c_trans
;
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
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_get_motors_on())
83
84
85
#endif
/* ACTUATORS_ASCTEC_H */
YAW
@ YAW
Definition:
actuators_asctec.h:48
actuators_asctec_init
void actuators_asctec_init(void)
Definition:
actuators_asctec.c:44
NONE
@ NONE
Definition:
actuators_asctec.h:33
ActuatorsAsctec::cur_addr
enum actuators_asctec_addr cur_addr
Definition:
actuators_asctec.h:55
ActuatorsAsctec::nb_err
volatile uint32_t nb_err
Definition:
actuators_asctec.h:59
TEST
@ TEST
Definition:
actuators_asctec.h:34
uint32_t
unsigned long uint32_t
Definition:
types.h:18
actuators_asctec_addr
actuators_asctec_addr
Definition:
actuators_asctec.h:39
ROLL
@ ROLL
Definition:
actuators_asctec.h:47
RIGHT
@ RIGHT
Definition:
actuators_asctec.h:42
ActuatorsAsctec::cmd
enum actuators_asctec_cmd cmd
Definition:
actuators_asctec.h:54
ActuatorsAsctec::new_addr
enum actuators_asctec_addr new_addr
Definition:
actuators_asctec.h:56
REVERSE
@ REVERSE
Definition:
actuators_asctec.h:35
BACK
@ BACK
Definition:
actuators_asctec.h:40
actuators_asctec_cmds
actuators_asctec_cmds
Definition:
actuators_asctec.h:46
i2c_transaction
I2C transaction structure.
Definition:
i2c.h:93
ActuatorsAsctec::cmds
int32_t cmds[CMD_NB]
Definition:
actuators_asctec.h:57
ActuatorsAsctec
Definition:
actuators_asctec.h:53
PITCH
@ PITCH
Definition:
actuators_asctec.h:46
int32_t
signed long int32_t
Definition:
types.h:19
actuators_asctec_set
void actuators_asctec_set(bool motors_on)
Definition:
actuators_asctec.c:56
actuators_asctec_cmd
actuators_asctec_cmd
Definition:
actuators_asctec.h:33
ActuatorsAsctec::i2c_trans
struct i2c_transaction i2c_trans
Definition:
actuators_asctec.h:58
SET_ADDR
@ SET_ADDR
Definition:
actuators_asctec.h:36
CMD_NB
@ CMD_NB
Definition:
actuators_asctec.h:50
FRONT
@ FRONT
Definition:
actuators_asctec.h:39
i2c.h
actuators_asctec
struct ActuatorsAsctec actuators_asctec
Definition:
actuators_asctec.c:42
THRUST
@ THRUST
Definition:
actuators_asctec.h:49
LEFT
@ LEFT
Definition:
actuators_asctec.h:41
sw
airborne
subsystems
actuators
actuators_asctec.h
Generated on Tue Feb 1 2022 13:51:17 for Paparazzi UAS by
1.8.17