#include "stm32f10x.h"
#include "../Include/Timer.h"
#include "../Include/PWM.h"
#include "../Include/GPIO.h"
// Variables
#define ARR_TIM1 0xFFAD
#define PSC_TIM1 0xFF
#define ARR_TIM2 0xFFAD
#define PSC_TIM2 0x0225
#define ARR_TIM3 0x2CF
#define PSC_TIM3 0x0

volatile int g_tick_count;
void Test(void){
    // Signal
    g_tick_count++;
	TogglePin(GPIOA, 8);
}

void ConfigureTimers(){
MyTimer_Base_Init(TIM2, ARR_TIM2, PSC_TIM2);
MyTimer_Base_Init(TIM1, ARR_TIM1, PSC_TIM1);
MyTimer_Base_Init(TIM3, ARR_TIM2, PSC_TIM2);
}
void ConfigureIT(){
//MyTimer_ActiveIT(TIM2, 4, Test); //start interruption with priority 4
//MyTimer_ActiveIT(TIM1, 4, Test); //start interruption with priority 4
MyTimer_ActiveIT(TIM3, 4, Test); //start interruption with priority 4
}
void ConfigurePWM(){
MyTimer_PWM(TIM1, 1);
MyTimer_Set_DutyCycle(TIM1, 1, 20.0);	
}
