From 4b20cbfb0e95e7002ec5a77420cb6ba441f34750 Mon Sep 17 00:00:00 2001 From: Oskar Date: Fri, 14 Nov 2025 13:23:02 +0100 Subject: [PATCH] =?UTF-8?q?MaJ=20S=C3=A9ance=20pr=C3=A9cedent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Girouette.c | 24 ++++++++++++++++++++++++ Girouette.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/Girouette.c b/Girouette.c index e69de29..36558cc 100644 --- a/Girouette.c +++ b/Girouette.c @@ -0,0 +1,24 @@ +#include "stm32f10x.h" +#include "MyTimer.h" +#include "Nucleo.h" +#include "Timer.h" +#include "DriverGPIO.h" +#include "Gironde.h" + +void configEncoder(TIM_TypeDef * Timer){ + Timer -> CCMR1 |= TIM_CCMR1_CC1S; + Timer -> CCMR2 |= TIM_CCMR1_CC2S; + Timer -> CCER &= ~(TIM_CCER_CC1P | TIM_CCER_CC1NP); + Timer -> CCMR1 &= ~(TIM_CCMR1_IC1F); + Timer -> CCER &= ~(TIM_CCER_CC2P | TIM_CCER_CC2NP); + Timer -> CCMR2 &= ~(TIM_CCMR1_IC2F); + Timer -> SMCR &= ~TIM_SMCR_SMS; + Timer -> SMCR |= TIM_SMCR_SMS_0 | TIM_SMCR_SMS_1; + Timer -> CR1 |= TIM_CR1_CEN; + Timer -> ARR = 0xFFFF; +} +void configChannel(){ + MyGPIO_Init(GPIOA,7,In_Floating ); + MyGPIO_Init(GPIOA,8,In_Floating ); + +} diff --git a/Girouette.h b/Girouette.h index e69de29..ffcb4bd 100644 --- a/Girouette.h +++ b/Girouette.h @@ -0,0 +1,2 @@ +void configEncoder(TIM_TypeDef * Timer); +void configChannel();