31 #define TM_SERVO_H 110
77 #include "stm32f4xx.h"
78 #include "stm32f4xx_rcc.h"
79 #include "stm32f4xx_gpio.h"
80 #include "stm32f4xx_tim.h"
82 #include "tm_stm32f4_pwm.h"
83 #include "tm_stm32f4_timer_properties.h"
94 #ifndef SERVO_MICROS_MIN
95 #define SERVO_MICROS_MIN 1000
101 #ifndef SERVO_MICROS_MAX
102 #define SERVO_MICROS_MAX 2000
PWM Timer data.
Definition: tm_stm32f4_pwm.h:142
Servo structure.
Definition: tm_stm32f4_servo.h:118
TM_SERVO_Result_t TM_SERVO_SetDegrees(TM_SERVO_t *ServoStruct, float degrees)
Set rotation degrees for servo.
Definition: tm_stm32f4_servo.h:131
TM_SERVO_Result_t TM_SERVO_Init(TM_SERVO_t *ServoStruct, TIM_TypeDef *TIMx, TM_PWM_Channel_t PWMChannel, TM_PWM_PinsPack_t Pinspack)
Initializes TIM and PWM for servo motor purpose.
TM_PWM_PinsPack_t Pinspack
Definition: tm_stm32f4_servo.h:122
TM_PWM_PinsPack_t
Pin selected for corresponding channel on specific channel.
Definition: tm_stm32f4_pwm.h:167
TM_PWM_Channel_t Channel
Definition: tm_stm32f4_servo.h:121
Definition: tm_stm32f4_servo.h:132
TM_PWM_TIM_t PWM
Definition: tm_stm32f4_servo.h:119
uint16_t Micros
Definition: tm_stm32f4_servo.h:124
float Degrees
Definition: tm_stm32f4_servo.h:123
TM_SERVO_Result_t
Results enumeration.
Definition: tm_stm32f4_servo.h:130
TM_SERVO_Result_t TM_SERVO_SetMicros(TM_SERVO_t *ServoStruct, uint16_t micros)
Sets pulse length in microseconds.
TM_PWM_Channel_t
Channel selection for PWM on specific timer.
Definition: tm_stm32f4_pwm.h:157
TIM_TypeDef * TIM
Definition: tm_stm32f4_servo.h:120