2017-05-22 15:08:04 +02:00
|
|
|
/**
|
|
|
|
******************************************************************************
|
|
|
|
*
|
2017-05-30 16:31:39 +02:00
|
|
|
* @file pios_servo_config.h
|
|
|
|
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017
|
|
|
|
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2013.
|
2017-05-22 15:08:04 +02:00
|
|
|
* @brief Architecture specific macros and definitions
|
|
|
|
* --
|
|
|
|
* @see The GNU Public License (GPL) Version 3
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
|
|
|
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
* for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
#ifndef PIOS_SERVO_CONFIG_H_
|
|
|
|
#define PIOS_SERVO_CONFIG_H_
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2017-05-30 16:31:39 +02:00
|
|
|
* Generic servo pin configuration structure for an STM32F30X
|
2017-05-22 15:08:04 +02:00
|
|
|
*/
|
|
|
|
#define TIM_SERVO_CHANNEL_CONFIG(_timer, _channel, _gpio, _pin) \
|
|
|
|
{ \
|
|
|
|
.timer = _timer, \
|
|
|
|
.timer_chan = TIM_Channel_##_channel, \
|
|
|
|
.pin = { \
|
|
|
|
.gpio = GPIO##_gpio, \
|
|
|
|
.init = { \
|
|
|
|
.GPIO_Pin = GPIO_Pin_##_pin, \
|
|
|
|
.GPIO_Speed = GPIO_Speed_2MHz, \
|
|
|
|
.GPIO_Mode = GPIO_Mode_AF, \
|
|
|
|
.GPIO_OType = GPIO_OType_PP, \
|
|
|
|
.GPIO_PuPd = GPIO_PuPd_UP \
|
|
|
|
}, \
|
|
|
|
.pin_source = GPIO_PinSource##_pin, \
|
|
|
|
}, \
|
|
|
|
.remap = GPIO_AF_P##_gpio##_pin##_##_timer, \
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* PIOS_SERVO_CONFIG_H_ */
|