From 575a62b72b4dfde5b36b0733a9508e228e6ba548 Mon Sep 17 00:00:00 2001 From: squallbest Date: Sat, 12 Oct 2019 14:57:31 +0800 Subject: [PATCH] NUCLEO_STM32F401RE Signed-off-by: squallbest --- board/NUCLEO_STM32F401RE/BSP/Inc/gpio.h | 57 ++++++++++++++++ board/NUCLEO_STM32F401RE/BSP/Inc/main.h | 73 +++++++++++++++++++++ board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h | 19 ++++++ 3 files changed, 149 insertions(+) create mode 100644 board/NUCLEO_STM32F401RE/BSP/Inc/gpio.h create mode 100644 board/NUCLEO_STM32F401RE/BSP/Inc/main.h create mode 100644 board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h diff --git a/board/NUCLEO_STM32F401RE/BSP/Inc/gpio.h b/board/NUCLEO_STM32F401RE/BSP/Inc/gpio.h new file mode 100644 index 00000000..40490539 --- /dev/null +++ b/board/NUCLEO_STM32F401RE/BSP/Inc/gpio.h @@ -0,0 +1,57 @@ +/** + ****************************************************************************** + * File Name : gpio.h + * Description : This file contains all the functions prototypes for + * the gpio + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __gpio_H +#define __gpio_H +#ifdef __cplusplus + extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "main.h" + +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +void MX_GPIO_Init(void); + +/* USER CODE BEGIN Prototypes */ + +/* USER CODE END Prototypes */ + +#ifdef __cplusplus +} +#endif +#endif /*__ pinoutConfig_H */ + +/** + * @} + */ + +/** + * @} + */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/NUCLEO_STM32F401RE/BSP/Inc/main.h b/board/NUCLEO_STM32F401RE/BSP/Inc/main.h new file mode 100644 index 00000000..0a2a8b5e --- /dev/null +++ b/board/NUCLEO_STM32F401RE/BSP/Inc/main.h @@ -0,0 +1,73 @@ +/* USER CODE BEGIN Header */ +/** + ****************************************************************************** + * @file : main.h + * @brief : Header for main.c file. + * This file contains the common defines of the application. + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2019 STMicroelectronics. + * All rights reserved.

+ * + * This software component is licensed by ST under BSD 3-Clause license, + * the "License"; You may not use this file except in compliance with the + * License. You may obtain a copy of the License at: + * opensource.org/licenses/BSD-3-Clause + * + ****************************************************************************** + */ +/* USER CODE END Header */ + +/* Define to prevent recursive inclusion -------------------------------------*/ +#ifndef __MAIN_H +#define __MAIN_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* Includes ------------------------------------------------------------------*/ +#include "stm32f4xx_hal.h" + +/* Private includes ----------------------------------------------------------*/ +/* USER CODE BEGIN Includes */ + +/* USER CODE END Includes */ + +/* Exported types ------------------------------------------------------------*/ +/* USER CODE BEGIN ET */ + +/* USER CODE END ET */ + +/* Exported constants --------------------------------------------------------*/ +/* USER CODE BEGIN EC */ + +/* USER CODE END EC */ + +/* Exported macro ------------------------------------------------------------*/ +/* USER CODE BEGIN EM */ + +/* USER CODE END EM */ + +/* Exported functions prototypes ---------------------------------------------*/ +void Error_Handler(void); + +/* USER CODE BEGIN EFP */ + +/* USER CODE END EFP */ + +/* Private defines -----------------------------------------------------------*/ +#define LED_Pin GPIO_PIN_5 +#define LED_GPIO_Port GPIOA +/* USER CODE BEGIN Private defines */ + +/* USER CODE END Private defines */ + +#ifdef __cplusplus +} +#endif + +#endif /* __MAIN_H */ + +/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ diff --git a/board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h b/board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h new file mode 100644 index 00000000..f4212ae9 --- /dev/null +++ b/board/NUCLEO_STM32F401RE/BSP/Inc/mcu_init.h @@ -0,0 +1,19 @@ +#ifndef __MCU_INIT_H +#define __MCU_INIT_H +#ifdef __cplusplus + extern "C" { +#endif + +#include "main.h" +#include "stm32f4xx_hal.h" +#include "usart.h" +#include "gpio.h" +#include "tos.h" + +void board_init(void); +void SystemClock_Config(void); + +#ifdef __cplusplus +} +#endif +#endif /*__ __MCU_INIT_H */