2023-03-22 15:20:38 +01:00
|
|
|
#ifndef MYTIMER_H
|
|
|
|
#define MYTIMER_H
|
|
|
|
#include "stm32f10x.h"
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
TIM_TypeDef * Timer;
|
|
|
|
unsigned short ARR;
|
|
|
|
unsigned short PSC;
|
|
|
|
} MyTimer_Struct_Typedef;
|
|
|
|
|
|
|
|
void MyTimer_Base_Init(MyTimer_Struct_Typedef * Timer);
|
|
|
|
void MyTimer_ActiveIT(TIM_TypeDef * Timer, char Prio, void (*IT_function) (void));
|
|
|
|
void MyTimer_PWM(TIM_TypeDef * Timer ,char Channel);
|
2023-04-04 14:36:29 +02:00
|
|
|
void MyTimer_DutyCycle(TIM_TypeDef * Timer, char Channel, unsigned int DutyCycle);
|
2023-03-22 15:20:38 +01:00
|
|
|
|
|
|
|
#define MyTimer_Base_Start(Tim) (Tim.Timer->CR1 |= TIM_CR1_CEN)
|
|
|
|
#define MyTimer_Base_Stop(Tim) (Tim.Timer->CR1 &= ~TIM_CR1_CEN)
|
|
|
|
|
|
|
|
#endif
|