TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
TM_SERVO_Functions

Library Functions. More...

Functions

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. More...
 
TM_SERVO_Result_t TM_SERVO_SetDegrees (TM_SERVO_t *ServoStruct, float degrees)
 Set rotation degrees for servo. More...
 
TM_SERVO_Result_t TM_SERVO_SetMicros (TM_SERVO_t *ServoStruct, uint16_t micros)
 Sets pulse length in microseconds. More...
 

Detailed Description

Library Functions.

Function Documentation

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.

Parameters
*ServoStructPointer to an empty TM_SERVO_t servo structure
*TIMxPointer to TIMx you will use for servo
PWMChannelChannel you will use for timer. This parameter can be a value of TM_PWM_Channel_t enumeration
PinspackPinspack for channel. This parameter can be a value of TM_PWM_PinsPack_t enumeration
Return values
Memberof TM_SERVO_Result_t
TM_SERVO_Result_t TM_SERVO_SetDegrees ( TM_SERVO_t ServoStruct,
float  degrees 
)

Set rotation degrees for servo.

Note
Degrees can be between 0 and 180
Parameters
*ServoStructPointer to an TM_SERVO_t servo structure
degreesRotation in degrees, between 0 and 180
Return values
Memberof TM_SERVO_Result_t
TM_SERVO_Result_t TM_SERVO_SetMicros ( TM_SERVO_t ServoStruct,
uint16_t  micros 
)

Sets pulse length in microseconds.

Parameters
*ServoStructPointer to an TM_SERVO_t servo structure
microspulse length in microseconds
Return values
Memberof TM_SERVO_Result_t