--- /dev/null
+/**\r
+ ******************************************************************************\r
+ * File Name : main.c\r
+ * Description : Main program body\r
+ ******************************************************************************\r
+ *\r
+ * COPYRIGHT(c) 2016 STMicroelectronics\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without modification,\r
+ * are permitted provided that the following conditions are met:\r
+ * 1. Redistributions of source code must retain the above copyright notice,\r
+ * this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright notice,\r
+ * this list of conditions and the following disclaimer in the documentation\r
+ * and/or other materials provided with the distribution.\r
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors\r
+ * may be used to endorse or promote products derived from this software\r
+ * without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ ******************************************************************************\r
+ */\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f7xx_hal.h"\r
+#include "dma.h"\r
+#include "usart.h"\r
+#include "gpio.h"\r
+\r
+/* USER CODE BEGIN Includes */\r
+\r
+/* USER CODE END Includes */\r
+\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* USER CODE BEGIN PV */\r
+/* Private variables ---------------------------------------------------------*/\r
+\r
+/* USER CODE END PV */\r
+\r
+/* Private function prototypes -----------------------------------------------*/\r
+void SystemClock_Config(void);\r
+void Error_Handler(void);\r
+\r
+/* USER CODE BEGIN PFP */\r
+/* Private function prototypes -----------------------------------------------*/\r
+\r
+void main1(void);
+/* USER CODE END PFP */\r
+\r
+/* USER CODE BEGIN 0 */\r
+\r
+/* USER CODE END 0 */\r
+\r
+__weak
+int main(void)\r
+{\r
+\r
+ /* USER CODE BEGIN 1 */\r
+\r
+ /* USER CODE END 1 */\r
+\r
+ /* MCU Configuration----------------------------------------------------------*/\r
+\r
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */\r
+ HAL_Init();\r
+\r
+ /* Configure the system clock */\r
+ SystemClock_Config();\r
+\r
+ /* Initialize all configured peripherals */\r
+ MX_GPIO_Init();\r
+ MX_DMA_Init();\r
+ MX_USART3_UART_Init();\r
+\r
+ /* USER CODE BEGIN 2 */\r
+\r
+ /* USER CODE END 2 */\r
+\r
+ /* Infinite loop */\r
+main1();
+ /* USER CODE BEGIN WHILE */\r
+ while (1)\r
+ {\r
+ /* USER CODE END WHILE */\r
+\r
+ /* USER CODE BEGIN 3 */\r
+\r
+ }\r
+ /* USER CODE END 3 */\r
+\r
+}\r
+\r
+/** System Clock Configuration\r
+*/\r
+void SystemClock_Config(void)\r
+{\r
+\r
+ RCC_OscInitTypeDef RCC_OscInitStruct;\r
+ RCC_ClkInitTypeDef RCC_ClkInitStruct;\r
+ RCC_PeriphCLKInitTypeDef PeriphClkInitStruct;\r
+\r
+ __HAL_RCC_PWR_CLK_ENABLE();\r
+\r
+ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);\r
+\r
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;\r
+ RCC_OscInitStruct.HSEState = RCC_HSE_ON;\r
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;\r
+ RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;\r
+ RCC_OscInitStruct.PLL.PLLM = 4;\r
+ RCC_OscInitStruct.PLL.PLLN = 200;\r
+ RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;\r
+ RCC_OscInitStruct.PLL.PLLQ = 2;\r
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)\r
+ {\r
+ Error_Handler();\r
+ }\r
+\r
+ if (HAL_PWREx_EnableOverDrive() != HAL_OK)\r
+ {\r
+ Error_Handler();\r
+ }\r
+\r
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK\r
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;\r
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;\r
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;\r
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;\r
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;\r
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_6) != HAL_OK)\r
+ {\r
+ Error_Handler();\r
+ }\r
+\r
+ PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART3;\r
+ PeriphClkInitStruct.Usart3ClockSelection = RCC_USART3CLKSOURCE_PCLK1;\r
+ if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)\r
+ {\r
+ Error_Handler();\r
+ }\r
+\r
+ HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/1000);\r
+\r
+ HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);\r
+\r
+ /* SysTick_IRQn interrupt configuration */\r
+ HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);\r
+}\r
+\r
+/* USER CODE BEGIN 4 */\r
+\r
+/* USER CODE END 4 */\r
+\r
+/**\r
+ * @brief This function is executed in case of error occurrence.\r
+ * @param None\r
+ * @retval None\r
+ */\r
+void Error_Handler(void)\r
+{\r
+ /* USER CODE BEGIN Error_Handler */\r
+ /* User can add his own implementation to report the HAL error return state */\r
+ while(1) \r
+ {\r
+ }\r
+ /* USER CODE END Error_Handler */ \r
+}\r
+\r
+#ifdef USE_FULL_ASSERT\r
+\r
+/**\r
+ * @brief Reports the name of the source file and the source line number\r
+ * where the assert_param error has occurred.\r
+ * @param file: pointer to the source file name\r
+ * @param line: assert_param error line source number\r
+ * @retval None\r
+ */\r
+void assert_failed(uint8_t* file, uint32_t line)\r
+{\r
+ /* USER CODE BEGIN 6 */\r
+ /* User can add his own implementation to report the file name and line number,\r
+ ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */\r
+ /* USER CODE END 6 */\r
+\r
+}\r
+\r
+#endif\r
+\r
+/**\r
+ * @}\r
+ */ \r
+\r
+/**\r
+ * @}\r
+*/ \r
+\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r
--- /dev/null
+/**\r
+ ******************************************************************************\r
+ * @file stm32f7xx_it.c\r
+ * @brief Interrupt Service Routines.\r
+ ******************************************************************************\r
+ *\r
+ * COPYRIGHT(c) 2016 STMicroelectronics\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without modification,\r
+ * are permitted provided that the following conditions are met:\r
+ * 1. Redistributions of source code must retain the above copyright notice,\r
+ * this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright notice,\r
+ * this list of conditions and the following disclaimer in the documentation\r
+ * and/or other materials provided with the distribution.\r
+ * 3. Neither the name of STMicroelectronics nor the names of its contributors\r
+ * may be used to endorse or promote products derived from this software\r
+ * without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\r
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r
+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\r
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\r
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
+ *\r
+ ******************************************************************************\r
+ */\r
+/* Includes ------------------------------------------------------------------*/\r
+#include "stm32f7xx_hal.h"\r
+#include "stm32f7xx.h"\r
+#include "stm32f7xx_it.h"\r
+\r
+/* USER CODE BEGIN 0 */\r
+\r
+/* USER CODE END 0 */\r
+\r
+/* External variables --------------------------------------------------------*/\r
+extern DMA_HandleTypeDef hdma_usart3_tx;\r
+extern UART_HandleTypeDef huart3;\r
+\r
+/******************************************************************************/\r
+/* Cortex-M7 Processor Interruption and Exception Handlers */ \r
+/******************************************************************************/\r
+\r
+/**\r
+* @brief This function handles System tick timer.\r
+*/\r
+void SysTick_Handler(void)\r
+{\r
+ /* USER CODE BEGIN SysTick_IRQn 0 */\r
+\r
+ /* USER CODE END SysTick_IRQn 0 */\r
+ HAL_IncTick();\r
+ HAL_SYSTICK_IRQHandler();\r
+ /* USER CODE BEGIN SysTick_IRQn 1 */\r
+\r
+ /* USER CODE END SysTick_IRQn 1 */\r
+}\r
+\r
+/******************************************************************************/\r
+/* STM32F7xx Peripheral Interrupt Handlers */\r
+/* Add here the Interrupt Handlers for the used peripherals. */\r
+/* For the available peripheral interrupt handler names, */\r
+/* please refer to the startup file (startup_stm32f7xx.s). */\r
+/******************************************************************************/\r
+\r
+/**\r
+* @brief This function handles DMA1 stream3 global interrupt.\r
+*/\r
+__weak
+void DMA1_Stream3_IRQHandler(void)\r
+{\r
+ /* USER CODE BEGIN DMA1_Stream3_IRQn 0 */\r
+\r
+ /* USER CODE END DMA1_Stream3_IRQn 0 */\r
+ HAL_DMA_IRQHandler(&hdma_usart3_tx);\r
+ /* USER CODE BEGIN DMA1_Stream3_IRQn 1 */\r
+\r
+ /* USER CODE END DMA1_Stream3_IRQn 1 */\r
+}\r
+\r
+/**\r
+* @brief This function handles USART3 global interrupt.\r
+*/\r
+__weak
+void USART3_IRQHandler(void)\r
+{\r
+ /* USER CODE BEGIN USART3_IRQn 0 */\r
+\r
+ /* USER CODE END USART3_IRQn 0 */\r
+ HAL_UART_IRQHandler(&huart3);\r
+ /* USER CODE BEGIN USART3_IRQn 1 */\r
+\r
+ /* USER CODE END USART3_IRQn 1 */\r
+}\r
+\r
+/* USER CODE BEGIN 1 */\r
+\r
+/* USER CODE END 1 */\r
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r