/*
 * Vibration_Motor.c
 *
 *  Created on: May 5, 2022
 *      Author: Jano
 */
//includes
#include <stdio.h>
#include "main.h"
#include "stm32l4xx.h"
#include "Vibration_Motor.h"

//extern
extern TIM_HandleTypeDef htim2;

void Vibration_SET(int set_pwm){
	if((set_pwm <= 99) && (set_pwm >= 0)){
		TIM2->CCR1 = set_pwm;
	}
}

void Vibration_START(){

	HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
}

void Vibration_STOP(){

	HAL_TIM_PWM_Stop(&htim2, TIM_CHANNEL_1);
}
