Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Toggle main menu visibility
Main Page
Related Pages
Topics
Data Structures
Data Structures
Data Structure Index
Data Fields
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
Loading...
Searching...
No Matches
actuators_pwm_arch.c
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2013 AggieAir, A Remote Sensing Unmanned Aerial System for Scientific Applications
3
* Utah State University, http://aggieair.usu.edu/
4
*
5
* Michal Podhradsky (michal.podhradsky@aggiemail.usu.edu)
6
* Calvin Coopmans (c.r.coopmans@ieee.org)
7
*
8
*
9
* This file is part of paparazzi.
10
*
11
* paparazzi is free software; you can redistribute it and/or modify
12
* it under the terms of the GNU General Public License as published by
13
* the Free Software Foundation; either version 2, or (at your option)
14
* any later version.
15
*
16
* paparazzi is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU General Public License for more details.
20
*
21
* You should have received a copy of the GNU General Public License
22
* along with paparazzi; see the file COPYING. If not, write to
23
* the Free Software Foundation, 59 Temple Place - Suite 330,
24
* Boston, MA 02111-1307, USA.
25
*/
33
#include "modules/actuators/actuators_pwm_arch.h"
34
#include "
modules/actuators/actuators_pwm.h
"
35
#include "
mcu_periph/gpio.h
"
36
37
/* Default timer base frequency is 1MHz */
38
#ifndef PWM_FREQUENCY
39
#define PWM_FREQUENCY 1000000
40
#endif
41
42
/* Default servo update rate in Hz */
43
#ifndef SERVO_HZ
44
#define SERVO_HZ 40
45
#endif
46
47
/* For each timer the period van be configured differently */
48
#ifndef TIM1_SERVO_HZ
49
#define TIM1_SERVO_HZ SERVO_HZ
50
#endif
51
#ifndef TIM2_SERVO_HZ
52
#define TIM2_SERVO_HZ SERVO_HZ
53
#endif
54
#ifndef TIM3_SERVO_HZ
55
#define TIM3_SERVO_HZ SERVO_HZ
56
#endif
57
#ifndef TIM4_SERVO_HZ
58
#define TIM4_SERVO_HZ SERVO_HZ
59
#endif
60
#ifndef TIM5_SERVO_HZ
61
#define TIM5_SERVO_HZ SERVO_HZ
62
#endif
63
#ifndef TIM8_SERVO_HZ
64
#define TIM8_SERVO_HZ SERVO_HZ
65
#endif
66
#ifndef TIM9_SERVO_HZ
67
#define TIM9_SERVO_HZ SERVO_HZ
68
#endif
69
#ifndef TIM12_SERVO_HZ
70
#define TIM12_SERVO_HZ SERVO_HZ
71
#endif
72
76
PRINT_CONFIG_VAR
(
ACTUATORS_PWM_NB
)
77
PRINT_CONFIG_VAR
(
PWM_FREQUENCY
)
78
PRINT_CONFIG_VAR
(
SERVO_HZ
)
79
80
88
#ifndef PWM_CMD_TO_US
89
#define PWM_CMD_TO_US(_t) (PWM_FREQUENCY * _t / 1000000)
90
#endif
91
92
int32_t
actuators_pwm_values
[
ACTUATORS_PWM_NB
];
93
103
__attribute__
((unused))
static
void
pwmpcb
(
PWMDriver
*pwmp
__attribute__
((unused))) {}
104
105
#if USE_PWM_TIM1
106
static
PWMConfig
pwmcfg1
= {
107
.frequency =
PWM_FREQUENCY
,
108
.period =
PWM_FREQUENCY
/
TIM1_SERVO_HZ
,
109
.callback =
NULL
,
110
.channels = {
111
{
PWM_OUTPUT_DISABLED
,
NULL
},
112
{
PWM_OUTPUT_DISABLED
,
NULL
},
113
{
PWM_OUTPUT_DISABLED
,
NULL
},
114
{
PWM_OUTPUT_DISABLED
,
NULL
},
115
},
116
.cr2 = 0,
117
.bdtr = 0,
118
.dier = 0
119
};
120
#endif
121
#if USE_PWM_TIM2
122
static
PWMConfig
pwmcfg2
= {
123
.frequency =
PWM_FREQUENCY
,
124
.period =
PWM_FREQUENCY
/
TIM2_SERVO_HZ
,
125
.callback =
NULL
,
126
.channels = {
127
{
PWM_OUTPUT_DISABLED
,
NULL
},
128
{
PWM_OUTPUT_DISABLED
,
NULL
},
129
{
PWM_OUTPUT_DISABLED
,
NULL
},
130
{
PWM_OUTPUT_DISABLED
,
NULL
},
131
},
132
.cr2 = 0,
133
.bdtr = 0,
134
.dier = 0
135
};
136
#endif
137
#if USE_PWM_TIM3
138
static
PWMConfig
pwmcfg3
= {
139
.frequency =
PWM_FREQUENCY
,
140
.period =
PWM_FREQUENCY
/
TIM3_SERVO_HZ
,
141
.callback =
NULL
,
142
.channels = {
143
{
PWM_OUTPUT_DISABLED
,
NULL
},
144
{
PWM_OUTPUT_DISABLED
,
NULL
},
145
{
PWM_OUTPUT_DISABLED
,
NULL
},
146
{
PWM_OUTPUT_DISABLED
,
NULL
},
147
},
148
.cr2 = 0,
149
.bdtr = 0,
150
.dier = 0
151
};
152
#endif
153
#if USE_PWM_TIM4
154
static
PWMConfig
pwmcfg4
= {
155
.frequency =
PWM_FREQUENCY
,
156
.period =
PWM_FREQUENCY
/
TIM4_SERVO_HZ
,
157
.callback =
NULL
,
158
.channels = {
159
{
PWM_OUTPUT_DISABLED
,
NULL
},
160
{
PWM_OUTPUT_DISABLED
,
NULL
},
161
{
PWM_OUTPUT_DISABLED
,
NULL
},
162
{
PWM_OUTPUT_DISABLED
,
NULL
},
163
},
164
.cr2 = 0,
165
.bdtr = 0,
166
.dier = 0
167
};
168
#endif
169
#if USE_PWM_TIM5
170
static
PWMConfig
pwmcfg5
= {
171
.frequency =
PWM_FREQUENCY
,
172
.period =
PWM_FREQUENCY
/
TIM5_SERVO_HZ
,
173
.callback =
NULL
,
174
.channels = {
175
{
PWM_OUTPUT_DISABLED
,
NULL
},
176
{
PWM_OUTPUT_DISABLED
,
NULL
},
177
{
PWM_OUTPUT_DISABLED
,
NULL
},
178
{
PWM_OUTPUT_DISABLED
,
NULL
},
179
},
180
.cr2 = 0,
181
.bdtr = 0,
182
.dier = 0
183
};
184
#endif
185
#if USE_PWM_TIM8
186
static
PWMConfig
pwmcfg8
= {
187
.frequency =
PWM_FREQUENCY
,
188
.period =
PWM_FREQUENCY
/
TIM8_SERVO_HZ
,
189
.callback =
NULL
,
190
.channels = {
191
{
PWM_OUTPUT_DISABLED
,
NULL
},
192
{
PWM_OUTPUT_DISABLED
,
NULL
},
193
{
PWM_OUTPUT_DISABLED
,
NULL
},
194
{
PWM_OUTPUT_DISABLED
,
NULL
},
195
},
196
.cr2 = 0,
197
.bdtr = 0,
198
.dier = 0
199
};
200
#endif
201
#if USE_PWM_TIM9
202
static
PWMConfig
pwmcfg9
= {
203
.frequency =
PWM_FREQUENCY
,
204
.period =
PWM_FREQUENCY
/
TIM9_SERVO_HZ
,
205
.callback =
NULL
,
206
.channels = {
207
{
PWM_OUTPUT_DISABLED
,
NULL
},
208
{
PWM_OUTPUT_DISABLED
,
NULL
},
209
{
PWM_OUTPUT_DISABLED
,
NULL
},
210
{
PWM_OUTPUT_DISABLED
,
NULL
},
211
},
212
.cr2 = 0,
213
.bdtr = 0,
214
.dier = 0
215
};
216
#endif
217
#if USE_PWM_TIM10
218
static
PWMConfig
pwmcfg10
= {
219
.frequency =
PWM_FREQUENCY
,
220
.period =
PWM_FREQUENCY
/
TIM10_SERVO_HZ
,
221
.callback =
NULL
,
222
.channels = {
223
{
PWM_OUTPUT_DISABLED
,
NULL
},
224
{
PWM_OUTPUT_DISABLED
,
NULL
},
225
{
PWM_OUTPUT_DISABLED
,
NULL
},
226
{
PWM_OUTPUT_DISABLED
,
NULL
},
227
},
228
.cr2 = 0,
229
.bdtr = 0,
230
.dier = 0
231
};
232
#endif
233
#if USE_PWM_TIM11
234
static
PWMConfig
pwmcfg11
= {
235
.frequency =
PWM_FREQUENCY
,
236
.period =
PWM_FREQUENCY
/
TIM11_SERVO_HZ
,
237
.callback =
NULL
,
238
.channels = {
239
{
PWM_OUTPUT_DISABLED
,
NULL
},
240
{
PWM_OUTPUT_DISABLED
,
NULL
},
241
{
PWM_OUTPUT_DISABLED
,
NULL
},
242
{
PWM_OUTPUT_DISABLED
,
NULL
},
243
},
244
.cr2 = 0,
245
.bdtr = 0,
246
.dier = 0
247
};
248
#endif
249
#if USE_PWM_TIM12
250
static
PWMConfig
pwmcfg12
= {
251
.frequency =
PWM_FREQUENCY
,
252
.period =
PWM_FREQUENCY
/
TIM12_SERVO_HZ
,
253
.callback =
NULL
,
254
.channels = {
255
{
PWM_OUTPUT_DISABLED
,
NULL
},
256
{
PWM_OUTPUT_DISABLED
,
NULL
},
257
{
PWM_OUTPUT_DISABLED
,
NULL
},
258
{
PWM_OUTPUT_DISABLED
,
NULL
},
259
},
260
.cr2 = 0,
261
.bdtr = 0,
262
.dier = 0
263
};
264
#endif
265
266
267
void
actuators_pwm_arch_init
(
void
)
268
{
269
/*----------------
270
* Configure GPIO
271
*----------------*/
272
#ifdef PWM_SERVO_0
273
gpio_setup_pin_af
(
PWM_SERVO_0_GPIO
,
PWM_SERVO_0_PIN
,
PWM_SERVO_0_AF
,
true
);
274
PWM_SERVO_0_CONF
.channels[
PWM_SERVO_0_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
275
#endif
276
#ifdef PWM_SERVO_1
277
gpio_setup_pin_af
(
PWM_SERVO_1_GPIO
,
PWM_SERVO_1_PIN
,
PWM_SERVO_1_AF
,
true
);
278
PWM_SERVO_1_CONF
.channels[
PWM_SERVO_1_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
279
#endif
280
#ifdef PWM_SERVO_2
281
gpio_setup_pin_af
(
PWM_SERVO_2_GPIO
,
PWM_SERVO_2_PIN
,
PWM_SERVO_2_AF
,
true
);
282
PWM_SERVO_2_CONF
.channels[
PWM_SERVO_2_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
283
#endif
284
#ifdef PWM_SERVO_3
285
gpio_setup_pin_af
(
PWM_SERVO_3_GPIO
,
PWM_SERVO_3_PIN
,
PWM_SERVO_3_AF
,
true
);
286
PWM_SERVO_3_CONF
.channels[
PWM_SERVO_3_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
287
#endif
288
#ifdef PWM_SERVO_4
289
gpio_setup_pin_af
(
PWM_SERVO_4_GPIO
,
PWM_SERVO_4_PIN
,
PWM_SERVO_4_AF
,
true
);
290
PWM_SERVO_4_CONF
.channels[
PWM_SERVO_4_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
291
#endif
292
#ifdef PWM_SERVO_5
293
gpio_setup_pin_af
(
PWM_SERVO_5_GPIO
,
PWM_SERVO_5_PIN
,
PWM_SERVO_5_AF
,
true
);
294
PWM_SERVO_5_CONF
.channels[
PWM_SERVO_5_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
295
#endif
296
#ifdef PWM_SERVO_6
297
gpio_setup_pin_af
(
PWM_SERVO_6_GPIO
,
PWM_SERVO_6_PIN
,
PWM_SERVO_6_AF
,
true
);
298
PWM_SERVO_6_CONF
.channels[
PWM_SERVO_6_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
299
#endif
300
#ifdef PWM_SERVO_7
301
gpio_setup_pin_af
(
PWM_SERVO_7_GPIO
,
PWM_SERVO_7_PIN
,
PWM_SERVO_7_AF
,
true
);
302
PWM_SERVO_7_CONF
.channels[
PWM_SERVO_7_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
303
#endif
304
#ifdef PWM_SERVO_8
305
gpio_setup_pin_af
(
PWM_SERVO_8_GPIO
,
PWM_SERVO_8_PIN
,
PWM_SERVO_8_AF
,
true
);
306
PWM_SERVO_8_CONF
.channels[
PWM_SERVO_8_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
307
#endif
308
#ifdef PWM_SERVO_9
309
gpio_setup_pin_af
(
PWM_SERVO_9_GPIO
,
PWM_SERVO_9_PIN
,
PWM_SERVO_9_AF
,
true
);
310
PWM_SERVO_9_CONF
.channels[
PWM_SERVO_9_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
311
#endif
312
#ifdef PWM_SERVO_10
313
gpio_setup_pin_af
(
PWM_SERVO_10_GPIO
,
PWM_SERVO_10_PIN
,
PWM_SERVO_10_AF
,
true
);
314
PWM_SERVO_10_CONF
.channels[
PWM_SERVO_10_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
315
#endif
316
#ifdef PWM_SERVO_11
317
gpio_setup_pin_af
(
PWM_SERVO_11_GPIO
,
PWM_SERVO_11_PIN
,
PWM_SERVO_11_AF
,
true
);
318
PWM_SERVO_11_CONF
.channels[
PWM_SERVO_11_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
319
#endif
320
#ifdef PWM_SERVO_12
321
gpio_setup_pin_af
(
PWM_SERVO_12_GPIO
,
PWM_SERVO_12_PIN
,
PWM_SERVO_12_AF
,
true
);
322
PWM_SERVO_12_CONF
.channels[
PWM_SERVO_12_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
323
#endif
324
#ifdef PWM_SERVO_13
325
gpio_setup_pin_af
(
PWM_SERVO_13_GPIO
,
PWM_SERVO_13_PIN
,
PWM_SERVO_13_AF
,
true
);
326
PWM_SERVO_13_CONF
.channels[
PWM_SERVO_13_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
327
#endif
328
#ifdef PWM_SERVO_14
329
gpio_setup_pin_af
(
PWM_SERVO_14_GPIO
,
PWM_SERVO_14_PIN
,
PWM_SERVO_14_AF
,
true
);
330
PWM_SERVO_14_CONF
.channels[
PWM_SERVO_14_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
331
#endif
332
#ifdef PWM_SERVO_15
333
gpio_setup_pin_af
(
PWM_SERVO_15_GPIO
,
PWM_SERVO_15_PIN
,
PWM_SERVO_15_AF
,
true
);
334
PWM_SERVO_15_CONF
.channels[
PWM_SERVO_15_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
335
#endif
336
#ifdef PWM_SERVO_16
337
gpio_setup_pin_af
(
PWM_SERVO_16_GPIO
,
PWM_SERVO_16_PIN
,
PWM_SERVO_16_AF
,
true
);
338
PWM_SERVO_16_CONF
.channels[
PWM_SERVO_16_CHANNEL
].mode =
PWM_OUTPUT_ACTIVE_HIGH
;
339
#endif
340
341
/*---------------
342
* Configure PWM
343
*---------------*/
344
#if USE_PWM_TIM1
345
pwmStart
(&
PWMD1
, &
pwmcfg1
);
346
#endif
347
#if USE_PWM_TIM2
348
pwmStart
(&
PWMD2
, &
pwmcfg2
);
349
#endif
350
#if USE_PWM_TIM3
351
pwmStart
(&
PWMD3
, &
pwmcfg3
);
352
#endif
353
#if USE_PWM_TIM4
354
pwmStart
(&
PWMD4
, &
pwmcfg4
);
355
#endif
356
#if USE_PWM_TIM5
357
pwmStart
(&
PWMD5
, &
pwmcfg5
);
358
#endif
359
#if USE_PWM_TIM8
360
pwmStart
(&
PWMD8
, &
pwmcfg8
);
361
#endif
362
#if USE_PWM_TIM9
363
pwmStart
(&
PWMD9
, &
pwmcfg9
);
364
#endif
365
#if USE_PWM_TIM10
366
pwmStart
(&
PWMD10
, &
pwmcfg10
);
367
#endif
368
#if USE_PWM_TIM11
369
pwmStart
(&
PWMD11
, &
pwmcfg11
);
370
#endif
371
#if USE_PWM_TIM12
372
pwmStart
(&
PWMD12
, &
pwmcfg12
);
373
#endif
374
}
267
void
actuators_pwm_arch_init
(
void
) {
…
}
375
376
377
void
actuators_pwm_commit
(
void
)
378
{
379
#ifdef PWM_SERVO_0
380
pwmEnableChannel
(&
PWM_SERVO_0_DRIVER
,
PWM_SERVO_0_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_0
]));
381
#endif
382
#ifdef PWM_SERVO_1
383
pwmEnableChannel
(&
PWM_SERVO_1_DRIVER
,
PWM_SERVO_1_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_1
]));
384
#endif
385
#ifdef PWM_SERVO_2
386
pwmEnableChannel
(&
PWM_SERVO_2_DRIVER
,
PWM_SERVO_2_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_2
]));
387
#endif
388
#ifdef PWM_SERVO_3
389
pwmEnableChannel
(&
PWM_SERVO_3_DRIVER
,
PWM_SERVO_3_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_3
]));
390
#endif
391
#ifdef PWM_SERVO_4
392
pwmEnableChannel
(&
PWM_SERVO_4_DRIVER
,
PWM_SERVO_4_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_4
]));
393
#endif
394
#ifdef PWM_SERVO_5
395
pwmEnableChannel
(&
PWM_SERVO_5_DRIVER
,
PWM_SERVO_5_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_5
]));
396
#endif
397
#ifdef PWM_SERVO_6
398
pwmEnableChannel
(&
PWM_SERVO_6_DRIVER
,
PWM_SERVO_6_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_6
]));
399
#endif
400
#ifdef PWM_SERVO_7
401
pwmEnableChannel
(&
PWM_SERVO_7_DRIVER
,
PWM_SERVO_7_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_7
]));
402
#endif
403
#ifdef PWM_SERVO_8
404
pwmEnableChannel
(&
PWM_SERVO_8_DRIVER
,
PWM_SERVO_8_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_8
]));
405
#endif
406
#ifdef PWM_SERVO_9
407
pwmEnableChannel
(&
PWM_SERVO_9_DRIVER
,
PWM_SERVO_9_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_9
]));
408
#endif
409
#ifdef PWM_SERVO_10
410
pwmEnableChannel
(&
PWM_SERVO_10_DRIVER
,
PWM_SERVO_10_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_10
]));
411
#endif
412
#ifdef PWM_SERVO_11
413
pwmEnableChannel
(&
PWM_SERVO_11_DRIVER
,
PWM_SERVO_11_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_11
]));
414
#endif
415
#ifdef PWM_SERVO_12
416
pwmEnableChannel
(&
PWM_SERVO_12_DRIVER
,
PWM_SERVO_12_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_12
]));
417
#endif
418
#ifdef PWM_SERVO_13
419
pwmEnableChannel
(&
PWM_SERVO_13_DRIVER
,
PWM_SERVO_13_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_13
]));
420
#endif
421
#ifdef PWM_SERVO_14
422
pwmEnableChannel
(&
PWM_SERVO_14_DRIVER
,
PWM_SERVO_14_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_14
]));
423
#endif
424
#ifdef PWM_SERVO_15
425
pwmEnableChannel
(&
PWM_SERVO_15_DRIVER
,
PWM_SERVO_15_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_15
]));
426
#endif
427
#ifdef PWM_SERVO_16
428
pwmEnableChannel
(&
PWM_SERVO_16_DRIVER
,
PWM_SERVO_16_CHANNEL
,
PWM_CMD_TO_US
(
actuators_pwm_values
[
PWM_SERVO_16
]));
429
#endif
430
}
377
void
actuators_pwm_commit
(
void
) {
…
}
actuators_pwm.h
gpio_setup_pin_af
void gpio_setup_pin_af(ioportid_t port, uint16_t pin, uint8_t af, bool is_output)
Setup a gpio for input or output with alternate function.
Definition
gpio_arch.c:65
actuators_pwm_values
int32_t actuators_pwm_values[ACTUATORS_PWM_NB]
Definition
actuators_pwm_arch.c:92
TIM3_SERVO_HZ
#define TIM3_SERVO_HZ
Definition
actuators_pwm_arch.c:55
TIM5_SERVO_HZ
#define TIM5_SERVO_HZ
Definition
actuators_pwm_arch.c:61
PWM_CMD_TO_US
#define PWM_CMD_TO_US(_t)
Print the configuration variables from the header.
Definition
actuators_pwm_arch.c:89
pwmpcb
static void pwmpcb(PWMDriver *pwmp)
PWM callback function.
Definition
actuators_pwm_arch.c:103
TIM4_SERVO_HZ
#define TIM4_SERVO_HZ
Definition
actuators_pwm_arch.c:58
SERVO_HZ
#define SERVO_HZ
Definition
actuators_pwm_arch.c:44
TIM8_SERVO_HZ
#define TIM8_SERVO_HZ
Definition
actuators_pwm_arch.c:64
TIM9_SERVO_HZ
#define TIM9_SERVO_HZ
Definition
actuators_pwm_arch.c:67
TIM12_SERVO_HZ
#define TIM12_SERVO_HZ
Definition
actuators_pwm_arch.c:70
PWM_FREQUENCY
#define PWM_FREQUENCY
Definition
actuators_pwm_arch.c:39
TIM1_SERVO_HZ
#define TIM1_SERVO_HZ
Definition
actuators_pwm_arch.c:49
TIM2_SERVO_HZ
#define TIM2_SERVO_HZ
Definition
actuators_pwm_arch.c:52
actuators_pwm_arch_init
void actuators_pwm_arch_init(void)
Arch dependent init file.
Definition
actuators_pwm_arch.c:267
actuators_pwm_commit
void actuators_pwm_commit(void)
Definition
actuators_pwm_arch.c:377
ACTUATORS_PWM_NB
#define ACTUATORS_PWM_NB
Definition
actuators_pwm_arch.h:42
gpio.h
Some architecture independent helper functions for GPIOs.
foo
uint16_t foo
Definition
main_demo5.c:58
PWM_SERVO_6
#define PWM_SERVO_6
Definition
naze32_common.h:214
PWM_SERVO_3
#define PWM_SERVO_3
Definition
naze32_common.h:211
PWM_SERVO_4
#define PWM_SERVO_4
Definition
naze32_common.h:212
PWM_SERVO_5
#define PWM_SERVO_5
Definition
naze32_common.h:213
PRINT_CONFIG_VAR
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
int32_t
int int32_t
Typedef defining 32 bit int type.
Definition
vl53l1_types.h:83
sw
airborne
arch
chibios
modules
actuators
actuators_pwm_arch.c
Generated on Fri Apr 4 2025 14:56:49 for Paparazzi UAS by
1.9.8