Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
actuators_pwm_arch.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 The Paparazzi Team
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//VALID TIMERS ARE TIM1,2,3,4,5,8,9,12
27
29#include "modules/actuators/actuators_pwm_arch.h"
31
32#include <libopencm3/stm32/gpio.h>
33#include <libopencm3/stm32/rcc.h>
34#include <libopencm3/stm32/timer.h>
35
36#include "mcu_periph/gpio_arch.h"
37
38
40
41
45{
46 /*-----------------------------------
47 * Configure timer peripheral clocks
48 *-----------------------------------*/
49#if PWM_USE_TIM1
51#endif
52#if PWM_USE_TIM2
54#endif
55#if PWM_USE_TIM3
57#endif
58#if PWM_USE_TIM4
60#endif
61#if PWM_USE_TIM5
63#endif
64#if PWM_USE_TIM8
66#endif
67#if PWM_USE_TIM9
69#endif
70#if PWM_USE_TIM12
72#endif
73
74 /*----------------
75 * Configure GPIO
76 *----------------*/
77#ifdef PWM_SERVO_0
79#endif
80#ifdef PWM_SERVO_1
82#endif
83#ifdef PWM_SERVO_2
85#endif
86#ifdef PWM_SERVO_3
88#endif
89#ifdef PWM_SERVO_4
91#endif
92#ifdef PWM_SERVO_5
94#endif
95#ifdef PWM_SERVO_6
97#endif
98#ifdef PWM_SERVO_7
100#endif
101#ifdef PWM_SERVO_8
103#endif
104#ifdef PWM_SERVO_9
106#endif
107#ifdef PWM_SERVO_10
109#endif
110#ifdef PWM_SERVO_11
112#endif
113
114#if PWM_USE_TIM1
117#endif
118
119#if PWM_USE_TIM2
122#endif
123
124#if PWM_USE_TIM3
127#endif
128
129#if PWM_USE_TIM4
132#endif
133
134#if PWM_USE_TIM5
137#endif
138
139#if PWM_USE_TIM8
142#endif
143
144#if PWM_USE_TIM9
147#endif
148
149#if PWM_USE_TIM12
152#endif
153
154}
155
159{
160#ifdef PWM_SERVO_0
162#endif
163#ifdef PWM_SERVO_1
165#endif
166#ifdef PWM_SERVO_2
168#endif
169#ifdef PWM_SERVO_3
171#endif
172#ifdef PWM_SERVO_4
174#endif
175#ifdef PWM_SERVO_5
177#endif
178#ifdef PWM_SERVO_6
180#endif
181#ifdef PWM_SERVO_7
183#endif
184#ifdef PWM_SERVO_8
186#endif
187#ifdef PWM_SERVO_9
189#endif
190#ifdef PWM_SERVO_10
192#endif
193#ifdef PWM_SERVO_11
195#endif
196
197}
void set_servo_timer(uint32_t timer, uint32_t freq, uint8_t channels_mask)
Set Timer configuration.
STM32 PWM and dualPWM servos shared functions.
#define PWM_TIM3_CHAN_MASK
Definition apogee_1.0.h:337
#define PWM_TIM2_CHAN_MASK
Definition apogee_1.0.h:336
#define PWM_TIM1_CHAN_MASK
Definition cc3d.h:238
#define PWM_TIM4_CHAN_MASK
Definition cc3d.h:236
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
int32_t actuators_pwm_values[ACTUATORS_PWM_NB]
#define TIM3_SERVO_HZ
#define TIM5_SERVO_HZ
#define TIM4_SERVO_HZ
#define TIM8_SERVO_HZ
#define TIM9_SERVO_HZ
#define TIM12_SERVO_HZ
#define TIM1_SERVO_HZ
#define TIM2_SERVO_HZ
void actuators_pwm_arch_init(void)
Arch dependent init file.
void actuators_pwm_commit(void)
#define ACTUATORS_PWM_NB
#define PWM_TIM5_CHAN_MASK
uint16_t foo
Definition main_demo5.c:58
#define PWM_TIM12_CHAN_MASK
#define PWM_TIM8_CHAN_MASK
#define PWM_SERVO_6
#define PWM_SERVO_3
#define PWM_SERVO_4
#define PWM_SERVO_5
#define PWM_TIM9_CHAN_MASK
#define TRUE
Definition std.h:4
int int32_t
Typedef defining 32 bit int type.