stm32_ota/SYSTEM/TIMER/timer.h

47 lines
1.9 KiB
C
Raw Permalink Normal View History

2023-12-15 06:28:06 +00:00
#ifndef __TIMERx_H
#define __TIMERx_H
#include "stm32f10x_it.h"
#include "stm32f10x_tim.h"
/*****************************************
*<EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD>ö<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
****************************************/
typedef enum
{
TIMER2 = 0 ,
TIMER3 = 1 ,
TIMER4 = 2 ,
TIMER5 = 3 ,
TIMER6 = 4,
TIMER7 = 5 ,
TIMERSUM = 6
}TIMER_e ; //Ӳ<><D3B2><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>ö<EFBFBD><C3B6>
/*****************************************
*<EFBFBD>ж<EFBFBD><EFBFBD>¼<EFBFBD><EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
****************************************/
typedef void (*TIMERFP)(void) ; //<2F><><EFBFBD><EFBFBD><E5BAAF>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD>int (*p_callback)()
/********************************************************************************
*<EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************************************/
void Timer_Hook(TIMER_e eTIMERn) ;//<2F><>ʱ<EFBFBD><CAB1><EFBFBD>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>Ӻ<EFBFBD><D3BA><EFBFBD>
/********************************************************************************
*<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӿں<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************************************/
extern void Timerx_Init(TIMER_e eTIMERn, u16 timeMs, IntPriority_e ePriority, FunctionalState NewState); //<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern TIMERFP Timer_RegHookCallback(TIMER_e eTIMERn, TIMERFP pCallback) ; //<2F><>ʱ<EFBFBD><CAB1><EFBFBD>жϻص<CFBB><D8B5><EFBFBD><EFBFBD><EFBFBD>ע<EFBFBD><EFBFBD><E1BAAF>
extern void Timerx_Reset(TIMER_e eTIMERn) ; //<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>
extern void Timerx_Open(TIMER_e eTIMERn) ; //<2F><>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
extern void Timerx_Close(TIMER_e eTIMERn) ; //<2F><>ʱ<EFBFBD><CAB1><EFBFBD>رն<D8B1>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>
extern void TIM2_IRQHandler(void) ; //timer2<72>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void TIM3_IRQHandler(void) ; //timer3<72>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void TIM4_IRQHandler(void) ; //timer4<72>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void TIM5_IRQHandler(void) ; //timer5<72>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void TIM6_IRQHandler(void) ; //timer6<72>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
extern void TIM7_IRQHandler(void) ; //timer7<72>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
#endif