#include "MyRF.h" #include "MyTimer.h" #include "MyPWM.h" #include "MyUSART.h" #include "stm32f1xx_ll_bus.h" // Pour l'activation des horloges #include "stm32f1xx_ll_tim.h" #include "stm32f1xx_ll_gpio.h" #include "stm32f1xx_ll_usart.h" void MyRF_Conf(void) { //RX //Activation horloge du GPIO LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB); LL_GPIO_InitTypeDef My_GPIO_Init_Struct; LL_GPIO_StructInit(&My_GPIO_Init_Struct); //PB.6 en floating input My_GPIO_Init_Struct.Pin = PinCH1; LL_GPIO_Init(GPIOIn, &My_GPIO_Init_Struct); //PB.7 en floating input My_GPIO_Init_Struct.Pin = PinCH2; LL_GPIO_Init(GPIOIn, &My_GPIO_Init_Struct); //Configuration et lancment du Timer PWM Input MyTimer_Conf(TimerCC,0xFFAD,0x15); MyPWM_Conf_Input(TimerCC, channelCC1, channelCC2); MyTimer_Start(TimerCC); //TX //Activation horloge du GPIO LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA); LL_GPIO_StructInit(&My_GPIO_Init_Struct); //PA.9 en alternate output pp My_GPIO_Init_Struct.Pin = PinOut; My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_ALTERNATE; My_GPIO_Init_Struct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; LL_GPIO_Init(GPIOOut, &My_GPIO_Init_Struct); //PA.11 en output pp My_GPIO_Init_Struct.Pin = PinTXEn; My_GPIO_Init_Struct.Mode = LL_GPIO_MODE_OUTPUT; My_GPIO_Init_Struct.OutputType = LL_GPIO_OUTPUT_PUSHPULL; LL_GPIO_Init(GPIOOut, &My_GPIO_Init_Struct); //Configuration de l'USART MyUSART_Conf(USARTOut, TransferDirTX); } int MyRF_Input_Duty_Cycle(void) { int duty_cycle_RC = MyPWM_Duty_Cycle_Permilles(TimerCC, channelCC1, channelCC2); if (74