Projet_voile_Cyril/Drivers/Inc/TIMER.h
2023-03-22 14:27:07 +01:00

36 行
1.2 KiB
C
Raw Blame 履歴

このファイルには曖昧(ambiguous)なUnicode文字が含まれています

このファイルには、他の文字と見間違える可能性があるUnicode文字が含まれています。 それが意図的なものと考えられる場合は、この警告を無視して構いません。 それらの文字を表示するにはエスケープボタンを使用します。

#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 * Timer);
/*
*****************************************************************************************
* @brief
* @param -> - TIM_TypeDef * Timer : Timer concerne
- char Prio : de 0 a 15
* @Note -> La fonction MyTimer_Base_Init doit avoir ete lancee au prealable
*************************************************************************************************
*/
void MyTimer_ActiveIT (TIM_TypeDef * Timer, char Prio, void (*IT_function)(void));
#define MyTimer_Base_Start(Timer) (Timer->CR1 |= 0x01)
#define MyTimer_Base_Stop(Timer) (Timer->CR1 &= ~0x01)
#endif