forked from trocache/RefKEIL
23 lines
570 B
C
23 lines
570 B
C
#ifndef TIMERDRIVER_H
|
|
#define TIMERDRIVER_H
|
|
#include "stm32f10x.h"
|
|
|
|
#define CEN 0x0
|
|
#define UIE 0x0
|
|
#define UIF 0x0
|
|
|
|
typedef struct {
|
|
TIM_TypeDef * Timer; //TIM1 -> TIM4
|
|
unsigned short ARR;
|
|
unsigned short PSC;
|
|
} MyTimer_Struct_TypeDef;
|
|
|
|
void MyTimer_Base_Init(MyTimer_Struct_TypeDef * Timer);
|
|
int TimerX2Int(TIM_TypeDef * TimerX);
|
|
uint8_t TimerIT2UInt(TIM_TypeDef * TimerX);
|
|
void MyTimer_ActiveIT(TIM_TypeDef * TimerX, uint8_t Prio);
|
|
|
|
#define MyTimer_Base_Start(Timer) (Timer->CR1 |= (0x01<<CEN))
|
|
#define MyTimer_Base_Stop(Timer) (Timer->CR1 &= ~(0x01<<CEN))
|
|
|
|
#endif
|