Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
esc32.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Murat Bronz <murat.bronz@enac.fr>
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, see
18  * <http://www.gnu.org/licenses/>.
19  */
26 #ifndef ESC32_H
27 #define ESC32_H
28 
29 #include "std.h"
30 
31 extern void esc32_init(void);
32 extern void esc32_periodic(void);
33 extern void esc32_event(void);
34 
36  float amps;
37  float volts_bat;
38  float volts_motor;
39  float rpm;
40  float duty;
41 };
42 
43 struct esc32 {
44  struct esc32_parameter params;
45  float energy;
46  float power;
48 };
49 
50 extern struct esc32 esc32;
51 
71 };
72 
91 };
92 
145 };
146 
147 #endif
148 
void esc32_periodic(void)
Definition: esc32.c:262
float rpm
motor rotation speed
Definition: esc32.h:39
binaryCommands
Definition: esc32.h:52
@ BINARY_COMMAND_TELEM_VALUE
Definition: esc32.h:67
@ BINARY_COMMAND_DUTY
Definition: esc32.h:58
@ BINARY_COMMAND_CONFIG
Definition: esc32.h:56
@ BINARY_COMMAND_CLI
Definition: esc32.h:55
@ BINARY_COMMAND_NOP
Definition: esc32.h:53
@ BINARY_COMMAND_RPM
Definition: esc32.h:60
@ BINARY_COMMAND_SET
Definition: esc32.h:61
@ BINARY_COMMAND_ARM
Definition: esc32.h:54
@ BINARY_COMMAND_GET_PARAM_ID
Definition: esc32.h:68
@ BINARY_COMMAND_NACK
Definition: esc32.h:70
@ BINARY_COMMAND_PWM
Definition: esc32.h:59
@ BINARY_COMMAND_VERSION
Definition: esc32.h:66
@ BINARY_COMMAND_DISARM
Definition: esc32.h:57
@ BINARY_COMMAND_STOP
Definition: esc32.h:64
@ BINARY_COMMAND_TELEM_RATE
Definition: esc32.h:65
@ BINARY_COMMAND_STATUS
Definition: esc32.h:63
@ BINARY_COMMAND_ACK
Definition: esc32.h:69
@ BINARY_COMMAND_START
Definition: esc32.h:62
bool data_available
data updated
Definition: esc32.h:47
void esc32_init(void)
Definition: esc32.c:242
float amps
current consumption
Definition: esc32.h:36
void esc32_event(void)
Definition: esc32.c:352
configParameters
Definition: esc32.h:93
@ THR1TERM
Definition: esc32.h:128
@ PWM_LO_VALUE
Definition: esc32.h:120
@ PNFAC
Definition: esc32.h:126
@ CONFIG_NUM_PARAMS
Definition: esc32.h:144
@ CONFIG_VERSION
Definition: esc32.h:94
@ PWM_LOWPASS
Definition: esc32.h:135
@ START_STEPS_NUM
Definition: esc32.h:132
@ FET_BRAKING
Definition: esc32.h:125
@ FF2TERM
Definition: esc32.h:100
@ PWM_MAX_VALUE
Definition: esc32.h:122
@ BLANKING_MICROS
Definition: esc32.h:109
@ SWITCH_FREQ
Definition: esc32.h:115
@ CL3TERM
Definition: esc32.h:103
@ GOOD_DETECTS_START
Definition: esc32.h:112
@ START_STEPS_ACCEL
Definition: esc32.h:134
@ ESC_ID
Definition: esc32.h:142
@ THR2TERM
Definition: esc32.h:129
@ DIRECTION
Definition: esc32.h:143
@ PWM_HI_VALUE
Definition: esc32.h:121
@ CL4TERM
Definition: esc32.h:104
@ CL2TERM
Definition: esc32.h:102
@ BAD_DETECTS_DISARM
Definition: esc32.h:113
@ SHUNT_RESISTANCE
Definition: esc32.h:106
@ MAX_CURRENT
Definition: esc32.h:114
@ START_VOLTAGE
Definition: esc32.h:111
@ INFAC
Definition: esc32.h:127
@ START_STEPS_PERIOD
Definition: esc32.h:133
@ PWM_MIN_PERIOD
Definition: esc32.h:117
@ STARTUP_MODE
Definition: esc32.h:95
@ CL1TERM
Definition: esc32.h:101
@ SERVO_SCALE
Definition: esc32.h:141
@ MAX_PERIOD
Definition: esc32.h:108
@ START_ALIGN_VOLTAGE
Definition: esc32.h:131
@ RPM_MEAS_LP
Definition: esc32.h:136
@ SERVO_D
Definition: esc32.h:139
@ MOTOR_POLES
Definition: esc32.h:116
@ PWM_MAX_PERIOD
Definition: esc32.h:118
@ BAUD_RATE
Definition: esc32.h:96
@ SERVO_DUTY
Definition: esc32.h:137
@ SERVO_MAX_RATE
Definition: esc32.h:140
@ PWM_MIN_VALUE
Definition: esc32.h:119
@ SERVO_P
Definition: esc32.h:138
@ PWM_RPM_SCALE
Definition: esc32.h:124
@ PTERM
Definition: esc32.h:97
@ CL5TERM
Definition: esc32.h:105
@ ADVANCE
Definition: esc32.h:110
@ FF1TERM
Definition: esc32.h:99
@ ITERM
Definition: esc32.h:98
@ MIN_PERIOD
Definition: esc32.h:107
@ PWM_MIN_START
Definition: esc32.h:123
@ START_ALIGN_TIME
Definition: esc32.h:130
float energy
accumulated energy
Definition: esc32.h:45
float duty
motor duty cycle (more or less throttle in %)
Definition: esc32.h:40
binaryValues
Definition: esc32.h:73
@ BINARY_VALUE_FETSTEP
Definition: esc32.h:89
@ BINARY_VALUE_AVGC
Definition: esc32.h:87
@ BINARY_VALUE_ADC_WINDOW
Definition: esc32.h:82
@ BINARY_VALUE_NUM
Definition: esc32.h:90
@ BINARY_VALUE_VOLTS_MOTOR
Definition: esc32.h:77
@ BINARY_VALUE_RPM
Definition: esc32.h:78
@ BINARY_VALUE_STATE
Definition: esc32.h:84
@ BINARY_VALUE_VOLTS_BAT
Definition: esc32.h:76
@ BINARY_VALUE_AVGA
Definition: esc32.h:85
@ BINARY_VALUE_IDLE_PERCENT
Definition: esc32.h:83
@ BINARY_VALUE_AMPS
Definition: esc32.h:75
@ BINARY_VALUE_AVGB
Definition: esc32.h:86
@ BINARY_VALUE_NONE
Definition: esc32.h:74
@ BINARY_VALUE_AVGCOMP
Definition: esc32.h:88
@ BINARY_VALUE_DUTY
Definition: esc32.h:79
@ BINARY_VALUE_BAD_DETECTS
Definition: esc32.h:81
@ BINARY_VALUE_COMM_PERIOD
Definition: esc32.h:80
float volts_motor
motor voltage (bat voltage * throttle in % in fact)
Definition: esc32.h:38
float volts_bat
input battery voltage
Definition: esc32.h:37
float power
computed battery power
Definition: esc32.h:46
struct esc32_parameter params
filtered data from the esc
Definition: esc32.h:44
Definition: esc32.h:43