| | |
| | | * inserted by the user or by software development tools |
| | | * are owned by their respective copyright owners. |
| | | * |
| | | * COPYRIGHT(c) 2024 STMicroelectronics |
| | | * COPYRIGHT(c) 2025 STMicroelectronics |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without modification, |
| | | * are permitted provided that the following conditions are met: |
| | |
| | | ADC_HandleTypeDef hadc1; |
| | | DMA_HandleTypeDef hdma_adc1; |
| | | |
| | | IWDG_HandleTypeDef hiwdg; |
| | | |
| | | SPI_HandleTypeDef hspi1; |
| | | |
| | | TIM_HandleTypeDef htim1; |
| | |
| | | static void MX_USART6_UART_Init(void); |
| | | static void MX_TIM3_Init(void); |
| | | static void MX_TIM1_Init(void); |
| | | static void MX_IWDG_Init(void); |
| | | |
| | | void HAL_TIM_MspPostInit(TIM_HandleTypeDef *htim); |
| | | |
| | |
| | | MX_USART6_UART_Init(); |
| | | MX_TIM3_Init(); |
| | | MX_TIM1_Init(); |
| | | MX_IWDG_Init(); |
| | | /* USER CODE BEGIN 2 */ |
| | | HAL_TIM_Base_Start_IT(&htim3); |
| | | BSP_Init(); |
| | |
| | | |
| | | /**Initializes the CPU, AHB and APB busses clocks |
| | | */ |
| | | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; |
| | | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE; |
| | | RCC_OscInitStruct.HSEState = RCC_HSE_ON; |
| | | RCC_OscInitStruct.LSIState = RCC_LSI_ON; |
| | | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; |
| | | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; |
| | | RCC_OscInitStruct.PLL.PLLM = 8; |
| | |
| | | sConfig.Channel = ADC_CHANNEL_VREFINT; |
| | | sConfig.Rank = 2; |
| | | if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK) |
| | | { |
| | | _Error_Handler(__FILE__, __LINE__); |
| | | } |
| | | |
| | | } |
| | | |
| | | /* IWDG init function */ |
| | | static void MX_IWDG_Init(void) |
| | | { |
| | | |
| | | hiwdg.Instance = IWDG; |
| | | hiwdg.Init.Prescaler = IWDG_PRESCALER_256; |
| | | hiwdg.Init.Reload = 4095; |
| | | if (HAL_IWDG_Init(&hiwdg) != HAL_OK) |
| | | { |
| | | _Error_Handler(__FILE__, __LINE__); |
| | | } |
| | |
| | | { |
| | | |
| | | huart1.Instance = USART1; |
| | | huart1.Init.BaudRate = 115200; |
| | | huart1.Init.BaudRate = 921600; |
| | | huart1.Init.WordLength = UART_WORDLENGTH_8B; |
| | | huart1.Init.StopBits = UART_STOPBITS_1; |
| | | huart1.Init.Parity = UART_PARITY_NONE; |