2025-06-27 00:32:57 +08:00
|
|
|
|
|
|
|
|
|
#ifndef TIMER_H__
|
|
|
|
|
#define TIMER_H__
|
|
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
|
#include "stm32f4xx.h"
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
|
typedef struct {
|
|
|
|
|
TIM_TypeDef *Tim;
|
|
|
|
|
uint32_t Cycle; // <20><><EFBFBD>ڣ<EFBFBD>us
|
|
|
|
|
void (*UpdataCall)(void);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
} TIMER_InitStruct;
|
|
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
|
typedef struct {
|
|
|
|
|
uint8_t Inited;
|
|
|
|
|
void (*UpdataCall)(void);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
} TIMER_UserStruct;
|
|
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
|
int TIMER_InitNormal(TIMER_InitStruct *init);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
2025-10-18 13:58:40 +08:00
|
|
|
|
void TIMER_DeInit(TIM_TypeDef *TIMx);
|
2025-06-27 00:32:57 +08:00
|
|
|
|
|
|
|
|
|
#endif
|