TP_Voilier/FileInclude/MyTimer.h
2022-10-14 13:00:20 +02:00

34 lines
985 B
C
Raw 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 ; // TIM1 à TIM4
unsigned short ARR ;
unsigned short PSC ;
} MyTimer_Struct_TypeDef ;
/*
*****************************************************************************************
* @brief
* @param -> Paramètre sous forme dune structure (son adresse) contenant les
informations de base
* @Note -> Fonction à lancer systématiquement avant daller plus en détail dans les
conf plus fines (PWM, codeur inc ...)
*************************************************************************************************
*/
void MyTimer_Base_Init (MyTimer_Struct_TypeDef* Data) ;
void MyTimer_Base_Start(TIM_TypeDef * Timer );
void MyTimer_Base_Stop(TIM_TypeDef * Timer );
void MyTimer_ActiveIT (TIM_TypeDef * Timer, char Prio, void (* IT_function) (void));
void MyTimer_PWM(TIM_TypeDef * Timer, char Channel);
void Set_PWM_PRCT(TIM_TypeDef * Timer, char Channel, int percent);
#endif