RefKEIL/ProjetsKEIL/Drivers/Include/Driver_MyTimer.h
2023-03-21 16:49:07 +01:00

36 lines
1.2 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef MYTIMER_H
#define MYTIMER_H
#include "stm32f10x.h"
typedef struct
{
TIM_TypeDef * Timer ;
unsigned short ARR ;
unsigned short PSC ;
}MyTimer_Struct_TypeDef;
/*
*****************************************************************************************
* @brief
* @param -> Paramè t r e sous forme d une s t r u c t u r e ( son a d r e s s e ) c o n t e n a n t l e s
i n f o r m a t i o n s de base
* @Note -> F o n c t i o n à l a n c e r s y s t é matiquement avant d a l l e r p l u s en dé t a i l dans l e s
c o n f p l u s f i n e s (PWM, codeur i n c . . . )
*************************************************************************************************
*/
void MyTimer_Base_Init(MyTimer_Struct_TypeDef * Timer);
#define MyTimer_Base_Start(Timer) Timer->CR1 |= 1
#define MyTimer_Base_Stop(Timer) Timer->CR1 &= 0
/*
**************************************************************************************************
* @brief
* @param : - TIM_TypeDef * Timer : Timer concerne
- c h a r P r i o : de 0 a 15
* @Note : La f o n c t i o n MyTimer_Base_Init d o i t a v o i r e t e l a n c e e au p r e a l a b l e
*************************************************************************/
void MyTimer_ActiveIT(TIM_TypeDef * Timer, char Prio);
#endif