You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

76 lines
3.0 KiB

#include "gins.h"
#include "main.h"
#include "stm32f4xx_hal_rtc.h"
#include "stm32f4xx_hal_rtc_ex.h"
DEFINE_GLOBAL(CAN_HandleTypeDef, hcan1);
DEFINE_GLOBAL(TIM_HandleTypeDef, htim1);
DEFINE_GLOBAL(TIM_HandleTypeDef, htim2);
DEFINE_GLOBAL(TIM_HandleTypeDef, htim3);
DEFINE_GLOBAL(TIM_HandleTypeDef, htim6);
DEFINE_GLOBAL(TIM_HandleTypeDef, htim7);
DEFINE_GLOBAL(TIM_HandleTypeDef, htim11);
DEFINE_GLOBAL(I2C_HandleTypeDef, hi2c1);
DEFINE_GLOBAL(UART_HandleTypeDef, huart1);
DEFINE_GLOBAL(UART_HandleTypeDef, huart2);
DEFINE_GLOBAL(UART_HandleTypeDef, huart3);
DEFINE_GLOBAL(UART_HandleTypeDef, huart4);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream0);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream1);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream2);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream3);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream4);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream5);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream6);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma1_stream7);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream0);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream1);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream2);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream3);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream4);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream5);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream6);
DEFINE_GLOBAL(DMA_HandleTypeDef, hdma2_stream7);
DEFINE_GLOBAL(RTC_HandleTypeDef, hrtc);
DEFINE_GLOBAL(HCD_HandleTypeDef, hhcd_USB_OTG_FS);
DMA_Stream_TypeDef* getDmaStreamTypeDef(DMA_HandleTypeDef* dmah) {
if (dmah->Instance) return dmah->Instance;
if (dmah == &hdma1_stream1) return DMA1_Stream1;
if (dmah == &hdma1_stream2) return DMA1_Stream2;
if (dmah == &hdma1_stream3) return DMA1_Stream3;
if (dmah == &hdma1_stream4) return DMA1_Stream4;
if (dmah == &hdma1_stream5) return DMA1_Stream5;
if (dmah == &hdma1_stream6) return DMA1_Stream6;
if (dmah == &hdma1_stream7) return DMA1_Stream7;
if (dmah == &hdma2_stream0) return DMA2_Stream0;
if (dmah == &hdma2_stream1) return DMA2_Stream1;
if (dmah == &hdma2_stream2) return DMA2_Stream2;
if (dmah == &hdma2_stream3) return DMA2_Stream3;
if (dmah == &hdma2_stream4) return DMA2_Stream4;
if (dmah == &hdma2_stream5) return DMA2_Stream5;
if (dmah == &hdma2_stream6) return DMA2_Stream6;
if (dmah == &hdma2_stream7) return DMA2_Stream7;
return NULL;
}
DEFINE_GLOBAL(SPI_HandleTypeDef, hspi1);
DEFINE_GLOBAL(SPI_HandleTypeDef, hspi2);
DEFINE_GLOBAL(SPI_HandleTypeDef, hspi3);
DEFINE_GLOBAL(ADC_HandleTypeDef, hadc1);
DEFINE_GLOBAL(ADC_HandleTypeDef, hadc2);
DEFINE_GLOBAL(ADC_HandleTypeDef, hadc3);
/***********************************************************************************************************************
* PTR *
***********************************************************************************************************************/
DEFINE_GLOBAL(IWDG_HandleTypeDef, hiwdg);