[bsp][stm32] add lcd drivers for f4 series bsp

This commit is contained in:
SummerGift 2019-01-14 16:39:52 +08:00
parent 0d7ac3448f
commit 1264fec1f9
20 changed files with 1385 additions and 432 deletions

View File

@ -340,6 +340,7 @@ CONFIG_BSP_USING_EXT_FMC_IO=y
# CONFIG_BSP_USING_SPI_FLASH is not set # CONFIG_BSP_USING_SPI_FLASH is not set
# CONFIG_BSP_USING_SDCARD is not set # CONFIG_BSP_USING_SDCARD is not set
# CONFIG_BSP_USING_ETH is not set # CONFIG_BSP_USING_ETH is not set
# CONFIG_BSP_USING_LCD is not set
# CONFIG_BSP_USING_MPU6050 is not set # CONFIG_BSP_USING_MPU6050 is not set
# #
@ -358,6 +359,8 @@ CONFIG_BSP_USING_UART1=y
# CONFIG_BSP_USING_ONCHIP_RTC is not set # CONFIG_BSP_USING_ONCHIP_RTC is not set
# CONFIG_BSP_USING_WDT is not set # CONFIG_BSP_USING_WDT is not set
# CONFIG_BSP_USING_SDIO is not set # CONFIG_BSP_USING_SDIO is not set
CONFIG_BSP_USING_FMC=y
# CONFIG_BSP_USING_LTDC is not set
# #
# Board extended module Drivers # Board extended module Drivers

File diff suppressed because one or more lines are too long

View File

@ -11,120 +11,151 @@ File.Version=6
KeepUserPlacement=false KeepUserPlacement=false
Mcu.Family=STM32F4 Mcu.Family=STM32F4
Mcu.IP0=ADC1 Mcu.IP0=ADC1
Mcu.IP1=ETH Mcu.IP1=DMA2D
Mcu.IP10=TIM2 Mcu.IP10=SPI3
Mcu.IP11=TIM11 Mcu.IP11=SYS
Mcu.IP12=TIM13 Mcu.IP12=TIM2
Mcu.IP13=TIM14 Mcu.IP13=TIM11
Mcu.IP14=USART1 Mcu.IP14=TIM13
Mcu.IP2=FMC Mcu.IP15=TIM14
Mcu.IP3=IWDG Mcu.IP16=USART1
Mcu.IP4=NVIC Mcu.IP2=ETH
Mcu.IP5=RCC Mcu.IP3=FMC
Mcu.IP6=RTC Mcu.IP4=IWDG
Mcu.IP7=SDIO Mcu.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 Mcu.Pin84=PI2
Mcu.Pin85=PI4 Mcu.Pin85=PI3
Mcu.Pin86=PI5 Mcu.Pin86=PA14
Mcu.Pin87=PI6 Mcu.Pin87=PC10
Mcu.Pin88=PI7 Mcu.Pin88=PC11
Mcu.Pin89=VP_IWDG_VS_IWDG Mcu.Pin89=PC12
Mcu.Pin9=PF4 Mcu.Pin9=PI13
Mcu.Pin90=VP_RTC_VS_RTC_Activate Mcu.Pin90=PD0
Mcu.Pin91=VP_SYS_VS_Systick Mcu.Pin91=PD1
Mcu.Pin92=VP_TIM2_VS_ClockSourceINT Mcu.Pin92=PD2
Mcu.Pin93=VP_TIM11_VS_ClockSourceINT Mcu.Pin93=PD4
Mcu.Pin94=VP_TIM13_VS_ClockSourceINT Mcu.Pin94=PD5
Mcu.Pin95=VP_TIM14_VS_ClockSourceINT Mcu.Pin95=PJ12
Mcu.PinsNb=96 Mcu.Pin96=PJ13
Mcu.Pin97=PJ14
Mcu.Pin98=PJ15
Mcu.Pin99=PG9
Mcu.PinsNb=125
Mcu.ThirdPartyNb=0 Mcu.ThirdPartyNb=0
Mcu.UserConstants= Mcu.UserConstants=
Mcu.UserName=STM32F429BITx Mcu.UserName=STM32F429BITx
@ -272,6 +303,14 @@ PH9.Signal=FMC_D17
PI0.Signal=FMC_D24 PI0.Signal=FMC_D24
PI1.Signal=FMC_D25 PI1.Signal=FMC_D25
PI10.Signal=FMC_D31 PI10.Signal=FMC_D31
PI12.Mode=RGB888
PI12.Signal=LTDC_HSYNC
PI13.Mode=RGB888
PI13.Signal=LTDC_VSYNC
PI14.Mode=RGB888
PI14.Signal=LTDC_CLK
PI15.Mode=RGB888
PI15.Signal=LTDC_R0
PI2.Signal=FMC_D26 PI2.Signal=FMC_D26
PI3.Signal=FMC_D27 PI3.Signal=FMC_D27
PI4.Signal=FMC_NBL2 PI4.Signal=FMC_NBL2
@ -279,6 +318,66 @@ PI5.Signal=FMC_NBL3
PI6.Signal=FMC_D28 PI6.Signal=FMC_D28
PI7.Signal=FMC_D29 PI7.Signal=FMC_D29
PI9.Signal=FMC_D30 PI9.Signal=FMC_D30
PJ0.Mode=RGB888
PJ0.Signal=LTDC_R1
PJ1.Mode=RGB888
PJ1.Signal=LTDC_R2
PJ10.Mode=RGB888
PJ10.Signal=LTDC_G3
PJ11.Locked=true
PJ11.Mode=RGB888
PJ11.Signal=LTDC_G4
PJ12.Locked=true
PJ12.Mode=RGB888
PJ12.Signal=LTDC_B0
PJ13.Mode=RGB888
PJ13.Signal=LTDC_B1
PJ14.Locked=true
PJ14.Mode=RGB888
PJ14.Signal=LTDC_B2
PJ15.Mode=RGB888
PJ15.Signal=LTDC_B3
PJ2.Locked=true
PJ2.Mode=RGB888
PJ2.Signal=LTDC_R3
PJ3.Mode=RGB888
PJ3.Signal=LTDC_R4
PJ4.Mode=RGB888
PJ4.Signal=LTDC_R5
PJ5.Locked=true
PJ5.Mode=RGB888
PJ5.Signal=LTDC_R6
PJ6.Mode=RGB888
PJ6.Signal=LTDC_R7
PJ7.Locked=true
PJ7.Mode=RGB888
PJ7.Signal=LTDC_G0
PJ8.Locked=true
PJ8.Mode=RGB888
PJ8.Signal=LTDC_G1
PJ9.Locked=true
PJ9.Mode=RGB888
PJ9.Signal=LTDC_G2
PK0.Locked=true
PK0.Mode=RGB888
PK0.Signal=LTDC_G5
PK1.Mode=RGB888
PK1.Signal=LTDC_G6
PK2.Mode=RGB888
PK2.Signal=LTDC_G7
PK3.Locked=true
PK3.Mode=RGB888
PK3.Signal=LTDC_B4
PK4.Locked=true
PK4.Mode=RGB888
PK4.Signal=LTDC_B5
PK5.Mode=RGB888
PK5.Signal=LTDC_B6
PK6.Mode=RGB888
PK6.Signal=LTDC_B7
PK7.Locked=true
PK7.Mode=RGB888
PK7.Signal=LTDC_DE
PinOutPanel.RotationAngle=0 PinOutPanel.RotationAngle=0
ProjectManager.AskForMigrate=true ProjectManager.AskForMigrate=true
ProjectManager.BackupPrevious=false ProjectManager.BackupPrevious=false
@ -306,7 +405,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=EWARM V8 ProjectManager.TargetToolchain=EWARM V8
ProjectManager.ToolChainLocation= ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_FMC_Init-FMC-false-HAL-true,5-MX_SPI3_Init-SPI3-false-HAL-true,6-MX_TIM2_Init-TIM2-false-HAL-true,7-MX_SDIO_SD_Init-SDIO-false-HAL-true,8-MX_IWDG_Init-IWDG-false-HAL-true,9-MX_ADC1_Init-ADC1-false-HAL-true,10-MX_RTC_Init-RTC-false-HAL-true,11-MX_TIM14_Init-TIM14-false-HAL-true,12-MX_TIM13_Init-TIM13-false-HAL-true,13-MX_TIM11_Init-TIM11-false-HAL-true,14-MX_ETH_Init-ETH-false-HAL-true ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_FMC_Init-FMC-false-HAL-true,5-MX_SPI3_Init-SPI3-false-HAL-true,6-MX_TIM2_Init-TIM2-false-HAL-true,7-MX_SDIO_SD_Init-SDIO-false-HAL-true,8-MX_IWDG_Init-IWDG-false-HAL-true,9-MX_ADC1_Init-ADC1-false-HAL-true,10-MX_RTC_Init-RTC-false-HAL-true,11-MX_TIM14_Init-TIM14-false-HAL-true,12-MX_TIM13_Init-TIM13-false-HAL-true,13-MX_TIM11_Init-TIM11-false-HAL-true,14-MX_ETH_Init-ETH-false-HAL-true,15-MX_LTDC_Init-LTDC-false-HAL-true,16-MX_DMA2D_Init-DMA2D-false-HAL-true
RCC.48MHZClocksFreq_Value=45000000 RCC.48MHZClocksFreq_Value=45000000
RCC.AHBFreq_Value=180000000 RCC.AHBFreq_Value=180000000
RCC.APB1CLKDivider=RCC_HCLK_DIV4 RCC.APB1CLKDivider=RCC_HCLK_DIV4
@ -322,31 +421,33 @@ RCC.FamilyName=M
RCC.HCLKFreq_Value=180000000 RCC.HCLKFreq_Value=180000000
RCC.HSE_VALUE=8000000 RCC.HSE_VALUE=8000000
RCC.HSI_VALUE=16000000 RCC.HSI_VALUE=16000000
RCC.I2SClocksFreq_Value=153600000 RCC.I2SClocksFreq_Value=192000000
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSAIN,PLLSourceVirtual,RCC_RTC_Clock_Source,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ
RCC.LCDTFTFreq_Value=19600000 RCC.LCDTFTFreq_Value=25000000
RCC.LSI_VALUE=32000 RCC.LSI_VALUE=32000
RCC.MCO2PinFreq_Value=180000000 RCC.MCO2PinFreq_Value=180000000
RCC.PLLCLKFreq_Value=180000000 RCC.PLLCLKFreq_Value=180000000
RCC.PLLM=5 RCC.PLLM=4
RCC.PLLN=225 RCC.PLLN=180
RCC.PLLQ=8 RCC.PLLQ=8
RCC.PLLQCLKFreq_Value=45000000 RCC.PLLQCLKFreq_Value=45000000
RCC.PLLSAIN=50
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
RCC.RTCFreq_Value=32000 RCC.RCC_RTC_Clock_Source=RCC_RTCCLKSOURCE_LSE
RCC.RTCFreq_Value=32768
RCC.RTCHSEDivFreq_Value=4000000 RCC.RTCHSEDivFreq_Value=4000000
RCC.SAI_AClocksFreq_Value=19600000 RCC.SAI_AClocksFreq_Value=25000000
RCC.SAI_BClocksFreq_Value=19600000 RCC.SAI_BClocksFreq_Value=25000000
RCC.SYSCLKFreq_VALUE=180000000 RCC.SYSCLKFreq_VALUE=180000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.VCOI2SOutputFreq_Value=307200000 RCC.VCOI2SOutputFreq_Value=384000000
RCC.VCOInputFreq_Value=1600000 RCC.VCOInputFreq_Value=2000000
RCC.VCOOutputFreq_Value=360000000 RCC.VCOOutputFreq_Value=360000000
RCC.VCOSAIOutputFreq_Value=78400000 RCC.VCOSAIOutputFreq_Value=100000000
RCC.VCOSAIOutputFreq_ValueQ=19600000 RCC.VCOSAIOutputFreq_ValueQ=25000000
RCC.VCOSAIOutputFreq_ValueR=39200000 RCC.VCOSAIOutputFreq_ValueR=50000000
RCC.VcooutputI2S=153600000 RCC.VcooutputI2S=192000000
RCC.VcooutputI2SQ=153600000 RCC.VcooutputI2SQ=192000000
SH.ADCx_IN10.0=ADC1_IN10,IN10 SH.ADCx_IN10.0=ADC1_IN10,IN10
SH.ADCx_IN10.ConfNb=1 SH.ADCx_IN10.ConfNb=1
SH.ADCx_IN13.0=ADC1_IN13,IN13 SH.ADCx_IN13.0=ADC1_IN13,IN13
@ -512,6 +613,8 @@ TIM2.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
TIM2.IPParameters=Channel-PWM Generation1 CH1 TIM2.IPParameters=Channel-PWM Generation1 CH1
USART1.IPParameters=VirtualMode USART1.IPParameters=VirtualMode
USART1.VirtualMode=VM_ASYNC USART1.VirtualMode=VM_ASYNC
VP_DMA2D_VS_DMA2D.Mode=DMA2D_Activate
VP_DMA2D_VS_DMA2D.Signal=DMA2D_VS_DMA2D
VP_IWDG_VS_IWDG.Mode=IWDG_Activate VP_IWDG_VS_IWDG.Mode=IWDG_Activate
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled

View File

@ -5,7 +5,7 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; COPYRIGHT(c) 2018 STMicroelectronics</center></h2> * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: * are permitted provided that the following conditions are met:
@ -56,7 +56,7 @@
/* #define HAL_CRYP_MODULE_ENABLED */ /* #define HAL_CRYP_MODULE_ENABLED */
/* #define HAL_DAC_MODULE_ENABLED */ /* #define HAL_DAC_MODULE_ENABLED */
/* #define HAL_DCMI_MODULE_ENABLED */ /* #define HAL_DCMI_MODULE_ENABLED */
/* #define HAL_DMA2D_MODULE_ENABLED */ #define HAL_DMA2D_MODULE_ENABLED
#define HAL_ETH_MODULE_ENABLED #define HAL_ETH_MODULE_ENABLED
/* #define HAL_NAND_MODULE_ENABLED */ /* #define HAL_NAND_MODULE_ENABLED */
/* #define HAL_NOR_MODULE_ENABLED */ /* #define HAL_NOR_MODULE_ENABLED */
@ -67,7 +67,7 @@
/* #define HAL_I2C_MODULE_ENABLED */ /* #define HAL_I2C_MODULE_ENABLED */
/* #define HAL_I2S_MODULE_ENABLED */ /* #define HAL_I2S_MODULE_ENABLED */
#define HAL_IWDG_MODULE_ENABLED #define HAL_IWDG_MODULE_ENABLED
/* #define HAL_LTDC_MODULE_ENABLED */ #define HAL_LTDC_MODULE_ENABLED
/* #define HAL_RNG_MODULE_ENABLED */ /* #define HAL_RNG_MODULE_ENABLED */
#define HAL_RTC_MODULE_ENABLED #define HAL_RTC_MODULE_ENABLED
/* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SAI_MODULE_ENABLED */

View File

@ -64,10 +64,14 @@
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
ADC_HandleTypeDef hadc1; ADC_HandleTypeDef hadc1;
DMA2D_HandleTypeDef hdma2d;
ETH_HandleTypeDef heth; ETH_HandleTypeDef heth;
IWDG_HandleTypeDef hiwdg; IWDG_HandleTypeDef hiwdg;
LTDC_HandleTypeDef hltdc;
RTC_HandleTypeDef hrtc; RTC_HandleTypeDef hrtc;
SD_HandleTypeDef hsd; SD_HandleTypeDef hsd;
@ -103,6 +107,8 @@ static void MX_TIM14_Init(void);
static void MX_TIM13_Init(void); static void MX_TIM13_Init(void);
static void MX_TIM11_Init(void); static void MX_TIM11_Init(void);
static void MX_ETH_Init(void); static void MX_ETH_Init(void);
static void MX_LTDC_Init(void);
static void MX_DMA2D_Init(void);
/* USER CODE BEGIN PFP */ /* USER CODE BEGIN PFP */
/* USER CODE END PFP */ /* USER CODE END PFP */
@ -152,6 +158,8 @@ int main(void)
MX_TIM13_Init(); MX_TIM13_Init();
MX_TIM11_Init(); MX_TIM11_Init();
MX_ETH_Init(); MX_ETH_Init();
MX_LTDC_Init();
MX_DMA2D_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
/* USER CODE END 2 */ /* USER CODE END 2 */
@ -183,13 +191,15 @@ void SystemClock_Config(void)
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/**Initializes the CPU, AHB and APB busses clocks /**Initializes the CPU, AHB and APB busses clocks
*/ */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE
|RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 5; RCC_OscInitStruct.PLL.PLLM = 4;
RCC_OscInitStruct.PLL.PLLN = 225; RCC_OscInitStruct.PLL.PLLN = 180;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 8; RCC_OscInitStruct.PLL.PLLQ = 8;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
@ -215,8 +225,11 @@ void SystemClock_Config(void)
{ {
Error_Handler(); Error_Handler();
} }
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC|RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSI; PeriphClkInitStruct.PLLSAI.PLLSAIN = 50;
PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{ {
Error_Handler(); Error_Handler();
@ -273,6 +286,43 @@ static void MX_ADC1_Init(void)
} }
/**
* @brief DMA2D Initialization Function
* @param None
* @retval None
*/
static void MX_DMA2D_Init(void)
{
/* USER CODE BEGIN DMA2D_Init 0 */
/* USER CODE END DMA2D_Init 0 */
/* USER CODE BEGIN DMA2D_Init 1 */
/* USER CODE END DMA2D_Init 1 */
hdma2d.Instance = DMA2D;
hdma2d.Init.Mode = DMA2D_M2M;
hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
hdma2d.Init.OutputOffset = 0;
hdma2d.LayerCfg[1].InputOffset = 0;
hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
hdma2d.LayerCfg[1].InputAlpha = 0;
if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
{
Error_Handler();
}
if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN DMA2D_Init 2 */
/* USER CODE END DMA2D_Init 2 */
}
/** /**
* @brief ETH Initialization Function * @brief ETH Initialization Function
* @param None * @param None
@ -346,6 +396,88 @@ static void MX_IWDG_Init(void)
} }
/**
* @brief LTDC Initialization Function
* @param None
* @retval None
*/
static void MX_LTDC_Init(void)
{
/* USER CODE BEGIN LTDC_Init 0 */
/* USER CODE END LTDC_Init 0 */
LTDC_LayerCfgTypeDef pLayerCfg = {0};
LTDC_LayerCfgTypeDef pLayerCfg1 = {0};
/* USER CODE BEGIN LTDC_Init 1 */
/* USER CODE END LTDC_Init 1 */
hltdc.Instance = LTDC;
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
hltdc.Init.HorizontalSync = 7;
hltdc.Init.VerticalSync = 3;
hltdc.Init.AccumulatedHBP = 14;
hltdc.Init.AccumulatedVBP = 5;
hltdc.Init.AccumulatedActiveW = 654;
hltdc.Init.AccumulatedActiveH = 485;
hltdc.Init.TotalWidth = 660;
hltdc.Init.TotalHeigh = 487;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 0;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 0;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
pLayerCfg.Alpha = 0;
pLayerCfg.Alpha0 = 0;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg.FBStartAdress = 0;
pLayerCfg.ImageWidth = 0;
pLayerCfg.ImageHeight = 0;
pLayerCfg.Backcolor.Blue = 0;
pLayerCfg.Backcolor.Green = 0;
pLayerCfg.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler();
}
pLayerCfg1.WindowX0 = 0;
pLayerCfg1.WindowX1 = 0;
pLayerCfg1.WindowY0 = 0;
pLayerCfg1.WindowY1 = 0;
pLayerCfg1.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
pLayerCfg1.Alpha = 0;
pLayerCfg1.Alpha0 = 0;
pLayerCfg1.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg1.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg1.FBStartAdress = 0;
pLayerCfg1.ImageWidth = 0;
pLayerCfg1.ImageHeight = 0;
pLayerCfg1.Backcolor.Blue = 0;
pLayerCfg1.Backcolor.Green = 0;
pLayerCfg1.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg1, 1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LTDC_Init 2 */
/* USER CODE END LTDC_Init 2 */
}
/** /**
* @brief RTC Initialization Function * @brief RTC Initialization Function
* @param None * @param None
@ -722,9 +854,11 @@ static void MX_GPIO_Init(void)
__HAL_RCC_GPIOF_CLK_ENABLE(); __HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOJ_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE();
__HAL_RCC_GPIOK_CLK_ENABLE();
/*Configure GPIO pin : PE2 */ /*Configure GPIO pin : PE2 */
GPIO_InitStruct.Pin = GPIO_PIN_2; GPIO_InitStruct.Pin = GPIO_PIN_2;

View File

@ -165,6 +165,53 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
} }
/**
* @brief DMA2D MSP Initialization
* This function configures the hardware resources used in this example
* @param hdma2d: DMA2D handle pointer
* @retval None
*/
void HAL_DMA2D_MspInit(DMA2D_HandleTypeDef* hdma2d)
{
if(hdma2d->Instance==DMA2D)
{
/* USER CODE BEGIN DMA2D_MspInit 0 */
/* USER CODE END DMA2D_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_DMA2D_CLK_ENABLE();
/* USER CODE BEGIN DMA2D_MspInit 1 */
/* USER CODE END DMA2D_MspInit 1 */
}
}
/**
* @brief DMA2D MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hdma2d: DMA2D handle pointer
* @retval None
*/
void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* hdma2d)
{
if(hdma2d->Instance==DMA2D)
{
/* USER CODE BEGIN DMA2D_MspDeInit 0 */
/* USER CODE END DMA2D_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_DMA2D_CLK_DISABLE();
/* USER CODE BEGIN DMA2D_MspDeInit 1 */
/* USER CODE END DMA2D_MspDeInit 1 */
}
}
/** /**
* @brief ETH MSP Initialization * @brief ETH MSP Initialization
* This function configures the hardware resources used in this example * This function configures the hardware resources used in this example
@ -277,6 +324,154 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
} }
/**
* @brief LTDC MSP Initialization
* This function configures the hardware resources used in this example
* @param hltdc: LTDC handle pointer
* @retval None
*/
void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hltdc->Instance==LTDC)
{
/* USER CODE BEGIN LTDC_MspInit 0 */
/* USER CODE END LTDC_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_LTDC_CLK_ENABLE();
__HAL_RCC_GPIOI_CLK_ENABLE();
__HAL_RCC_GPIOJ_CLK_ENABLE();
__HAL_RCC_GPIOK_CLK_ENABLE();
/**LTDC GPIO Configuration
PI12 ------> LTDC_HSYNC
PI13 ------> LTDC_VSYNC
PI14 ------> LTDC_CLK
PI15 ------> LTDC_R0
PJ0 ------> LTDC_R1
PJ1 ------> LTDC_R2
PJ2 ------> LTDC_R3
PJ3 ------> LTDC_R4
PJ4 ------> LTDC_R5
PJ5 ------> LTDC_R6
PJ6 ------> LTDC_R7
PJ7 ------> LTDC_G0
PJ8 ------> LTDC_G1
PJ9 ------> LTDC_G2
PJ10 ------> LTDC_G3
PJ11 ------> LTDC_G4
PK0 ------> LTDC_G5
PK1 ------> LTDC_G6
PK2 ------> LTDC_G7
PJ12 ------> LTDC_B0
PJ13 ------> LTDC_B1
PJ14 ------> LTDC_B2
PJ15 ------> LTDC_B3
PK3 ------> LTDC_B4
PK4 ------> LTDC_B5
PK5 ------> LTDC_B6
PK6 ------> LTDC_B7
PK7 ------> LTDC_DE
*/
GPIO_InitStruct.Pin = GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOJ, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOK, &GPIO_InitStruct);
/* USER CODE BEGIN LTDC_MspInit 1 */
/* USER CODE END LTDC_MspInit 1 */
}
}
/**
* @brief LTDC MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hltdc: LTDC handle pointer
* @retval None
*/
void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc)
{
if(hltdc->Instance==LTDC)
{
/* USER CODE BEGIN LTDC_MspDeInit 0 */
/* USER CODE END LTDC_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_LTDC_CLK_DISABLE();
/**LTDC GPIO Configuration
PI12 ------> LTDC_HSYNC
PI13 ------> LTDC_VSYNC
PI14 ------> LTDC_CLK
PI15 ------> LTDC_R0
PJ0 ------> LTDC_R1
PJ1 ------> LTDC_R2
PJ2 ------> LTDC_R3
PJ3 ------> LTDC_R4
PJ4 ------> LTDC_R5
PJ5 ------> LTDC_R6
PJ6 ------> LTDC_R7
PJ7 ------> LTDC_G0
PJ8 ------> LTDC_G1
PJ9 ------> LTDC_G2
PJ10 ------> LTDC_G3
PJ11 ------> LTDC_G4
PK0 ------> LTDC_G5
PK1 ------> LTDC_G6
PK2 ------> LTDC_G7
PJ12 ------> LTDC_B0
PJ13 ------> LTDC_B1
PJ14 ------> LTDC_B2
PJ15 ------> LTDC_B3
PK3 ------> LTDC_B4
PK4 ------> LTDC_B5
PK5 ------> LTDC_B6
PK6 ------> LTDC_B7
PK7 ------> LTDC_DE
*/
HAL_GPIO_DeInit(GPIOI, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15);
HAL_GPIO_DeInit(GPIOJ, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7
|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_11
|GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15);
HAL_GPIO_DeInit(GPIOK, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3
|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
/* USER CODE BEGIN LTDC_MspDeInit 1 */
/* USER CODE END LTDC_MspDeInit 1 */
}
}
/** /**
* @brief RTC MSP Initialization * @brief RTC MSP Initialization
* This function configures the hardware resources used in this example * This function configures the hardware resources used in this example

View File

@ -15,10 +15,12 @@ menu "Onboard Peripheral Drivers"
config BSP_USING_EXT_FMC_IO config BSP_USING_EXT_FMC_IO
bool "Enable extend gpio" bool "Enable extend gpio"
select BSP_USING_FMC
default y default y
config BSP_USING_SDRAM config BSP_USING_SDRAM
bool "Enable SDRAM" bool "Enable SDRAM"
select BSP_USING_FMC
default n default n
config BSP_USING_SPI_FLASH config BSP_USING_SPI_FLASH
@ -38,9 +40,7 @@ menu "Onboard Peripheral Drivers"
config PHY_USING_DM9161CEP config PHY_USING_DM9161CEP
bool bool
menuconfig BSP_USING_ETH menuconfig BSP_USING_ETH
bool "Enable Ethernet" bool "Enable Ethernet"
select RT_USING_LWIP select RT_USING_LWIP
@ -57,14 +57,22 @@ menu "Onboard Peripheral Drivers"
default 118 default 118
endif endif
config BSP_USING_LCD
bool "Enable LCD"
select BSP_USING_LTDC
select BSP_USING_SDRAM
select BSP_USING_PWM
select BSP_USING_PWM2
select BSP_USING_PWM2_CH1
default n
config BSP_USING_MPU6050 config BSP_USING_MPU6050
bool "Enable MPU6050(i2c1)" bool "Enable MPU6050(i2c1)"
select BSP_USING_I2C1 select BSP_USING_I2C1
select PKG_USING_MPU6XXX select PKG_USING_MPU6XXX
select PKG_USING_MPU6XXX_SAMPLE select PKG_USING_MPU6XXX_SAMPLE
select PKG_USING_MPU6XXX_LATEST_VERSION select PKG_USING_MPU6XXX_LATEST_VERSION
default n default n
endmenu endmenu
menu "On-chip Peripheral Drivers" menu "On-chip Peripheral Drivers"
@ -191,6 +199,13 @@ menu "On-chip Peripheral Drivers"
select RT_USING_DFS select RT_USING_DFS
default n default n
config BSP_USING_FMC
bool
default n
config BSP_USING_LTDC
bool
default n
endmenu endmenu
menu "Board extended module Drivers" menu "Board extended module Drivers"

View File

@ -5,7 +5,7 @@
* *
* Change Logs: * Change Logs:
* Date Author Notes * Date Author Notes
* 2018-11-7 zylx first version * 2018-11-7 zylx first version
*/ */
#include "board.h" #include "board.h"
@ -14,54 +14,57 @@
*/ */
void SystemClock_Config(void) void SystemClock_Config(void)
{ {
RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
/**Configure the main internal regulator output voltage /**Configure the main internal regulator output voltage
*/ */
__HAL_RCC_PWR_CLK_ENABLE(); __HAL_RCC_PWR_CLK_ENABLE();
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/**Initializes the CPU, AHB and APB busses clocks /**Initializes the CPU, AHB and APB busses clocks
*/ */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE
|RCC_OSCILLATORTYPE_LSE; |RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.LSEState = RCC_LSE_ON; RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 5; RCC_OscInitStruct.PLL.PLLM = 4;
RCC_OscInitStruct.PLL.PLLN = 225; RCC_OscInitStruct.PLL.PLLN = 180;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 8; RCC_OscInitStruct.PLL.PLLQ = 8;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
/**Activate the Over-Drive mode /**Activate the Over-Drive mode
*/ */
if (HAL_PWREx_EnableOverDrive() != HAL_OK) if (HAL_PWREx_EnableOverDrive() != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
/**Initializes the CPU, AHB and APB busses clocks /**Initializes the CPU, AHB and APB busses clocks
*/ */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC|RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; PeriphClkInitStruct.PLLSAI.PLLSAIN = 50;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
{ PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
Error_Handler(); PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
} if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
} }

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-01-08 zylx first version
*/
#ifndef __LCD_PORT_H__
#define __LCD_PORT_H__
/* armfly 5 inch screen, 800 * 480 */
#define LCD_WIDTH 800
#define LCD_HEIGHT 480
#define LCD_BITS_PER_PIXEL 16
#define LCD_BUF_SIZE (LCD_WIDTH * LCD_HEIGHT * LCD_BITS_PER_PIXEL / 8)
#define LCD_PIXEL_FORMAT RTGRAPHIC_PIXEL_FORMAT_RGB565
#define LCD_HSYNC_WIDTH 96
#define LCD_VSYNC_HEIGHT 2
#define LCD_HBP 10
#define LCD_VBP 10
#define LCD_HFP 10
#define LCD_VFP 10
#define LCD_BACKLIGHT_USING_PWM
#define LCD_PWM_DEV_NAME "pwm2"
#define LCD_PWM_DEV_CHANNEL 1
/* armfly 5 inch screen, 800 * 480 */
#endif /* __LCD_PORT_H__ */

View File

@ -169,6 +169,7 @@
#define BSP_USING_GPIO #define BSP_USING_GPIO
#define BSP_USING_UART #define BSP_USING_UART
#define BSP_USING_UART1 #define BSP_USING_UART1
#define BSP_USING_FMC
/* Board extended module Drivers */ /* Board extended module Drivers */

View File

@ -26,6 +26,7 @@ menu "Onboard Peripheral Drivers"
config BSP_USING_SDRAM config BSP_USING_SDRAM
bool "Enable SDRAM" bool "Enable SDRAM"
select BSP_USING_FMC
default n default n
config BSP_USING_SPI_FLASH config BSP_USING_SPI_FLASH
@ -235,6 +236,9 @@ menu "On-chip Peripheral Drivers"
select RT_USING_DFS select RT_USING_DFS
default n default n
config BSP_USING_FMC
bool
default n
endmenu endmenu
menu "Board extended module Drivers" menu "Board extended module Drivers"

View File

@ -338,6 +338,7 @@ CONFIG_BSP_USING_USB_TO_USART=y
# CONFIG_BSP_USING_RS232 is not set # CONFIG_BSP_USING_RS232 is not set
# CONFIG_BSP_USING_SDRAM is not set # CONFIG_BSP_USING_SDRAM is not set
# CONFIG_BSP_USING_SPI_FLASH is not set # CONFIG_BSP_USING_SPI_FLASH is not set
# CONFIG_BSP_USING_LCD is not set
# CONFIG_BSP_USING_MPU6050 is not set # CONFIG_BSP_USING_MPU6050 is not set
# CONFIG_BSP_USING_ETH is not set # CONFIG_BSP_USING_ETH is not set
# CONFIG_BSP_USING_RGB is not set # CONFIG_BSP_USING_RGB is not set
@ -361,6 +362,8 @@ CONFIG_BSP_USING_UART1=y
# CONFIG_BSP_USING_ONCHIP_RTC is not set # CONFIG_BSP_USING_ONCHIP_RTC is not set
# CONFIG_BSP_USING_WDT is not set # CONFIG_BSP_USING_WDT is not set
# CONFIG_BSP_USING_SDIO is not set # CONFIG_BSP_USING_SDIO is not set
# CONFIG_BSP_USING_FMC is not set
# CONFIG_BSP_USING_LTDC is not set
# #
# Board extended module Drivers # Board extended module Drivers

File diff suppressed because one or more lines are too long

View File

@ -11,102 +11,130 @@ File.Version=6
KeepUserPlacement=false KeepUserPlacement=false
Mcu.Family=STM32F4 Mcu.Family=STM32F4
Mcu.IP0=ADC1 Mcu.IP0=ADC1
Mcu.IP1=ETH Mcu.IP1=DMA2D
Mcu.IP10=TIM5 Mcu.IP10=SPI5
Mcu.IP11=TIM11 Mcu.IP11=SYS
Mcu.IP12=TIM13 Mcu.IP12=TIM5
Mcu.IP13=TIM14 Mcu.IP13=TIM11
Mcu.IP14=USART1 Mcu.IP14=TIM13
Mcu.IP15=USART2 Mcu.IP15=TIM14
Mcu.IP2=FMC Mcu.IP16=USART1
Mcu.IP3=IWDG Mcu.IP2=ETH
Mcu.IP4=NVIC Mcu.IP3=FMC
Mcu.IP5=RCC Mcu.IP4=IWDG
Mcu.IP6=RTC Mcu.IP5=LTDC
Mcu.IP7=SDIO Mcu.IP6=NVIC
Mcu.IP8=SPI5 Mcu.IP7=RCC
Mcu.IP9=SYS Mcu.IP8=RTC
Mcu.IPNb=16 Mcu.IP9=SDIO
Mcu.IPNb=17
Mcu.Name=STM32F429I(E-G)Tx Mcu.Name=ST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pin7=PF5 Mcu.Pin66=PC8
Mcu.Pin70=VP_IWDG_VS_IWDG Mcu.Pin67=PC9
Mcu.Pin71=VP_RTC_VS_RTC_Activate Mcu.Pin68=PA9
Mcu.Pin72=VP_SYS_VS_Systick Mcu.Pin69=PA10
Mcu.Pin73=VP_TIM5_VS_ClockSourceINT Mcu.Pin7=PF0
Mcu.Pin74=VP_TIM11_VS_ClockSourceINT Mcu.Pin70=PA11
Mcu.Pin75=VP_TIM13_VS_ClockSourceINT Mcu.Pin71=PA12
Mcu.Pin76=VP_TIM14_VS_ClockSourceINT Mcu.Pin72=PA13
Mcu.Pin8=PF7 Mcu.Pin73=PH13
Mcu.Pin9=PF8 Mcu.Pin74=PH15
Mcu.PinsNb=77 Mcu.Pin75=PI0
Mcu.Pin76=PI2
Mcu.Pin77=PA14
Mcu.Pin78=PC10
Mcu.Pin79=PC11
Mcu.Pin8=PF1
Mcu.Pin80=PC12
Mcu.Pin81=PD0
Mcu.Pin82=PD1
Mcu.Pin83=PD2
Mcu.Pin84=PD6
Mcu.Pin85=PG10
Mcu.Pin86=PG11
Mcu.Pin87=PG12
Mcu.Pin88=PG13
Mcu.Pin89=PG14
Mcu.Pin9=PF2
Mcu.Pin90=PG15
Mcu.Pin91=PB8
Mcu.Pin92=PB9
Mcu.Pin93=PE0
Mcu.Pin94=PE1
Mcu.Pin95=PI4
Mcu.Pin96=VP_DMA2D_VS_DMA2D
Mcu.Pin97=VP_IWDG_VS_IWDG
Mcu.Pin98=VP_RTC_VS_RTC_Activate
Mcu.Pin99=VP_SYS_VS_Systick
Mcu.PinsNb=104
Mcu.ThirdPartyNb=0 Mcu.ThirdPartyNb=0
Mcu.UserConstants= Mcu.UserConstants=
Mcu.UserName=STM32F429IGTx Mcu.UserName=STM32F429IGTx
@ -127,18 +155,37 @@ PA1.Mode=RMII
PA1.Signal=ETH_REF_CLK PA1.Signal=ETH_REF_CLK
PA10.Mode=Asynchronous PA10.Mode=Asynchronous
PA10.Signal=USART1_RX PA10.Signal=USART1_RX
PA11.Mode=RGB888
PA11.Signal=LTDC_R4
PA12.Mode=RGB888
PA12.Signal=LTDC_R5
PA13.Mode=Serial_Wire PA13.Mode=Serial_Wire
PA13.Signal=SYS_JTMS-SWDIO PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Serial_Wire PA14.Mode=Serial_Wire
PA14.Signal=SYS_JTCK-SWCLK PA14.Signal=SYS_JTCK-SWCLK
PA2.Mode=RMII PA2.Mode=RMII
PA2.Signal=ETH_MDIO PA2.Signal=ETH_MDIO
PA3.Locked=true
PA3.Mode=RGB888
PA3.Signal=LTDC_B5
PA7.Mode=RMII PA7.Mode=RMII
PA7.Signal=ETH_CRS_DV PA7.Signal=ETH_CRS_DV
PA9.Mode=Asynchronous PA9.Mode=Asynchronous
PA9.Signal=USART1_TX PA9.Signal=USART1_TX
PB0.Locked=true
PB0.Mode=RGB888
PB0.Signal=LTDC_R3
PB1.Locked=true
PB1.Mode=RGB888
PB1.Signal=LTDC_R6
PB11.Mode=RMII PB11.Mode=RMII
PB11.Signal=ETH_TX_EN PB11.Signal=ETH_TX_EN
PB8.Locked=true
PB8.Mode=RGB888
PB8.Signal=LTDC_B6
PB9.Locked=true
PB9.Mode=RGB888
PB9.Signal=LTDC_B7
PC0.Signal=FMC_SDNWE PC0.Signal=FMC_SDNWE
PC1.Mode=RMII PC1.Mode=RMII
PC1.Signal=ETH_MDC PC1.Signal=ETH_MDC
@ -158,6 +205,9 @@ PC4.Mode=RMII
PC4.Signal=ETH_RXD0 PC4.Signal=ETH_RXD0
PC5.Mode=RMII PC5.Mode=RMII
PC5.Signal=ETH_RXD1 PC5.Signal=ETH_RXD1
PC7.Locked=true
PC7.Mode=RGB888
PC7.Signal=LTDC_G6
PC8.Mode=SD_4_bits_Wide_bus PC8.Mode=SD_4_bits_Wide_bus
PC8.Signal=SDIO_D0 PC8.Signal=SDIO_D0
PC9.Mode=SD_4_bits_Wide_bus PC9.Mode=SD_4_bits_Wide_bus
@ -177,11 +227,9 @@ PD14.Signal=FMC_D0_DA0
PD15.Signal=FMC_D1_DA1 PD15.Signal=FMC_D1_DA1
PD2.Mode=SD_4_bits_Wide_bus PD2.Mode=SD_4_bits_Wide_bus
PD2.Signal=SDIO_CMD PD2.Signal=SDIO_CMD
PD5.Mode=Asynchronous
PD5.Signal=USART2_TX
PD6.Locked=true PD6.Locked=true
PD6.Mode=Asynchronous PD6.Mode=RGB888
PD6.Signal=USART2_RX PD6.Signal=LTDC_B2
PD8.Signal=FMC_D13_DA13 PD8.Signal=FMC_D13_DA13
PD9.Signal=FMC_D14_DA14 PD9.Signal=FMC_D14_DA14
PE0.Signal=FMC_NBL0 PE0.Signal=FMC_NBL0
@ -192,11 +240,19 @@ PE12.Signal=FMC_D9_DA9
PE13.Signal=FMC_D10_DA10 PE13.Signal=FMC_D10_DA10
PE14.Signal=FMC_D11_DA11 PE14.Signal=FMC_D11_DA11
PE15.Signal=FMC_D12_DA12 PE15.Signal=FMC_D12_DA12
PE4.Mode=RGB888
PE4.Signal=LTDC_B0
PE5.Mode=RGB888
PE5.Signal=LTDC_G0
PE6.Mode=RGB888
PE6.Signal=LTDC_G1
PE7.Signal=FMC_D4_DA4 PE7.Signal=FMC_D4_DA4
PE8.Signal=FMC_D5_DA5 PE8.Signal=FMC_D5_DA5
PE9.Signal=FMC_D6_DA6 PE9.Signal=FMC_D6_DA6
PF0.Signal=FMC_A0 PF0.Signal=FMC_A0
PF1.Signal=FMC_A1 PF1.Signal=FMC_A1
PF10.Mode=RGB888
PF10.Signal=LTDC_DE
PF11.Signal=FMC_SDNRAS PF11.Signal=FMC_SDNRAS
PF12.Signal=FMC_A6 PF12.Signal=FMC_A6
PF13.Signal=FMC_A7 PF13.Signal=FMC_A7
@ -216,6 +272,13 @@ PF9.Mode=Full_Duplex_Master
PF9.Signal=SPI5_MOSI PF9.Signal=SPI5_MOSI
PG0.Signal=FMC_A10 PG0.Signal=FMC_A10
PG1.Signal=FMC_A11 PG1.Signal=FMC_A11
PG10.Locked=true
PG10.Mode=RGB888
PG10.Signal=LTDC_G3
PG11.Mode=RGB888
PG11.Signal=LTDC_B3
PG12.Mode=RGB888
PG12.Signal=LTDC_B1
PG13.Locked=true PG13.Locked=true
PG13.Mode=RMII PG13.Mode=RMII
PG13.Signal=ETH_TXD0 PG13.Signal=ETH_TXD0
@ -225,6 +288,10 @@ PG14.Signal=ETH_TXD1
PG15.Signal=FMC_SDNCAS PG15.Signal=FMC_SDNCAS
PG4.Signal=FMC_A14_BA0 PG4.Signal=FMC_A14_BA0
PG5.Signal=FMC_A15_BA1 PG5.Signal=FMC_A15_BA1
PG6.Mode=RGB888
PG6.Signal=LTDC_R7
PG7.Mode=RGB888
PG7.Signal=LTDC_CLK
PG8.Signal=FMC_SDCLK PG8.Signal=FMC_SDCLK
PH0/OSC_IN.Mode=HSE-External-Oscillator PH0/OSC_IN.Mode=HSE-External-Oscillator
PH0/OSC_IN.Signal=RCC_OSC_IN PH0/OSC_IN.Signal=RCC_OSC_IN
@ -234,10 +301,31 @@ PH10.Locked=true
PH10.Signal=S_TIM5_CH1 PH10.Signal=S_TIM5_CH1
PH11.Signal=S_TIM5_CH2 PH11.Signal=S_TIM5_CH2
PH12.Signal=S_TIM5_CH3 PH12.Signal=S_TIM5_CH3
PH13.Mode=RGB888
PH13.Signal=LTDC_G2
PH15.Mode=RGB888
PH15.Signal=LTDC_G4
PH2.Locked=true
PH2.Mode=RGB888
PH2.Signal=LTDC_R0
PH3.Mode=RGB888
PH3.Signal=LTDC_R1
PH6.Mode=SdramChipSelect2_1 PH6.Mode=SdramChipSelect2_1
PH6.Signal=FMC_SDNE1 PH6.Signal=FMC_SDNE1
PH7.Mode=SdramChipSelect2_1 PH7.Mode=SdramChipSelect2_1
PH7.Signal=FMC_SDCKE1 PH7.Signal=FMC_SDCKE1
PH8.Mode=RGB888
PH8.Signal=LTDC_R2
PI0.Mode=RGB888
PI0.Signal=LTDC_G5
PI10.Mode=RGB888
PI10.Signal=LTDC_HSYNC
PI2.Mode=RGB888
PI2.Signal=LTDC_G7
PI4.Mode=RGB888
PI4.Signal=LTDC_B4
PI9.Mode=RGB888
PI9.Signal=LTDC_VSYNC
PinOutPanel.RotationAngle=0 PinOutPanel.RotationAngle=0
ProjectManager.AskForMigrate=true ProjectManager.AskForMigrate=true
ProjectManager.BackupPrevious=false ProjectManager.BackupPrevious=false
@ -265,7 +353,7 @@ ProjectManager.StackSize=0x400
ProjectManager.TargetToolchain=MDK-ARM V5 ProjectManager.TargetToolchain=MDK-ARM V5
ProjectManager.ToolChainLocation= ProjectManager.ToolChainLocation=
ProjectManager.UnderRoot=false ProjectManager.UnderRoot=false
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_ETH_Init-ETH-false-HAL-true,5-MX_SPI5_Init-SPI5-false-HAL-true,6-MX_FMC_Init-FMC-false-HAL-true,7-MX_ADC1_Init-ADC1-false-HAL-true,8-MX_RTC_Init-RTC-false-HAL-true,9-MX_IWDG_Init-IWDG-false-HAL-true,10-MX_TIM14_Init-TIM14-false-HAL-true,11-MX_TIM13_Init-TIM13-false-HAL-true,12-MX_TIM11_Init-TIM11-false-HAL-true,13-MX_SDIO_SD_Init-SDIO-false-HAL-true,14-MX_TIM5_Init-TIM5-false-HAL-true,15-MX_USART2_UART_Init-USART2-false-HAL-true ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-SystemClock_Config-RCC-false-HAL-false,3-MX_USART1_UART_Init-USART1-false-HAL-true,4-MX_ETH_Init-ETH-false-HAL-true,5-MX_SPI5_Init-SPI5-false-HAL-true,6-MX_FMC_Init-FMC-false-HAL-true,7-MX_ADC1_Init-ADC1-false-HAL-true,8-MX_RTC_Init-RTC-false-HAL-true,9-MX_IWDG_Init-IWDG-false-HAL-true,10-MX_TIM14_Init-TIM14-false-HAL-true,11-MX_TIM13_Init-TIM13-false-HAL-true,12-MX_TIM11_Init-TIM11-false-HAL-true,13-MX_SDIO_SD_Init-SDIO-false-HAL-true,14-MX_TIM5_Init-TIM5-false-HAL-true,15-MX_LTDC_Init-LTDC-false-HAL-true,16-MX_DMA2D_Init-DMA2D-false-HAL-true
RCC.48MHZClocksFreq_Value=45000000 RCC.48MHZClocksFreq_Value=45000000
RCC.AHBFreq_Value=180000000 RCC.AHBFreq_Value=180000000
RCC.APB1CLKDivider=RCC_HCLK_DIV4 RCC.APB1CLKDivider=RCC_HCLK_DIV4
@ -282,8 +370,8 @@ RCC.HCLKFreq_Value=180000000
RCC.HSE_VALUE=25000000 RCC.HSE_VALUE=25000000
RCC.HSI_VALUE=16000000 RCC.HSI_VALUE=16000000
RCC.I2SClocksFreq_Value=160000000 RCC.I2SClocksFreq_Value=160000000
RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSourceVirtual,RCC_RTC_Clock_Source,RCC_RTC_Clock_SourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ RCC.IPParameters=48MHZClocksFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2SClocksFreq_Value,LCDTFTFreq_Value,LSI_VALUE,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLM,PLLN,PLLQ,PLLQCLKFreq_Value,PLLSAIN,PLLSourceVirtual,RCC_RTC_Clock_Source,RCC_RTC_Clock_SourceVirtual,RTCFreq_Value,RTCHSEDivFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueQ,VCOSAIOutputFreq_ValueR,VcooutputI2S,VcooutputI2SQ
RCC.LCDTFTFreq_Value=20416666.666666668 RCC.LCDTFTFreq_Value=25000000
RCC.LSI_VALUE=32000 RCC.LSI_VALUE=32000
RCC.MCO2PinFreq_Value=180000000 RCC.MCO2PinFreq_Value=180000000
RCC.PLLCLKFreq_Value=180000000 RCC.PLLCLKFreq_Value=180000000
@ -291,21 +379,22 @@ RCC.PLLM=15
RCC.PLLN=216 RCC.PLLN=216
RCC.PLLQ=8 RCC.PLLQ=8
RCC.PLLQCLKFreq_Value=45000000 RCC.PLLQCLKFreq_Value=45000000
RCC.PLLSAIN=60
RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
RCC.RCC_RTC_Clock_Source=RCC_RTCCLKSOURCE_LSE RCC.RCC_RTC_Clock_Source=RCC_RTCCLKSOURCE_LSE
RCC.RCC_RTC_Clock_SourceVirtual=RCC_RTCCLKSOURCE_LSE RCC.RCC_RTC_Clock_SourceVirtual=RCC_RTCCLKSOURCE_LSE
RCC.RTCFreq_Value=32768 RCC.RTCFreq_Value=32768
RCC.RTCHSEDivFreq_Value=12500000 RCC.RTCHSEDivFreq_Value=12500000
RCC.SAI_AClocksFreq_Value=20416666.666666668 RCC.SAI_AClocksFreq_Value=25000000
RCC.SAI_BClocksFreq_Value=20416666.666666668 RCC.SAI_BClocksFreq_Value=25000000
RCC.SYSCLKFreq_VALUE=180000000 RCC.SYSCLKFreq_VALUE=180000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.VCOI2SOutputFreq_Value=320000000 RCC.VCOI2SOutputFreq_Value=320000000
RCC.VCOInputFreq_Value=1666666.6666666667 RCC.VCOInputFreq_Value=1666666.6666666667
RCC.VCOOutputFreq_Value=360000000 RCC.VCOOutputFreq_Value=360000000
RCC.VCOSAIOutputFreq_Value=81666666.66666667 RCC.VCOSAIOutputFreq_Value=100000000
RCC.VCOSAIOutputFreq_ValueQ=20416666.666666668 RCC.VCOSAIOutputFreq_ValueQ=25000000
RCC.VCOSAIOutputFreq_ValueR=40833333.333333336 RCC.VCOSAIOutputFreq_ValueR=50000000
RCC.VcooutputI2S=160000000 RCC.VcooutputI2S=160000000
RCC.VcooutputI2SQ=160000000 RCC.VcooutputI2SQ=160000000
SH.ADCx_IN13.0=ADC1_IN13,IN13 SH.ADCx_IN13.0=ADC1_IN13,IN13
@ -388,9 +477,10 @@ SH.S_TIM5_CH2.0=TIM5_CH2,PWM Generation2 CH2
SH.S_TIM5_CH2.ConfNb=1 SH.S_TIM5_CH2.ConfNb=1
SH.S_TIM5_CH3.0=TIM5_CH3,PWM Generation3 CH3 SH.S_TIM5_CH3.0=TIM5_CH3,PWM Generation3 CH3
SH.S_TIM5_CH3.ConfNb=1 SH.S_TIM5_CH3.ConfNb=1
SPI5.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
SPI5.CalculateBaudRate=45.0 MBits/s SPI5.CalculateBaudRate=45.0 MBits/s
SPI5.Direction=SPI_DIRECTION_2LINES SPI5.Direction=SPI_DIRECTION_2LINES
SPI5.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate SPI5.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,BaudRatePrescaler
SPI5.Mode=SPI_MODE_MASTER SPI5.Mode=SPI_MODE_MASTER
SPI5.VirtualType=VM_MASTER SPI5.VirtualType=VM_MASTER
TIM5.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1 TIM5.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1
@ -399,8 +489,8 @@ TIM5.Channel-PWM\ Generation3\ CH3=TIM_CHANNEL_3
TIM5.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3 TIM5.IPParameters=Channel-PWM Generation1 CH1,Channel-PWM Generation2 CH2,Channel-PWM Generation3 CH3
USART1.IPParameters=VirtualMode USART1.IPParameters=VirtualMode
USART1.VirtualMode=VM_ASYNC USART1.VirtualMode=VM_ASYNC
USART2.IPParameters=VirtualMode VP_DMA2D_VS_DMA2D.Mode=DMA2D_Activate
USART2.VirtualMode=VM_ASYNC VP_DMA2D_VS_DMA2D.Signal=DMA2D_VS_DMA2D
VP_IWDG_VS_IWDG.Mode=IWDG_Activate VP_IWDG_VS_IWDG.Mode=IWDG_Activate
VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG VP_IWDG_VS_IWDG.Signal=IWDG_VS_IWDG
VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled VP_RTC_VS_RTC_Activate.Mode=RTC_Enabled

View File

@ -5,7 +5,7 @@
****************************************************************************** ******************************************************************************
* @attention * @attention
* *
* <h2><center>&copy; COPYRIGHT(c) 2018 STMicroelectronics</center></h2> * <h2><center>&copy; COPYRIGHT(c) 2019 STMicroelectronics</center></h2>
* *
* Redistribution and use in source and binary forms, with or without modification, * Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met: * are permitted provided that the following conditions are met:
@ -56,7 +56,7 @@
/* #define HAL_CRYP_MODULE_ENABLED */ /* #define HAL_CRYP_MODULE_ENABLED */
/* #define HAL_DAC_MODULE_ENABLED */ /* #define HAL_DAC_MODULE_ENABLED */
/* #define HAL_DCMI_MODULE_ENABLED */ /* #define HAL_DCMI_MODULE_ENABLED */
/* #define HAL_DMA2D_MODULE_ENABLED */ #define HAL_DMA2D_MODULE_ENABLED
#define HAL_ETH_MODULE_ENABLED #define HAL_ETH_MODULE_ENABLED
/* #define HAL_NAND_MODULE_ENABLED */ /* #define HAL_NAND_MODULE_ENABLED */
/* #define HAL_NOR_MODULE_ENABLED */ /* #define HAL_NOR_MODULE_ENABLED */
@ -67,7 +67,7 @@
/* #define HAL_I2C_MODULE_ENABLED */ /* #define HAL_I2C_MODULE_ENABLED */
/* #define HAL_I2S_MODULE_ENABLED */ /* #define HAL_I2S_MODULE_ENABLED */
#define HAL_IWDG_MODULE_ENABLED #define HAL_IWDG_MODULE_ENABLED
/* #define HAL_LTDC_MODULE_ENABLED */ #define HAL_LTDC_MODULE_ENABLED
/* #define HAL_RNG_MODULE_ENABLED */ /* #define HAL_RNG_MODULE_ENABLED */
#define HAL_RTC_MODULE_ENABLED #define HAL_RTC_MODULE_ENABLED
/* #define HAL_SAI_MODULE_ENABLED */ /* #define HAL_SAI_MODULE_ENABLED */

View File

@ -64,10 +64,14 @@
/* Private variables ---------------------------------------------------------*/ /* Private variables ---------------------------------------------------------*/
ADC_HandleTypeDef hadc1; ADC_HandleTypeDef hadc1;
DMA2D_HandleTypeDef hdma2d;
ETH_HandleTypeDef heth; ETH_HandleTypeDef heth;
IWDG_HandleTypeDef hiwdg; IWDG_HandleTypeDef hiwdg;
LTDC_HandleTypeDef hltdc;
RTC_HandleTypeDef hrtc; RTC_HandleTypeDef hrtc;
SD_HandleTypeDef hsd; SD_HandleTypeDef hsd;
@ -80,7 +84,6 @@ TIM_HandleTypeDef htim13;
TIM_HandleTypeDef htim14; TIM_HandleTypeDef htim14;
UART_HandleTypeDef huart1; UART_HandleTypeDef huart1;
UART_HandleTypeDef huart2;
SDRAM_HandleTypeDef hsdram1; SDRAM_HandleTypeDef hsdram1;
@ -103,7 +106,8 @@ static void MX_TIM13_Init(void);
static void MX_TIM11_Init(void); static void MX_TIM11_Init(void);
static void MX_SDIO_SD_Init(void); static void MX_SDIO_SD_Init(void);
static void MX_TIM5_Init(void); static void MX_TIM5_Init(void);
static void MX_USART2_UART_Init(void); static void MX_LTDC_Init(void);
static void MX_DMA2D_Init(void);
/* USER CODE BEGIN PFP */ /* USER CODE BEGIN PFP */
/* USER CODE END PFP */ /* USER CODE END PFP */
@ -153,7 +157,8 @@ int main(void)
MX_TIM11_Init(); MX_TIM11_Init();
MX_SDIO_SD_Init(); MX_SDIO_SD_Init();
MX_TIM5_Init(); MX_TIM5_Init();
MX_USART2_UART_Init(); MX_LTDC_Init();
MX_DMA2D_Init();
/* USER CODE BEGIN 2 */ /* USER CODE BEGIN 2 */
/* USER CODE END 2 */ /* USER CODE END 2 */
@ -219,7 +224,10 @@ void SystemClock_Config(void)
{ {
Error_Handler(); Error_Handler();
} }
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC|RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.PLLSAI.PLLSAIN = 60;
PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{ {
@ -277,6 +285,43 @@ static void MX_ADC1_Init(void)
} }
/**
* @brief DMA2D Initialization Function
* @param None
* @retval None
*/
static void MX_DMA2D_Init(void)
{
/* USER CODE BEGIN DMA2D_Init 0 */
/* USER CODE END DMA2D_Init 0 */
/* USER CODE BEGIN DMA2D_Init 1 */
/* USER CODE END DMA2D_Init 1 */
hdma2d.Instance = DMA2D;
hdma2d.Init.Mode = DMA2D_M2M;
hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
hdma2d.Init.OutputOffset = 0;
hdma2d.LayerCfg[1].InputOffset = 0;
hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
hdma2d.LayerCfg[1].InputAlpha = 0;
if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
{
Error_Handler();
}
if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN DMA2D_Init 2 */
/* USER CODE END DMA2D_Init 2 */
}
/** /**
* @brief ETH Initialization Function * @brief ETH Initialization Function
* @param None * @param None
@ -350,6 +395,88 @@ static void MX_IWDG_Init(void)
} }
/**
* @brief LTDC Initialization Function
* @param None
* @retval None
*/
static void MX_LTDC_Init(void)
{
/* USER CODE BEGIN LTDC_Init 0 */
/* USER CODE END LTDC_Init 0 */
LTDC_LayerCfgTypeDef pLayerCfg = {0};
LTDC_LayerCfgTypeDef pLayerCfg1 = {0};
/* USER CODE BEGIN LTDC_Init 1 */
/* USER CODE END LTDC_Init 1 */
hltdc.Instance = LTDC;
hltdc.Init.HSPolarity = LTDC_HSPOLARITY_AL;
hltdc.Init.VSPolarity = LTDC_VSPOLARITY_AL;
hltdc.Init.DEPolarity = LTDC_DEPOLARITY_AL;
hltdc.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
hltdc.Init.HorizontalSync = 7;
hltdc.Init.VerticalSync = 3;
hltdc.Init.AccumulatedHBP = 14;
hltdc.Init.AccumulatedVBP = 5;
hltdc.Init.AccumulatedActiveW = 654;
hltdc.Init.AccumulatedActiveH = 485;
hltdc.Init.TotalWidth = 660;
hltdc.Init.TotalHeigh = 487;
hltdc.Init.Backcolor.Blue = 0;
hltdc.Init.Backcolor.Green = 0;
hltdc.Init.Backcolor.Red = 0;
if (HAL_LTDC_Init(&hltdc) != HAL_OK)
{
Error_Handler();
}
pLayerCfg.WindowX0 = 0;
pLayerCfg.WindowX1 = 0;
pLayerCfg.WindowY0 = 0;
pLayerCfg.WindowY1 = 0;
pLayerCfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
pLayerCfg.Alpha = 0;
pLayerCfg.Alpha0 = 0;
pLayerCfg.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg.FBStartAdress = 0;
pLayerCfg.ImageWidth = 0;
pLayerCfg.ImageHeight = 0;
pLayerCfg.Backcolor.Blue = 0;
pLayerCfg.Backcolor.Green = 0;
pLayerCfg.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg, 0) != HAL_OK)
{
Error_Handler();
}
pLayerCfg1.WindowX0 = 0;
pLayerCfg1.WindowX1 = 0;
pLayerCfg1.WindowY0 = 0;
pLayerCfg1.WindowY1 = 0;
pLayerCfg1.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
pLayerCfg1.Alpha = 0;
pLayerCfg1.Alpha0 = 0;
pLayerCfg1.BlendingFactor1 = LTDC_BLENDING_FACTOR1_CA;
pLayerCfg1.BlendingFactor2 = LTDC_BLENDING_FACTOR2_CA;
pLayerCfg1.FBStartAdress = 0;
pLayerCfg1.ImageWidth = 0;
pLayerCfg1.ImageHeight = 0;
pLayerCfg1.Backcolor.Blue = 0;
pLayerCfg1.Backcolor.Green = 0;
pLayerCfg1.Backcolor.Red = 0;
if (HAL_LTDC_ConfigLayer(&hltdc, &pLayerCfg1, 1) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN LTDC_Init 2 */
/* USER CODE END LTDC_Init 2 */
}
/** /**
* @brief RTC Initialization Function * @brief RTC Initialization Function
* @param None * @param None
@ -647,39 +774,6 @@ static void MX_USART1_UART_Init(void)
} }
/**
* @brief USART2 Initialization Function
* @param None
* @retval None
*/
static void MX_USART2_UART_Init(void)
{
/* USER CODE BEGIN USART2_Init 0 */
/* USER CODE END USART2_Init 0 */
/* USER CODE BEGIN USART2_Init 1 */
/* USER CODE END USART2_Init 1 */
huart2.Instance = USART2;
huart2.Init.BaudRate = 115200;
huart2.Init.WordLength = UART_WORDLENGTH_8B;
huart2.Init.StopBits = UART_STOPBITS_1;
huart2.Init.Parity = UART_PARITY_NONE;
huart2.Init.Mode = UART_MODE_TX_RX;
huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart2.Init.OverSampling = UART_OVERSAMPLING_16;
if (HAL_UART_Init(&huart2) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN USART2_Init 2 */
/* USER CODE END USART2_Init 2 */
}
/* FMC initialization function */ /* FMC initialization function */
static void MX_FMC_Init(void) static void MX_FMC_Init(void)
{ {
@ -724,13 +818,14 @@ static void MX_GPIO_Init(void)
{ {
/* GPIO Ports Clock Enable */ /* GPIO Ports Clock Enable */
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE(); __HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOI_CLK_ENABLE();
__HAL_RCC_GPIOF_CLK_ENABLE(); __HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE(); __HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE(); __HAL_RCC_GPIOD_CLK_ENABLE();
} }

View File

@ -163,6 +163,53 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* hadc)
} }
/**
* @brief DMA2D MSP Initialization
* This function configures the hardware resources used in this example
* @param hdma2d: DMA2D handle pointer
* @retval None
*/
void HAL_DMA2D_MspInit(DMA2D_HandleTypeDef* hdma2d)
{
if(hdma2d->Instance==DMA2D)
{
/* USER CODE BEGIN DMA2D_MspInit 0 */
/* USER CODE END DMA2D_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_DMA2D_CLK_ENABLE();
/* USER CODE BEGIN DMA2D_MspInit 1 */
/* USER CODE END DMA2D_MspInit 1 */
}
}
/**
* @brief DMA2D MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hdma2d: DMA2D handle pointer
* @retval None
*/
void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* hdma2d)
{
if(hdma2d->Instance==DMA2D)
{
/* USER CODE BEGIN DMA2D_MspDeInit 0 */
/* USER CODE END DMA2D_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_DMA2D_CLK_DISABLE();
/* USER CODE BEGIN DMA2D_MspDeInit 1 */
/* USER CODE END DMA2D_MspDeInit 1 */
}
}
/** /**
* @brief ETH MSP Initialization * @brief ETH MSP Initialization
* This function configures the hardware resources used in this example * This function configures the hardware resources used in this example
@ -275,6 +322,225 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
} }
/**
* @brief LTDC MSP Initialization
* This function configures the hardware resources used in this example
* @param hltdc: LTDC handle pointer
* @retval None
*/
void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
{
GPIO_InitTypeDef GPIO_InitStruct = {0};
if(hltdc->Instance==LTDC)
{
/* USER CODE BEGIN LTDC_MspInit 0 */
/* USER CODE END LTDC_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_LTDC_CLK_ENABLE();
__HAL_RCC_GPIOE_CLK_ENABLE();
__HAL_RCC_GPIOI_CLK_ENABLE();
__HAL_RCC_GPIOF_CLK_ENABLE();
__HAL_RCC_GPIOH_CLK_ENABLE();
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOB_CLK_ENABLE();
__HAL_RCC_GPIOG_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
/**LTDC GPIO Configuration
PE4 ------> LTDC_B0
PE5 ------> LTDC_G0
PE6 ------> LTDC_G1
PI9 ------> LTDC_VSYNC
PI10 ------> LTDC_HSYNC
PF10 ------> LTDC_DE
PH2 ------> LTDC_R0
PH3 ------> LTDC_R1
PA3 ------> LTDC_B5
PB0 ------> LTDC_R3
PB1 ------> LTDC_R6
PH8 ------> LTDC_R2
PG6 ------> LTDC_R7
PG7 ------> LTDC_CLK
PC7 ------> LTDC_G6
PA11 ------> LTDC_R4
PA12 ------> LTDC_R5
PH13 ------> LTDC_G2
PH15 ------> LTDC_G4
PI0 ------> LTDC_G5
PI2 ------> LTDC_G7
PD6 ------> LTDC_B2
PG10 ------> LTDC_G3
PG11 ------> LTDC_B3
PG12 ------> LTDC_B1
PB8 ------> LTDC_B6
PB9 ------> LTDC_B7
PI4 ------> LTDC_B4
*/
GPIO_InitStruct.Pin = GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_0|GPIO_PIN_2
|GPIO_PIN_4;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_8|GPIO_PIN_13
|GPIO_PIN_15;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOH, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_11|GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_11|GPIO_PIN_12;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_7;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_10;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF9_LTDC;
HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_9;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
/* USER CODE BEGIN LTDC_MspInit 1 */
/* USER CODE END LTDC_MspInit 1 */
}
}
/**
* @brief LTDC MSP De-Initialization
* This function freeze the hardware resources used in this example
* @param hltdc: LTDC handle pointer
* @retval None
*/
void HAL_LTDC_MspDeInit(LTDC_HandleTypeDef* hltdc)
{
if(hltdc->Instance==LTDC)
{
/* USER CODE BEGIN LTDC_MspDeInit 0 */
/* USER CODE END LTDC_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_LTDC_CLK_DISABLE();
/**LTDC GPIO Configuration
PE4 ------> LTDC_B0
PE5 ------> LTDC_G0
PE6 ------> LTDC_G1
PI9 ------> LTDC_VSYNC
PI10 ------> LTDC_HSYNC
PF10 ------> LTDC_DE
PH2 ------> LTDC_R0
PH3 ------> LTDC_R1
PA3 ------> LTDC_B5
PB0 ------> LTDC_R3
PB1 ------> LTDC_R6
PH8 ------> LTDC_R2
PG6 ------> LTDC_R7
PG7 ------> LTDC_CLK
PC7 ------> LTDC_G6
PA11 ------> LTDC_R4
PA12 ------> LTDC_R5
PH13 ------> LTDC_G2
PH15 ------> LTDC_G4
PI0 ------> LTDC_G5
PI2 ------> LTDC_G7
PD6 ------> LTDC_B2
PG10 ------> LTDC_G3
PG11 ------> LTDC_B3
PG12 ------> LTDC_B1
PB8 ------> LTDC_B6
PB9 ------> LTDC_B7
PI4 ------> LTDC_B4
*/
HAL_GPIO_DeInit(GPIOE, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6);
HAL_GPIO_DeInit(GPIOI, GPIO_PIN_9|GPIO_PIN_10|GPIO_PIN_0|GPIO_PIN_2
|GPIO_PIN_4);
HAL_GPIO_DeInit(GPIOF, GPIO_PIN_10);
HAL_GPIO_DeInit(GPIOH, GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_8|GPIO_PIN_13
|GPIO_PIN_15);
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_3|GPIO_PIN_11|GPIO_PIN_12);
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_8|GPIO_PIN_9);
HAL_GPIO_DeInit(GPIOG, GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_10|GPIO_PIN_11
|GPIO_PIN_12);
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_7);
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_6);
/* USER CODE BEGIN LTDC_MspDeInit 1 */
/* USER CODE END LTDC_MspDeInit 1 */
}
}
/** /**
* @brief RTC MSP Initialization * @brief RTC MSP Initialization
* This function configures the hardware resources used in this example * This function configures the hardware resources used in this example
@ -659,30 +925,6 @@ void HAL_UART_MspInit(UART_HandleTypeDef* huart)
/* USER CODE END USART1_MspInit 1 */ /* USER CODE END USART1_MspInit 1 */
} }
else if(huart->Instance==USART2)
{
/* USER CODE BEGIN USART2_MspInit 0 */
/* USER CODE END USART2_MspInit 0 */
/* Peripheral clock enable */
__HAL_RCC_USART2_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
/**USART2 GPIO Configuration
PD5 ------> USART2_TX
PD6 ------> USART2_RX
*/
GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF7_USART2;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
/* USER CODE BEGIN USART2_MspInit 1 */
/* USER CODE END USART2_MspInit 1 */
}
} }
@ -716,24 +958,6 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
/* USER CODE END USART1_MspDeInit 1 */ /* USER CODE END USART1_MspDeInit 1 */
} }
else if(huart->Instance==USART2)
{
/* USER CODE BEGIN USART2_MspDeInit 0 */
/* USER CODE END USART2_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USART2_CLK_DISABLE();
/**USART2 GPIO Configuration
PD5 ------> USART2_TX
PD6 ------> USART2_RX
*/
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_5|GPIO_PIN_6);
/* USER CODE BEGIN USART2_MspDeInit 1 */
/* USER CODE END USART2_MspDeInit 1 */
}
} }

View File

@ -21,6 +21,7 @@ menu "Onboard Peripheral Drivers"
config BSP_USING_SDRAM config BSP_USING_SDRAM
bool "Enable SDRAM" bool "Enable SDRAM"
select BSP_USING_FMC
default n default n
config BSP_USING_SPI_FLASH config BSP_USING_SPI_FLASH
@ -30,6 +31,12 @@ menu "Onboard Peripheral Drivers"
select RT_USING_SFUD select RT_USING_SFUD
select RT_SFUD_USING_SFDP select RT_SFUD_USING_SFDP
default n default n
config BSP_USING_LCD
bool "Enable LCD"
select BSP_USING_LTDC
select BSP_USING_SDRAM
default n
config BSP_USING_MPU6050 config BSP_USING_MPU6050
bool "Enable MPU6050 (i2c1)" bool "Enable MPU6050 (i2c1)"
@ -214,6 +221,13 @@ menu "On-chip Peripheral Drivers"
select RT_USING_DFS select RT_USING_DFS
default n default n
config BSP_USING_FMC
bool
default n
config BSP_USING_LTDC
bool
default n
endmenu endmenu
menu "Board extended module Drivers" menu "Board extended module Drivers"

View File

@ -12,54 +12,57 @@
void SystemClock_Config(void) void SystemClock_Config(void)
{ {
RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_OscInitTypeDef RCC_OscInitStruct = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
/**Configure the main internal regulator output voltage /**Configure the main internal regulator output voltage
*/ */
__HAL_RCC_PWR_CLK_ENABLE(); __HAL_RCC_PWR_CLK_ENABLE();
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/**Initializes the CPU, AHB and APB busses clocks /**Initializes the CPU, AHB and APB busses clocks
*/ */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI|RCC_OSCILLATORTYPE_HSE RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSI | RCC_OSCILLATORTYPE_HSE
|RCC_OSCILLATORTYPE_LSE; | RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.LSEState = RCC_LSE_ON; RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.LSIState = RCC_LSI_ON; RCC_OscInitStruct.LSIState = RCC_LSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 15; RCC_OscInitStruct.PLL.PLLM = 15;
RCC_OscInitStruct.PLL.PLLN = 216; RCC_OscInitStruct.PLL.PLLN = 216;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 8; RCC_OscInitStruct.PLL.PLLQ = 8;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
/**Activate the Over-Drive mode /**Activate the Over-Drive mode
*/ */
if (HAL_PWREx_EnableOverDrive() != HAL_OK) if (HAL_PWREx_EnableOverDrive() != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
/**Initializes the CPU, AHB and APB busses clocks /**Initializes the CPU, AHB and APB busses clocks
*/ */
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK)
{ {
Error_Handler(); Error_Handler();
} }
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_RTC; PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC | RCC_PERIPHCLK_RTC;
PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; PeriphClkInitStruct.PLLSAI.PLLSAIN = 60;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK) PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
{ PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
Error_Handler(); PeriphClkInitStruct.RTCClockSelection = RCC_RTCCLKSOURCE_LSE;
} if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
} }

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2006-2018, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2019-01-08 zylx first version
*/
#ifndef __LCD_PORT_H__
#define __LCD_PORT_H__
/* fire 5 inch screen, 800 * 480 */
#define LCD_WIDTH 800
#define LCD_HEIGHT 480
#define LCD_BITS_PER_PIXEL 16
#define LCD_BUF_SIZE (LCD_WIDTH * LCD_HEIGHT * BITS_PER_PIXEL / 8)
#define LCD_PIXEL_FORMAT RTGRAPHIC_PIXEL_FORMAT_RGB565
#define LCD_HSYNC_WIDTH 2
#define LCD_VSYNC_HEIGHT 2
#define LCD_HBP 46
#define LCD_VBP 23
#define LCD_HFP 22
#define LCD_VFP 22
#define LCD_BACKLIGHT_USING_GPIO
#define LCD_BL_GPIO_NUM GET_PIN(D, 7)
#define LCD_DISP_GPIO_NUM GET_PIN(D, 4)
/* fire 5 inch screen, 800 * 480 */
#endif /* __LCD_PORT_H__ */