From c5f0beac0bef869be97787186a70de06a542a27b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jasper=20G=C3=BCldenstein?= Date: Sun, 15 Nov 2020 17:37:02 +0100 Subject: [PATCH] dc motor documentation --- keil_project/Services/DcMotor.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/keil_project/Services/DcMotor.h b/keil_project/Services/DcMotor.h index 34c690a..96a4660 100644 --- a/keil_project/Services/DcMotor.h +++ b/keil_project/Services/DcMotor.h @@ -1,9 +1,25 @@ +/** + ****************************************************************************** + * @file DCMotor.h + * @author CAVAILLES, Kevin and GÜLDENSTEIN, Jasper + * @brief Service for setting the speed of a DC motor using a PWM signal. + ****************************************************************************** + */ #ifndef DC_MOTOR_H #define DC_MOTOR_H +/** + * @brief Initialziation function for the DC_MOTOR module. + * Peripherals used: TIM2 + * Pins used: PA1 (TIM2 channel 1, PWM Output) + * PA2 (GPIO, direction control) + */ void DC_MOTOR_Init(void); -// set a speed between -100 (full throttle clockwise) 0 (stop) and 100 (full throttle counterclockwise) +/** + * @brief Sets the speed of the DC motor using a PWM signal with a period of 50us -> frequency of 20kHz and a resolution of 0.5us + * @param speed value between -100 (full throttle clockwise), 0 (stop), and 100 (full throttle counterclockwise) + */ void DC_MOTOR_SetSpeed(int speed); #endif